+2013-03-05 Eric Seidel <eric@webkit.org>
+
+ Replace shouldLazyAttach bool with an enum for readability
+ https://bugs.webkit.org/show_bug.cgi?id=111503
+
+ Reviewed by Dimitri Glazkov.
+
+ No behavioral change.
+
+ * bindings/cpp/WebDOMNodeCustom.cpp:
+ (WebDOMNode::insertBefore):
+ (WebDOMNode::replaceChild):
+ (WebDOMNode::appendChild):
+ * bindings/js/JSNodeCustom.cpp:
+ (WebCore::JSNode::insertBefore):
+ (WebCore::JSNode::replaceChild):
+ (WebCore::JSNode::appendChild):
+ * bindings/v8/custom/V8NodeCustom.cpp:
+ (WebCore):
+ (WebCore::V8Node::insertBeforeMethodCustom):
+ (WebCore::V8Node::replaceChildMethodCustom):
+ (WebCore::V8Node::appendChildMethodCustom):
+ * dom/ContainerNode.cpp:
+ (WebCore):
+ (WebCore::ContainerNode::insertBefore):
+ (WebCore::ContainerNode::replaceChild):
+ (WebCore::ContainerNode::appendChild):
+ (WebCore::updateTreeAfterInsertion):
+ * dom/ContainerNode.h:
+ (ContainerNode):
+ * dom/Node.cpp:
+ (WebCore::Node::insertBefore):
+ (WebCore::Node::replaceChild):
+ (WebCore::Node::appendChild):
+ * dom/Node.h:
+ (Node):
+ * editing/AppendNodeCommand.cpp:
+ (WebCore::AppendNodeCommand::doApply):
+ * editing/InsertNodeBeforeCommand.cpp:
+ (WebCore::InsertNodeBeforeCommand::doApply):
+ * html/shadow/MediaControlsApple.cpp:
+ (WebCore::MediaControlsApple::createControls):
+ * html/shadow/MediaControlsBlackBerry.cpp:
+ (WebCore::MediaControlsBlackBerry::createControls):
+ * html/shadow/MediaControlsChromium.cpp:
+ (WebCore::MediaControlsChromium::initializeControls):
+ * html/shadow/MediaControlsChromiumAndroid.cpp:
+ (WebCore::MediaControlsChromiumAndroid::createControls):
+
2013-03-05 Hajime Morrita <morrita@google.com>
Custom Elements: CustomElementConstructor::m_name doesn't have any good use.
__ZN7WebCore13AXObjectCache23focusedUIElementForPageEPKNS_4PageE
__ZN7WebCore13AXObjectCache42gAccessibilityEnhancedUserInterfaceEnabledE
__ZN7WebCore13CharacterData7setDataERKN3WTF6StringERi
-__ZN7WebCore13ContainerNode11appendChildEN3WTF10PassRefPtrINS_4NodeEEERib
+__ZN7WebCore13ContainerNode11appendChildEN3WTF10PassRefPtrINS_4NodeEEERiNS_14AttachBehaviorE
__ZN7WebCore13ContainerNode11removeChildEPNS_4NodeERi
__ZN7WebCore13HTTPHeaderMapC1Ev
__ZN7WebCore13HTTPHeaderMapD1Ev
__ZN7WebCore4KURLC1EP5NSURL
__ZN7WebCore4KURLC1EPK7__CFURL
__ZN7WebCore4KURLC1ERKS0_RKN3WTF6StringE
+__ZN7WebCore4Node11appendChildEN3WTF10PassRefPtrIS0_EERiNS_14AttachBehaviorE
+__ZN7WebCore4Node12insertBeforeEN3WTF10PassRefPtrIS0_EEPS0_RiNS_14AttachBehaviorE
__ZN7WebCore4Node10renderRectEPb
-__ZN7WebCore4Node11appendChildEN3WTF10PassRefPtrIS0_EERib
__ZN7WebCore4Node11removeChildEPS0_Ri
__ZN7WebCore4Node14removedLastRefEv
__ZN7WebCore4Node14setTextContentERKN3WTF6StringERi
__ZNK7WebCore4KURL8protocolEv
__ZNK7WebCore4KURLcvP5NSURLEv
__ZNK7WebCore4Node11textContentEb
-__ZN7WebCore4Node12insertBeforeEN3WTF10PassRefPtrIS0_EEPS0_Rib
__ZNK7WebCore4Node13ownerDocumentEv
__ZNK7WebCore4Node14isDescendantOfEPKS0_
__ZNK7WebCore4Node18getSubresourceURLsERN3WTF11ListHashSetINS_4KURLELm256ENS_8KURLHashEEE
return WebDOMNode();
WebCore::ExceptionCode ec = 0;
- if (impl()->insertBefore(toWebCore(newChild), toWebCore(refChild), ec, true))
+ if (impl()->insertBefore(toWebCore(newChild), toWebCore(refChild), ec, AttachLazily))
return newChild;
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
return WebDOMNode();
WebCore::ExceptionCode ec = 0;
- if (impl()->replaceChild(toWebCore(newChild), toWebCore(oldChild), ec, true))
+ if (impl()->replaceChild(toWebCore(newChild), toWebCore(oldChild), ec, AttachLazily))
return oldChild;
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
return WebDOMNode();
WebCore::ExceptionCode ec = 0;
- if (impl()->appendChild(toWebCore(newChild), ec, true))
+ if (impl()->appendChild(toWebCore(newChild), ec, AttachLazily))
return newChild;
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
{
Node* imp = static_cast<Node*>(impl());
ExceptionCode ec = 0;
- bool ok = imp->insertBefore(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, true);
+ bool ok = imp->insertBefore(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
setDOMException(exec, ec);
if (ok)
return exec->argument(0);
{
Node* imp = static_cast<Node*>(impl());
ExceptionCode ec = 0;
- bool ok = imp->replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, true);
+ bool ok = imp->replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
setDOMException(exec, ec);
if (ok)
return exec->argument(1);
{
Node* imp = static_cast<Node*>(impl());
ExceptionCode ec = 0;
- bool ok = imp->appendChild(toNode(exec->argument(0)), ec, true);
+ bool ok = imp->appendChild(toNode(exec->argument(0)), ec, AttachLazily);
setDOMException(exec, ec);
if (ok)
return exec->argument(0);
namespace WebCore {
-// This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
+// This function is customized to take advantage of the optional 4th argument: AttachBehavior
v8::Handle<v8::Value> V8Node::insertBeforeMethodCustom(const v8::Arguments& args)
{
v8::Handle<v8::Object> holder = args.Holder();
ExceptionCode ec = 0;
Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
Node* refChild = V8Node::HasInstance(args[1], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
- bool success = imp->insertBefore(newChild, refChild, ec, true);
+ bool success = imp->insertBefore(newChild, refChild, ec, AttachLazily);
if (ec)
return setDOMException(ec, args.GetIsolate());
if (success)
return v8Null(args.GetIsolate());
}
-// This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
+// This function is customized to take advantage of the optional 4th argument: AttachBehavior
v8::Handle<v8::Value> V8Node::replaceChildMethodCustom(const v8::Arguments& args)
{
v8::Handle<v8::Object> holder = args.Holder();
ExceptionCode ec = 0;
Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
Node* oldChild = V8Node::HasInstance(args[1], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
- bool success = imp->replaceChild(newChild, oldChild, ec, true);
+ bool success = imp->replaceChild(newChild, oldChild, ec, AttachLazily);
if (ec)
return setDOMException(ec, args.GetIsolate());
if (success)
return v8Null(args.GetIsolate());
}
-// This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
+// This function is customized to take advantage of the optional 4th argument: AttachBehavior
v8::Handle<v8::Value> V8Node::appendChildMethodCustom(const v8::Arguments& args)
{
v8::Handle<v8::Object> holder = args.Holder();
Node* imp = V8Node::toNative(holder);
ExceptionCode ec = 0;
Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
- bool success = imp->appendChild(newChild, ec, true );
+ bool success = imp->appendChild(newChild, ec, AttachLazily);
if (ec)
return setDOMException(ec, args.GetIsolate());
if (success)
static void dispatchChildInsertionEvents(Node*);
static void dispatchChildRemovalEvents(Node*);
-static void updateTreeAfterInsertion(ContainerNode*, Node*, bool shouldLazyAttach);
+static void updateTreeAfterInsertion(ContainerNode*, Node*, AttachBehavior);
typedef pair<RefPtr<Node>, unsigned> CallbackParameters;
typedef pair<NodeCallback, CallbackParameters> CallbackInfo;
return true;
}
-bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, bool shouldLazyAttach)
+bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, AttachBehavior attachBehavior)
{
// Check that this node is not "floating".
// If it is, it can be deleted as a side effect of sending mutation events.
// insertBefore(node, 0) is equivalent to appendChild(node)
if (!refChild)
- return appendChild(newChild, ec, shouldLazyAttach);
+ return appendChild(newChild, ec, attachBehavior);
// Make sure adding the new child is OK.
if (!checkAddChild(this, newChild.get(), ec))
insertBeforeCommon(next.get(), child);
- updateTreeAfterInsertion(this, child, shouldLazyAttach);
+ updateTreeAfterInsertion(this, child, attachBehavior);
}
dispatchSubtreeModifiedEvent();
ChildNodeInsertionNotifier(this).notify(newChild.get());
}
-bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, bool shouldLazyAttach)
+bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, AttachBehavior attachBehavior)
{
// Check that this node is not "floating".
// If it is, it can be deleted as a side effect of sending mutation events.
appendChildToContainer(child, this);
}
- updateTreeAfterInsertion(this, child, shouldLazyAttach);
+ updateTreeAfterInsertion(this, child, attachBehavior);
}
dispatchSubtreeModifiedEvent();
dispatchSubtreeModifiedEvent();
}
-bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bool shouldLazyAttach)
+bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, AttachBehavior attachBehavior)
{
RefPtr<ContainerNode> protect(this);
appendChildToContainer(child, this);
}
- updateTreeAfterInsertion(this, child, shouldLazyAttach);
+ updateTreeAfterInsertion(this, child, attachBehavior);
}
dispatchSubtreeModifiedEvent();
}
}
-static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, bool shouldLazyAttach)
+static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, AttachBehavior attachBehavior)
{
ASSERT(parent->refCount());
ASSERT(child->refCount());
// FIXME: Attachment should be the first operation in this function, but some code
// (for example, HTMLFormControlElement's autofocus support) requires this ordering.
if (parent->attached() && !child->attached() && child->parentNode() == parent) {
- if (shouldLazyAttach)
+ if (attachBehavior == AttachLazily)
child->lazyAttach();
else
child->attach();
unsigned childNodeCount() const;
Node* childNode(unsigned index) const;
- bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& = ASSERT_NO_EXCEPTION, bool shouldLazyAttach = false);
- bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& = ASSERT_NO_EXCEPTION, bool shouldLazyAttach = false);
+ bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& = ASSERT_NO_EXCEPTION, AttachBehavior = AttachNow);
+ bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& = ASSERT_NO_EXCEPTION, AttachBehavior = AttachNow);
bool removeChild(Node* child, ExceptionCode& = ASSERT_NO_EXCEPTION);
- bool appendChild(PassRefPtr<Node> newChild, ExceptionCode& = ASSERT_NO_EXCEPTION, bool shouldLazyAttach = false);
+ bool appendChild(PassRefPtr<Node> newChild, ExceptionCode& = ASSERT_NO_EXCEPTION, AttachBehavior = AttachNow);
// These methods are only used during parsing.
// They don't send DOM mutation events or handle reparenting.
return n;
}
-bool Node::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, bool shouldLazyAttach)
+bool Node::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, AttachBehavior attachBehavior)
{
if (!isContainerNode()) {
ec = HIERARCHY_REQUEST_ERR;
return false;
}
- return toContainerNode(this)->insertBefore(newChild, refChild, ec, shouldLazyAttach);
+ return toContainerNode(this)->insertBefore(newChild, refChild, ec, attachBehavior);
}
-bool Node::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, bool shouldLazyAttach)
+bool Node::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, AttachBehavior attachBehavior)
{
if (!isContainerNode()) {
ec = HIERARCHY_REQUEST_ERR;
return false;
}
- return toContainerNode(this)->replaceChild(newChild, oldChild, ec, shouldLazyAttach);
+ return toContainerNode(this)->replaceChild(newChild, oldChild, ec, attachBehavior);
}
bool Node::removeChild(Node* oldChild, ExceptionCode& ec)
return toContainerNode(this)->removeChild(oldChild, ec);
}
-bool Node::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bool shouldLazyAttach)
+bool Node::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, AttachBehavior attachBehavior)
{
if (!isContainerNode()) {
ec = HIERARCHY_REQUEST_ERR;
return false;
}
- return toContainerNode(this)->appendChild(newChild, ec, shouldLazyAttach);
+ return toContainerNode(this)->appendChild(newChild, ec, attachBehavior);
}
void Node::remove(ExceptionCode& ec)
RenderObject* m_renderer;
};
+enum AttachBehavior {
+ AttachNow,
+ AttachLazily,
+};
+
class Node : public EventTarget, public ScriptWrappable, public TreeShared<Node> {
friend class Document;
friend class TreeScope;
// These should all actually return a node, but this is only important for language bindings,
// which will already know and hold a ref on the right node to return. Returning bool allows
// these methods to be more efficient since they don't need to return a ref
- bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode&, bool shouldLazyAttach = false);
- bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode&, bool shouldLazyAttach = false);
+ bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode&, AttachBehavior = AttachNow);
+ bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode&, AttachBehavior = AttachNow);
bool removeChild(Node* child, ExceptionCode&);
- bool appendChild(PassRefPtr<Node> newChild, ExceptionCode&, bool shouldLazyAttach = false);
+ bool appendChild(PassRefPtr<Node> newChild, ExceptionCode&, AttachBehavior = AttachNow);
void remove(ExceptionCode&);
bool hasChildNodes() const { return firstChild(); }
if (!m_parent->rendererIsEditable() && m_parent->attached())
return;
- m_parent->appendChild(m_node.get(), IGNORE_EXCEPTION, true /* lazyAttach */);
+ m_parent->appendChild(m_node.get(), IGNORE_EXCEPTION, AttachLazily);
if (AXObjectCache::accessibilityEnabled())
sendAXTextChangedIgnoringLineBreaks(m_node.get(), AXObjectCache::AXTextInserted);
return;
ASSERT(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable));
- parent->insertBefore(m_insertChild.get(), m_refChild.get(), IGNORE_EXCEPTION, true /* lazyAttach */);
+ parent->insertBefore(m_insertChild.get(), m_refChild.get(), IGNORE_EXCEPTION, AttachLazily);
if (AXObjectCache::accessibilityEnabled())
document()->axObjectCache()->nodeTextChangeNotification(m_insertChild.get(), AXObjectCache::AXTextInserted, 0, m_insertChild->nodeValue());
void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot* root)
{
- root->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION, true);
- root->appendChild(DetailsContentElement::create(document()), ASSERT_NO_EXCEPTION, true);
+ root->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
+ root->appendChild(DetailsContentElement::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
}
Element* HTMLDetailsElement::findMainSummary() const
void HTMLSummaryElement::didAddUserAgentShadowRoot(ShadowRoot* root)
{
- root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION, true);
- root->appendChild(SummaryContentElement::create(document()), ASSERT_NO_EXCEPTION, true);
+ root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
+ root->appendChild(SummaryContentElement::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
}
HTMLDetailsElement* HTMLSummaryElement::detailsElement() const
{
m_cueContainer = HTMLElement::create(spanTag, document);
m_cueContainer->setPseudo(TextTrackCue::cueShadowPseudoId());
- appendChild(m_cueContainer, ASSERT_NO_EXCEPTION, false);
+ appendChild(m_cueContainer, ASSERT_NO_EXCEPTION, AttachNow);
}
PassRefPtr<MediaControlTextTrackContainerElement> MediaControlTextTrackContainerElement::create(Document* document)
RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(m_videoDisplaySize.size());
if (displayBox->hasChildNodes() && !contains(static_cast<Node*>(displayBox.get())))
// Note: the display tree of a cue is removed when the active flag of the cue is unset.
- m_cueContainer->appendChild(displayBox, ASSERT_NO_EXCEPTION, false);
+ m_cueContainer->appendChild(displayBox, ASSERT_NO_EXCEPTION, AttachNow);
}
// 11. Return output.
m_textDisplayContainer->setMediaController(m_mediaController);
// Insert it before the first controller element so it always displays behind the controls.
- insertBefore(textDisplayContainer, m_panel, IGNORE_EXCEPTION, true);
+ insertBefore(textDisplayContainer, m_panel, IGNORE_EXCEPTION, AttachLazily);
textDisplayContainer->createSubtrees(document());
textDisplayContainer.release();
}
RefPtr<MediaControlRewindButtonElement> rewindButton = MediaControlRewindButtonElement::create(document);
controls->m_rewindButton = rewindButton.get();
- panel->appendChild(rewindButton.release(), ec, true);
+ panel->appendChild(rewindButton.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlPlayButtonElement> playButton = MediaControlPlayButtonElement::create(document);
controls->m_playButton = playButton.get();
- panel->appendChild(playButton.release(), ec, true);
+ panel->appendChild(playButton.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlReturnToRealtimeButtonElement> returnToRealtimeButton = MediaControlReturnToRealtimeButtonElement::create(document);
controls->m_returnToRealTimeButton = returnToRealtimeButton.get();
- panel->appendChild(returnToRealtimeButton.release(), ec, true);
+ panel->appendChild(returnToRealtimeButton.release(), ec, AttachLazily);
if (ec)
return 0;
if (document->page()->theme()->usesMediaControlStatusDisplay()) {
RefPtr<MediaControlStatusDisplayElement> statusDisplay = MediaControlStatusDisplayElement::create(document);
controls->m_statusDisplay = statusDisplay.get();
- panel->appendChild(statusDisplay.release(), ec, true);
+ panel->appendChild(statusDisplay.release(), ec, AttachLazily);
if (ec)
return 0;
}
RefPtr<MediaControlCurrentTimeDisplayElement> currentTimeDisplay = MediaControlCurrentTimeDisplayElement::create(document);
controls->m_currentTimeDisplay = currentTimeDisplay.get();
- timelineContainer->appendChild(currentTimeDisplay.release(), ec, true);
+ timelineContainer->appendChild(currentTimeDisplay.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlTimelineElement> timeline = MediaControlTimelineElement::create(document, controls.get());
controls->m_timeline = timeline.get();
- timelineContainer->appendChild(timeline.release(), ec, true);
+ timelineContainer->appendChild(timeline.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlTimeRemainingDisplayElement> timeRemainingDisplay = MediaControlTimeRemainingDisplayElement::create(document);
controls->m_timeRemainingDisplay = timeRemainingDisplay.get();
- timelineContainer->appendChild(timeRemainingDisplay.release(), ec, true);
+ timelineContainer->appendChild(timeRemainingDisplay.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_timelineContainer = timelineContainer.get();
- panel->appendChild(timelineContainer.release(), ec, true);
+ panel->appendChild(timelineContainer.release(), ec, AttachLazily);
if (ec)
return 0;
// FIXME: Only create when needed <http://webkit.org/b/57163>
RefPtr<MediaControlSeekBackButtonElement> seekBackButton = MediaControlSeekBackButtonElement::create(document);
controls->m_seekBackButton = seekBackButton.get();
- panel->appendChild(seekBackButton.release(), ec, true);
+ panel->appendChild(seekBackButton.release(), ec, AttachLazily);
if (ec)
return 0;
// FIXME: Only create when needed <http://webkit.org/b/57163>
RefPtr<MediaControlSeekForwardButtonElement> seekForwardButton = MediaControlSeekForwardButtonElement::create(document);
controls->m_seekForwardButton = seekForwardButton.get();
- panel->appendChild(seekForwardButton.release(), ec, true);
+ panel->appendChild(seekForwardButton.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlClosedCaptionsTrackListElement> closedCaptionsTrackList = MediaControlClosedCaptionsTrackListElement::create(document, controls.get());
controls->m_closedCaptionsTrackList = closedCaptionsTrackList.get();
- closedCaptionsContainer->appendChild(closedCaptionsTrackList.release(), ec, true);
+ closedCaptionsContainer->appendChild(closedCaptionsTrackList.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(document, controls.get());
controls->m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get();
- panel->appendChild(toggleClosedCaptionsButton.release(), ec, true);
+ panel->appendChild(toggleClosedCaptionsButton.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_closedCaptionsContainer = closedCaptionsContainer.get();
- panel->appendChild(closedCaptionsContainer.release(), ec, true);
+ panel->appendChild(closedCaptionsContainer.release(), ec, AttachLazily);
if (ec)
return 0;
}
// FIXME: Only create when needed <http://webkit.org/b/57163>
RefPtr<MediaControlFullscreenButtonElement> fullScreenButton = MediaControlFullscreenButtonElement::create(document);
controls->m_fullScreenButton = fullScreenButton.get();
- panel->appendChild(fullScreenButton.release(), ec, true);
+ panel->appendChild(fullScreenButton.release(), ec, AttachLazily);
// The mute button and the slider element should be in the same div.
RefPtr<HTMLDivElement> panelVolumeControlContainer = HTMLDivElement::create(document);
RefPtr<MediaControlPanelVolumeSliderElement> slider = MediaControlPanelVolumeSliderElement::create(document);
controls->m_volumeSlider = slider.get();
- volumeSliderContainer->appendChild(slider.release(), ec, true);
+ volumeSliderContainer->appendChild(slider.release(), ec, AttachLazily);
if (ec)
return 0;
// It's important only when the volume bar is displayed below the controls.
RefPtr<MediaControlVolumeSliderMuteButtonElement> volumeSliderMuteButton = MediaControlVolumeSliderMuteButtonElement::create(document);
controls->m_volumeSliderMuteButton = volumeSliderMuteButton.get();
- volumeSliderContainer->appendChild(volumeSliderMuteButton.release(), ec, true);
+ volumeSliderContainer->appendChild(volumeSliderMuteButton.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_volumeSliderContainer = volumeSliderContainer.get();
- panelVolumeControlContainer->appendChild(volumeSliderContainer.release(), ec, true);
+ panelVolumeControlContainer->appendChild(volumeSliderContainer.release(), ec, AttachLazily);
if (ec)
return 0;
}
RefPtr<MediaControlPanelMuteButtonElement> panelMuteButton = MediaControlPanelMuteButtonElement::create(document, controls.get());
controls->m_panelMuteButton = panelMuteButton.get();
- panelVolumeControlContainer->appendChild(panelMuteButton.release(), ec, true);
+ panelVolumeControlContainer->appendChild(panelMuteButton.release(), ec, AttachLazily);
if (ec)
return 0;
- panel->appendChild(panelVolumeControlContainer, ec, true);
+ panel->appendChild(panelVolumeControlContainer, ec, AttachLazily);
if (ec)
return 0;
// FIXME: Only create when needed <http://webkit.org/b/57163>
RefPtr<MediaControlFullscreenVolumeMinButtonElement> fullScreenMinVolumeButton = MediaControlFullscreenVolumeMinButtonElement::create(document);
controls->m_fullScreenMinVolumeButton = fullScreenMinVolumeButton.get();
- panel->appendChild(fullScreenMinVolumeButton.release(), ec, true);
+ panel->appendChild(fullScreenMinVolumeButton.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlFullscreenVolumeSliderElement> fullScreenVolumeSlider = MediaControlFullscreenVolumeSliderElement::create(document);
controls->m_fullScreenVolumeSlider = fullScreenVolumeSlider.get();
- panel->appendChild(fullScreenVolumeSlider.release(), ec, true);
+ panel->appendChild(fullScreenVolumeSlider.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlFullscreenVolumeMaxButtonElement> fullScreenMaxVolumeButton = MediaControlFullscreenVolumeMaxButtonElement::create(document);
controls->m_fullScreenMaxVolumeButton = fullScreenMaxVolumeButton.get();
- panel->appendChild(fullScreenMaxVolumeButton.release(), ec, true);
+ panel->appendChild(fullScreenMaxVolumeButton.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_panel = panel.get();
- controls->appendChild(panel.release(), ec, true);
+ controls->appendChild(panel.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlPlayButtonElement> playButton = MediaControlPlayButtonElement::create(document);
controls->m_playButton = playButton.get();
- embedPanel->appendChild(playButton.release(), ec, true);
+ embedPanel->appendChild(playButton.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlTimelineElement> timeline = MediaControlTimelineElement::create(document, controls.get());
controls->m_timeline = timeline.get();
- timelineContainer->appendChild(timeline.release(), ec, true);
+ timelineContainer->appendChild(timeline.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlCurrentTimeDisplayElement> currentTimeDisplay = MediaControlCurrentTimeDisplayElement::create(document);
controls->m_currentTimeDisplay = currentTimeDisplay.get();
- timeDisplayContainer->appendChild(currentTimeDisplay.release(), ec, true);
+ timeDisplayContainer->appendChild(currentTimeDisplay.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlTimeRemainingDisplayElement> timeRemainingDisplay = MediaControlTimeRemainingDisplayElement::create(document);
controls->m_timeRemainingDisplay = timeRemainingDisplay.get();
- timeDisplayContainer->appendChild(timeRemainingDisplay.release(), ec, true);
+ timeDisplayContainer->appendChild(timeRemainingDisplay.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_timeDisplayContainer = timeDisplayContainer.get();
- timelineContainer->appendChild(timeDisplayContainer.release(), ec, true);
+ timelineContainer->appendChild(timeDisplayContainer.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_timelineContainer = timelineContainer.get();
- embedPanel->appendChild(timelineContainer.release(), ec, true);
+ embedPanel->appendChild(timelineContainer.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlFullscreenButtonElement> fullScreenButton = MediaControlFullscreenButtonElement::create(document);
controls->m_fullScreenButton = fullScreenButton.get();
- embedPanel->appendChild(fullScreenButton.release(), ec, true);
+ embedPanel->appendChild(fullScreenButton.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlPanelVolumeSliderElement> slider = MediaControlPanelVolumeSliderElement::create(document);
controls->m_volumeSlider = slider.get();
- volumeSliderContainer->appendChild(slider.release(), ec, true);
+ volumeSliderContainer->appendChild(slider.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_volumeSliderContainer = volumeSliderContainer.get();
- volumeControlContainer->appendChild(volumeSliderContainer.release(), ec, true);
+ volumeControlContainer->appendChild(volumeSliderContainer.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlAudioMuteButtonElement> muteButton = MediaControlAudioMuteButtonElement::create(document, controls.get());
controls->m_muteButton = muteButton.get();
- volumeControlContainer->appendChild(muteButton.release(), ec, true);
+ volumeControlContainer->appendChild(muteButton.release(), ec, AttachLazily);
if (ec)
return 0;
- embedPanel->appendChild(volumeControlContainer.release(), ec, true);
+ embedPanel->appendChild(volumeControlContainer.release(), ec, AttachLazily);
if (ec)
return 0;
}
RefPtr<MediaControlFullscreenTimelineElement> fullscreenTimeline = MediaControlFullscreenTimelineElement::create(document, controls.get());
controls->m_fullscreenTimeline = fullscreenTimeline.get();
- fullscreenTimelineContainer->appendChild(fullscreenTimeline.release(), ec, true);
+ fullscreenTimelineContainer->appendChild(fullscreenTimeline.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlFullscreenCurrentTimeDisplayElement> fullscreenCurrentTimeDisplay = MediaControlFullscreenCurrentTimeDisplayElement::create(document);
controls->m_fullscreenCurrentTimeDisplay = fullscreenCurrentTimeDisplay.get();
- fullscreenTimeDisplayContainer->appendChild(fullscreenCurrentTimeDisplay.release(), ec, true);
+ fullscreenTimeDisplayContainer->appendChild(fullscreenCurrentTimeDisplay.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlFullscreenTimeRemainingDisplayElement> fullscreenTimeRemainingDisplay = MediaControlFullscreenTimeRemainingDisplayElement::create(document);
controls->m_fullscreenTimeRemainingDisplay = fullscreenTimeRemainingDisplay.get();
- fullscreenTimeDisplayContainer->appendChild(fullscreenTimeRemainingDisplay.release(), ec, true);
+ fullscreenTimeDisplayContainer->appendChild(fullscreenTimeRemainingDisplay.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_fullscreenTimeDisplayContainer = fullscreenTimeDisplayContainer.get();
- fullscreenTimelineContainer->appendChild(fullscreenTimeDisplayContainer.release(), ec, true);
+ fullscreenTimelineContainer->appendChild(fullscreenTimeDisplayContainer.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_fullscreenTimelineContainer = fullscreenTimelineContainer.get();
- panel->appendChild(fullscreenTimelineContainer.release(), ec, true);
+ panel->appendChild(fullscreenTimelineContainer.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_fullScreenButtonContainer = fullScreenButtonContainer.get();
RefPtr<MediaControlFullscreenFullscreenButtonElement> fullscreenFullScreenButton = MediaControlFullscreenFullscreenButtonElement::create(document);
controls->m_fullscreenFullScreenButton = fullscreenFullScreenButton.get();
- fullScreenButtonContainer->appendChild(fullscreenFullScreenButton.release(), ec, true);
+ fullScreenButtonContainer->appendChild(fullscreenFullScreenButton.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlFullscreenButtonDividerElement> fullScreenDivider = MediaControlFullscreenButtonDividerElement::create(document);
controls->m_fullScreenDivider = fullScreenDivider.get();
- fullScreenButtonContainer->appendChild(fullScreenDivider.release(), ec, true);
+ fullScreenButtonContainer->appendChild(fullScreenDivider.release(), ec, AttachLazily);
if (ec)
return 0;
- buttonGroupContainer->appendChild(fullScreenButtonContainer.release(), ec, true);
+ buttonGroupContainer->appendChild(fullScreenButtonContainer.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_playButtonContainer = playButtonContainer.get();
RefPtr<MediaControlFullscreenPlayButtonElement> fullscreenPlayButton = MediaControlFullscreenPlayButtonElement::create(document);
controls->m_fullscreenPlayButton = fullscreenPlayButton.get();
- playButtonContainer->appendChild(fullscreenPlayButton.release(), ec, true);
+ playButtonContainer->appendChild(fullscreenPlayButton.release(), ec, AttachLazily);
if (ec)
return 0;
- buttonGroupContainer->appendChild(playButtonContainer.release(), ec, true);
+ buttonGroupContainer->appendChild(playButtonContainer.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlPlaceholderElement> placeholder = MediaControlPlaceholderElement::create(document);
controls->m_placeholder = placeholder.get();
- buttonGroupContainer->appendChild(placeholder.release(), ec, true);
+ buttonGroupContainer->appendChild(placeholder.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_buttonContainer = buttonGroupContainer.get();
- panel->appendChild(buttonGroupContainer.release(), ec, true);
+ panel->appendChild(buttonGroupContainer.release(), ec, AttachLazily);
if (ec)
return 0;
if (document->page()->theme()->supportsClosedCaptioning()) {
RefPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(document, controls.get());
controls->m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get();
- panel->appendChild(toggleClosedCaptionsButton.release(), ec, true);
+ panel->appendChild(toggleClosedCaptionsButton.release(), ec, AttachLazily);
if (ec)
return 0;
}
controls->m_panel = panel.get();
- controls->appendChild(panel.release(), ec, true);
+ controls->appendChild(panel.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_embeddedPanel = embedPanel.get();
- controls->appendChild(embedPanel.release(), ec, true);
+ controls->appendChild(embedPanel.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlPlayButtonElement> playButton = MediaControlPlayButtonElement::create(document);
m_playButton = playButton.get();
- panel->appendChild(playButton.release(), ec, true);
+ panel->appendChild(playButton.release(), ec, AttachLazily);
if (ec)
return false;
RefPtr<MediaControlTimelineElement> timeline = MediaControlTimelineElement::create(document, this);
m_timeline = timeline.get();
- panel->appendChild(timeline.release(), ec, true);
+ panel->appendChild(timeline.release(), ec, AttachLazily);
if (ec)
return false;
RefPtr<MediaControlCurrentTimeDisplayElement> currentTimeDisplay = MediaControlCurrentTimeDisplayElement::create(document);
m_currentTimeDisplay = currentTimeDisplay.get();
m_currentTimeDisplay->hide();
- panel->appendChild(currentTimeDisplay.release(), ec, true);
+ panel->appendChild(currentTimeDisplay.release(), ec, AttachLazily);
if (ec)
return false;
RefPtr<MediaControlTimeRemainingDisplayElement> durationDisplay = MediaControlTimeRemainingDisplayElement::create(document);
m_durationDisplay = durationDisplay.get();
- panel->appendChild(durationDisplay.release(), ec, true);
+ panel->appendChild(durationDisplay.release(), ec, AttachLazily);
if (ec)
return false;
RefPtr<MediaControlPanelMuteButtonElement> panelMuteButton = MediaControlPanelMuteButtonElement::create(document, this);
m_panelMuteButton = panelMuteButton.get();
- panel->appendChild(panelMuteButton.release(), ec, true);
+ panel->appendChild(panelMuteButton.release(), ec, AttachLazily);
if (ec)
return false;
RefPtr<MediaControlPanelVolumeSliderElement> slider = MediaControlPanelVolumeSliderElement::create(document);
m_volumeSlider = slider.get();
m_volumeSlider->setClearMutedOnUserInteraction(true);
- panel->appendChild(slider.release(), ec, true);
+ panel->appendChild(slider.release(), ec, AttachLazily);
if (ec)
return false;
if (document->page()->theme()->supportsClosedCaptioning()) {
RefPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(document, this);
m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get();
- panel->appendChild(toggleClosedCaptionsButton.release(), ec, true);
+ panel->appendChild(toggleClosedCaptionsButton.release(), ec, AttachLazily);
if (ec)
return false;
}
RefPtr<MediaControlFullscreenButtonElement> fullscreenButton = MediaControlFullscreenButtonElement::create(document);
m_fullScreenButton = fullscreenButton.get();
- panel->appendChild(fullscreenButton.release(), ec, true);
+ panel->appendChild(fullscreenButton.release(), ec, AttachLazily);
if (ec)
return false;
m_panel = panel.get();
- enclosure->appendChild(panel.release(), ec, true);
+ enclosure->appendChild(panel.release(), ec, AttachLazily);
if (ec)
return false;
m_enclosure = enclosure.get();
- appendChild(enclosure.release(), ec, true);
+ appendChild(enclosure.release(), ec, AttachLazily);
if (ec)
return false;
// Insert it before the first controller element so it always displays behind the controls.
// In the Chromium case, that's the enclosure element.
- insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, true);
+ insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, AttachLazily);
textDisplayContainer->createSubtrees(document());
textDisplayContainer.release();
}
RefPtr<MediaControlOverlayEnclosureElement> overlayEnclosure = MediaControlOverlayEnclosureElement::create(document);
RefPtr<MediaControlOverlayPlayButtonElement> overlayPlayButton = MediaControlOverlayPlayButtonElement::create(document);
controls->m_overlayPlayButton = overlayPlayButton.get();
- overlayEnclosure->appendChild(overlayPlayButton.release(), ec, true);
+ overlayEnclosure->appendChild(overlayPlayButton.release(), ec, AttachLazily);
if (ec)
return 0;
controls->m_overlayEnclosure = overlayEnclosure.get();
- controls->appendChild(overlayEnclosure.release(), ec, true);
+ controls->appendChild(overlayEnclosure.release(), ec, AttachLazily);
if (ec)
return 0;
RefPtr<MediaControlPlayButtonElement> playButton = MediaControlPlayButtonElement::create(document);
m_playButton = playButton.get();
- panel->appendChild(playButton.release(), exceptionCode, true);
+ panel->appendChild(playButton.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
RefPtr<MediaControlTimelineElement> timeline = MediaControlTimelineElement::create(document, this);
m_timeline = timeline.get();
- panel->appendChild(timeline.release(), exceptionCode, true);
+ panel->appendChild(timeline.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
RefPtr<MediaControlCurrentTimeDisplayElement> currentTimeDisplay = MediaControlCurrentTimeDisplayElement::create(document);
m_currentTimeDisplay = currentTimeDisplay.get();
m_currentTimeDisplay->hide();
- panel->appendChild(currentTimeDisplay.release(), exceptionCode, true);
+ panel->appendChild(currentTimeDisplay.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
RefPtr<MediaControlTimeRemainingDisplayElement> durationDisplay = MediaControlTimeRemainingDisplayElement::create(document);
m_durationDisplay = durationDisplay.get();
- panel->appendChild(durationDisplay.release(), exceptionCode, true);
+ panel->appendChild(durationDisplay.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
if (document->page()->theme()->supportsClosedCaptioning()) {
RefPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(document, this);
m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get();
- panel->appendChild(toggleClosedCaptionsButton.release(), exceptionCode, true);
+ panel->appendChild(toggleClosedCaptionsButton.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
}
RefPtr<MediaControlFullscreenButtonElement> fullscreenButton = MediaControlFullscreenButtonElement::create(document);
m_fullScreenButton = fullscreenButton.get();
- panel->appendChild(fullscreenButton.release(), exceptionCode, true);
+ panel->appendChild(fullscreenButton.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
RefPtr<MediaControlPanelMuteButtonElement> panelMuteButton = MediaControlPanelMuteButtonElement::create(document, this);
m_panelMuteButton = panelMuteButton.get();
- panel->appendChild(panelMuteButton.release(), exceptionCode, true);
+ panel->appendChild(panelMuteButton.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
RefPtr<MediaControlVolumeSliderContainerElement> sliderContainer = MediaControlVolumeSliderContainerElement::create(document);
m_volumeSliderContainer = sliderContainer.get();
- panel->appendChild(sliderContainer.release(), exceptionCode, true);
+ panel->appendChild(sliderContainer.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
RefPtr<MediaControlPanelVolumeSliderElement> slider = MediaControlPanelVolumeSliderElement::create(document);
m_volumeSlider = slider.get();
m_volumeSlider->setClearMutedOnUserInteraction(true);
- m_volumeSliderContainer->appendChild(slider.release(), exceptionCode, true);
+ m_volumeSliderContainer->appendChild(slider.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
m_panel = panel.get();
- enclosure->appendChild(panel.release(), exceptionCode, true);
+ enclosure->appendChild(panel.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
m_enclosure = enclosure.get();
- appendChild(enclosure.release(), exceptionCode, true);
+ appendChild(enclosure.release(), exceptionCode, AttachLazily);
if (exceptionCode)
return false;
m_textDisplayContainer->setMediaController(m_mediaController);
// Insert it before the first controller element so it always displays behind the controls.
- insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, true);
+ insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, AttachLazily);
textDisplayContainer->createSubtrees(document());
textDisplayContainer.release();
}
// Note: This is contained by default in m_allDocumentNodes.
m_allDocumentNodes->setPseudo(allNodesShadowPseudoId());
- displayTree->appendChild(m_allDocumentNodes, ASSERT_NO_EXCEPTION, true);
+ displayTree->appendChild(m_allDocumentNodes, ASSERT_NO_EXCEPTION, AttachLazily);
// FIXME(BUG 79916): Runs of children of WebVTT Ruby Objects that are not
// WebVTT Ruby Text Objects must be wrapped in anonymous boxes whose