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

Unified Diff: sky/engine/core/editing/VisibleSelection.cpp

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/editing/VisibleSelection.h ('k') | sky/engine/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/editing/VisibleSelection.cpp
diff --git a/sky/engine/core/editing/VisibleSelection.cpp b/sky/engine/core/editing/VisibleSelection.cpp
index 0cc876374bfabb565b52d6f4a50a584f05cada62..2a8c977b3524e0dab5da8e7ba981e34e7b41a567 100644
--- a/sky/engine/core/editing/VisibleSelection.cpp
+++ b/sky/engine/core/editing/VisibleSelection.cpp
@@ -264,52 +264,6 @@ bool VisibleSelection::expandUsingGranularity(TextGranularity granularity)
return true;
}
-static PassRefPtr<Range> makeSearchRange(const Position& pos)
-{
- Node* node = pos.deprecatedNode();
- if (!node)
- return nullptr;
- Document& document = node->document();
- if (!document.documentElement())
- return nullptr;
- Element* boundary = enclosingBlockFlowElement(*node);
- if (!boundary)
- return nullptr;
-
- RefPtr<Range> searchRange(Range::create(document));
- TrackExceptionState exceptionState;
-
- Position start(pos.parentAnchoredEquivalent());
- searchRange->selectNodeContents(boundary, exceptionState);
- searchRange->setStart(start.containerNode(), start.offsetInContainerNode(), exceptionState);
-
- ASSERT(!exceptionState.had_exception());
- if (exceptionState.had_exception())
- return nullptr;
-
- return searchRange.release();
-}
-
-void VisibleSelection::appendTrailingWhitespace()
-{
- RefPtr<Range> searchRange = makeSearchRange(m_end);
- if (!searchRange)
- return;
-
- CharacterIterator charIt(searchRange.get(), TextIteratorEmitsCharactersBetweenAllVisiblePositions);
- bool changed = false;
-
- for (; charIt.length(); charIt.advance(1)) {
- UChar c = charIt.characterAt(0);
- if ((!isSpaceOrNewline(c) && c != noBreakSpace) || c == '\n')
- break;
- m_end = charIt.range()->endPosition();
- changed = true;
- }
- if (changed)
- didChange();
-}
-
void VisibleSelection::setBaseAndExtentToDeepEquivalents()
{
// Move the selection to rendered positions, if possible.
« no previous file with comments | « sky/engine/core/editing/VisibleSelection.h ('k') | sky/engine/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698