Commit 2f0a4c13 authored by dglazkov@chromium.org's avatar dglazkov@chromium.org
Browse files

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7fa15457
2012-09-24 Dimitri Glazkov <dglazkov@chromium.org>
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 <webkit.review.bot@gmail.com>
 
Unreviewed, rolling out r129388.
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 ---
<!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 &lt;style scoped&gt;</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>
2012-09-24 Dimitri Glazkov <dglazkov@chromium.org>
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 <rniwa@webkit.org>
 
suspend/resumeWidgetHierarchyUpdates should be a RAII object
......@@ -183,7 +183,6 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
case PseudoValid:
case PseudoInvalid:
case PseudoIndeterminate:
case PseudoScope:
case PseudoTarget:
case PseudoLang:
case PseudoNot:
......@@ -265,7 +264,6 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
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 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
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 @@ void CSSSelector::extractPseudoType() const
case PseudoValid:
case PseudoInvalid:
case PseudoIndeterminate:
case PseudoScope:
case PseudoTarget:
case PseudoLang:
case PseudoNot:
......
......@@ -116,7 +116,6 @@ namespace WebCore {
PseudoValid,
PseudoInvalid,
PseudoIndeterminate,
PseudoScope,
PseudoTarget,
PseudoBefore,
PseudoAfter,
......
......@@ -1115,10 +1115,6 @@ bool SelectorChecker::checkOneSelector(const SelectorCheckingContext& context, P
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment