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

Issue 16865007: Make createNodeIterator() and createTreeWalker() accept default arguments. (Closed)

Created:
7 years, 6 months ago by Yuta Kitamura
Modified:
7 years, 6 months ago
Reviewers:
Hajime Morrita
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

Make createNodeIterator() and createTreeWalker() accept default arguments. In DOM Level 2 Traversal and Range, the arguments to these methods were all mandatory. In DOM4, however, the arguments except the first one (root node) became optional. Especially, the |whatToShow| argument has the default value of 0xFFFFFFFF, which is a bitmask meaning that the all kinds of nodes will be accepted. In contrast, in our current implementation, |whatToShow| argument is defaulted to zero when it is omitted. This means that all kinds of nodes should be filtered, which is totally useless for users. This change updates Document.createNodeIterator() and createTreeWalker() so they can accept default arguments properly. The potential risk of this change is low, because omitting the |whatToShow| argument was meaningless with our old implementation. Mozilla also implements this default argument, so I assume it is safe to follow the recent specification. Additionally, this change removes |expandEntityReferences| flag from these methods' implementation. This flag first appeared in the DOM2 Traversal specification, but later got removed in DOM4. This flag was never implemented and was actually ignored. To keep compatibility, this flag is still accepted when specified in createNodeIterator() and createTreeWalker() methods, so this change does not affect the behavior. BUG=248446 R=morrita@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152411

Patch Set 1 #

Total comments: 5

Patch Set 2 : Use type tags in tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+431 lines, -51 lines) Patch
A LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html View 1 1 chunk +184 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/NodeIterator/NodeIterator-basic-expected.txt View 1 chunk +12 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/TreeWalker/TreeWalker-basic.html View 1 1 chunk +112 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/TreeWalker/TreeWalker-basic-expected.txt View 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/dom/Document.h View 1 chunk +9 lines, -5 lines 0 comments Download
M Source/core/dom/Document.cpp View 3 chunks +76 lines, -16 lines 0 comments Download
M Source/core/dom/Document.idl View 1 chunk +13 lines, -11 lines 0 comments Download
M Source/core/dom/NodeIterator.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/NodeIterator.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/Traversal.h View 1 chunk +5 lines, -3 lines 0 comments Download
M Source/core/dom/Traversal.cpp View 1 chunk +1 line, -4 lines 0 comments Download
M Source/core/dom/TreeWalker.h View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/dom/TreeWalker.cpp View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Yuta Kitamura
7 years, 6 months ago (2013-06-13 23:58:21 UTC) #1
Hajime Morrita
lgtm.
7 years, 6 months ago (2013-06-14 00:12:05 UTC) #2
Hajime Morrita
https://codereview.chromium.org/16865007/diff/1/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html File LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html (right): https://codereview.chromium.org/16865007/diff/1/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html#newcode106 LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html:106: { type: 'element', id: 'a' }, This is rather ...
7 years, 6 months ago (2013-06-14 00:12:15 UTC) #3
Yuta Kitamura
https://codereview.chromium.org/16865007/diff/1/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html File LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html (right): https://codereview.chromium.org/16865007/diff/1/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html#newcode106 LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html:106: { type: 'element', id: 'a' }, Agreed, will fix. ...
7 years, 6 months ago (2013-06-14 01:08:50 UTC) #4
Yuta Kitamura
https://codereview.chromium.org/16865007/diff/1/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html File LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html (right): https://codereview.chromium.org/16865007/diff/1/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html#newcode106 LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html:106: { type: 'element', id: 'a' }, On 2013/06/14 01:08:50, ...
7 years, 6 months ago (2013-06-14 01:39:58 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yutak@chromium.org/16865007/9001
7 years, 6 months ago (2013-06-14 03:26:36 UTC) #6
commit-bot: I haz the power
7 years, 6 months ago (2013-06-14 04:49:12 UTC) #7
Message was sent while issue was closed.
Change committed as 152411

Powered by Google App Engine
This is Rietveld 408576698