Replace shouldLazyAttach bool with an enum for readability
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 07:59:18 +0000 (07:59 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 07:59:18 +0000 (07:59 +0000)
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/cpp/WebDOMNodeCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNode.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/editing/AppendNodeCommand.cpp
Source/WebCore/editing/InsertNodeBeforeCommand.cpp
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/html/shadow/MediaControlsApple.cpp
Source/WebCore/html/shadow/MediaControlsBlackBerry.cpp
Source/WebCore/html/shadow/MediaControlsChromium.cpp
Source/WebCore/html/shadow/MediaControlsChromiumAndroid.cpp
Source/WebCore/html/shadow/MediaControlsGtk.cpp
Source/WebCore/html/track/TextTrackCue.cpp

index d83675d..4894a34 100644 (file)
@@ -1,3 +1,52 @@
+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.
index 86ed721..b551f6b 100644 (file)
@@ -243,7 +243,7 @@ __ZN7WebCore13AXObjectCache21gAccessibilityEnabledE
 __ZN7WebCore13AXObjectCache23focusedUIElementForPageEPKNS_4PageE
 __ZN7WebCore13AXObjectCache42gAccessibilityEnhancedUserInterfaceEnabledE
 __ZN7WebCore13CharacterData7setDataERKN3WTF6StringERi
-__ZN7WebCore13ContainerNode11appendChildEN3WTF10PassRefPtrINS_4NodeEEERib
+__ZN7WebCore13ContainerNode11appendChildEN3WTF10PassRefPtrINS_4NodeEEERiNS_14AttachBehaviorE
 __ZN7WebCore13ContainerNode11removeChildEPNS_4NodeERi
 __ZN7WebCore13HTTPHeaderMapC1Ev
 __ZN7WebCore13HTTPHeaderMapD1Ev
@@ -765,8 +765,9 @@ __ZN7WebCore4KURLC1ENS_18ParsedURLStringTagERKN3WTF6StringE
 __ZN7WebCore4KURLC1EP5NSURL
 __ZN7WebCore4KURLC1EPK7__CFURL
 __ZN7WebCore4KURLC1ERKS0_RKN3WTF6StringE
+__ZN7WebCore4Node11appendChildEN3WTF10PassRefPtrIS0_EERiNS_14AttachBehaviorE
+__ZN7WebCore4Node12insertBeforeEN3WTF10PassRefPtrIS0_EEPS0_RiNS_14AttachBehaviorE
 __ZN7WebCore4Node10renderRectEPb
-__ZN7WebCore4Node11appendChildEN3WTF10PassRefPtrIS0_EERib
 __ZN7WebCore4Node11removeChildEPS0_Ri
 __ZN7WebCore4Node14removedLastRefEv
 __ZN7WebCore4Node14setTextContentERKN3WTF6StringERi
@@ -1420,7 +1421,6 @@ __ZNK7WebCore4KURL5queryEv
 __ZNK7WebCore4KURL8protocolEv
 __ZNK7WebCore4KURLcvP5NSURLEv
 __ZNK7WebCore4Node11textContentEb
-__ZN7WebCore4Node12insertBeforeEN3WTF10PassRefPtrIS0_EEPS0_Rib
 __ZNK7WebCore4Node13ownerDocumentEv
 __ZNK7WebCore4Node14isDescendantOfEPKS0_
 __ZNK7WebCore4Node18getSubresourceURLsERN3WTF11ListHashSetINS_4KURLELm256ENS_8KURLHashEEE
index 41abb0c..3c2dd57 100644 (file)
@@ -31,7 +31,7 @@ WebDOMNode WebDOMNode::insertBefore(const WebDOMNode& newChild, const WebDOMNode
         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));
@@ -44,7 +44,7 @@ WebDOMNode WebDOMNode::replaceChild(const WebDOMNode& newChild, const WebDOMNode
         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));
@@ -70,7 +70,7 @@ WebDOMNode WebDOMNode::appendChild(const WebDOMNode& newChild)
         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));
index 2a917f5..99f2d55 100644 (file)
@@ -145,7 +145,7 @@ JSValue JSNode::insertBefore(ExecState* exec)
 {
     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);
@@ -156,7 +156,7 @@ JSValue JSNode::replaceChild(ExecState* exec)
 {
     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);
@@ -178,7 +178,7 @@ JSValue JSNode::appendChild(ExecState* exec)
 {
     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);
index f3a9cc4..1c50080 100644 (file)
@@ -60,7 +60,7 @@
 
 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();
@@ -68,7 +68,7 @@ v8::Handle<v8::Value> V8Node::insertBeforeMethodCustom(const v8::Arguments& args
     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)
@@ -76,7 +76,7 @@ v8::Handle<v8::Value> V8Node::insertBeforeMethodCustom(const v8::Arguments& args
     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();
@@ -84,7 +84,7 @@ v8::Handle<v8::Value> V8Node::replaceChildMethodCustom(const v8::Arguments& args
     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)
@@ -106,14 +106,14 @@ v8::Handle<v8::Value> V8Node::removeChildMethodCustom(const v8::Arguments& args)
     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)
index b229881..7b3831b 100644 (file)
@@ -66,7 +66,7 @@ namespace WebCore {
 
 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;
@@ -242,7 +242,7 @@ static inline bool checkReplaceChild(ContainerNode* newParent, Node* newChild, N
     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.
@@ -254,7 +254,7 @@ bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, Exce
 
     // 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))
@@ -301,7 +301,7 @@ bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, Exce
 
         insertBeforeCommon(next.get(), child);
 
-        updateTreeAfterInsertion(this, child, shouldLazyAttach);
+        updateTreeAfterInsertion(this, child, attachBehavior);
     }
 
     dispatchSubtreeModifiedEvent();
@@ -360,7 +360,7 @@ void ContainerNode::parserInsertBefore(PassRefPtr<Node> newChild, Node* nextChil
     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.
@@ -440,7 +440,7 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
                 appendChildToContainer(child, this);
         }
 
-        updateTreeAfterInsertion(this, child, shouldLazyAttach);
+        updateTreeAfterInsertion(this, child, attachBehavior);
     }
 
     dispatchSubtreeModifiedEvent();
