[webkit-reviews] review granted: [Bug 137184] Use the new is<>() / downcast<>() for more Node subclasses : [Attachment 238792] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Sep 27 19:46:46 PDT 2014


Ryosuke Niwa <rniwa at webkit.org> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 137184: Use the new is<>() / downcast<>() for more Node subclasses
https://bugs.webkit.org/show_bug.cgi?id=137184

Attachment 238792: Patch
https://bugs.webkit.org/attachment.cgi?id=238792&action=review

------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=238792&action=review


> Source/WebCore/dom/Range.cpp:665
>      case Node::PROCESSING_INSTRUCTION_NODE:
> -	   return toProcessingInstruction(node)->data().length();
> +	   return downcast<ProcessingInstruction>(*node).data().length();

Since ProcessingInstruction inherits from CharacterData, can't we combine this
with the case above??

> Source/WebCore/dom/Range.cpp:1163
>	   case Node::PROCESSING_INSTRUCTION_NODE:
> -	       if (static_cast<unsigned>(offset) >
toProcessingInstruction(n)->data().length())
> +	       if (static_cast<unsigned>(offset) >
downcast<ProcessingInstruction>(*n).data().length())

Ditto about merging this case with CharacterData.


More information about the webkit-reviews mailing list