DescriptionGet rid of loops looking for the first Element ancestor
Get rid of loops looking for the first Element ancestor and use
Node::parentElement() instead. There is no point going up more than one level
to find an Element ancestor.
Only non-Element nodes can have children: Document, DocumentFragment and Attr.
However, none of these can have parents.
This CL also uses Node::parentElement() instead of Node::parentNode() +
Node::isElementNode() in a couple of instances to simplify the code a bit.
R=esprehn@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180552
Patch Set 1 #Patch Set 2 : Update one more instance #
Total comments: 4
Patch Set 3 : Fix nits #
Messages
Total messages: 6 (0 generated)
|