Text-combine erroneously draws vertically after non-layout-causing style change
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 22:36:56 +0000 (22:36 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 22:36:56 +0000 (22:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143461
<rdar://problem/19285490>

Reviewed by Darin Adler.

Source/WebCore:

RenderCombineText::styleDidChange() unconditionally uncombines its text. Layout then
recombines it. However, if there is a style change that does not cause layout, the
RenderCombineText will be left uncombined until the next layout.

Test: fast/text/text-combine-style-change-no-layout.html

* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::styleDidChange):

LayoutTests:

* fast/text/text-combine-style-change-no-layout-expected.html: Added.
* fast/text/text-combine-style-change-no-layout.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182609 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/text/text-combine-style-change-no-layout-expected.html [new file with mode: 0644]
LayoutTests/fast/text/text-combine-style-change-no-layout.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderCombineText.cpp

index 90d4b8f4dcfdda2eddfdfe5d8ee0e876a4d18074..21bdcf76acb7ea327be6aca363d2749e60bea074 100644 (file)
@@ -1,3 +1,14 @@
+2015-04-09  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Text-combine erroneously draws vertically after non-layout-causing style change
+        https://bugs.webkit.org/show_bug.cgi?id=143461
+        <rdar://problem/19285490>
+
+        Reviewed by Darin Adler.
+
+        * fast/text/text-combine-style-change-no-layout-expected.html: Added.
+        * fast/text/text-combine-style-change-no-layout.html: Added.
+
 2015-04-09  Hunseop Jeong  <hs85.jeong@samsung.com>
 
         [EFL] fast/css/vertical-text-overflow-ellipsis-text-align-center.html is failing 
diff --git a/LayoutTests/fast/text/text-combine-style-change-no-layout-expected.html b/LayoutTests/fast/text/text-combine-style-change-no-layout-expected.html
new file mode 100644 (file)
index 0000000..5a39fda
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+    <head>
+    </head>
+    <body style="-webkit-writing-mode: vertical-rl; font-size: 40px;">
+        <div id="word" style="-webkit-text-combine: horizontal; color: green;">39</div>
+    </body>
+</html>
diff --git a/LayoutTests/fast/text/text-combine-style-change-no-layout.html b/LayoutTests/fast/text/text-combine-style-change-no-layout.html
new file mode 100644 (file)
index 0000000..35985ff
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            .colorClass {
+                color: green;
+            }
+        </style>
+    </head>
+    <body style="-webkit-writing-mode: vertical-rl; font-size: 40px;">
+        <div id="word" style="-webkit-text-combine: horizontal;">39</div>
+        <script>
+            if (window.testRunner)
+                testRunner.waitUntilDone();
+            window.setTimeout(function() {
+                document.querySelector("#word").className = "colorClass";
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0);
+        </script>
+    </body>
+</html>
index 2d2f9a494d271b837ab509a0baa2bec385e2e16f..8232a7c44cdc90fbb5bc7327bcdd418c56c3b935 100644 (file)
@@ -1,3 +1,20 @@
+2015-04-09  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Text-combine erroneously draws vertically after non-layout-causing style change
+        https://bugs.webkit.org/show_bug.cgi?id=143461
+        <rdar://problem/19285490>
+
+        Reviewed by Darin Adler.
+
+        RenderCombineText::styleDidChange() unconditionally uncombines its text. Layout then
+        recombines it. However, if there is a style change that does not cause layout, the
+        RenderCombineText will be left uncombined until the next layout.
+
+        Test: fast/text/text-combine-style-change-no-layout.html
+
+        * rendering/RenderCombineText.cpp:
+        (WebCore::RenderCombineText::styleDidChange):
+
 2015-04-09  Simon Fraser  <simon.fraser@apple.com>
 
         Revert part of 182516: it broke tests
index fb233797f7dbcb97780019cc84e63145ec3eef52..0409f8df2f192fd435041917f2c0da324a322069 100644 (file)
@@ -42,7 +42,8 @@ void RenderCombineText::styleDidChange(StyleDifference diff, const RenderStyle*
 
     RenderText::styleDidChange(diff, oldStyle);
 
-    if (m_isCombined) {
+    if (m_isCombined && selfNeedsLayout()) {
+        // Layouts cause the text to be recombined; therefore, only only un-combine when the style diff causes a layout.
         RenderText::setRenderedText(originalText()); // This RenderCombineText has been combined once. Restore the original text for the next combineText().
         m_isCombined = false;
     }