Changeset 151282 in webkit
- Timestamp:
- Jun 6, 2013 10:18:09 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 67 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r151279 r151282 1 2013-06-06 Radu Stavila <stavila@adobe.com> 2 3 :hover style not applied on hover if its display property is different from original style's 4 https://bugs.webkit.org/show_bug.cgi?id=7555 5 6 Reviewed by Antti Koivisto. 7 8 * fast/regions/hover-display-block-inline-expected.txt: Added. 9 * fast/regions/hover-display-block-inline.html: Added. 10 * fast/regions/hover-display-block-none-expected.txt: Added. 11 * fast/regions/hover-display-block-none.html: Added. 12 * fast/events/drag-display-none-element-expected.txt: 13 * fast/events/drag-display-none-element: 14 1 15 2013-06-06 Mihnea Ovidenie <mihnea@adobe.com> 2 16 -
trunk/LayoutTests/fast/events/drag-display-none-element-expected.txt
r121388 r151282 1 To test, try dragging this div around. It shouldn't crash, and PASS should appear below when you end the drag.2 1 PASS -
trunk/LayoutTests/fast/events/drag-display-none-element.html
r121388 r151282 16 16 testRunner.notifyDone(); 17 17 document.getElementById('console').appendChild(document.createTextNode('PASS')); 18 dragme.style.display = "none"; 18 19 }); 19 20 … … 34 35 </head> 35 36 <body> 36 <div id="dragme" draggable="true">To test, try dragging this div around. It shouldn't crash, and PASS should appear below when you end the drag.</div>37 <div id="dragme" draggable="true">To test, try dragging this div around. It shouldn't crash, the div should disappear and PASS should appear.</div> 37 38 <div id="console"></div> 38 39 </body> -
trunk/Source/WebCore/ChangeLog
r151281 r151282 1 2013-06-06 Radu Stavila <stavila@adobe.com> 2 3 :hover style not applied on hover if its display property is different from original style's 4 https://bugs.webkit.org/show_bug.cgi?id=7555 5 6 Properly apply the :hover pseudo-class when reattaching is required (e.g. when changing the display type) 7 8 A new AttachContext class was created to be passed along as an optional parameter to the attach/detach/reattach methods. 9 This new parameter is used to: 10 - prevent the element from being removed from the list of hovered/active elements upon detach when a reattach is in progress 11 - prevent the style from being incorrectly computed (due to the previous point) 12 - prevent the style from being computed twice (the attach() method used to recompute it) 13 14 Special care was required to the case when display:none is specified in the :hover class. Enabling the :hover style 15 was leaving the element without a renderer, which was causing it to remain stuck in the :hover state (subsequent mouseMove 16 events were not able to reset the element to its normal style due to the fact that it had no renderer). 17 18 The DragController::startDrag method was updated to properly handle the case when dragImage is NULL 19 (for instance by setting display:none inside the -webkit-drag pseudo-class). 20 21 Reviewed by Antti Koivisto. 22 23 Tests: fast/regions/hover-display-block-inline.html 24 fast/regions/hover-display-block-none.html 25 26 * page/DragController.cpp: 27 (WebCore::DragController::startDrag): 28 * dom/ContainerNode.cpp: 29 (WebCore::ContainerNode::attach): 30 (WebCore::ContainerNode::detach): 31 * dom/ContainerNode.h: 32 * dom/Document.cpp: 33 (WebCore::Document::attach): 34 (WebCore::Document::detach): 35 (WebCore::Document::updateHoverActiveState): 36 * dom/Document.h: 37 * dom/Element.cpp: 38 (WebCore::Element::setHovered): 39 (WebCore::Element::createRendererIfNeeded): 40 (WebCore::Element::attach): 41 (WebCore::Element::detach): 42 (WebCore::Element::recalcStyle): 43 * dom/Element.h: 44 * dom/Node.cpp: 45 (WebCore::Node::AttachDetachContext::AttachDetachContext): 46 (WebCore::Node::AttachDetachContext::~AttachDetachContext): 47 (WebCore::Node::attach): 48 (WebCore::Node::detach): 49 * dom/Node.h: 50 (WebCore::Node::reattach): 51 (WebCore::Node::reattachIfAttached): 52 * dom/NodeRenderingContext.cpp: 53 (WebCore::NodeRenderingContext::NodeRenderingContext): 54 * dom/PseudoElement.cpp: 55 (WebCore::PseudoElement::attach): 56 * dom/PseudoElement.h: 57 * dom/ShadowRoot.cpp: 58 (WebCore::ShadowRoot::attach): 59 * dom/ShadowRoot.h: 60 * dom/Text.cpp: 61 (WebCore::Text::attach): 62 * dom/Text.h: 63 * html/HTMLCanvasElement.cpp: 64 (WebCore::HTMLCanvasElement::attach): 65 * html/HTMLCanvasElement.h: 66 * html/HTMLFormControlElement.cpp: 67 (WebCore::HTMLFormControlElement::attach): 68 * html/HTMLFormControlElement.h: 69 * html/HTMLFrameElement.cpp: 70 (WebCore::HTMLFrameElement::attach): 71 * html/HTMLFrameElement.h: 72 * html/HTMLFrameElementBase.cpp: 73 (WebCore::HTMLFrameElementBase::attach): 74 * html/HTMLFrameElementBase.h: 75 * html/HTMLFrameSetElement.cpp: 76 (WebCore::HTMLFrameSetElement::attach): 77 * html/HTMLFrameSetElement.h: 78 * html/HTMLImageElement.cpp: 79 (WebCore::HTMLImageElement::attach): 80 * html/HTMLImageElement.h: 81 * html/HTMLInputElement.cpp: 82 (WebCore::HTMLInputElement::attach): 83 (WebCore::HTMLInputElement::detach): 84 * html/HTMLInputElement.h: 85 * html/HTMLLIElement.cpp: 86 (WebCore::HTMLLIElement::attach): 87 * html/HTMLLIElement.h: 88 * html/HTMLMediaElement.cpp: 89 (WebCore::HTMLMediaElement::attach): 90 * html/HTMLMediaElement.h: 91 * html/HTMLOptGroupElement.cpp: 92 (WebCore::HTMLOptGroupElement::attach): 93 (WebCore::HTMLOptGroupElement::detach): 94 * html/HTMLOptGroupElement.h: 95 * html/HTMLOptionElement.cpp: 96 (WebCore::HTMLOptionElement::attach): 97 (WebCore::HTMLOptionElement::detach): 98 * html/HTMLOptionElement.h: 99 * html/HTMLPlugInElement.cpp: 100 (WebCore::HTMLPlugInElement::detach): 101 * html/HTMLPlugInElement.h: 102 * html/HTMLPlugInImageElement.cpp: 103 (WebCore::HTMLPlugInImageElement::attach): 104 (WebCore::HTMLPlugInImageElement::detach): 105 * html/HTMLPlugInImageElement.h: 106 * html/HTMLProgressElement.cpp: 107 (WebCore::HTMLProgressElement::attach): 108 * html/HTMLProgressElement.h: 109 * html/HTMLTextAreaElement.cpp: 110 (WebCore::HTMLTextAreaElement::attach): 111 * html/HTMLTextAreaElement.h: 112 * html/HTMLVideoElement.cpp: 113 (WebCore::HTMLVideoElement::attach): 114 * html/HTMLVideoElement.h: 115 * html/PluginDocument.cpp: 116 (WebCore::PluginDocument::detach): 117 * html/PluginDocument.h: 118 * html/shadow/InsertionPoint.cpp: 119 (WebCore::InsertionPoint::attach): 120 (WebCore::InsertionPoint::detach): 121 * html/shadow/InsertionPoint.h: 122 * html/shadow/SliderThumbElement.cpp: 123 (WebCore::SliderThumbElement::detach): 124 * html/shadow/SliderThumbElement.h: 125 * html/shadow/SpinButtonElement.cpp: 126 (WebCore::SpinButtonElement::detach): 127 * html/shadow/SpinButtonElement.h: 128 * html/shadow/TextControlInnerElements.cpp: 129 (WebCore::SearchFieldCancelButtonElement::detach): 130 (WebCore::InputFieldSpeechButtonElement::attach): 131 (WebCore::InputFieldSpeechButtonElement::detach): 132 * html/shadow/TextControlInnerElements.h: 133 * loader/PlaceholderDocument.cpp: 134 (WebCore::PlaceholderDocument::attach): 135 * loader/PlaceholderDocument.h: 136 * svg/SVGImageElement.cpp: 137 (WebCore::SVGImageElement::attach): 138 * svg/SVGImageElement.h: 139 1 140 2013-06-06 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 141 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r150715 r151282 788 788 } 789 789 790 void ContainerNode::attach( )790 void ContainerNode::attach(const AttachContext& context) 791 791 { 792 792 attachChildren(); 793 Node::attach( );794 } 795 796 void ContainerNode::detach( )793 Node::attach(context); 794 } 795 796 void ContainerNode::detach(const AttachContext& context) 797 797 { 798 798 detachChildren(); 799 799 clearChildNeedsStyleRecalc(); 800 Node::detach( );800 Node::detach(context); 801 801 } 802 802 -
trunk/Source/WebCore/dom/ContainerNode.h
r150715 r151282 107 107 void cloneChildNodes(ContainerNode* clone); 108 108 109 virtual void attach( ) OVERRIDE;110 virtual void detach( ) OVERRIDE;109 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 110 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 111 111 virtual LayoutRect boundingBox() const OVERRIDE; 112 112 virtual void scheduleSetNeedsStyleRecalc(StyleChangeType = FullStyleChange) OVERRIDE FINAL; -
trunk/Source/WebCore/dom/Document.cpp
r150957 r151282 2039 2039 } 2040 2040 2041 void Document::attach( )2041 void Document::attach(const AttachContext& context) 2042 2042 { 2043 2043 ASSERT(!attached()); … … 2059 2059 setRenderer(0); 2060 2060 2061 ContainerNode::attach( );2061 ContainerNode::attach(context); 2062 2062 2063 2063 setRenderer(render); 2064 2064 } 2065 2065 2066 void Document::detach( )2066 void Document::detach(const AttachContext& context) 2067 2067 { 2068 2068 ASSERT(attached()); … … 2115 2115 m_activeElement = 0; 2116 2116 2117 ContainerNode::detach( );2117 ContainerNode::detach(context); 2118 2118 2119 2119 unscheduleStyleRecalc(); … … 5893 5893 5894 5894 if (oldHoverObj != newHoverObj) { 5895 // If the old hovered element is not nil but it's renderer is, it was probably detached as part of the :hover style 5896 // (for instance by setting display:none in the :hover pseudo-class). In this case, the old hovered element 5897 // must be updated, to ensure it's normal style is re-applied. 5898 if (oldHoveredElement && !oldHoverObj) { 5899 if (!mustBeInActiveChain || (oldHoveredElement->isElementNode() && oldHoveredElement->inActiveChain())) 5900 nodesToRemoveFromChain.append(oldHoveredElement); 5901 } 5902 5895 5903 // The old hover path only needs to be cleared up to (and not including) the common ancestor; 5896 5904 for (RenderObject* curr = oldHoverObj; curr && curr != ancestor; curr = curr->hoverAncestor()) { -
trunk/Source/WebCore/dom/Document.h
r150873 r151282 533 533 CachedResourceLoader* cachedResourceLoader() { return m_cachedResourceLoader.get(); } 534 534 535 virtual void attach( );536 virtual void detach( );535 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 536 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 537 537 void prepareForDestruction(); 538 538 -
trunk/Source/WebCore/dom/Element.cpp
r151072 r151282 550 550 document->userActionElements().setHovered(this, flag); 551 551 552 if (!renderer()) 553 return; 552 if (!renderer()) { 553 // When setting hover to false, the style needs to be recalc'd even when 554 // there's no renderer (imagine setting display:none in the :hover class, 555 // if a nil renderer would prevent this element from recalculating its 556 // style, it would never go back to its normal style and remain 557 // stuck in its hovered style). 558 if (!flag) 559 setNeedsStyleRecalc(); 560 561 return; 562 } 554 563 555 564 if (renderer()->style()->affectedByHover() || childrenAffectedByHover()) … … 1406 1415 } 1407 1416 1408 void Element::createRendererIfNeeded( )1409 { 1410 NodeRenderingContext(this ).createRendererForElementIfNeeded();1411 } 1412 1413 void Element::attach( )1417 void Element::createRendererIfNeeded(const AttachContext& context) 1418 { 1419 NodeRenderingContext(this, context).createRendererForElementIfNeeded(); 1420 } 1421 1422 void Element::attach(const AttachContext& context) 1414 1423 { 1415 1424 PostAttachCallbackDisabler callbackDisabler(this); … … 1417 1426 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; 1418 1427 1419 createRendererIfNeeded( );1428 createRendererIfNeeded(context); 1420 1429 1421 1430 if (parentElement() && parentElement()->isInCanvasSubtree()) … … 1431 1440 parentPusher.push(); 1432 1441 1433 ContainerNode::attach( );1442 ContainerNode::attach(context); 1434 1443 1435 1444 updatePseudoElement(AFTER); … … 1451 1460 } 1452 1461 1453 void Element::detach( )1462 void Element::detach(const AttachContext& context) 1454 1463 { 1455 1464 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; … … 1470 1479 } 1471 1480 1472 if (isUserActionElement()) { 1473 if (hovered()) 1474 document()->hoveredElementDidDetach(this); 1475 if (inActiveChain()) 1476 document()->elementInActiveChainDidDetach(this); 1477 document()->userActionElements().didDetach(this); 1478 } 1479 1480 ContainerNode::detach(); 1481 // Do not remove the element's hovered and active status 1482 // if performing a reattach. 1483 if (!context.performingReattach) { 1484 if (isUserActionElement()) { 1485 if (hovered()) 1486 document()->hoveredElementDidDetach(this); 1487 if (inActiveChain()) 1488 document()->elementInActiveChainDidDetach(this); 1489 document()->userActionElements().didDetach(this); 1490 } 1491 } 1492 1493 ContainerNode::detach(context); 1481 1494 } 1482 1495 … … 1554 1567 } 1555 1568 if (localChange == Detach) { 1556 // FIXME: The style gets computed twice by calling attach. We could do better if we passed the style along. 1557 reattach(); 1569 AttachContext reattachContext; 1570 reattachContext.resolvedStyle = newStyle.get(); 1571 reattach(reattachContext); 1572 1558 1573 // attach recalculates the style for all children. No need to do it twice. 1559 1574 clearNeedsStyleRecalc(); -
trunk/Source/WebCore/dom/Element.h
r151071 r151282 410 410 virtual void copyNonAttributePropertiesFromElement(const Element&) { } 411 411 412 virtual void attach( );413 virtual void detach( );412 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 413 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 414 414 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 415 415 virtual bool rendererIsNeeded(const NodeRenderingContext&); … … 757 757 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); 758 758 759 void createRendererIfNeeded( );759 void createRendererIfNeeded(const AttachContext&); 760 760 761 761 bool isJavaScriptURLAttribute(const Attribute&) const; -
trunk/Source/WebCore/dom/Node.cpp
r150879 r151282 974 974 } 975 975 976 void Node::attach( )976 void Node::attach(const AttachContext&) 977 977 { 978 978 ASSERT(!attached()); … … 1017 1017 #endif 1018 1018 1019 void Node::detach( )1019 void Node::detach(const AttachContext&) 1020 1020 { 1021 1021 #ifndef NDEBUG -
trunk/Source/WebCore/dom/Node.h
r151071 r151282 476 476 RenderBoxModelObject* renderBoxModelObject() const; 477 477 478 struct AttachContext { 479 RenderStyle* resolvedStyle; 480 bool performingReattach; 481 482 AttachContext() : resolvedStyle(0), performingReattach(false) { } 483 }; 484 478 485 // Attaches this node to the rendering tree. This calculates the style to be applied to the node and creates an 479 486 // appropriate RenderObject which will be inserted into the tree (except when the style has display: none). This 480 487 // makes the node visible in the FrameView. 481 virtual void attach( );488 virtual void attach(const AttachContext& = AttachContext()); 482 489 483 490 // Detaches the node from the rendering tree, making it invisible in the rendered view. This method will remove 484 491 // the node's rendering object from the rendering tree and delete it. 485 virtual void detach( );492 virtual void detach(const AttachContext& = AttachContext()); 486 493 487 494 #ifndef NDEBUG … … 489 496 #endif 490 497 491 void reattach( );492 void reattachIfAttached( );498 void reattach(const AttachContext& = AttachContext()); 499 void reattachIfAttached(const AttachContext& = AttachContext()); 493 500 ContainerNode* parentNodeForRenderingAndStyle(); 494 501 … … 808 815 } 809 816 810 inline void Node::reattach() 817 inline void Node::reattach(const AttachContext& context) 818 { 819 AttachContext reattachContext(context); 820 reattachContext.performingReattach = true; 821 822 if (attached()) 823 detach(reattachContext); 824 attach(reattachContext); 825 } 826 827 inline void Node::reattachIfAttached(const AttachContext& context) 811 828 { 812 829 if (attached()) 813 detach(); 814 attach(); 815 } 816 817 inline void Node::reattachIfAttached() 818 { 819 if (attached()) 820 reattach(); 830 reattach(context); 821 831 } 822 832 -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r149525 r151282 69 69 } 70 70 71 NodeRenderingContext::NodeRenderingContext(Node* node, const Node::AttachContext& context) 72 : m_node(node) 73 , m_style(context.resolvedStyle) 74 , m_parentFlowRenderer(0) 75 { 76 m_renderingParent = NodeRenderingTraversal::parent(node, &m_parentDetails); 77 } 78 71 79 NodeRenderingContext::~NodeRenderingContext() 72 80 { -
trunk/Source/WebCore/dom/NodeRenderingContext.h
r148865 r151282 48 48 explicit NodeRenderingContext(Node*); 49 49 NodeRenderingContext(Node*, RenderStyle*); 50 NodeRenderingContext(Node*, const Node::AttachContext&); 50 51 ~NodeRenderingContext(); 51 52 -
trunk/Source/WebCore/dom/PseudoElement.cpp
r145312 r151282 77 77 } 78 78 79 void PseudoElement::attach( )79 void PseudoElement::attach(const AttachContext& context) 80 80 { 81 81 ASSERT(!renderer()); 82 82 83 Element::attach( );83 Element::attach(context); 84 84 85 85 RenderObject* renderer = this->renderer(); -
trunk/Source/WebCore/dom/PseudoElement.h
r149960 r151282 44 44 45 45 virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE; 46 virtual void attach( ) OVERRIDE;46 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 47 47 virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE; 48 48 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r150480 r151282 166 166 } 167 167 168 void ShadowRoot::attach( )168 void ShadowRoot::attach(const AttachContext& context) 169 169 { 170 170 StyleResolver* styleResolver = document()->ensureStyleResolver(); 171 171 styleResolver->pushParentShadowRoot(this); 172 DocumentFragment::attach( );172 DocumentFragment::attach(context); 173 173 styleResolver->popParentShadowRoot(this); 174 174 } -
trunk/Source/WebCore/dom/ShadowRoot.h
r150733 r151282 72 72 Element* activeElement() const; 73 73 74 virtual void attach( );74 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 75 75 76 76 virtual void registerScopedHTMLStyleChild() OVERRIDE; -
trunk/Source/WebCore/dom/Text.cpp
r151236 r151282 278 278 } 279 279 280 void Text::attach( )280 void Text::attach(const AttachContext& context) 281 281 { 282 282 createTextRendererIfNeeded(); 283 CharacterData::attach( );283 CharacterData::attach(context); 284 284 } 285 285 -
trunk/Source/WebCore/dom/Text.h
r149960 r151282 51 51 void updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData); 52 52 53 virtual void attach( ) OVERRIDE FINAL;53 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE FINAL; 54 54 55 55 virtual bool canContainRangeEndPoint() const OVERRIDE FINAL { return true; } -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r151259 r151282 122 122 } 123 123 124 void HTMLCanvasElement::attach( )124 void HTMLCanvasElement::attach(const AttachContext& context) 125 125 { 126 126 setIsInCanvasSubtree(true); 127 HTMLElement::attach( );127 HTMLElement::attach(context); 128 128 } 129 129 -
trunk/Source/WebCore/html/HTMLCanvasElement.h
r149960 r151282 145 145 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 146 146 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 147 virtual void attach( );147 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 148 148 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } 149 149 -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r150805 r151282 209 209 } 210 210 211 void HTMLFormControlElement::attach( )211 void HTMLFormControlElement::attach(const AttachContext& context) 212 212 { 213 213 PostAttachCallbackDisabler disabler(this); 214 214 215 HTMLElement::attach( );215 HTMLElement::attach(context); 216 216 217 217 // The call to updateFromElement() needs to go after the call through -
trunk/Source/WebCore/html/HTMLFormControlElement.h
r150805 r151282 112 112 virtual void requiredAttributeChanged(); 113 113 virtual void disabledAttributeChanged(); 114 virtual void attach( );114 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 115 115 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 116 116 virtual void removedFrom(ContainerNode*) OVERRIDE; -
trunk/Source/WebCore/html/HTMLFrameElement.cpp
r135069 r151282 73 73 } 74 74 75 void HTMLFrameElement::attach( )75 void HTMLFrameElement::attach(const AttachContext& context) 76 76 { 77 HTMLFrameElementBase::attach( );77 HTMLFrameElementBase::attach(context); 78 78 79 79 if (HTMLFrameSetElement* frameSetElement = containingFrameSetElement(this)) { -
trunk/Source/WebCore/html/HTMLFrameElement.h
r149960 r151282 40 40 HTMLFrameElement(const QualifiedName&, Document*); 41 41 42 virtual void attach( );42 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 43 43 44 44 virtual bool rendererIsNeeded(const NodeRenderingContext&); -
trunk/Source/WebCore/html/HTMLFrameElementBase.cpp
r147281 r151282 173 173 } 174 174 175 void HTMLFrameElementBase::attach( )176 { 177 HTMLFrameOwnerElement::attach( );175 void HTMLFrameElementBase::attach(const AttachContext& context) 176 { 177 HTMLFrameOwnerElement::attach(context); 178 178 179 179 if (RenderPart* part = renderPart()) { -
trunk/Source/WebCore/html/HTMLFrameElementBase.h
r150710 r151282 53 53 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 54 54 virtual void didNotifySubtreeInsertions(ContainerNode*) OVERRIDE; 55 virtual void attach( );55 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 56 56 57 57 private: -
trunk/Source/WebCore/html/HTMLFrameSetElement.cpp
r144568 r151282 166 166 } 167 167 168 void HTMLFrameSetElement::attach( )168 void HTMLFrameSetElement::attach(const AttachContext& context) 169 169 { 170 170 // Inherit default settings from parent frameset … … 187 187 } 188 188 189 HTMLElement::attach( );189 HTMLElement::attach(context); 190 190 } 191 191 -
trunk/Source/WebCore/html/HTMLFrameSetElement.h
r149960 r151282 72 72 virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE; 73 73 74 virtual void attach( );74 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 75 75 virtual bool rendererIsNeeded(const NodeRenderingContext&); 76 76 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r149881 r151282 173 173 } 174 174 175 void HTMLImageElement::attach( )176 { 177 HTMLElement::attach( );175 void HTMLImageElement::attach(const AttachContext& context) 176 { 177 HTMLElement::attach(context); 178 178 179 179 if (renderer() && renderer()->isImage() && !m_imageLoader.hasPendingBeforeLoadEvent()) { -
trunk/Source/WebCore/html/HTMLImageElement.h
r149652 r151282 89 89 virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE; 90 90 91 virtual void attach( );91 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 92 92 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 93 93 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r150876 r151282 800 800 } 801 801 802 void HTMLInputElement::attach( )802 void HTMLInputElement::attach(const AttachContext& context) 803 803 { 804 804 PostAttachCallbackDisabler disabler(this); … … 807 807 updateType(); 808 808 809 HTMLTextFormControlElement::attach( );809 HTMLTextFormControlElement::attach(context); 810 810 811 811 m_inputType->attach(); … … 815 815 } 816 816 817 void HTMLInputElement::detach( )818 { 819 HTMLTextFormControlElement::detach( );817 void HTMLInputElement::detach(const AttachContext& context) 818 { 819 HTMLTextFormControlElement::detach(context); 820 820 setFormControlValueMatchesRenderer(false); 821 821 m_inputType->detach(); -
trunk/Source/WebCore/html/HTMLInputElement.h
r150876 r151282 189 189 virtual bool rendererIsNeeded(const NodeRenderingContext&); 190 190 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 191 virtual void detach( );191 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 192 192 193 193 // FIXME: For isActivatedSubmit and setActivatedSubmit, we should use the NVI-idiom here by making … … 352 352 virtual void copyNonAttributePropertiesFromElement(const Element&); 353 353 354 virtual void attach( );354 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 355 355 356 356 virtual bool appendFormData(FormDataList&, bool); -
trunk/Source/WebCore/html/HTMLLIElement.cpp
r148863 r151282 86 86 } 87 87 88 void HTMLLIElement::attach( )88 void HTMLLIElement::attach(const AttachContext& context) 89 89 { 90 90 ASSERT(!attached()); 91 91 92 HTMLElement::attach( );92 HTMLElement::attach(context); 93 93 94 94 if (renderer() && renderer()->isListItem()) { -
trunk/Source/WebCore/html/HTMLLIElement.h
r149960 r151282 40 40 virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE; 41 41 42 virtual void attach( );42 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 43 43 44 44 void parseValue(const AtomicString&); -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r150971 r151282 617 617 } 618 618 619 void HTMLMediaElement::attach( )619 void HTMLMediaElement::attach(const AttachContext& context) 620 620 { 621 621 ASSERT(!attached()); … … 625 625 #endif 626 626 627 HTMLElement::attach( );627 HTMLElement::attach(context); 628 628 629 629 if (renderer()) -
trunk/Source/WebCore/html/HTMLMediaElement.h
r150971 r151282 389 389 virtual void finishParsingChildren(); 390 390 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; 391 virtual void attach( ) OVERRIDE;391 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 392 392 393 393 virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE; -
trunk/Source/WebCore/html/HTMLOptGroupElement.cpp
r149392 r151282 97 97 } 98 98 99 void HTMLOptGroupElement::attach( )99 void HTMLOptGroupElement::attach(const AttachContext& context) 100 100 { 101 HTMLElement::attach( );101 HTMLElement::attach(context); 102 102 // If after attaching nothing called styleForRenderer() on this node we 103 103 // manually cache the value. This happens if our parent doesn't have a … … 107 107 } 108 108 109 void HTMLOptGroupElement::detach( )109 void HTMLOptGroupElement::detach(const AttachContext& context) 110 110 { 111 111 m_style.clear(); 112 HTMLElement::detach( );112 HTMLElement::detach(context); 113 113 } 114 114 -
trunk/Source/WebCore/html/HTMLOptGroupElement.h
r150710 r151282 48 48 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 49 49 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; } 50 virtual void attach( );51 virtual void detach( );50 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 51 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 52 52 53 53 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r149392 r151282 91 91 } 92 92 93 void HTMLOptionElement::attach( )94 { 95 HTMLElement::attach( );93 void HTMLOptionElement::attach(const AttachContext& context) 94 { 95 HTMLElement::attach(context); 96 96 // If after attaching nothing called styleForRenderer() on this node we 97 97 // manually cache the value. This happens if our parent doesn't have a … … 101 101 } 102 102 103 void HTMLOptionElement::detach( )103 void HTMLOptionElement::detach(const AttachContext& context) 104 104 { 105 105 m_style.clear(); 106 HTMLElement::detach( );106 HTMLElement::detach(context); 107 107 } 108 108 -
trunk/Source/WebCore/html/HTMLOptionElement.h
r150710 r151282 73 73 virtual bool isFocusable() const OVERRIDE; 74 74 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; } 75 virtual void attach( );76 virtual void detach( );75 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 76 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 77 77 78 78 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; -
trunk/Source/WebCore/html/HTMLPlugInElement.cpp
r149980 r151282 94 94 } 95 95 96 void HTMLPlugInElement::detach( )96 void HTMLPlugInElement::detach(const AttachContext& context) 97 97 { 98 98 m_instance.clear(); … … 111 111 #endif 112 112 113 HTMLFrameOwnerElement::detach( );113 HTMLFrameOwnerElement::detach(context); 114 114 } 115 115 -
trunk/Source/WebCore/html/HTMLPlugInElement.h
r150687 r151282 84 84 HTMLPlugInElement(const QualifiedName& tagName, Document*); 85 85 86 virtual void detach( );86 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 87 87 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; 88 88 virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE; -
trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp
r150731 r151282 235 235 } 236 236 237 void HTMLPlugInImageElement::attach( )237 void HTMLPlugInImageElement::attach(const AttachContext& context) 238 238 { 239 239 PostAttachCallbackDisabler disabler(this); … … 244 244 queuePostAttachCallback(&HTMLPlugInImageElement::updateWidgetCallback, this); 245 245 246 HTMLPlugInElement::attach( );246 HTMLPlugInElement::attach(context); 247 247 248 248 if (isImage && renderer() && !useFallbackContent()) { … … 253 253 } 254 254 255 void HTMLPlugInImageElement::detach( )255 void HTMLPlugInImageElement::detach(const AttachContext& context) 256 256 { 257 257 // FIXME: Because of the insanity that is HTMLPlugInImageElement::recalcStyle, … … 261 261 // Update the widget the next time we attach (detaching destroys the plugin). 262 262 setNeedsWidgetUpdate(true); 263 HTMLPlugInElement::detach( );263 HTMLPlugInElement::detach(context); 264 264 } 265 265 -
trunk/Source/WebCore/html/HTMLPlugInImageElement.h
r150731 r151282 111 111 112 112 static void updateWidgetCallback(Node*, unsigned = 0); 113 virtual void attach( );114 virtual void detach( );113 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 114 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 115 115 116 116 bool allowedToLoadFrameURL(const String& url); -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r146860 r151282 93 93 } 94 94 95 void HTMLProgressElement::attach( )95 void HTMLProgressElement::attach(const AttachContext& context) 96 96 { 97 LabelableElement::attach( );97 LabelableElement::attach(context); 98 98 if (RenderProgress* render = renderProgress()) 99 99 render->updateFromElement(); -
trunk/Source/WebCore/html/HTMLProgressElement.h
r149960 r151282 61 61 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 62 62 63 virtual void attach( );63 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 64 64 65 65 void didElementStateChange(); -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r150796 r151282 525 525 } 526 526 527 void HTMLTextAreaElement::attach( )528 { 529 HTMLTextFormControlElement::attach( );527 void HTMLTextAreaElement::attach(const AttachContext& context) 528 { 529 HTMLTextFormControlElement::attach(context); 530 530 fixPlaceholderRenderer(m_placeholder, innerTextElement()); 531 531 } -
trunk/Source/WebCore/html/HTMLTextAreaElement.h
r150692 r151282 112 112 113 113 virtual bool shouldUseInputMethod(); 114 virtual void attach( ) OVERRIDE;114 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 115 115 virtual bool matchesReadOnlyPseudoClass() const OVERRIDE; 116 116 virtual bool matchesReadWritePseudoClass() const OVERRIDE; -
trunk/Source/WebCore/html/HTMLVideoElement.cpp
r150214 r151282 75 75 #endif 76 76 77 void HTMLVideoElement::attach( )78 { 79 HTMLMediaElement::attach( );77 void HTMLVideoElement::attach(const AttachContext& context) 78 { 79 HTMLMediaElement::attach(context); 80 80 81 81 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) -
trunk/Source/WebCore/html/HTMLVideoElement.h
r149960 r151282 79 79 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 80 80 #endif 81 virtual void attach( );81 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 82 82 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 83 83 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; -
trunk/Source/WebCore/html/PluginDocument.cpp
r150700 r151282 162 162 } 163 163 164 void PluginDocument::detach( )164 void PluginDocument::detach(const AttachContext& context) 165 165 { 166 166 // Release the plugin Element so that we don't have a circular reference. … … 168 168 if (FrameLoader* loader = frame()->loader()) 169 169 loader->client()->redirectDataToPlugin(0); 170 HTMLDocument::detach( );170 HTMLDocument::detach(context); 171 171 } 172 172 -
trunk/Source/WebCore/html/PluginDocument.h
r150700 r151282 45 45 HTMLPlugInElement* pluginElement() { return m_pluginElement.get(); } 46 46 47 virtual void detach( ) OVERRIDE;47 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 48 48 49 49 void cancelManualPluginLoad(); -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r150483 r151282 52 52 } 53 53 54 void InsertionPoint::attach( )54 void InsertionPoint::attach(const AttachContext& context) 55 55 { 56 56 if (ShadowRoot* shadowRoot = containingShadowRoot()) … … 58 58 for (Node* current = firstDistributed(); current; current = nextDistributedTo(current)) { 59 59 if (!current->attached()) 60 current->attach( );61 } 62 63 HTMLElement::attach( );64 } 65 66 void InsertionPoint::detach( )60 current->attach(context); 61 } 62 63 HTMLElement::attach(context); 64 } 65 66 void InsertionPoint::detach(const AttachContext& context) 67 67 { 68 68 if (ShadowRoot* shadowRoot = containingShadowRoot()) … … 70 70 71 71 for (Node* current = firstDistributed(); current; current = nextDistributedTo(current)) 72 current->detach( );73 74 HTMLElement::detach( );72 current->detach(context); 73 74 HTMLElement::detach(context); 75 75 } 76 76 -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r150483 r151282 67 67 void setResetStyleInheritance(bool); 68 68 69 virtual void attach( );70 virtual void detach( );69 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 70 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 71 71 72 72 bool shouldUseFallbackElements() const; -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r150697 r151282 388 388 } 389 389 390 void SliderThumbElement::detach( )390 void SliderThumbElement::detach(const AttachContext& context) 391 391 { 392 392 if (m_inDragMode) { … … 394 394 frame->eventHandler()->setCapturingMouseEventsNode(0); 395 395 } 396 HTMLDivElement::detach( );396 HTMLDivElement::detach(context); 397 397 } 398 398 -
trunk/Source/WebCore/html/shadow/SliderThumbElement.h
r150697 r151282 57 57 virtual bool willRespondToMouseMoveEvents() OVERRIDE; 58 58 virtual bool willRespondToMouseClickEvents() OVERRIDE; 59 virtual void detach( );59 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 60 60 virtual const AtomicString& shadowPseudoId() const; 61 61 HTMLInputElement* hostInput() const; -
trunk/Source/WebCore/html/shadow/SpinButtonElement.cpp
r150214 r151282 64 64 } 65 65 66 void SpinButtonElement::detach( )66 void SpinButtonElement::detach(const AttachContext& context) 67 67 { 68 68 releaseCapture(); 69 HTMLDivElement::detach( );69 HTMLDivElement::detach(context); 70 70 } 71 71 -
trunk/Source/WebCore/html/shadow/SpinButtonElement.h
r150684 r151282 71 71 72 72 virtual const AtomicString& shadowPseudoId() const; 73 virtual void detach( );73 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 74 74 virtual bool isSpinButtonElement() const { return true; } 75 75 virtual bool isDisabledFormControl() const OVERRIDE { return shadowHost() && shadowHost()->isDisabledFormControl(); } -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r146977 r151282 200 200 } 201 201 202 void SearchFieldCancelButtonElement::detach( )202 void SearchFieldCancelButtonElement::detach(const AttachContext& context) 203 203 { 204 204 if (m_capturing) { … … 206 206 frame->eventHandler()->setCapturingMouseEventsNode(0); 207 207 } 208 HTMLDivElement::detach( );208 HTMLDivElement::detach(context); 209 209 } 210 210 … … 409 409 } 410 410 411 void InputFieldSpeechButtonElement::attach( )411 void InputFieldSpeechButtonElement::attach(const AttachContext& context) 412 412 { 413 413 ASSERT(!m_listenerId); 414 414 if (SpeechInput* input = SpeechInput::from(document()->page())) 415 415 m_listenerId = input->registerListener(this); 416 HTMLDivElement::attach( );417 } 418 419 void InputFieldSpeechButtonElement::detach( )416 HTMLDivElement::attach(context); 417 } 418 419 void InputFieldSpeechButtonElement::detach(const AttachContext& context) 420 420 { 421 421 if (m_capturing) { … … 431 431 } 432 432 433 HTMLDivElement::detach( );433 HTMLDivElement::detach(context); 434 434 } 435 435 -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.h
r150692 r151282 92 92 SearchFieldCancelButtonElement(Document*); 93 93 virtual const AtomicString& shadowPseudoId() const; 94 virtual void detach( );94 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; 95 95 virtual bool isMouseFocusable() const OVERRIDE { return false; } 96 96 … … 132 132 virtual const AtomicString& shadowPseudoId() const; 133 133 virtual bool isMouseFocusable() const OVERRIDE { return false; } 134 virtual void attach( );134 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 135 135 136 136 bool m_capturing; -
trunk/Source/WebCore/loader/PlaceholderDocument.cpp
r95901 r151282 29 29 namespace WebCore { 30 30 31 void PlaceholderDocument::attach( )31 void PlaceholderDocument::attach(const AttachContext& context) 32 32 { 33 33 ASSERT(!attached()); 34 34 35 35 // Skipping Document::attach(). 36 ContainerNode::attach( );36 ContainerNode::attach(context); 37 37 } 38 38 -
trunk/Source/WebCore/loader/PlaceholderDocument.h
r149705 r151282 38 38 } 39 39 40 virtual void attach( );40 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 41 41 42 42 private: -
trunk/Source/WebCore/page/DragController.cpp
r150354 r151282 851 851 doSystemDrag(dragImage, dragLoc, mouseDraggedPoint, clipboard, src, true); 852 852 } else if (state.type == DragSourceActionDHTML) { 853 ASSERT(m_dragSourceAction & DragSourceActionDHTML); 854 m_client->willPerformDragSourceAction(DragSourceActionDHTML, dragOrigin, clipboard); 855 doSystemDrag(dragImage, dragLoc, dragOrigin, clipboard, src, false); 853 if (dragImage) { 854 ASSERT(m_dragSourceAction & DragSourceActionDHTML); 855 m_client->willPerformDragSourceAction(DragSourceActionDHTML, dragOrigin, clipboard); 856 doSystemDrag(dragImage, dragLoc, dragOrigin, clipboard, src, false); 857 } else 858 startedDrag = false; 856 859 } else { 857 860 // draggableElement() determined an image or link node was draggable, but it turns out the -
trunk/Source/WebCore/svg/SVGImageElement.cpp
r145750 r151282 200 200 } 201 201 202 void SVGImageElement::attach( )203 { 204 SVGStyledTransformableElement::attach( );202 void SVGImageElement::attach(const AttachContext& context) 203 { 204 SVGStyledTransformableElement::attach(context); 205 205 206 206 if (RenderSVGImage* imageObj = toRenderSVGImage(renderer())) { -
trunk/Source/WebCore/svg/SVGImageElement.h
r150710 r151282 55 55 virtual void svgAttributeChanged(const QualifiedName&); 56 56 57 virtual void attach( );57 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 58 58 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 59 59
Note: See TracChangeset
for help on using the changeset viewer.