Title: [264556] trunk
Revision
264556
Author
[email protected]
Date
2020-07-17 16:43:12 -0700 (Fri, 17 Jul 2020)

Log Message

Followup to r264531
https://bugs.webkit.org/show_bug.cgi?id=214488
<rdar://problem/64531754>

Reviewed by Darin Adler.

Source/WebCore:

Elide a null check by grabbing `RenderStyle` from the renderer instead of the element, and also limit
overflow hidden to the X axis.

* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::completeManipulation):

Tools:

See WebCore ChangeLog for more details.

* TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264555 => 264556)


--- trunk/Source/WebCore/ChangeLog	2020-07-17 23:40:57 UTC (rev 264555)
+++ trunk/Source/WebCore/ChangeLog	2020-07-17 23:43:12 UTC (rev 264556)
@@ -1,3 +1,17 @@
+2020-07-17  Wenson Hsieh  <[email protected]>
+
+        Followup to r264531
+        https://bugs.webkit.org/show_bug.cgi?id=214488
+        <rdar://problem/64531754>
+
+        Reviewed by Darin Adler.
+
+        Elide a null check by grabbing `RenderStyle` from the renderer instead of the element, and also limit
+        overflow hidden to the X axis.
+
+        * editing/TextManipulationController.cpp:
+        (WebCore::TextManipulationController::completeManipulation):
+
 2020-07-17  Clark Wang  <[email protected]>
 
         Added Fixes for AudioScheduledSourceNode

Modified: trunk/Source/WebCore/editing/TextManipulationController.cpp (264555 => 264556)


--- trunk/Source/WebCore/editing/TextManipulationController.cpp	2020-07-17 23:40:57 UTC (rev 264555)
+++ trunk/Source/WebCore/editing/TextManipulationController.cpp	2020-07-17 23:43:12 UTC (rev 264556)
@@ -641,9 +641,11 @@
             if (!box || !box->hasVisualOverflow())
                 continue;
 
-            auto* style = element.renderStyle();
-            if (style && style->width().isFixed() && style->height().isFixed() && !style->hasOutOfFlowPosition() && !style->hasClip())
-                element.setInlineStyleProperty(CSSPropertyOverflow, CSSValueHidden);
+            auto& style = box->style();
+            if (style.width().isFixed() && style.height().isFixed() && !style.hasOutOfFlowPosition() && !style.hasClip()) {
+                element.setInlineStyleProperty(CSSPropertyOverflowX, CSSValueHidden);
+                element.setInlineStyleProperty(CSSPropertyOverflowY, CSSValueAuto);
+            }
         }
     }
 

Modified: trunk/Tools/ChangeLog (264555 => 264556)


--- trunk/Tools/ChangeLog	2020-07-17 23:40:57 UTC (rev 264555)
+++ trunk/Tools/ChangeLog	2020-07-17 23:43:12 UTC (rev 264556)
@@ -1,3 +1,15 @@
+2020-07-17  Wenson Hsieh  <[email protected]>
+
+        Followup to r264531
+        https://bugs.webkit.org/show_bug.cgi?id=214488
+        <rdar://problem/64531754>
+
+        Reviewed by Darin Adler.
+
+        See WebCore ChangeLog for more details.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:
+
 2020-07-17  Jiewen Tan  <[email protected]>
 
         [WebAuthn] Cache the PIN to improve NFC user experience

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm (264555 => 264556)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm	2020-07-17 23:40:57 UTC (rev 264555)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm	2020-07-17 23:43:12 UTC (rev 264556)
@@ -2886,7 +2886,8 @@
     TestWebKitAPI::Util::run(&done);
 
     EXPECT_WK_STREQ("This is a long translation Foo bar", [webView stringByEvaluatingJavaScript:@"document.querySelector('a').textContent.trim()"]);
-    EXPECT_WK_STREQ("hidden", [webView stringByEvaluatingJavaScript:@"getComputedStyle(document.querySelector('span')).overflow"]);
+    EXPECT_WK_STREQ("hidden", [webView stringByEvaluatingJavaScript:@"getComputedStyle(document.querySelector('span')).overflowX"]);
+    EXPECT_WK_STREQ("auto", [webView stringByEvaluatingJavaScript:@"getComputedStyle(document.querySelector('span')).overflowY"]);
 }
 
 TEST(TextManipulation, TextManipulationTokenDebugDescription)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to