Title: [172632] branches/safari-600.1.4.11-branch

Diff

Modified: branches/safari-600.1.4.11-branch/LayoutTests/ChangeLog (172631 => 172632)


--- branches/safari-600.1.4.11-branch/LayoutTests/ChangeLog	2014-08-15 17:38:47 UTC (rev 172631)
+++ branches/safari-600.1.4.11-branch/LayoutTests/ChangeLog	2014-08-15 18:24:08 UTC (rev 172632)
@@ -1,3 +1,26 @@
+2014-08-15  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-08-07  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r172183. <rdar://problem/17908085>

Copied: branches/safari-600.1.4.11-branch/LayoutTests/fast/history/nested-visited-test-complex-expected.txt (from rev 171675, trunk/LayoutTests/fast/history/nested-visited-test-complex-expected.txt) (0 => 172632)


--- branches/safari-600.1.4.11-branch/LayoutTests/fast/history/nested-visited-test-complex-expected.txt	                        (rev 0)
+++ branches/safari-600.1.4.11-branch/LayoutTests/fast/history/nested-visited-test-complex-expected.txt	2014-08-15 18:24:08 UTC (rev 172632)
@@ -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.4.11-branch/LayoutTests/fast/history/nested-visited-test-complex.html (from rev 171675, trunk/LayoutTests/fast/history/nested-visited-test-complex.html) (0 => 172632)


--- branches/safari-600.1.4.11-branch/LayoutTests/fast/history/nested-visited-test-complex.html	                        (rev 0)
+++ branches/safari-600.1.4.11-branch/LayoutTests/fast/history/nested-visited-test-complex.html	2014-08-15 18:24:08 UTC (rev 172632)
@@ -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.4.11-branch/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt (from rev 171675, trunk/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt) (0 => 172632)


--- branches/safari-600.1.4.11-branch/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt	                        (rev 0)
+++ branches/safari-600.1.4.11-branch/LayoutTests/fast/history/sibling-visited-test-complex-expected.txt	2014-08-15 18:24:08 UTC (rev 172632)
@@ -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.4.11-branch/LayoutTests/fast/history/sibling-visited-test-complex.html (from rev 171675, trunk/LayoutTests/fast/history/sibling-visited-test-complex.html) (0 => 172632)


--- branches/safari-600.1.4.11-branch/LayoutTests/fast/history/sibling-visited-test-complex.html	                        (rev 0)
+++ branches/safari-600.1.4.11-branch/LayoutTests/fast/history/sibling-visited-test-complex.html	2014-08-15 18:24:08 UTC (rev 172632)
@@ -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.4.11-branch/Source/WebCore/ChangeLog (172631 => 172632)


--- branches/safari-600.1.4.11-branch/Source/WebCore/ChangeLog	2014-08-15 17:38:47 UTC (rev 172631)
+++ branches/safari-600.1.4.11-branch/Source/WebCore/ChangeLog	2014-08-15 18:24:08 UTC (rev 172632)
@@ -1,3 +1,22 @@
+2014-08-15  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-08-11  Babak Shafiei  <bshaf...@apple.com>
 
         Merge r172422. <rdar://problem/17912361>

Modified: branches/safari-600.1.4.11-branch/Source/WebCore/css/SelectorChecker.cpp (172631 => 172632)


--- branches/safari-600.1.4.11-branch/Source/WebCore/css/SelectorChecker.cpp	2014-08-15 17:38:47 UTC (rev 172631)
+++ branches/safari-600.1.4.11-branch/Source/WebCore/css/SelectorChecker.cpp	2014-08-15 18:24:08 UTC (rev 172632)
@@ -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;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to