Title: [265561] trunk
Revision
265561
Author
wenson_hs...@apple.com
Date
2020-08-12 13:11:37 -0700 (Wed, 12 Aug 2020)

Log Message

Broken formatting in price table on yandex.ru after translating to English
https://bugs.webkit.org/show_bug.cgi?id=215416
<rdar://problem/66354018>

Reviewed by Tim Horton.

Source/WebCore:

Extend the behavior added in r265188 so that it applies to all elements that have `display: table-cell;`, rather
than only table data cell elements.

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

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (265560 => 265561)


--- trunk/Source/WebCore/ChangeLog	2020-08-12 19:53:29 UTC (rev 265560)
+++ trunk/Source/WebCore/ChangeLog	2020-08-12 20:11:37 UTC (rev 265561)
@@ -1,3 +1,17 @@
+2020-08-12  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Broken formatting in price table on yandex.ru after translating to English
+        https://bugs.webkit.org/show_bug.cgi?id=215416
+        <rdar://problem/66354018>
+
+        Reviewed by Tim Horton.
+
+        Extend the behavior added in r265188 so that it applies to all elements that have `display: table-cell;`, rather
+        than only table data cell elements.
+
+        * editing/TextManipulationController.cpp:
+        (WebCore::isEnclosingItemBoundaryElement):
+
 2020-08-12  Adrian Perez de Castro  <ape...@igalia.com>
 
         Unreviewed non-unified build fix.

Modified: trunk/Source/WebCore/editing/TextManipulationController.cpp (265560 => 265561)


--- trunk/Source/WebCore/editing/TextManipulationController.cpp	2020-08-12 19:53:29 UTC (rev 265560)
+++ trunk/Source/WebCore/editing/TextManipulationController.cpp	2020-08-12 20:11:37 UTC (rev 265561)
@@ -325,7 +325,7 @@
         }
     }
 
-    if (element.hasTagName(HTMLNames::tdTag) && displayType == DisplayType::TableCell)
+    if (displayType == DisplayType::TableCell)
         return true;
 
     if (element.hasTagName(HTMLNames::spanTag) && displayType == DisplayType::InlineBlock)

Modified: trunk/Tools/ChangeLog (265560 => 265561)


--- trunk/Tools/ChangeLog	2020-08-12 19:53:29 UTC (rev 265560)
+++ trunk/Tools/ChangeLog	2020-08-12 20:11:37 UTC (rev 265561)
@@ -1,3 +1,14 @@
+2020-08-12  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Broken formatting in price table on yandex.ru after translating to English
+        https://bugs.webkit.org/show_bug.cgi?id=215416
+        <rdar://problem/66354018>
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:
+        (TestWebKitAPI::TEST):
+
 2020-08-12  Devin Rousso  <drou...@apple.com>
 
         Add Copy WebKit Permalink items to Sublime Text command palette

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm (265560 => 265561)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm	2020-08-12 19:53:29 UTC (rev 265560)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm	2020-08-12 20:11:37 UTC (rev 265561)
@@ -1157,6 +1157,7 @@
         "<head>"
         "  <style>"
         "    td { border: solid 1px tomato; }"
+        "    a { border: solid 1px black; display: table-cell; }"
         "  </style>"
         "</head>"
         "<body>"
@@ -1163,6 +1164,8 @@
         "  <table>"
         "    <tbody>"
         "      <tr>"
+        "        <a><span>Hello</span></a>"
+        "        <a>World</a>"
         "        <td>Foo</td>"
         "        <td>Bar</td>"
         "        <td>Baz</td>"
@@ -1178,13 +1181,17 @@
     TestWebKitAPI::Util::run(&done);
 
     auto items = [delegate items];
-    EXPECT_EQ(items.count, 3UL);
+    EXPECT_EQ(items.count, 5UL);
     EXPECT_EQ(items[0].tokens.count, 1UL);
-    EXPECT_WK_STREQ("Foo", items[0].tokens[0].content);
+    EXPECT_WK_STREQ("Hello", items[0].tokens[0].content);
     EXPECT_EQ(items[1].tokens.count, 1UL);
-    EXPECT_WK_STREQ("Bar", items[1].tokens[0].content);
+    EXPECT_WK_STREQ("World", items[1].tokens[0].content);
     EXPECT_EQ(items[2].tokens.count, 1UL);
-    EXPECT_WK_STREQ("Baz", items[2].tokens[0].content);
+    EXPECT_WK_STREQ("Foo", items[2].tokens[0].content);
+    EXPECT_EQ(items[3].tokens.count, 1UL);
+    EXPECT_WK_STREQ("Bar", items[3].tokens[0].content);
+    EXPECT_EQ(items[4].tokens.count, 1UL);
+    EXPECT_WK_STREQ("Baz", items[4].tokens[0].content);
 }
 
 struct Token {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to