| Summary: | Simplify DOM tree traversal in FrameSelection::setSelectionFromNone() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
| Component: | HTML Editing | Assignee: | Chris Dumez <cdumez> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, rniwa | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Chris Dumez
2014-09-11 15:39:11 PDT
Created attachment 237992 [details]
Patch
Comment on attachment 237992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237992&action=review > Source/WebCore/editing/FrameSelection.cpp:2117 > + Element* documentElement = document->documentElement(); > + if (!documentElement) > + return; If I were you, I'd declare documentElement inside the if condition and nest the if's. Comment on attachment 237992 [details] Patch Clearing flags on attachment: 237992 Committed r173549: <http://trac.webkit.org/changeset/173549> All reviewed patches have been landed. Closing bug. Comment on attachment 237992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237992&action=review > Source/WebCore/editing/FrameSelection.cpp:2115 > + Element* documentElement = document->documentElement(); In a case like this I prefer to use auto*. Later we might make the documentElement() function return a more specific type and it would be nice not to have to visit this call site. Comment on attachment 237992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237992&action=review >> Source/WebCore/editing/FrameSelection.cpp:2115 >> + Element* documentElement = document->documentElement(); > > In a case like this I prefer to use auto*. Later we might make the documentElement() function return a more specific type and it would be nice not to have to visit this call site. Ok, it makes sense. Would you like me to land another patch for the nit fix or is this for future reference? |