| Summary: | Use the new is<>() / downcast<>() for more Node subclasses | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
| Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | benjamin, commit-queue, kling, rniwa | ||||||||
| Priority: | P2 | ||||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Bug Depends on: | 137056 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Chris Dumez
2014-09-27 15:43:58 PDT
Created attachment 238792 [details]
Patch
Comment on attachment 238792 [details] Patch 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. Comment on attachment 238792 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238792&action=review >> Source/WebCore/dom/Range.cpp:665 >> + return downcast<ProcessingInstruction>(*node).data().length(); > > Since ProcessingInstruction inherits from CharacterData, can't we combine this with the case above?? Nice catch, I don't see why not. Created attachment 238797 [details]
Patch
Created attachment 238801 [details]
Patch
Comment on attachment 238801 [details] Patch Clearing flags on attachment: 238801 Committed r174039: <http://trac.webkit.org/changeset/174039> All reviewed patches have been landed. Closing bug. |