RESOLVED FIXED 91716
[Refactoring] Use userAgentShadowRoot() for elements having user agent shadow root.
https://bugs.webkit.org/show_bug.cgi?id=91716
Summary [Refactoring] Use userAgentShadowRoot() for elements having user agent shadow...
Shinya Kawanaka
Reported 2012-07-18 23:33:57 PDT
We have introduced Element::userAgentShadowRoot() for getting a user agent shadow root. We often used shadow()->oldestShadowRoot() to take user agent shadow root, but we have to use userAgentShadowRoot() instead. This will make our code intention clearer.
Attachments
Patch (15.13 KB, patch)
2012-07-19 00:41 PDT, Shinya Kawanaka
no flags
Patch (14.32 KB, patch)
2012-07-19 01:07 PDT, Shinya Kawanaka
no flags
Shinya Kawanaka
Comment 1 2012-07-18 23:44:38 PDT
grep 'oldestShadowRoot' -r Source/WebCore/html | wc 30 126 3819 So, it's not so tough to covert them at once.
Shinya Kawanaka
Comment 2 2012-07-19 00:41:03 PDT
Hajime Morrita
Comment 3 2012-07-19 00:55:44 PDT
Comment on attachment 153196 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153196&action=review > Source/WebCore/dom/ShadowRoot.cpp:146 > + if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, host()->document()->documentElement(), AllowScriptingContent, ec)) How is this related to this change? > Source/WebCore/html/HTMLImageElement.cpp:115 > + if (ShadowRoot* userAgent = userAgentShadowRoot()) { Could you consider the variable name? It's ridiculous to call it userAgent.
Shinya Kawanaka
Comment 4 2012-07-19 01:03:45 PDT
> > Source/WebCore/dom/ShadowRoot.cpp:146 > > + if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, host()->document()->documentElement(), AllowScriptingContent, ec)) > > How is this related to this change? Oops... my experimental code was mixed...
Shinya Kawanaka
Comment 5 2012-07-19 01:07:48 PDT
Shinya Kawanaka
Comment 6 2012-07-19 01:08:17 PDT
(In reply to comment #3) > (From update of attachment 153196 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=153196&action=review > > > Source/WebCore/dom/ShadowRoot.cpp:146 > > + if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, host()->document()->documentElement(), AllowScriptingContent, ec)) > > How is this related to this change? --> removed. > > > Source/WebCore/html/HTMLImageElement.cpp:115 > > + if (ShadowRoot* userAgent = userAgentShadowRoot()) { > > Could you consider the variable name? It's ridiculous to call it userAgent. userAgent -> root
WebKit Review Bot
Comment 7 2012-07-19 01:56:27 PDT
Comment on attachment 153204 [details] Patch Clearing flags on attachment: 153204 Committed r123082: <http://trac.webkit.org/changeset/123082>
WebKit Review Bot
Comment 8 2012-07-19 01:56:35 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.