Title: [230412] releases/WebKitGTK/webkit-2.20
Revision
230412
Author
carlo...@webkit.org
Date
2018-04-09 05:59:18 -0700 (Mon, 09 Apr 2018)

Log Message

Merge r229867 - [Simple line layout] Text with letter spacing is not positioned properly.
https://bugs.webkit.org/show_bug.cgi?id=183079
<rdar://problem/38762569>

Reviewed by Antti Koivisto.

Source/WebCore:

We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
since we might not be able to use the fast path anymore.

Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html

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

LayoutTests:

* fast/text/simple-line-layout-dynamic-letter-word-spacing-expected.html: Added.
* fast/text/simple-line-layout-dynamic-letter-word-spacing.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog (230411 => 230412)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-04-09 12:59:05 UTC (rev 230411)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-04-09 12:59:18 UTC (rev 230412)
@@ -1,3 +1,14 @@
+2018-03-22  Zalan Bujtas  <za...@apple.com>
+
+        [Simple line layout] Text with letter spacing is not positioned properly.
+        https://bugs.webkit.org/show_bug.cgi?id=183079
+        <rdar://problem/38762569>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/text/simple-line-layout-dynamic-letter-word-spacing-expected.html: Added.
+        * fast/text/simple-line-layout-dynamic-letter-word-spacing.html: Added.
+
 2018-03-22  Adrian Perez de Castro  <ape...@igalia.com>
 
         [WPE] Enable WOFF2 support

Added: releases/WebKitGTK/webkit-2.20/LayoutTests/fast/text/simple-line-layout-dynamic-letter-word-spacing-expected.html (0 => 230412)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/fast/text/simple-line-layout-dynamic-letter-word-spacing-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/fast/text/simple-line-layout-dynamic-letter-word-spacing-expected.html	2018-04-09 12:59:18 UTC (rev 230412)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+    width: 200px;
+}
+</style>
+</head>
+<body>
+<div id=letterSpacing>foobar foobar foobar foobar</div>
+<div id=wordSpacing>foobar foobar foobar foobar</div>
+<script>
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+document.body.offsetHeight;
+letterSpacing.style.letterSpacing = "10px";
+wordSpacing.style.wordSpacing = "20px";
+</script>
+</body>
+</html>

Added: releases/WebKitGTK/webkit-2.20/LayoutTests/fast/text/simple-line-layout-dynamic-letter-word-spacing.html (0 => 230412)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/fast/text/simple-line-layout-dynamic-letter-word-spacing.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/fast/text/simple-line-layout-dynamic-letter-word-spacing.html	2018-04-09 12:59:18 UTC (rev 230412)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+    width: 200px;
+}
+</style>
+</head>
+<body>
+<div id=letterSpacing>foobar foobar foobar foobar</div>
+<div id=wordSpacing>foobar foobar foobar foobar</div>
+<script>
+document.body.offsetHeight;
+letterSpacing.style.letterSpacing = "10px";
+wordSpacing.style.wordSpacing = "20px";
+</script>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog (230411 => 230412)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-04-09 12:59:05 UTC (rev 230411)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-04-09 12:59:18 UTC (rev 230412)
@@ -1,3 +1,19 @@
+2018-03-22  Zalan Bujtas  <za...@apple.com>
+
+        [Simple line layout] Text with letter spacing is not positioned properly.
+        https://bugs.webkit.org/show_bug.cgi?id=183079
+        <rdar://problem/38762569>
+
+        Reviewed by Antti Koivisto.
+
+        We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
+        since we might not be able to use the fast path anymore.
+
+        Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html
+
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::styleDidChange):
+
 2018-03-22  Adrian Perez de Castro  <ape...@igalia.com>
 
         [WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are disabled

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderText.cpp (230411 => 230412)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderText.cpp	2018-04-09 12:59:05 UTC (rev 230411)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderText.cpp	2018-04-09 12:59:18 UTC (rev 230412)
@@ -263,13 +263,14 @@
     if (!oldStyle) {
         m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol();
         needsResetText = m_useBackslashAsYenSymbol;
-        // It should really be computed in the c'tor, but during construction we don't have parent yet -and RenderText style == parent()->style()
-        m_canUseSimplifiedTextMeasuring = computeCanUseSimplifiedTextMeasuring();
     } else if (oldStyle->fontCascade().useBackslashAsYenSymbol() != newStyle.fontCascade().useBackslashAsYenSymbol()) {
         m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol();
         needsResetText = true;
     }
 
+    if (!oldStyle || oldStyle->fontCascade() != newStyle.fontCascade())
+        m_canUseSimplifiedTextMeasuring = computeCanUseSimplifiedTextMeasuring();
+
     ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE;
     ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE;
     if (needsResetText || oldTransform != newStyle.textTransform() || oldSecurity != newStyle.textSecurity())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to