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

Unified Diff: Source/core/html/HTMLTextFormControlElement.cpp

Issue 330383004: Oilpan: Introduce TempRangeScope to avoid needless Range attaches on Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments. Created 6 years, 6 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: Source/core/html/HTMLTextFormControlElement.cpp
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index 06a5579087d1bb2131efb3dd86802a41428cfacb..b9aa7e929b8cac2821c69278223ec4fcfec6497f 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -317,6 +317,7 @@ VisiblePosition HTMLTextFormControlElement::visiblePositionForIndex(int index) c
{
if (index <= 0)
return VisiblePosition(firstPositionInNode(innerEditorElement()), DOWNSTREAM);
+ TemporaryRangeScope scope;
RefPtrWillBeRawPtr<Range> range = Range::create(document());
range->selectNodeContents(innerEditorElement(), ASSERT_NO_EXCEPTION);
CharacterIterator it(range.get());
@@ -329,6 +330,7 @@ int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& p
Position indexPosition = pos.deepEquivalent().parentAnchoredEquivalent();
if (enclosingTextFormControl(indexPosition) != this)
return 0;
+ TemporaryRangeScope scope;
ASSERT(indexPosition.document());
RefPtrWillBeRawPtr<Range> range = Range::create(*indexPosition.document());
range->setStart(innerEditorElement(), 0, ASSERT_NO_EXCEPTION);
« Source/core/editing/SpellChecker.cpp ('K') | « Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698