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

Issue 2341053002: Mark the createVisiblePosition overloads as deprecated (Closed)

Created:
4 years, 3 months ago by Xiaocheng
Modified:
4 years, 3 months ago
Reviewers:
tkent, yosin_UTC9
CC:
aboxhall, aboxhall+watch_chromium.org, blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, blink-reviews-layout_chromium.org, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, dmazzoni, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, eae+blinkwatch, groby+blinkspell_chromium.org, haraken, jchaffraix+rendering, je_julie, kinuko+watch, leviw+renderwatch, nektarios, nektar+watch_chromium.org, pdr+renderingwatchlist_chromium.org, rwlbuis, sof, szager+layoutwatch_chromium.org, yuzo+watch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mark current createVisiblePosition overloads deprecated This patch renames createVisiblePosition() (all overloads) to createVisiblePositionDeprecated() to discourage creating a VisiblePosition in dirty layout and waiting for layout update lazily. This patch also introduces new createVisiblePosition() which assumes clean layout. This patch is a preparation for hoisting the layout update call from the old createVisiblePosition(). In follow up patches, the callers should ensure clean layout by themselves and call the new createVisiblePosition() instead. This patch is a mechanical substitution 's/createVisiblePosition(/createVisiblePositionDeprecated(/g', followed by the following changes: - Introduce the new createVisiblePosition() in VisiblePosition.h/cpp. - Revert the substitution in modules/accessibility/AXLayoutObject.cpp, since callers there already ensure clean layout BUG=647219 Committed: https://crrev.com/31805260d90d814face4ed1735a6ff2755692f6d Cr-Commit-Position: refs/heads/master@{#419069}

Patch Set 1 #

Patch Set 2 : minor revision #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+344 lines, -306 lines) Patch
M third_party/WebKit/Source/core/dom/Range.cpp View 1 chunk +2 lines, -2 lines 1 comment Download
M third_party/WebKit/Source/core/editing/DOMSelection.cpp View 3 chunks +4 lines, -4 lines 4 comments Download
M third_party/WebKit/Source/core/editing/DragCaretController.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.cpp View 13 chunks +19 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/FrameCaret.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/FrameSelection.cpp View 6 chunks +11 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp View 4 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/PendingSelection.cpp View 2 chunks +4 lines, -4 lines 1 comment Download
M third_party/WebKit/Source/core/editing/PlainTextRange.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/RelocatablePositionTest.cpp View 1 chunk +1 line, -1 line 1 comment Download
M third_party/WebKit/Source/core/editing/SelectionController.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/SelectionModifier.cpp View 10 chunks +24 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisiblePosition.h View 1 2 chunks +10 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisiblePosition.cpp View 3 chunks +35 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisiblePositionTest.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleSelection.h View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleSelection.cpp View 9 chunks +20 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp View 5 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleUnits.cpp View 26 chunks +32 lines, -32 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp View 10 chunks +44 lines, -44 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp View 9 chunks +12 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp View 11 chunks +13 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp View 4 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp View 5 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp View 7 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp View 6 chunks +9 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp View 7 chunks +8 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/editing/spellcheck/TextCheckingParagraph.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/HitTestResult.cpp View 1 chunk +1 line, -1 line 1 comment Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 chunk +1 line, -1 line 1 comment Download
M third_party/WebKit/Source/web/WebSurroundingText.cpp View 1 chunk +1 line, -1 line 1 comment Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 21 (13 generated)
Xiaocheng
PTAL.
4 years, 3 months ago (2016-09-15 13:43:46 UTC) #12
tkent
lgtm
4 years, 3 months ago (2016-09-16 00:13:41 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2341053002/20001
4 years, 3 months ago (2016-09-16 01:10:18 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 3 months ago (2016-09-16 01:24:37 UTC) #16
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/31805260d90d814face4ed1735a6ff2755692f6d Cr-Commit-Position: refs/heads/master@{#419069}
4 years, 3 months ago (2016-09-16 01:26:33 UTC) #18
yosin_UTC9
lgtm Thanks for doing this! This is the first step of tons of changes! I ...
4 years, 3 months ago (2016-09-16 02:01:22 UTC) #19
Xiaocheng
On 2016/09/16 at 02:01:22, yosin wrote: > lgtm > > Thanks for doing this! > ...
4 years, 3 months ago (2016-09-16 06:56:57 UTC) #20
Xiaocheng
4 years, 3 months ago (2016-09-16 09:14:00 UTC) #21
Message was sent while issue was closed.
https://codereview.chromium.org/2341053002/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/editing/DOMSelection.cpp (right):

https://codereview.chromium.org/2341053002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/editing/DOMSelection.cpp:292: VisiblePosition
visibleBase = createVisiblePositionDeprecated(createPosition(baseNode,
baseOffset));
On 2016/09/16 at 02:01:21, Yosi_UTC9 wrote:
> Since |VisibleSelection| ctor converts passed |Position| objects to
|VisiblePosition| in |VisibleSelection::validate()|, we can just pass |Position|
to |VisibleSelection| ctor.

We will still be updating layout here if we are going to hoist layout update
calls from VisibleSelection. Anyway, passing Positions to the VS's ctor seems to
lead to simpler code.

Powered by Google App Engine
This is Rietveld 408576698