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

Unified Diff: Source/core/editing/VisibleUnits.cpp

Issue 1307233006: Make previousBoundary() not to use Range object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-03T15:34:51 Remove redundant #include ExceptionState.h" Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleUnits.cpp
diff --git a/Source/core/editing/VisibleUnits.cpp b/Source/core/editing/VisibleUnits.cpp
index e1aec9163927b5fbd483dc0521612eecb22521eb..199a082dd719ade6733a16c37474992468c82cd5 100644
--- a/Source/core/editing/VisibleUnits.cpp
+++ b/Source/core/editing/VisibleUnits.cpp
@@ -26,8 +26,6 @@
#include "config.h"
#include "core/editing/VisibleUnits.h"
-#include "bindings/core/v8/ExceptionState.h"
-#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "core/HTMLNames.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
@@ -671,19 +669,14 @@ static VisiblePosition previousBoundary(const VisiblePosition& c, BoundarySearch
if (!boundary)
return VisiblePosition();
- Document& d = boundary->document();
Position start = Position::editingPositionOf(boundary, 0).parentAnchoredEquivalent();
Position end = pos.parentAnchoredEquivalent();
Vector<UChar, 1024> string;
unsigned suffixLength = 0;
- TrackExceptionState exceptionState;
if (requiresContextForWordBoundary(characterBefore(c))) {
- RefPtrWillBeRawPtr<Range> forwardsScanRange(d.createRange());
- forwardsScanRange->setEndAfter(boundary, exceptionState);
- forwardsScanRange->setStart(end.anchorNode(), end.offsetInContainerNode(), exceptionState);
- TextIterator forwardsIterator(forwardsScanRange->startPosition(), forwardsScanRange->endPosition());
+ TextIterator forwardsIterator(end, Position::afterNode(boundary));
while (!forwardsIterator.atEnd()) {
Vector<UChar, 1024> characters;
forwardsIterator.text().appendTextTo(characters);
@@ -696,10 +689,6 @@ static VisiblePosition previousBoundary(const VisiblePosition& c, BoundarySearch
}
}
- ASSERT(!exceptionState.hadException());
- if (exceptionState.hadException())
- return VisiblePosition();
-
SimplifiedBackwardsTextIterator it(start, end);
unsigned next = 0;
bool needMoreContext = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698