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

Issue 252783002: Make Range.detach() a no-op (Closed)

Created:
6 years, 8 months ago by Inactive
Modified:
6 years, 7 months ago
CC:
blink-reviews, chrishtr, arv+blink, sof, eae+blinkwatch, groby+blinkspell_chromium.org, dglazkov+blink, adamk+blink_chromium.org, ojan, watchdog-blink-watchlist_google.com, rwlbuis, leviw_travelin_and_unemployed
Visibility:
Public.

Description

Make Range.detach() a no-op Make Range.detach() a no-op as per DOM4: http://dom.spec.whatwg.org/#dom-range-detach This makes the code a lot simpler, as it avoids a lot of null checks and exception throwing. Also add a UseCounter and a deprecation message to see if this can be removed entirely from the specification. Firefox already does this since version 15: https://bugzilla.mozilla.org/show_bug.cgi?id=702948 However, detach() is not a no-op in IE11. R=arv@chromium.org, tkent@chromium.org BUG=367322 TEST=fast/dom/Range/detach-no-op.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173010

Patch Set 1 #

Patch Set 2 : Fix mac build #

Patch Set 3 : Fix some failures #

Total comments: 8

Patch Set 4 : Take feedback into consideration #

Patch Set 5 : Rebase #

Patch Set 6 : Remove useless include #

Patch Set 7 : Rebase #

Patch Set 8 : Rebase #

Patch Set 9 : Rebase #

Patch Set 10 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+179 lines, -452 lines) Patch
M LayoutTests/editing/selection/addRange-failures-expected.txt View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/editing/text-iterator/rtl-selection-crash-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/fast/dom/Range/bug-19527.html View 1 chunk +0 lines, -9 lines 0 comments Download
A LayoutTests/fast/dom/Range/detach-no-op.html View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/Range/detach-no-op-expected.txt View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Range/detach-range-during-deletecontents-expected.txt View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Range/range-compareNode.html View 1 chunk +5 lines, -11 lines 0 comments Download
M LayoutTests/fast/dom/Range/range-compareNode-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/fast/dom/Range/range-comparePoint.html View 1 chunk +5 lines, -7 lines 0 comments Download
M LayoutTests/fast/dom/Range/range-comparePoint-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
D LayoutTests/fast/dom/Range/range-detached-exceptions.html View 1 chunk +0 lines, -52 lines 0 comments Download
D LayoutTests/fast/dom/Range/range-detached-exceptions-expected.txt View 1 chunk +0 lines, -32 lines 0 comments Download
D LayoutTests/fast/dom/Range/range-intersectsNode-exception.html View 1 chunk +0 lines, -21 lines 0 comments Download
D LayoutTests/fast/dom/Range/range-intersectsNode-exception-expected.txt View 1 chunk +0 lines, -10 lines 0 comments Download
M LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/Range/range-isPointInRange.html View 1 chunk +4 lines, -6 lines 0 comments Download
M LayoutTests/fast/dom/Range/range-isPointInRange-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/fast/dom/Range/resources/intersectsNode.js View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/Range.h View 2 chunks +6 lines, -10 lines 0 comments Download
M Source/core/dom/Range.cpp View 1 2 3 4 5 32 chunks +32 lines, -223 lines 0 comments Download
M Source/core/dom/Range.idl View 1 2 3 3 chunks +10 lines, -10 lines 0 comments Download
M Source/core/editing/EditingStyle.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/editing/Editor.cpp View 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/editing/EditorCommand.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/editing/FormatBlockCommand.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/editing/FrameSelection.cpp View 2 chunks +3 lines, -8 lines 0 comments Download
M Source/core/editing/SpellChecker.cpp View 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/editing/TextCheckingHelper.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/editing/TextIterator.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/editing/TextIteratorTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/editing/markup.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/frame/UseCounter.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/UseCounter.cpp View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/page/DOMSelection.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/web/ContextMenuClientImpl.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/web/TextFinder.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/web/WebRange.cpp View 1 chunk +4 lines, -6 lines 0 comments Download
M Source/web/mac/WebSubstringUtil.mm View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/web/tests/TextFinderTest.cpp View 3 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Inactive
6 years, 8 months ago (2014-04-26 00:01:09 UTC) #1
tkent
> However, detach() is not a no-op in IE11. It sounds risky. We should be ...
6 years, 7 months ago (2014-04-28 01:36:21 UTC) #2
Inactive
On 2014/04/28 01:36:21, tkent wrote: > > However, detach() is not a no-op in IE11. ...
6 years, 7 months ago (2014-04-28 01:55:26 UTC) #3
tkent
I found Range.detach has been supported since IE9. The risk is very very low actually. ...
6 years, 7 months ago (2014-04-28 02:20:15 UTC) #4
tkent
+yosin, yutak
6 years, 7 months ago (2014-04-28 08:45:45 UTC) #5
tkent
https://codereview.chromium.org/252783002/diff/40001/Source/core/dom/Range.idl File Source/core/dom/Range.idl (right): https://codereview.chromium.org/252783002/diff/40001/Source/core/dom/Range.idl#newcode33 Source/core/dom/Range.idl:33: readonly attribute Node commonAncestorContainer; nit: remove an extra whitespace ...
6 years, 7 months ago (2014-04-28 08:50:49 UTC) #6
Yuta Kitamura
This is a web-visible change but I think this is low-risk. Code change looks mostly ...
6 years, 7 months ago (2014-04-28 09:27:37 UTC) #7
Inactive
https://codereview.chromium.org/252783002/diff/40001/LayoutTests/fast/dom/Range/detach-no-op.html File LayoutTests/fast/dom/Range/detach-no-op.html (right): https://codereview.chromium.org/252783002/diff/40001/LayoutTests/fast/dom/Range/detach-no-op.html#newcode12 LayoutTests/fast/dom/Range/detach-no-op.html:12: shouldBe("range.startContainer", "document"); On 2014/04/28 09:27:38, Yuta Kitamura wrote: > ...
6 years, 7 months ago (2014-04-28 14:44:18 UTC) #8
ojan
I'll let tkent finish the review, but I just want to say I <3 this ...
6 years, 7 months ago (2014-04-28 22:12:03 UTC) #9
Inactive
6 years, 7 months ago (2014-04-29 13:12:12 UTC) #10
tkent
lgtm
6 years, 7 months ago (2014-04-29 22:45:40 UTC) #11
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 7 months ago (2014-04-29 22:58:01 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/252783002/120001
6 years, 7 months ago (2014-04-29 22:59:16 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-30 05:06:43 UTC) #14
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/UseCounter.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 7 months ago (2014-04-30 05:06:43 UTC) #15
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 7 months ago (2014-04-30 17:07:58 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/252783002/160001
6 years, 7 months ago (2014-04-30 17:08:27 UTC) #17
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-30 17:17:39 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink
6 years, 7 months ago (2014-04-30 17:17:39 UTC) #19
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 7 months ago (2014-04-30 17:21:01 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/252783002/180001
6 years, 7 months ago (2014-04-30 17:21:15 UTC) #21
commit-bot: I haz the power
6 years, 7 months ago (2014-04-30 18:28:12 UTC) #22
Message was sent while issue was closed.
Change committed as 173010

Powered by Google App Engine
This is Rietveld 408576698