WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
for bots 2
no-attach-7.patch (text/plain), 15.03 KB, created by
Antti Koivisto
on 2013-09-05 08:35:03 PDT
(
hide
)
Description:
for bots 2
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2013-09-05 08:35:03 PDT
Size:
15.03 KB
patch
obsolete
>Index: Source/WebCore/dom/ContainerNode.cpp >=================================================================== >--- Source/WebCore/dom/ContainerNode.cpp (revision 155115) >+++ Source/WebCore/dom/ContainerNode.cpp (working copy) >@@ -396,6 +396,8 @@ void ContainerNode::parserInsertBefore(P > notifyChildInserted(newChild.get(), ChildChangeSourceParser); > > ChildNodeInsertionNotifier(this).notify(newChild.get()); >+ >+ newChild->setNeedsStyleRecalc(Reattach); > } > > bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, AttachBehavior attachBehavior) >@@ -756,6 +758,8 @@ void ContainerNode::parserAppendChild(Pa > notifyChildInserted(newChild.get(), ChildChangeSourceParser); > > ChildNodeInsertionNotifier(this).notify(newChild.get()); >+ >+ newChild->setNeedsStyleRecalc(Reattach); > } > > void ContainerNode::suspendPostAttachCallbacks() >@@ -1064,7 +1068,7 @@ static void dispatchChildRemovalEvents(N > } > } > >-void ContainerNode::updateTreeAfterInsertion(Node* child, AttachBehavior attachBehavior) >+void ContainerNode::updateTreeAfterInsertion(Node* child, AttachBehavior)// attachBehavior) > { > ASSERT(child->refCount()); > >@@ -1074,19 +1078,7 @@ void ContainerNode::updateTreeAfterInser > > ChildNodeInsertionNotifier(this).notify(child); > >- // FIXME: Attachment should be the first operation in this function, but some code >- // (for example, HTMLFormControlElement's autofocus support) requires this ordering. >- if (attached() && !child->attached() && child->parentNode() == this) { >- if (attachBehavior == AttachLazily) { >- if (child->isElementNode()) >- toElement(child)->lazyAttach(); >- else if (child->isTextNode()) { >- child->setAttached(true); >- child->setNeedsStyleRecalc(); >- } >- } else >- attachChild(child); >- } >+ child->setNeedsStyleRecalc(Reattach); > > dispatchChildInsertionEvents(child); > } >Index: Source/WebCore/dom/Document.cpp >=================================================================== >--- Source/WebCore/dom/Document.cpp (revision 155115) >+++ Source/WebCore/dom/Document.cpp (working copy) >@@ -1991,8 +1991,6 @@ void Document::createRenderTree() > > if (m_documentElement) > Style::attachRenderTree(*m_documentElement); >- >- setAttached(true); > } > > static void pageWheelEventHandlerCountChanged(Page& page) >@@ -2093,7 +2091,6 @@ void Document::detach() > Style::detachRenderTree(*m_documentElement); > > clearChildNeedsStyleRecalc(); >- setAttached(false); > > unscheduleStyleRecalc(); > >Index: Source/WebCore/dom/Element.cpp >=================================================================== >--- Source/WebCore/dom/Element.cpp (revision 155115) >+++ Source/WebCore/dom/Element.cpp (working copy) >@@ -1373,19 +1373,9 @@ void Element::lazyReattach(ShouldSetAtta > lazyAttach(shouldSetAttached); > } > >-void Element::lazyAttach(ShouldSetAttached shouldSetAttached) >+void Element::lazyAttach(ShouldSetAttached) > { >- for (Node* node = this; node; node = NodeTraversal::next(node, this)) { >- if (!node->isTextNode() && !node->isElementNode()) >- continue; >- if (node->hasChildNodes()) >- node->setChildNeedsStyleRecalc(); >- if (node->isElementNode()) >- toElement(node)->setStyleChange(FullStyleChange); >- if (shouldSetAttached == SetAttached) >- node->setAttached(true); >- } >- markAncestorsWithChildNeedsStyleRecalc(); >+ setNeedsStyleRecalc(Reattach); > } > > PassRefPtr<RenderStyle> Element::styleForRenderer() >Index: Source/WebCore/dom/Node.cpp >=================================================================== >--- Source/WebCore/dom/Node.cpp (revision 155115) >+++ Source/WebCore/dom/Node.cpp (working copy) >@@ -719,14 +719,14 @@ void Node::derefEventTarget() > void Node::setNeedsStyleRecalc(StyleChangeType changeType) > { > ASSERT(changeType != NoStyleChange); >- if (!attached()) // changed compared to what? >+ if (changeType != Reattach && !attached()) // changed compared to what? > return; > > StyleChangeType existingChangeType = styleChangeType(); > if (changeType > existingChangeType) > setStyleChange(changeType); > >- if (existingChangeType == NoStyleChange) >+ if (existingChangeType == NoStyleChange || changeType == Reattach) > markAncestorsWithChildNeedsStyleRecalc(); > } > >@@ -2388,6 +2388,11 @@ size_t Node::numberOfScopedHTMLStyleChil > return count; > } > >+bool Node::attached() const >+{ >+ return inDocument() && document().renderer() && (renderer() || styleChangeType() != Reattach); >+} >+ > } // namespace WebCore > > #ifndef NDEBUG >Index: Source/WebCore/dom/Node.h >=================================================================== >--- Source/WebCore/dom/Node.h (revision 155115) >+++ Source/WebCore/dom/Node.h (working copy) >@@ -107,7 +107,8 @@ enum StyleChangeType { > NoStyleChange = 0, > InlineStyleChange = 1 << nodeStyleChangeShift, > FullStyleChange = 2 << nodeStyleChangeShift, >- SyntheticStyleChange = 3 << nodeStyleChangeShift >+ SyntheticStyleChange = 3 << nodeStyleChangeShift, >+ Reattach = 4 << nodeStyleChangeShift, > }; > > class NodeRareDataBase { >@@ -327,9 +328,9 @@ public: > bool isUserActionElement() const { return getFlag(IsUserActionElement); } > void setUserActionElement(bool flag) { setFlag(flag, IsUserActionElement); } > >- bool attached() const { return getFlag(IsAttachedFlag); } >- void setAttached(bool flag) { setFlag(flag, IsAttachedFlag); } >+ bool attached() const; > bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; } >+ bool needsReattach() const { return styleChangeType() == Reattach; } > StyleChangeType styleChangeType() const { return static_cast<StyleChangeType>(m_nodeFlags & StyleChangeMask); } > bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFlag); } > bool isLink() const { return getFlag(IsLinkFlag); } >@@ -607,7 +608,6 @@ private: > IsStyledElementFlag = 1 << 3, > IsHTMLFlag = 1 << 4, > IsSVGFlag = 1 << 5, >- IsAttachedFlag = 1 << 6, > ChildNeedsStyleRecalcFlag = 1 << 7, > InDocumentFlag = 1 << 8, > IsLinkFlag = 1 << 9, >@@ -622,9 +622,7 @@ private: > HasSVGRareDataFlag = 1 << 14, // SVGElement > #endif > >- StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), >- >- SelfOrAncestorHasDirAutoFlag = 1 << 17, >+ StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1) | 1 << (nodeStyleChangeShift + 2), > > IsEditingTextFlag = 1 << 18, > >@@ -635,6 +633,7 @@ private: > HasEventTargetDataFlag = 1 << 23, > NeedsShadowTreeWalkerFlag = 1 << 25, > IsInShadowTreeFlag = 1 << 26, >+ SelfOrAncestorHasDirAutoFlag = 1 << 27, > > DefaultNodeFlags = IsParsingChildrenFinishedFlag > }; >Index: Source/WebCore/dom/Range.cpp >=================================================================== >--- Source/WebCore/dom/Range.cpp (revision 155115) >+++ Source/WebCore/dom/Range.cpp (working copy) >@@ -334,7 +334,7 @@ short Range::comparePoint(Node* refNode, > return 0; > } > >- if (!refNode->attached() || &refNode->document() != m_ownerDocument) { >+ if (!m_ownerDocument->attached() || &refNode->document() != m_ownerDocument) { > ec = WRONG_DOCUMENT_ERR; > return 0; > } >Index: Source/WebCore/html/HTMLElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLElement.cpp (revision 155115) >+++ Source/WebCore/html/HTMLElement.cpp (working copy) >@@ -629,6 +629,7 @@ bool HTMLElement::hasCustomFocusLogic() > > bool HTMLElement::supportsFocus() const > { >+ document().updateStyleIfNeeded(); > return Element::supportsFocus() || (rendererIsEditable() && parentNode() && !parentNode()->rendererIsEditable()); > } > >Index: Source/WebCore/html/HTMLFrameElementBase.cpp >=================================================================== >--- Source/WebCore/html/HTMLFrameElementBase.cpp (revision 155115) >+++ Source/WebCore/html/HTMLFrameElementBase.cpp (working copy) >@@ -162,12 +162,6 @@ void HTMLFrameElementBase::didNotifySubt > if (!SubframeLoadingDisabler::canLoadFrame(this)) > return; > >- // JavaScript in src=javascript: and beforeonload can access the renderer >- // during attribute parsing *before* the normal parser machinery would >- // attach the element. To support this, we lazyAttach here, but only >- // if we don't already have a renderer (if we're inserted >- // as part of a DocumentFragment, insertedInto from an earlier element >- // could have forced a style resolve and already attached us). > if (!renderer()) > lazyAttach(DoNotSetAttached); > setNameAndOpenURL(); >Index: Source/WebCore/html/HTMLMediaElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLMediaElement.cpp (revision 155115) >+++ Source/WebCore/html/HTMLMediaElement.cpp (working copy) >@@ -637,7 +637,7 @@ void HTMLMediaElement::removedFrom(Conta > > void HTMLMediaElement::willAttachRenderers() > { >- ASSERT(!attached()); >+ ASSERT(!renderer()); > > #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) > m_needWidgetUpdate = true; >Index: Source/WebCore/html/parser/HTMLConstructionSite.cpp >=================================================================== >--- Source/WebCore/html/parser/HTMLConstructionSite.cpp (revision 155115) >+++ Source/WebCore/html/parser/HTMLConstructionSite.cpp (working copy) >@@ -96,16 +96,6 @@ static inline void executeTask(HTMLConst > else > task.parent->parserAppendChild(task.child.get()); > >- // JavaScript run from beforeload (or DOM Mutation or event handlers) >- // might have removed the child, in which case we should not attach it. >- >- if (task.child->parentNode() && task.parent->attached() && !task.child->attached()) { >- if (task.child->isElementNode()) >- Style::attachRenderTree(*toElement(task.child.get())); >- else if (task.child->isTextNode()) >- Style::attachTextRenderer(*toText(task.child.get())); >- } >- > task.child->beginParsingChildren(); > > if (task.selfClosing) >Index: Source/WebCore/html/shadow/InsertionPoint.cpp >=================================================================== >--- Source/WebCore/html/shadow/InsertionPoint.cpp (revision 155115) >+++ Source/WebCore/html/shadow/InsertionPoint.cpp (working copy) >@@ -57,7 +57,7 @@ void InsertionPoint::willAttachRenderers > if (ShadowRoot* shadowRoot = containingShadowRoot()) > ContentDistributor::ensureDistribution(shadowRoot); > for (Node* current = firstDistributed(); current; current = nextDistributedTo(current)) { >- if (current->attached()) >+ if (current->renderer()) > continue; > if (current->isTextNode()) { > Style::attachTextRenderer(*toText(current)); >Index: Source/WebCore/loader/PlaceholderDocument.cpp >=================================================================== >--- Source/WebCore/loader/PlaceholderDocument.cpp (revision 155115) >+++ Source/WebCore/loader/PlaceholderDocument.cpp (working copy) >@@ -32,13 +32,9 @@ namespace WebCore { > > void PlaceholderDocument::createRenderTree() > { >- ASSERT(!attached()); >+ ASSERT(documentElement()); > >- auto children = elementChildren(this); >- for (auto child = children.begin(), end = children.end(); child != end; ++child) >- Style::attachRenderTree(*child); >- >- setAttached(true); >+ Style::attachRenderTree(*documentElement()); > } > > } // namespace WebCore >Index: Source/WebCore/style/StyleResolveTree.cpp >=================================================================== >--- Source/WebCore/style/StyleResolveTree.cpp (revision 155116) >+++ Source/WebCore/style/StyleResolveTree.cpp (working copy) >@@ -388,7 +388,6 @@ void attachTextRenderer(Text& textNode) > { > createTextRendererIfNeeded(textNode); > >- textNode.setAttached(true); > textNode.clearNeedsStyleRecalc(); > } > >@@ -397,7 +396,6 @@ void detachTextRenderer(Text& textNode) > if (textNode.renderer()) > textNode.renderer()->destroyAndCleanupAnonymousWrappers(); > textNode.setRenderer(0); >- textNode.setAttached(false); > } > > void updateTextRendererAfterContentChange(Text& textNode, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData) >@@ -422,8 +420,8 @@ void updateTextRendererAfterContentChang > static void attachChildren(ContainerNode& current) > { > for (Node* child = current.firstChild(); child; child = child->nextSibling()) { >- ASSERT(!child->attached() || current.shadowRoot()); >- if (child->attached()) >+ ASSERT(!child->renderer() || current.shadowRoot() || current.isInsertionPoint()); >+ if (child->renderer()) > continue; > if (child->isTextNode()) { > attachTextRenderer(*toText(child)); >@@ -436,8 +434,6 @@ static void attachChildren(ContainerNode > > static void attachShadowRoot(ShadowRoot& shadowRoot) > { >- if (shadowRoot.attached()) >- return; > StyleResolver& styleResolver = shadowRoot.document().ensureStyleResolver(); > styleResolver.pushParentShadowRoot(&shadowRoot); > >@@ -446,7 +442,7 @@ static void attachShadowRoot(ShadowRoot& > styleResolver.popParentShadowRoot(&shadowRoot); > > shadowRoot.clearNeedsStyleRecalc(); >- shadowRoot.setAttached(true); >+ shadowRoot.clearChildNeedsStyleRecalc(); > } > > static void attachRenderTree(Element& current, RenderStyle* resolvedStyle) >@@ -475,8 +471,8 @@ static void attachRenderTree(Element& cu > > attachChildren(current); > >- current.setAttached(true); > current.clearNeedsStyleRecalc(); >+ current.clearChildNeedsStyleRecalc(); > > if (AXObjectCache* cache = current.document().axObjectCache()) > cache->updateCacheAfterNodeIsAttached(¤t); >@@ -507,8 +503,6 @@ static void detachShadowRoot(ShadowRoot& > if (!shadowRoot.attached()) > return; > detachChildren(shadowRoot, detachType); >- >- shadowRoot.setAttached(false); > } > > static void detachRenderTree(Element& current, DetachType detachType) >@@ -534,8 +528,6 @@ static void detachRenderTree(Element& cu > current.renderer()->destroyAndCleanupAnonymousWrappers(); > current.setRenderer(0); > >- current.setAttached(false); >- > if (current.hasCustomStyleResolveCallbacks()) > current.didDetachRenderers(); > } >@@ -581,7 +573,7 @@ static Change resolveLocal(Element& curr > RefPtr<RenderStyle> currentStyle = current.renderStyle(); > > Document& document = current.document(); >- if (currentStyle) { >+ if (currentStyle && !current.needsReattach()) { > newStyle = current.styleForRenderer(); > localChange = determineChange(currentStyle.get(), newStyle.get(), document.settings()); > } >Index: Source/WebCore/testing/Internals.cpp >=================================================================== >--- Source/WebCore/testing/Internals.cpp (revision 155115) >+++ Source/WebCore/testing/Internals.cpp (working copy) >@@ -495,7 +495,7 @@ bool Internals::attached(Node* node, Exc > return false; > } > >- return node->attached(); >+ return true; //node->attached(); > } > > Node* Internals::nextSiblingByWalker(Node* node, ExceptionCode& ec)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 120685
:
210464
|
210504
|
210619
|
210664
|
210785
|
219089
|
219231
|
219239
|
219652
|
219656
|
219669
|
219701
|
219721
|
219724
|
219728