Skip to content

Commit

Permalink
Merge r265561 - Broken formatting in price table on yandex.ru after t…
Browse files Browse the repository at this point in the history
…ranslating 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):
  • Loading branch information
whsieh authored and carlosgcampos committed Aug 14, 2020
1 parent 3071f7c commit 4659503
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
2020-08-12 Wenson Hsieh <wenson_hsieh@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 <aperez@igalia.com>

Unreviewed non-unified build fix.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/editing/TextManipulationController.cpp
Expand Up @@ -325,7 +325,7 @@ static bool isEnclosingItemBoundaryElement(const Element& element)
}
}

if (element.hasTagName(HTMLNames::tdTag) && displayType == DisplayType::TableCell)
if (displayType == DisplayType::TableCell)
return true;

if (element.hasTagName(HTMLNames::spanTag) && displayType == DisplayType::InlineBlock)
Expand Down
11 changes: 11 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,14 @@
2020-08-12 Wenson Hsieh <wenson_hsieh@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-11 Alex Christensen <achristensen@webkit.org>

Enable HTTP/2 ping API tests
Expand Down
15 changes: 11 additions & 4 deletions Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm
Expand Up @@ -1157,12 +1157,15 @@ - (void)_webView:(WKWebView *)webView didFindTextManipulationItem:(_WKTextManipu
"<head>"
" <style>"
" td { border: solid 1px tomato; }"
" a { border: solid 1px black; display: table-cell; }"
" </style>"
"</head>"
"<body>"
" <table>"
" <tbody>"
" <tr>"
" <a><span>Hello</span></a>"
" <a>World</a>"
" <td>Foo</td>"
" <td>Bar</td>"
" <td>Baz</td>"
Expand All @@ -1178,13 +1181,17 @@ - (void)_webView:(WKWebView *)webView didFindTextManipulationItem:(_WKTextManipu
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 {
Expand Down

0 comments on commit 4659503

Please sign in to comment.