WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
136746
Use tighter typing for Document::ownerElement() return value
https://bugs.webkit.org/show_bug.cgi?id=136746
Summary
Use tighter typing for Document::ownerElement() return value
Chris Dumez
Reported
2014-09-11 11:28:55 PDT
Use tighter typing for Document::ownerElement() return value to improve code readability and allow to compiler to generate slightly more efficient code is some cases.
Attachments
Patch
(7.86 KB, patch)
2014-09-11 11:36 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2014-09-11 11:36:06 PDT
Created
attachment 237970
[details]
Patch
Ryosuke Niwa
Comment 2
2014-09-11 11:42:43 PDT
Comment on
attachment 237970
[details]
Patch r=me
WebKit Commit Bot
Comment 3
2014-09-11 12:26:30 PDT
Comment on
attachment 237970
[details]
Patch Clearing flags on attachment: 237970 Committed
r173528
: <
http://trac.webkit.org/changeset/173528
>
WebKit Commit Bot
Comment 4
2014-09-11 12:26:37 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 5
2014-09-14 12:43:19 PDT
Comment on
attachment 237970
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237970&action=review
> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1464 > + if (HTMLFrameOwnerElement* owner = document->ownerElement()) {
auto* is better than HTMLFrameOwnerElement here; if we had used auto before then the code would have been closer to correct without modifying it
> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1466 > + const AtomicString& title = owner->getAttribute(titleAttr);
fastGetAttribute
> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1477 > + if (HTMLElement* body = document->body())
I think auto* is better than HTMLElement here. Maybe some day we will have an HTMLBodyElement, and maybe it will have some special optimization for getNameAttribute. Why not be future proof in this respect?
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