- Revision
- 129408
- Author
- [email protected]
- Date
- 2012-09-24 13:58:47 -0700 (Mon, 24 Sep 2012)
Log Message
Remove unbaked support for :scope pseudo-class.
https://bugs.webkit.org/show_bug.cgi?id=97467
Reviewed by Antti Koivisto.
It turns out, the Selectors 4 require ":scope" to match contextual reference element set, which would be the root node in querySelector:
http://dev.w3.org/csswg/selectors4/#the-scope-pseudo
Right now, we simply make ":scope" equivalent to ":root", which is not correct. Let's remove the partial implementation until we have
time/energy to fully implement it.
Source/WebCore:
No new tests, removing half-baked feature.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId): Removed all mentions of PseudoScope
(WebCore::nameToPseudoTypeMap): Ditto.
(WebCore::CSSSelector::extractPseudoType): Ditto.
* css/CSSSelector.h: Ditto.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOneSelector): Ditto.
LayoutTests:
* fast/css/style-scoped/scope-pseudo-expected.txt: Removed.
* fast/css/style-scoped/scope-pseudo.html: Removed.
Modified Paths
Removed Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (129407 => 129408)
--- trunk/LayoutTests/ChangeLog 2012-09-24 20:47:45 UTC (rev 129407)
+++ trunk/LayoutTests/ChangeLog 2012-09-24 20:58:47 UTC (rev 129408)
@@ -1,3 +1,19 @@
+2012-09-24 Dimitri Glazkov <[email protected]>
+
+ Remove unbaked support for :scope pseudo-class.
+ https://bugs.webkit.org/show_bug.cgi?id=97467
+
+ Reviewed by Antti Koivisto.
+
+ It turns out, the Selectors 4 require ":scope" to match contextual reference element set, which would be the root node in querySelector:
+ http://dev.w3.org/csswg/selectors4/#the-scope-pseudo
+
+ Right now, we simply make ":scope" equivalent to ":root", which is not correct. Let's remove the partial implementation until we have
+ time/energy to fully implement it.
+
+ * fast/css/style-scoped/scope-pseudo-expected.txt: Removed.
+ * fast/css/style-scoped/scope-pseudo.html: Removed.
+
2012-09-24 Sheriff Bot <[email protected]>
Unreviewed, rolling out r129388.
Deleted: trunk/LayoutTests/fast/css/style-scoped/scope-pseudo-expected.txt (129407 => 129408)
--- trunk/LayoutTests/fast/css/style-scoped/scope-pseudo-expected.txt 2012-09-24 20:47:45 UTC (rev 129407)
+++ trunk/LayoutTests/fast/css/style-scoped/scope-pseudo-expected.txt 2012-09-24 20:58:47 UTC (rev 129408)
@@ -1,23 +0,0 @@
-Test :scope pseudo-class with <style scoped>
-
-Text
-Text
-Text
-Text
-Text
-Text
-Text
---- COMPUTED STYLES ---
-<html> background: rgb(255, 255, 0)
-outer: rgb(0, 0, 0)
-sibling1: rgb(0, 0, 0)
-scope1: rgb(0, 128, 0)
-inner1d: rgb(255, 255, 0)
-inner1s: rgb(0, 128, 0)
-sibling2: rgb(0, 0, 0)
-scope2: rgb(0, 0, 0)
-inner2d: rgb(0, 0, 255)
-inner2s: rgb(0, 0, 0)
-sibling3: rgb(0, 0, 0)
---- FINISHED ---
-
Deleted: trunk/LayoutTests/fast/css/style-scoped/scope-pseudo.html (129407 => 129408)
--- trunk/LayoutTests/fast/css/style-scoped/scope-pseudo.html 2012-09-24 20:47:45 UTC (rev 129407)
+++ trunk/LayoutTests/fast/css/style-scoped/scope-pseudo.html 2012-09-24 20:58:47 UTC (rev 129408)
@@ -1,68 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <script type="text/_javascript_">
- function log(msg)
- {
- document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
- }
-
- function test(id)
- {
- var elem = document.getElementById(id);
- log(id + ': ' + document.defaultView.getComputedStyle(elem, null).getPropertyValue('color'));
- }
-
- function runTests()
- {
- if (window.testRunner)
- testRunner.dumpAsText();
-
- log('--- COMPUTED STYLES ---');
-
- log('<html> background: ' + document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color'));
- test('outer');
- test('sibling1');
- test('scope1');
- test('inner1d');
- test('inner1s');
- test('sibling2');
- test('scope2');
- test('inner2d');
- test('inner2s');
- test('sibling3');
-
- log('--- FINISHED ---');
- }
- </script>
- <style type="text/css">
- body { color: black; }
- :scope { background-color: yellow; }
- </style>
-</head>
-<body _onload_="runTests();">
- <p>Test :scope pseudo-class with <style scoped></p>
- <div id="outer">
- <div id="sibling1">Text</div>
- <div id="scope1">
- <style type="text/css" scoped>
- div { color: yellow; }
- :scope { color: red; }
- div:scope { color: green; }
- </style>
- <div id="inner1d">Text</div>
- <span id="inner1s">Text<span>
- </div>
- <div id="sibling2">Text</div>
- <div id="scope2">
- <style type="text/css" scoped>
- :scope div { color: blue; }
- </style>
- <div id="inner2d">Text</div>
- <span id="inner2s">Text<span>
- </div>
- <div id="sibling3">Text</div>
- </div>
- <pre id="console"></pre>
-</body>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (129407 => 129408)
--- trunk/Source/WebCore/ChangeLog 2012-09-24 20:47:45 UTC (rev 129407)
+++ trunk/Source/WebCore/ChangeLog 2012-09-24 20:58:47 UTC (rev 129408)
@@ -1,3 +1,26 @@
+2012-09-24 Dimitri Glazkov <[email protected]>
+
+ Remove unbaked support for :scope pseudo-class.
+ https://bugs.webkit.org/show_bug.cgi?id=97467
+
+ Reviewed by Antti Koivisto.
+
+ It turns out, the Selectors 4 require ":scope" to match contextual reference element set, which would be the root node in querySelector:
+ http://dev.w3.org/csswg/selectors4/#the-scope-pseudo
+
+ Right now, we simply make ":scope" equivalent to ":root", which is not correct. Let's remove the partial implementation until we have
+ time/energy to fully implement it.
+
+ No new tests, removing half-baked feature.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::pseudoId): Removed all mentions of PseudoScope
+ (WebCore::nameToPseudoTypeMap): Ditto.
+ (WebCore::CSSSelector::extractPseudoType): Ditto.
+ * css/CSSSelector.h: Ditto.
+ * css/SelectorChecker.cpp:
+ (WebCore::SelectorChecker::checkOneSelector): Ditto.
+
2012-09-24 Ryosuke Niwa <[email protected]>
suspend/resumeWidgetHierarchyUpdates should be a RAII object
Modified: trunk/Source/WebCore/css/CSSSelector.cpp (129407 => 129408)
--- trunk/Source/WebCore/css/CSSSelector.cpp 2012-09-24 20:47:45 UTC (rev 129407)
+++ trunk/Source/WebCore/css/CSSSelector.cpp 2012-09-24 20:58:47 UTC (rev 129408)
@@ -183,7 +183,6 @@
case PseudoValid:
case PseudoInvalid:
case PseudoIndeterminate:
- case PseudoScope:
case PseudoTarget:
case PseudoLang:
case PseudoNot:
@@ -265,7 +264,6 @@
DEFINE_STATIC_LOCAL(AtomicString, scrollbarTrack, ("-webkit-scrollbar-track", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, scrollbarTrackPiece, ("-webkit-scrollbar-track-piece", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, selection, ("selection", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, scope, ("scope", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, target, ("target", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, visited, ("visited", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, windowInactive, ("window-inactive", AtomicString::ConstructFromLiteral));
@@ -353,7 +351,6 @@
nameToPseudoType->set(scrollbarTrackPiece.impl(), CSSSelector::PseudoScrollbarTrackPiece);
nameToPseudoType->set(cornerPresent.impl(), CSSSelector::PseudoCornerPresent);
nameToPseudoType->set(selection.impl(), CSSSelector::PseudoSelection);
- nameToPseudoType->set(scope.impl(), CSSSelector::PseudoScope);
nameToPseudoType->set(target.impl(), CSSSelector::PseudoTarget);
nameToPseudoType->set(visited.impl(), CSSSelector::PseudoVisited);
nameToPseudoType->set(firstPage.impl(), CSSSelector::PseudoFirstPage);
@@ -445,7 +442,6 @@
case PseudoValid:
case PseudoInvalid:
case PseudoIndeterminate:
- case PseudoScope:
case PseudoTarget:
case PseudoLang:
case PseudoNot:
Modified: trunk/Source/WebCore/css/CSSSelector.h (129407 => 129408)
--- trunk/Source/WebCore/css/CSSSelector.h 2012-09-24 20:47:45 UTC (rev 129407)
+++ trunk/Source/WebCore/css/CSSSelector.h 2012-09-24 20:58:47 UTC (rev 129408)
@@ -116,7 +116,6 @@
PseudoValid,
PseudoInvalid,
PseudoIndeterminate,
- PseudoScope,
PseudoTarget,
PseudoBefore,
PseudoAfter,
Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (129407 => 129408)
--- trunk/Source/WebCore/css/SelectorChecker.cpp 2012-09-24 20:47:45 UTC (rev 129407)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp 2012-09-24 20:58:47 UTC (rev 129408)
@@ -1115,10 +1115,6 @@
return true;
break;
}
- case CSSSelector::PseudoScope:
- if (context.scope)
- return element == context.scope;
- // If there is no scope, :scope should behave as :root -> fall through
case CSSSelector::PseudoRoot:
if (element == element->document()->documentElement())
return true;