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

Unified Diff: Source/core/dom/Position.cpp

Issue 59963002: Unable to delete the first and the last characters of a contenteditable div with display: table. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing the nits Created 7 years, 1 month 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
Index: Source/core/dom/Position.cpp
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
index 405a064e2df21dcd92580d7db0e433d70637ce11..4ceb136f5f7e67280133e30f444a3f9d6dc438c7 100644
--- a/Source/core/dom/Position.cpp
+++ b/Source/core/dom/Position.cpp
@@ -211,13 +211,13 @@ Position Position::parentAnchoredEquivalent() const
// FIXME: This should only be necessary for legacy positions, but is also needed for positions before and after Tables
if (m_offset <= 0 && (m_anchorType != PositionIsAfterAnchor && m_anchorType != PositionIsAfterChildren)) {
- if (m_anchorNode->parentNode() && (editingIgnoresContent(m_anchorNode.get()) || isRenderedTable(m_anchorNode.get())))
+ if (m_anchorNode->parentNode() && (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get())))
return positionInParentBeforeNode(m_anchorNode.get());
return Position(m_anchorNode.get(), 0, PositionIsOffsetInAnchor);
}
if (!m_anchorNode->offsetInCharacters()
&& (m_anchorType == PositionIsAfterAnchor || m_anchorType == PositionIsAfterChildren || static_cast<unsigned>(m_offset) == m_anchorNode->childNodeCount())
- && (editingIgnoresContent(m_anchorNode.get()) || isRenderedTable(m_anchorNode.get()))
+ && (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get()))
&& containerNode()) {
return positionInParentAfterNode(m_anchorNode.get());
}
@@ -635,7 +635,7 @@ Position Position::upstream(EditingBoundaryCrossingRule rule) const
return lastVisible;
// Return position after tables and nodes which have content that can be ignored.
- if (editingIgnoresContent(currentNode) || isRenderedTable(currentNode)) {
+ if (editingIgnoresContent(currentNode) || isTableElement(currentNode)) {
if (currentPos.atEndOfNode())
return positionAfterNode(currentNode);
continue;
@@ -763,7 +763,7 @@ Position Position::downstream(EditingBoundaryCrossingRule rule) const
lastVisible = currentPos;
// Return position before tables and nodes which have content that can be ignored.
- if (editingIgnoresContent(currentNode) || isRenderedTable(currentNode)) {
+ if (editingIgnoresContent(currentNode) || isTableElement(currentNode)) {
if (currentPos.offsetInLeafNode() <= renderer->caretMinOffset())
return createLegacyEditingPosition(currentNode, renderer->caretMinOffset());
continue;
@@ -889,7 +889,7 @@ bool Position::isCandidate() const
if (renderer->isText())
return !nodeIsUserSelectNone(deprecatedNode()) && inRenderedText();
- if (isRenderedTable(deprecatedNode()) || editingIgnoresContent(deprecatedNode()))
+ if (isTableElement(deprecatedNode()) || editingIgnoresContent(deprecatedNode()))
return (atFirstEditingPositionForNode() || atLastEditingPositionForNode()) && !nodeIsUserSelectNone(deprecatedNode()->parentNode());
if (isHTMLHtmlElement(m_anchorNode.get()))
« no previous file with comments | « LayoutTests/editing/execCommand/format-block-at-root-expected.txt ('k') | Source/core/dom/PositionIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698