Table data is incorrectly translated in some articles on en.wikipedia.org
https://bugs.webkit.org/show_bug.cgi?id=215071
<rdar://problem/66354013>

Reviewed by Darin Adler.

Source/WebCore:

Text in table cells sometimes end up in adjacent cells after translation, since adjacent cells are currently
extracted as different tokens in a single item; mitigate this by splitting text in table cells into different
text manipulation items instead.

Test: TextManipulation.StartTextManipulationExtractsTableCellsAsSeparateItems

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

Tools:

Add a new API test to exercise the change.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@265188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/editing/TextManipulationController.cpp b/Source/WebCore/editing/TextManipulationController.cpp
index 40c46a9..876c0b3 100644
--- a/Source/WebCore/editing/TextManipulationController.cpp
+++ b/Source/WebCore/editing/TextManipulationController.cpp
@@ -320,6 +320,9 @@
         }
     }
 
+    if (element.hasTagName(HTMLNames::tdTag) && displayType == DisplayType::TableCell)
+        return true;
+
     if (element.hasTagName(HTMLNames::spanTag) && displayType == DisplayType::InlineBlock)
         return true;