Title: [160317] trunk/LayoutTests
Revision
160317
Author
[email protected]
Date
2013-12-09 10:51:02 -0800 (Mon, 09 Dec 2013)

Log Message

Add a test for style sharing if grandparents matches different rule chain and nth-last child
https://bugs.webkit.org/show_bug.cgi?id=125397

Reviewed by Darin Adler.

Add the test from https://chromium.googlesource.com/chromium/blink/+/30ff49bf63cdec31070ab4eda8784564f56789d4
and https://chromium.googlesource.com/chromium/blink/+/3cb1724bb52f3607006ddd0a89d356da23766115
so that we may not introduce the same regressions in WebKit.

* fast/css/nth-last-child-recalc-expected.html: Added.
* fast/css/nth-last-child-recalc.html: Added.
* fast/css/style-sharing-grand-parent-invalidate-expected.txt: Added.
* fast/css/style-sharing-grand-parent-invalidate.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (160316 => 160317)


--- trunk/LayoutTests/ChangeLog	2013-12-09 18:40:09 UTC (rev 160316)
+++ trunk/LayoutTests/ChangeLog	2013-12-09 18:51:02 UTC (rev 160317)
@@ -1,3 +1,19 @@
+2013-12-09  Ryosuke Niwa  <[email protected]>
+
+        Add a test for style sharing if grandparents matches different rule chain and nth-last child
+        https://bugs.webkit.org/show_bug.cgi?id=125397
+
+        Reviewed by Darin Adler.
+        
+        Add the test from https://chromium.googlesource.com/chromium/blink/+/30ff49bf63cdec31070ab4eda8784564f56789d4
+        and https://chromium.googlesource.com/chromium/blink/+/3cb1724bb52f3607006ddd0a89d356da23766115
+        so that we may not introduce the same regressions in WebKit.
+
+        * fast/css/nth-last-child-recalc-expected.html: Added.
+        * fast/css/nth-last-child-recalc.html: Added.
+        * fast/css/style-sharing-grand-parent-invalidate-expected.txt: Added.
+        * fast/css/style-sharing-grand-parent-invalidate.html: Added.
+
 2013-12-09  Joanmarie Diggs  <[email protected]>
 
         AX: [ATK] Convert the get_{string,text}_at_offset atktest.c unit tests to layout tests

Added: trunk/LayoutTests/fast/css/nth-last-child-recalc-expected.html (0 => 160317)


--- trunk/LayoutTests/fast/css/nth-last-child-recalc-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/nth-last-child-recalc-expected.html	2013-12-09 18:51:02 UTC (rev 160317)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<style>
+a {
+    float: left;
+    background-color: green;
+    width: 100px;
+    height: 100px;
+    margin: 0 13px 13px 0;
+}
+.lastInRow {
+    margin-right: 0;
+}
+div {
+    width: 370px;
+}
+</style>
+<body>
+<p>This tests that we get nth-child and nth-last-child correct on style recalc. There should be 2 identical rows of green boxes below.</p>
+<div>
+<a></a>
+<a></a>
+<a class="lastInRow"></a>
+<a></a>
+<a></a>
+<a class="lastInRow"></a>
+</div>

Added: trunk/LayoutTests/fast/css/nth-last-child-recalc.html (0 => 160317)


--- trunk/LayoutTests/fast/css/nth-last-child-recalc.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/nth-last-child-recalc.html	2013-12-09 18:51:02 UTC (rev 160317)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<style>
+a {
+    float: left;
+    background-color: green;
+    width: 100px;
+    height: 100px;
+    margin: 0 13px 13px 0;
+}
+a:nth-child(3n+3) {
+    margin-right: 0;
+}
+a:nth-last-child(-n+3) {
+    margin-bottom: 30px;
+}
+div {
+    width: 370px;
+}
+</style>
+<script>
+_onload_ = function () {
+    test.focus();
+    test.blur();
+}
+</script>
+<body>
+<p>This tests that we get nth-child and nth-last-child correct on style recalc. There should be 2 identical rows of green boxes below.</p>
+<div>
+<a id="test" href=""
+<a></a>
+<a></a>
+<a></a>
+<a></a>
+<a></a>
+</div>

Added: trunk/LayoutTests/fast/css/style-sharing-grand-parent-invalidate-expected.txt (0 => 160317)


--- trunk/LayoutTests/fast/css/style-sharing-grand-parent-invalidate-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/style-sharing-grand-parent-invalidate-expected.txt	2013-12-09 18:51:02 UTC (rev 160317)
@@ -0,0 +1,2 @@
+This test succeeds if the two blocks show red and green repectively: SUCCESS
+

Added: trunk/LayoutTests/fast/css/style-sharing-grand-parent-invalidate.html (0 => 160317)


--- trunk/LayoutTests/fast/css/style-sharing-grand-parent-invalidate.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/style-sharing-grand-parent-invalidate.html	2013-12-09 18:51:02 UTC (rev 160317)
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.outerx .mid .inner {
+    background-color: red;
+}
+.outery .mid .inner {
+    background-color: green;
+}
+.inner {
+    width: 50px;
+    height: 50px;
+}
+</style>
+<script>
+function test() {
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    var x = document.getElementById("x");
+    x.classList.add("outerx");
+
+    var y = document.getElementById("y");
+    y.classList.add("outery");
+
+    var colorX = getComputedStyle(x.children[0].children[0]).backgroundColor;
+    var colorY = getComputedStyle(y.children[0].children[0]).backgroundColor;
+
+    var result = document.getElementById("result")
+    if (colorX == colorY)
+        result.innerHTML = "FAIL";
+    else
+        result.innerHTML = "SUCCESS";
+}
+</script>
+</head>
+<body _onload_="test()">
+This test succeeds if the two blocks show red and green repectively: <span id="result"></span>
+<div id="x">
+    <div class="mid">
+        <div class="inner">
+        </div>
+    </div>
+</div>
+<div id="y">
+    <div class="mid">
+        <div class="inner">
+        </div>
+    </div>
+</div>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to