RESOLVED FIXED 91564
Element wants to have userAgentShadowRoot()
https://bugs.webkit.org/show_bug.cgi?id=91564
Summary Element wants to have userAgentShadowRoot()
Hajime Morrita
Reported 2012-07-17 17:28:47 PDT
This is a follow up t bug 77936. userAgentShadowRoot() could have an assertion to type debug field. Also, it will make ua-shadow related code more readable.
Attachments
Patch (5.09 KB, patch)
2012-07-17 22:22 PDT, Shinya Kawanaka
no flags
Patch (5.06 KB, patch)
2012-07-17 22:46 PDT, Shinya Kawanaka
no flags
Patch for landing (5.06 KB, patch)
2012-07-18 18:11 PDT, Shinya Kawanaka
no flags
Shinya Kawanaka
Comment 1 2012-07-17 18:53:36 PDT
I think Element should have this method, right? A lot of code use the following pattern shadow()->oldestShadowRoot()->... But we should be able to do: userAgentShadowRoot()->...
Shinya Kawanaka
Comment 2 2012-07-17 22:22:56 PDT
Early Warning System Bot
Comment 3 2012-07-17 22:37:55 PDT
Early Warning System Bot
Comment 4 2012-07-17 22:40:24 PDT
WebKit Review Bot
Comment 5 2012-07-17 22:42:38 PDT
Comment on attachment 152919 [details] Patch Attachment 152919 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13277399
Shinya Kawanaka
Comment 6 2012-07-17 22:46:12 PDT
Eric Carlson
Comment 7 2012-07-18 09:39:30 PDT
Comment on attachment 152930 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152930&action=review This is much cleaner, thanks! > Source/WebCore/html/HTMLMediaElement.cpp:4185 > + if (ShadowRoot* userAgent = userAgentShadowRoot()) { > + Node* node = userAgent->firstChild(); > + return node && node->isMediaControls(); > + } Isn't it true that userAgentShadowRoot()->firstChild() *must* be the media controls? If so, I think "&& node->isMediaControls()" could be replaced with "ASSERT(node->isMediaControls())".
Shinya Kawanaka
Comment 8 2012-07-18 17:58:00 PDT
(In reply to comment #7) > (From update of attachment 152930 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=152930&action=review > > This is much cleaner, thanks! > > > Source/WebCore/html/HTMLMediaElement.cpp:4185 > > + if (ShadowRoot* userAgent = userAgentShadowRoot()) { > > + Node* node = userAgent->firstChild(); > > + return node && node->isMediaControls(); > > + } > > Isn't it true that userAgentShadowRoot()->firstChild() *must* be the media controls? If so, I think "&& node->isMediaControls()" could be replaced with "ASSERT(node->isMediaControls())". If firstChild() exists, it must be the media control, I believe. I'll update the patch, and if it passes tests, I'll land it.
Shinya Kawanaka
Comment 9 2012-07-18 18:11:38 PDT
Created attachment 153150 [details] Patch for landing
WebKit Review Bot
Comment 10 2012-07-18 22:09:03 PDT
Comment on attachment 153150 [details] Patch for landing Clearing flags on attachment: 153150 Committed r123071: <http://trac.webkit.org/changeset/123071>
WebKit Review Bot
Comment 11 2012-07-18 22:09:09 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.