WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
136763
Simplify DOM tree traversal in FrameSelection::setSelectionFromNone()
https://bugs.webkit.org/show_bug.cgi?id=136763
Summary
Simplify DOM tree traversal in FrameSelection::setSelectionFromNone()
Chris Dumez
Reported
2014-09-11 15:39:11 PDT
Simplify DOM Tree traversal in FrameSelection::setSelectionFromNone(). We only need to traverse the direct children of the Document element to find the body. The previous code was potentially traversing descendants. The new code is consistent with Document::body() except that we only look for an HTMLBodyElement (and ignore HTMLFrameSetElement).
Attachments
Patch
(2.26 KB, patch)
2014-09-11 15:51 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2014-09-11 15:51:47 PDT
Created
attachment 237992
[details]
Patch
Ryosuke Niwa
Comment 2
2014-09-11 16:58:34 PDT
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.
WebKit Commit Bot
Comment 3
2014-09-11 17:40:20 PDT
Comment on
attachment 237992
[details]
Patch Clearing flags on attachment: 237992 Committed
r173549
: <
http://trac.webkit.org/changeset/173549
>
WebKit Commit Bot
Comment 4
2014-09-11 17:40:23 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 5
2014-09-11 18:46:21 PDT
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.
Chris Dumez
Comment 6
2014-09-12 07:51:40 PDT
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?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug