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

Issue 2788473003: Use EphmeralRange insteadof Range in CompositeEditCommands::isNodeVisiblyContainedWithin()

Created:
3 years, 8 months ago by yoichio
Modified:
3 years, 8 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, blink-reviews-style_chromium.org, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Use EphmeralRange insteadof Range in CompositeEditCommands::isNodeVisiblyContainedWithin() Change in ApplyStyleCommand.cpp is subtle: 1. |range| is only used in if close to call isNode.. so move it into the close and make it const. 2. Range is often created where |start| > |end|. We permit create the constructor EphemeralRange(Range) with such Range but not permit constructing EphemeralRange(start, end). However isNode.. always returns false such |range|. Then check it early in if conditional. BUG=388681

Patch Set 1 #

Patch Set 2 : update #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -9 lines) Patch
M third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp View 1 1 chunk +3 lines, -3 lines 1 comment Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 14 (11 generated)
yoichio
3 years, 8 months ago (2017-04-03 02:03:49 UTC) #12
yoichio
PTAL
3 years, 8 months ago (2017-04-04 01:56:12 UTC) #13
yosin_UTC9
3 years, 8 months ago (2017-04-04 04:54:46 UTC) #14
https://codereview.chromium.org/2788473003/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
(right):

https://codereview.chromium.org/2788473003/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp:866: if
(startNode != editableRoot && start <= end) {
Since this function assumes start <= end, e.g. |startNode =
NodeTraveral::next(*startNode)|,
we should fix call sites to make sure passing start and end in start <= end.

Powered by Google App Engine
This is Rietveld 408576698