Handle createShadowSubtree inside of ensureUserAgentShadowRoot
authoresprehn@chromium.org <esprehn@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2013 07:47:20 +0000 (07:47 +0000)
committeresprehn@chromium.org <esprehn@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2013 07:47:20 +0000 (07:47 +0000)
commit4cef0c7071af7cf9d1bbd1fa1101dd8f946bc14a
tree0968508bb244156c5139cf222dd7edc445ccfcb3
parent6f3f16ebb0b290d7c3c6df602a0c5106b3da9853
Handle createShadowSubtree inside of ensureUserAgentShadowRoot
https://bugs.webkit.org/show_bug.cgi?id=108116

Reviewed by Dimitri Glazkov.

Instead of making everyone create the UserAgentShadowRoot manually all
over, centralize it in ensureUserAgentShadowRoot() and add a notification
Element::didAddUserAgentShadowRoot that lets elements fill in the subtree.
This lets us get rid of lots of code duplication.

No new tests, just refactoring.

* dom/Element.cpp:
(WebCore::Element::ensureUserAgentShadowRoot):
* dom/Element.h:
(WebCore::Element::didAddUserAgentShadowRoot):
(Element):
* html/HTMLDetailsElement.cpp:
(WebCore::DetailsSummaryElement::create):
(WebCore::HTMLDetailsElement::create):
(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
* html/HTMLDetailsElement.h:
(HTMLDetailsElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::create):
(WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
* html/HTMLInputElement.h:
(HTMLInputElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::willAddAuthorShadowRoot):
(WebCore::HTMLMediaElement::createMediaControls):
* html/HTMLMediaElement.h:
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::create):
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
* html/HTMLMeterElement.h:
(HTMLMeterElement):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::create):
(WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
* html/HTMLProgressElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::create):
(WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
* html/HTMLSummaryElement.h:
(HTMLSummaryElement):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::create):
(WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot):
* html/HTMLTextAreaElement.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelMuteButtonElement::create):
(WebCore::MediaControlVolumeSliderMuteButtonElement::create):
(WebCore::MediaControlPlayButtonElement::create):
(WebCore::MediaControlOverlayPlayButtonElement::create):
(WebCore::MediaControlSeekForwardButtonElement::create):
(WebCore::MediaControlSeekBackButtonElement::create):
(WebCore::MediaControlRewindButtonElement::create):
(WebCore::MediaControlReturnToRealtimeButtonElement::create):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
(WebCore::MediaControlTimelineElement::create):
(WebCore::MediaControlPanelVolumeSliderElement::create):
(WebCore::MediaControlFullscreenVolumeSliderElement::create):
(WebCore::MediaControlFullscreenButtonElement::create):
(WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
(WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
* html/shadow/MediaControlsBlackBerry.cpp:
(WebCore::MediaControlFullscreenPlayButtonElement::create):
(WebCore::MediaControlFullscreenFullscreenButtonElement::create):
(WebCore::MediaControlFullscreenTimelineElement::create):
(WebCore::MediaControlAudioMuteButtonElement::create):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::create):
* svg/SVGTRefElement.h:
(SVGTRefElement):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::create):
* svg/SVGUseElement.h:
(SVGUseElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLDetailsElement.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLMeterElement.cpp
Source/WebCore/html/HTMLMeterElement.h
Source/WebCore/html/HTMLProgressElement.cpp
Source/WebCore/html/HTMLProgressElement.h
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/HTMLSummaryElement.h
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextAreaElement.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlsBlackBerry.cpp
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTRefElement.h
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/SVGUseElement.h