Diff
Modified: branches/safari-600.1-branch/LayoutTests/ChangeLog (171725 => 171726)
--- branches/safari-600.1-branch/LayoutTests/ChangeLog 2014-07-29 08:12:46 UTC (rev 171725)
+++ branches/safari-600.1-branch/LayoutTests/ChangeLog 2014-07-29 08:18:04 UTC (rev 171726)
@@ -1,3 +1,26 @@
+2014-07-29 Lucas Forschler <lforsch...@apple.com>
+
+ Merge r171675
+
+ 2014-07-28 Yusuke Suzuki <utatane....@gmail.com>
+
+ CSS: Fix :visited behavior for SubSelectors
+ https://bugs.webkit.org/show_bug.cgi?id=135324
+
+ Reviewed by Benjamin Poulain.
+
+ Disable :visited match for the selectors that has SubSelectors.
+ This `isSubSelector` (`context.firstSelectorOfTheFragment == context.selector`) is intended to
+ check `relation != CSSSelector::SubSelector`.
+ But since this value belongs to the previous selector and it is tested inside the branch that checks
+ the next selector isn't SubSelector `relation != CSSSelector::SubSelector`,
+ this only matches when the previous selector doesn't has SubSelectors.
+
+ * fast/history/nested-visited-test-complex-expected.txt: Added.
+ * fast/history/nested-visited-test-complex.html: Added.
+ * fast/history/sibling-visited-test-complex-expected.txt: Added.
+ * fast/history/sibling-visited-test-complex.html: Added.
+
2014-07-28 Anders Carlsson <ander...@apple.com>
Update test expectations.
Copied: branches/safari-600.1-branch/LayoutTests/fast/history/nested-visited-test-complex-expected.txt (from rev 171675, trunk/LayoutTests/fast/history/nested-visited-test-complex-expected.txt) (0 => 171726)
--- branches/safari-600.1-branch/LayoutTests/fast/history/nested-visited-test-complex-expected.txt (rev 0)
+++ branches/safari-600.1-branch/LayoutTests/fast/history/nested-visited-test-complex-expected.txt 2014-07-29 08:18:04 UTC (rev 171726)
@@ -0,0 +1,9 @@
+These contents (not underline) of two links should be different colors (green and orange):
+
+One Two
+
+PASS firstStyle.color became different from secondStyle.color
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/safari-600.1-branch/LayoutTests/fast/history/nested-visited-test-complex.html (from rev 171675, trunk/LayoutTests/fast/history/nested-visited-test-complex.html) (0 => 171726)
--- branches/safari-600.1-branch/LayoutTests/fast/history/nested-visited-test-complex.html (rev 0)
+++ branches/safari-600.1-branch/LayoutTests/fast/history/nested-visited-test-complex.html 2014-07-29 08:18:04 UTC (rev 171726)
@@ -0,0 +1,44 @@
+<html>
+<head>
+<script src=""
+<script>
+jsTestIsAsync = true;
+
+if (window.testRunner)
+ window.testRunner.keepWebHistory();
+
+function compareStyles()
+{
+ var anchor = document.createElement("a");
+ anchor.href=""
+ anchor.setAttribute("id", "one");
+ anchor.classList.add("ok");
+ anchor.classList.add("ng");
+ anchor.innerHTML = "One";
+ document.getElementById('enclosure').appendChild(anchor);
+
+ if (window.internals) {
+ firstStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('one'));
+ secondStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('two'));
+ shouldBecomeDifferent('firstStyle.color', 'secondStyle.color', finishJSTest);
+ }
+}
+</script>
+<style>
+a { color: green }
+:visited.ok > a.ok { color: orange }
+:visited.ok > span.ok { color: orange }
+</style>
+</head>
+<body _onload_="compareStyles()">
+<iframe src="" style="display:none"></iframe>
+
+<p>These contents (not underline) of two links should be different colors (green and orange):</p>
+<p style="color:green">
+<a id="enclosure" class="ok" href=""
+<a class="ok" href="" class="ok" id="two">Two</span></a>
+</p>
+<div id=console></div>
+</body>
+<script src=""
+</html>
Copied: branches/safari-600.1-branch/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt (from rev 171675, trunk/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt) (0 => 171726)
--- branches/safari-600.1-branch/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt (rev 0)
+++ branches/safari-600.1-branch/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt 2014-07-29 08:18:04 UTC (rev 171726)
@@ -0,0 +1,9 @@
+These two links should be different colors (green and orange):
+
+One Two
+
+PASS firstStyle.color became different from secondStyle.color
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/safari-600.1-branch/LayoutTests/fast/history/sibling-visited-test-complex.html (from rev 171675, trunk/LayoutTests/fast/history/sibling-visited-test-complex.html) (0 => 171726)
--- branches/safari-600.1-branch/LayoutTests/fast/history/sibling-visited-test-complex.html (rev 0)
+++ branches/safari-600.1-branch/LayoutTests/fast/history/sibling-visited-test-complex.html 2014-07-29 08:18:04 UTC (rev 171726)
@@ -0,0 +1,36 @@
+<html>
+<head>
+<script src=""
+<script>
+jsTestIsAsync = true;
+
+if (window.testRunner)
+ window.testRunner.keepWebHistory();
+
+function compareStyles()
+{
+ if (window.internals) {
+ firstStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('one'));
+ secondStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('two'));
+ shouldBecomeDifferent('firstStyle.color', 'secondStyle.color', finishJSTest);
+ }
+}
+</script>
+<style>
+:link { color: orange }
+:visited + :link.ok { color: green }
+:visited { color: green }
+</style>
+</head>
+<body _onload_="compareStyles()">
+<iframe src="" style="display:none"></iframe>
+
+<p>These two links should be different colors (green and orange):</p>
+<p style="color:green">
+<a href="" class="ok" id="one">One</a>
+<a href="" class="ok" id="two">Two</a>
+</p>
+<div id=console></div>
+</body>
+<script src=""
+</html>
Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (171725 => 171726)
--- branches/safari-600.1-branch/Source/WebCore/ChangeLog 2014-07-29 08:12:46 UTC (rev 171725)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog 2014-07-29 08:18:04 UTC (rev 171726)
@@ -1,3 +1,22 @@
+2014-07-29 Lucas Forschler <lforsch...@apple.com>
+
+ Merge r171675
+
+ 2014-07-28 Yusuke Suzuki <utatane....@gmail.com>
+
+ CSS: Fix :visited behavior for SubSelectors
+ https://bugs.webkit.org/show_bug.cgi?id=135324
+
+ Reviewed by Benjamin Poulain.
+
+ Disable :visited match for the selectors that has SubSelectors.
+
+ Tests: fast/history/nested-visited-test-complex.html
+ fast/history/sibling-visited-test-complex.html
+
+ * css/SelectorChecker.cpp:
+ (WebCore::SelectorChecker::matchRecursively):
+
2014-07-27 Matthew Hanson <matthew_han...@apple.com>
Merge r171661. <rdar://problem/17315237>
Modified: branches/safari-600.1-branch/Source/WebCore/css/SelectorChecker.cpp (171725 => 171726)
--- branches/safari-600.1-branch/Source/WebCore/css/SelectorChecker.cpp 2014-07-29 08:12:46 UTC (rev 171725)
+++ branches/safari-600.1-branch/Source/WebCore/css/SelectorChecker.cpp 2014-07-29 08:18:04 UTC (rev 171726)
@@ -207,7 +207,7 @@
return SelectorFailsCompletely;
// Disable :visited matching when we see the first link or try to match anything else than an ancestors.
- if (context.firstSelectorOfTheFragment == context.selector && (context.element->isLink() || (relation != CSSSelector::Descendant && relation != CSSSelector::Child)))
+ if (context.element->isLink() || (relation != CSSSelector::Descendant && relation != CSSSelector::Child))
nextContext.visitedMatchType = VisitedMatchDisabled;
nextContext.pseudoId = NOPSEUDO;