Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp

Issue 2757553002: Editing: Content of display:table elements should be editable. (Closed)
Patch Set: Remove parenthesis Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingUtilities.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
index 3b826f4d6726e0e66f6882d1eab84d643858d1dd..46272509a43b3f6ece191483ddad55c0f40050a0 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -147,6 +147,13 @@ int shadowDepthOf<EditingInFlatTreeStrategy>(const Node& startContainer,
return 0;
}
+bool isRenderedAsTable(const Node* node) {
+ if (!node || !node->isElementNode())
+ return false;
+ LayoutObject* layoutObject = node->layoutObject();
+ return layoutObject && layoutObject->isTable();
+}
+
} // namespace
template <typename Strategy>
@@ -1037,8 +1044,7 @@ static bool shouldEmitExtraNewlineForNode(Node* node) {
// container) or as we hit it (if it's atomic).
template <typename Strategy>
bool TextIteratorAlgorithm<Strategy>::shouldRepresentNodeOffsetZero() {
- if (emitsCharactersBetweenAllVisiblePositions() &&
- isDisplayInsideTable(m_node))
+ if (emitsCharactersBetweenAllVisiblePositions() && isRenderedAsTable(m_node))
return true;
// Leave element positioned flush with start of a paragraph
@@ -1107,7 +1113,7 @@ bool TextIteratorAlgorithm<Strategy>::shouldRepresentNodeOffsetZero() {
template <typename Strategy>
bool TextIteratorAlgorithm<Strategy>::shouldEmitSpaceBeforeAndAfterNode(
Node* node) {
- return isDisplayInsideTable(node) &&
+ return isRenderedAsTable(node) &&
(node->layoutObject()->isInline() ||
emitsCharactersBetweenAllVisiblePositions());
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingUtilities.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698