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

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

Issue 2352763004: Prune CreateVisiblePositionDeprecated from Editor::firstRectForRange (Closed)
Patch Set: Add comments and DisallowTransitionScope Created 4 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
Index: third_party/WebKit/Source/core/editing/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index 6a66aa9d0db49ff014f509bfa78e2cf6c5cc1c1c..fb4d38efb0921a32a6cbb6442e0da96eb1549ef5 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -1163,14 +1163,17 @@ void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection,
IntRect Editor::firstRectForRange(const EphemeralRange& range) const
{
+ DCHECK(!frame().document()->needsLayoutTreeUpdate());
+ DocumentLifecycle::DisallowTransitionScope disallowTransition(frame().document()->lifecycle());
+
LayoutUnit extraWidthToEndOfLine;
DCHECK(range.isNotNull());
- IntRect startCaretRect = RenderedPosition(createVisiblePositionDeprecated(range.startPosition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthToEndOfLine);
+ IntRect startCaretRect = RenderedPosition(createVisiblePosition(range.startPosition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthToEndOfLine);
if (startCaretRect.isEmpty())
return IntRect();
- IntRect endCaretRect = RenderedPosition(createVisiblePositionDeprecated(range.endPosition()).deepEquivalent(), TextAffinity::Upstream).absoluteRect();
+ IntRect endCaretRect = RenderedPosition(createVisiblePosition(range.endPosition()).deepEquivalent(), TextAffinity::Upstream).absoluteRect();
if (endCaretRect.isEmpty())
return IntRect();
@@ -1189,12 +1192,6 @@ IntRect Editor::firstRectForRange(const EphemeralRange& range) const
startCaretRect.height());
}
-IntRect Editor::firstRectForRange(const Range* range) const
-{
- DCHECK(range);
- return firstRectForRange(EphemeralRange(range));
-}
-
void Editor::computeAndSetTypingStyle(StylePropertySet* style, InputEvent::InputType inputType)
{
if (!style || style->isEmpty()) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/Editor.h ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698