Bug 91716 - [Refactoring] Use userAgentShadowRoot() for elements having user agent shadow root.
Summary: [Refactoring] Use userAgentShadowRoot() for elements having user agent shadow...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shinya Kawanaka
URL:
Keywords:
Depends on:
Blocks: 72352
  Show dependency treegraph
 
Reported: 2012-07-18 23:33 PDT by Shinya Kawanaka
Modified: 2012-07-19 01:56 PDT (History)
8 users (show)

See Also:


Attachments
Patch (15.13 KB, patch)
2012-07-19 00:41 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (14.32 KB, patch)
2012-07-19 01:07 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 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.
Comment 1 Shinya Kawanaka 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.
Comment 2 Shinya Kawanaka 2012-07-19 00:41:03 PDT
Created attachment 153196 [details]
Patch
Comment 3 Hajime Morrita 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.
Comment 4 Shinya Kawanaka 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...
Comment 5 Shinya Kawanaka 2012-07-19 01:07:48 PDT
Created attachment 153204 [details]
Patch
Comment 6 Shinya Kawanaka 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
Comment 7 WebKit Review Bot 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>
Comment 8 WebKit Review Bot 2012-07-19 01:56:35 PDT
All reviewed patches have been landed.  Closing bug.