@@ -654,7 +654,7 @@ void ContainerNode::removeChildren()
     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);
 
@@ -704,7 +704,7 @@ bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
             appendChildToContainer(child, this);
         }
 
-        updateTreeAfterInsertion(this, child, shouldLazyAttach);
+        updateTreeAfterInsertion(this, child, attachBehavior);
     }
 
     dispatchSubtreeModifiedEvent();
@@ -1144,7 +1144,7 @@ static void dispatchChildRemovalEvents(Node* child)
     }
 }
 
-static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, bool shouldLazyAttach)
+static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, AttachBehavior attachBehavior)
 {
     ASSERT(parent->refCount());
     ASSERT(child->refCount());
@@ -1158,7 +1158,7 @@ static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, bool sh
     // 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();
index fe2ec85..6d77d04 100644 (file)
@@ -89,10 +89,10 @@ public:
     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.
index 9af7366..07c5cec 100644 (file)
@@ -541,22 +541,22 @@ Node* Node::firstDescendant() const
     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)
@@ -568,13 +568,13 @@ 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)
index 86d1c69..39de31b 100644 (file)
@@ -129,6 +129,11 @@ private:
     RenderObject* m_renderer;
 };
 
+enum AttachBehavior {
+    AttachNow,
+    AttachLazily,
+};
+
 class Node : public EventTarget, public ScriptWrappable, public TreeShared<Node> {
     friend class Document;
     friend class TreeScope;
@@ -197,10 +202,10 @@ public:
     // 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(); }
index 5f20f4e..6d2cf23 100644 (file)
@@ -60,7 +60,7 @@ void AppendNodeCommand::doApply()
     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);
index 76cfa54..7ede999 100644 (file)
@@ -55,7 +55,7 @@ void InsertNodeBeforeCommand::doApply()
         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());
index 5c67dbc..a212788 100644 (file)
@@ -112,8 +112,8 @@ RenderObject* HTMLDetailsElement::createRenderer(RenderArena* arena, RenderStyle
 
 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
index 800ae1b..b978279 100644 (file)
@@ -78,8 +78,8 @@ bool HTMLSummaryElement::childShouldCreateRenderer(const NodeRenderingContext& c
 
 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
index 224d435..775c077 100644 (file)
@@ -1185,7 +1185,7 @@ void MediaControlTextTrackContainerElement::createSubtrees(Document* document)
 {
     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)
@@ -1273,7 +1273,7 @@ void MediaControlTextTrackContainerElement::updateDisplay()
         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.
index 3814ded..cec9bc5 100644 (file)
@@ -381,7 +381,7 @@ void MediaControls::createTextTrackDisplay()
         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();
 }
index 9ca2de7..396e49d 100644 (file)
@@ -84,26 +84,26 @@ PassRefPtr<MediaControlsApple> MediaControlsApple::createControls(Document* docu
 
     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;
     }
@@ -112,38 +112,38 @@ PassRefPtr<MediaControlsApple> MediaControlsApple::createControls(Document* docu
 
     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;
 
@@ -152,18 +152,18 @@ PassRefPtr<MediaControlsApple> MediaControlsApple::createControls(Document* docu
 
         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;
     }
@@ -171,7 +171,7 @@ PassRefPtr<MediaControlsApple> MediaControlsApple::createControls(Document* docu
     // 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);
@@ -181,7 +181,7 @@ PassRefPtr<MediaControlsApple> MediaControlsApple::createControls(Document* docu
 
         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;
 
@@ -189,48 +189,48 @@ PassRefPtr<MediaControlsApple> MediaControlsApple::createControls(Document* docu
         // 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;
 
index fe71583..aff0dbf 100644 (file)
@@ -649,7 +649,7 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
 
     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;
 
@@ -657,7 +657,7 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
 
     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;
 
@@ -665,29 +665,29 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
 
     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;
 
@@ -699,21 +699,21 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
 
         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;
     }
@@ -722,7 +722,7 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
 
     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;
 
@@ -730,23 +730,23 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
 
     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;
 
@@ -757,15 +757,15 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
     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;
 
@@ -773,39 +773,39 @@ PassRefPtr<MediaControlsBlackBerry> MediaControlsBlackBerry::createControls(Docu
     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;
 
index 4641b9d..bda5549 100644 (file)
@@ -74,63 +74,63 @@ bool MediaControlsChromium::initializeControls(Document* document)
 
     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;
 
@@ -215,7 +215,7 @@ void MediaControlsChromium::createTextTrackDisplay()
 
     // 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();
 }
index ea11bb3..f8609d8 100644 (file)
@@ -54,12 +54,12 @@ PassRefPtr<MediaControlsChromiumAndroid> MediaControlsChromiumAndroid::createCon
     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;
 
index a386293..e895bc6 100644 (file)
@@ -67,69 +67,69 @@ bool MediaControlsGtk::initializeControls(Document* document)
 
     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;
 
@@ -223,7 +223,7 @@ void MediaControlsGtk::createTextTrackDisplay()
         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();
 }
index 22b0b7a..3b2c699 100644 (file)
@@ -749,7 +749,7 @@ PassRefPtr<TextTrackCueBox> TextTrackCue::getDisplayTree(const IntSize& videoSiz
 
     // 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