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

Issue 2251703002: Introduce EphemeralRange::nodes() helper to traverse over a range. (Closed)

Created:
4 years, 4 months ago by Andrey Kraynov
Modified:
4 years, 4 months ago
Reviewers:
tkent, yosin_UTC9
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, kinuko+watch, rwlbuis, sof, webcomponents-bugzilla_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce EphemeralRange::nodes() helper to traverse over a range. New |EphemeralRange::nodes()| function can help to avoid creating Range objects when iterating over range nodes. BUG=388681 TEST=webkit_unit_tests --gtest_filter="EphemeralRangeTest.*" Committed: https://crrev.com/3bb329fd3811a6914fd08f66d882bf1b36b940cf Cr-Commit-Position: refs/heads/master@{#413081}

Patch Set 1 #

Total comments: 9

Patch Set 2 : Add null object check #

Patch Set 3 : Add missing test file. #

Total comments: 6

Patch Set 4 : Move inRange() to EphemeralRange::nodes() #

Total comments: 11

Patch Set 5 : Address review remarks. #

Patch Set 6 : Move default template to right place #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -20 lines) Patch
M third_party/WebKit/Source/core/core.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingStyle.cpp View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EphemeralRange.h View 1 2 3 4 3 chunks +40 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EphemeralRange.cpp View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/editing/EphemeralRangeTest.cpp View 1 2 3 4 5 1 chunk +153 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp View 1 2 3 2 chunks +4 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 4 chunks +8 lines, -8 lines 0 comments Download

Messages

Total messages: 29 (9 generated)
Andrey Kraynov
Hi! Here is CL with extracted inRange() helper function, as yosin@ suggested in https://codereview.chromium.org/2246143004/#msg3 comment. ...
4 years, 4 months ago (2016-08-16 10:02:11 UTC) #2
yosin_UTC9
+tkent@ for second opinion and OWNERS Which is better? - (global) inRange() - EphemralRange::nodes() - ...
4 years, 4 months ago (2016-08-17 01:45:31 UTC) #4
tkent
> Which is better? > - (global) inRange() > - EphemralRange::nodes() > - another option ...
4 years, 4 months ago (2016-08-17 02:05:02 UTC) #5
Andrey Kraynov
Thanks for helpful comments! I moved inRange() to EphemeralRange::nodes() member function and removed version that ...
4 years, 4 months ago (2016-08-17 09:58:16 UTC) #7
Andrey Kraynov
Also I have a POC for custom iteration, e.g for (Node& n : EphemeralRange(...).nodes([](Node& n) ...
4 years, 4 months ago (2016-08-17 14:09:29 UTC) #8
yosin_UTC9
On 2016/08/17 at 14:09:29, iceman wrote: > Also I have a POC for custom iteration, ...
4 years, 4 months ago (2016-08-18 02:07:53 UTC) #9
yosin_UTC9
https://codereview.chromium.org/2251703002/diff/60001/third_party/WebKit/Source/core/editing/EphemeralRange.h File third_party/WebKit/Source/core/editing/EphemeralRange.h (right): https://codereview.chromium.org/2251703002/diff/60001/third_party/WebKit/Source/core/editing/EphemeralRange.h#newcode44 third_party/WebKit/Source/core/editing/EphemeralRange.h:44: void operator++() Interesting, I never know we can implement ...
4 years, 4 months ago (2016-08-18 02:11:10 UTC) #10
Andrey Kraynov
On 2016/08/18 02:07:53, Yosi_UTC9 wrote: > I feel having customer step-function is bit complex. > ...
4 years, 4 months ago (2016-08-18 05:57:41 UTC) #11
yosin_UTC9
On 2016/08/18 at 05:57:41, iceman wrote: > On 2016/08/18 02:07:53, Yosi_UTC9 wrote: > > I ...
4 years, 4 months ago (2016-08-18 06:11:09 UTC) #12
Andrey Kraynov
On 2016/08/18 02:07:53, Yosi_UTC9 wrote: > Ugliness of example code fragment comes from iterating with ...
4 years, 4 months ago (2016-08-18 06:34:29 UTC) #13
yosin_UTC9
On 2016/08/18 at 06:34:29, iceman wrote: > On 2016/08/18 02:07:53, Yosi_UTC9 wrote: > > Ugliness ...
4 years, 4 months ago (2016-08-18 07:13:01 UTC) #14
Andrey Kraynov
On 2016/08/18 07:13:01, Yosi_UTC9 wrote: > Let's keep original behavior. So, we need to have ...
4 years, 4 months ago (2016-08-18 07:31:08 UTC) #15
Andrey Kraynov
I reverted my changes in DeleteSelectionCommand.cpp file and address yosin@ review remarks. https://codereview.chromium.org/2251703002/diff/60001/third_party/WebKit/Source/core/editing/EphemeralRange.h File third_party/WebKit/Source/core/editing/EphemeralRange.h ...
4 years, 4 months ago (2016-08-18 10:16:33 UTC) #16
yosin_UTC9
lgtm
4 years, 4 months ago (2016-08-19 01:32:01 UTC) #17
tkent
lgtm
4 years, 4 months ago (2016-08-19 02:12:01 UTC) #19
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/2251703002/80001
4 years, 4 months ago (2016-08-19 02:12:40 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/115081)
4 years, 4 months ago (2016-08-19 03:19:36 UTC) #22
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/2251703002/100001
4 years, 4 months ago (2016-08-19 05:58:49 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 4 months ago (2016-08-19 07:55:01 UTC) #27
commit-bot: I haz the power
4 years, 4 months ago (2016-08-19 07:56:54 UTC) #29
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/3bb329fd3811a6914fd08f66d882bf1b36b940cf
Cr-Commit-Position: refs/heads/master@{#413081}

Powered by Google App Engine
This is Rietveld 408576698