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

Unified Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2772203002: Move EditingUtilities::isNodeVisiblyContainedWithin() to CompositeEditCommand (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index 736d889bf286020e88b7afa6ef2f399bf276d8fd..8c1b3c10ec0da89f302771a119acb2a59edbc9c7 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -104,7 +104,7 @@ InputEvent::EventCancelable inputTypeIsCancelable(
} // namespace
-static bool needsLayoutTreeUpdate(const Node& node) {
+bool needsLayoutTreeUpdate(const Node& node) {
const Document& document = node.document();
if (document.needsLayoutTreeUpdate())
return true;
@@ -1970,36 +1970,6 @@ VisiblePosition visiblePositionForIndex(int index, ContainerNode* scope) {
return createVisiblePosition(range.startPosition());
}
-// Determines whether a node is inside a range or visibly starts and ends at the
-// boundaries of the range. Call this function to determine whether a node is
-// visibly fit inside selectedRange
-bool isNodeVisiblyContainedWithin(Node& node, const Range& selectedRange) {
- DCHECK(!needsLayoutTreeUpdate(node));
- DocumentLifecycle::DisallowTransitionScope disallowTransition(
- node.document().lifecycle());
-
- if (selectedRange.isNodeFullyContained(node))
- return true;
-
- bool startIsVisuallySame =
- visiblePositionBeforeNode(node).deepEquivalent() ==
- createVisiblePosition(selectedRange.startPosition()).deepEquivalent();
- if (startIsVisuallySame &&
- comparePositions(Position::inParentAfterNode(node),
- selectedRange.endPosition()) < 0)
- return true;
-
- bool endIsVisuallySame =
- visiblePositionAfterNode(node).deepEquivalent() ==
- createVisiblePosition(selectedRange.endPosition()).deepEquivalent();
- if (endIsVisuallySame &&
- comparePositions(selectedRange.startPosition(),
- Position::inParentBeforeNode(node)) < 0)
- return true;
-
- return startIsVisuallySame && endIsVisuallySame;
-}
-
bool isRenderedAsNonInlineTableImageOrHR(const Node* node) {
if (!node)
return false;

Powered by Google App Engine
This is Rietveld 408576698