DescriptionMake 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. #
Messages
Total messages: 7 (0 generated)
|