Changeset 154371 in webkit
- Timestamp:
- Aug 20, 2013 3:52:55 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 63 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r154370 r154371 1 2013-08-20 Antti Koivisto <antti@apple.com> 2 3 <https://webkit.org/b/120071> Replace NodeRenderingContext with Node* as childShouldCreateRenderer() argument 4 5 Reviewed by Darin Adler. 6 7 This simplifies the code. NodeRenderingContext was basically only used for getting the Node. 8 9 * dom/ContainerNode.h: 10 (WebCore::ContainerNode::childShouldCreateRenderer): 11 * dom/Element.cpp: 12 (WebCore::Element::childShouldCreateRenderer): 13 * dom/Element.h: 14 * dom/NodeRenderingContext.cpp: 15 (WebCore::NodeRenderingContext::shouldCreateRenderer): 16 * dom/NodeRenderingContext.h: 17 18 Move isOnEncapsulationBoundary() to InsertionPoint.h and call it hasShadowRootOrActiveInsertionPointParent(). 19 Move isOnUpperEncapsulationBoundary() to ShadowRoot.h and call it hasShadowRootParent(). 20 21 * dom/ShadowRoot.h: 22 (WebCore::hasShadowRootParent): 23 * html/HTMLDetailsElement.cpp: 24 (WebCore::HTMLDetailsElement::childShouldCreateRenderer): 25 * html/HTMLDetailsElement.h: 26 * html/HTMLFormControlElement.cpp: 27 (WebCore::HTMLFormControlElement::validationMessageShadowTreeContains): 28 * html/HTMLFormControlElement.h: 29 * html/HTMLMediaElement.cpp: 30 (WebCore::HTMLMediaElement::childShouldCreateRenderer): 31 * html/HTMLMediaElement.h: 32 * html/HTMLMeterElement.cpp: 33 (WebCore::HTMLMeterElement::childShouldCreateRenderer): 34 * html/HTMLMeterElement.h: 35 * html/HTMLOptGroupElement.h: 36 (WebCore::isHTMLOptGroupElement): 37 * html/HTMLOptionElement.h: 38 (WebCore::isHTMLOptionElement): 39 * html/HTMLProgressElement.cpp: 40 (WebCore::HTMLProgressElement::childShouldCreateRenderer): 41 * html/HTMLProgressElement.h: 42 * html/HTMLSelectElement.cpp: 43 (WebCore::HTMLSelectElement::childShouldCreateRenderer): 44 * html/HTMLSelectElement.h: 45 * html/HTMLSummaryElement.cpp: 46 (WebCore::HTMLSummaryElement::childShouldCreateRenderer): 47 * html/HTMLSummaryElement.h: 48 * html/HTMLTextFormControlElement.cpp: 49 (WebCore::HTMLTextFormControlElement::childShouldCreateRenderer): 50 (WebCore::enclosingTextFormControl): 51 * html/HTMLTextFormControlElement.h: 52 * html/ValidationMessage.cpp: 53 (WebCore::ValidationMessage::shadowTreeContains): 54 * html/ValidationMessage.h: 55 * html/shadow/InsertionPoint.cpp: 56 (WebCore::InsertionPoint::rendererIsNeeded): 57 * html/shadow/InsertionPoint.h: 58 (WebCore::isActiveInsertionPoint): 59 60 Remove isShadowBoundary() as it was equivalent to isActive(). 61 Remove isLowerEncapsulationBoundary() as it was equivalent to isActiveInsertionPoint(). 62 63 (WebCore::hasShadowRootOrActiveInsertionPointParent): 64 65 Moved and renamed from NodeRenderingContext::isOnEncapsulationBoundary(). 66 67 * svg/SVGAElement.cpp: 68 (WebCore::SVGAElement::childShouldCreateRenderer): 69 * svg/SVGAElement.h: 70 * svg/SVGAltGlyphElement.cpp: 71 (WebCore::SVGAltGlyphElement::childShouldCreateRenderer): 72 * svg/SVGAltGlyphElement.h: 73 * svg/SVGDocument.cpp: 74 (WebCore::SVGDocument::childShouldCreateRenderer): 75 * svg/SVGDocument.h: 76 * svg/SVGElement.cpp: 77 (WebCore::SVGElement::childShouldCreateRenderer): 78 * svg/SVGElement.h: 79 * svg/SVGFilterElement.cpp: 80 (WebCore::SVGFilterElement::childShouldCreateRenderer): 81 * svg/SVGFilterElement.h: 82 * svg/SVGFilterPrimitiveStandardAttributes.h: 83 * svg/SVGForeignObjectElement.cpp: 84 (WebCore::SVGForeignObjectElement::childShouldCreateRenderer): 85 * svg/SVGForeignObjectElement.h: 86 * svg/SVGSVGElement.h: 87 (WebCore::toSVGSVGElement): 88 * svg/SVGSwitchElement.cpp: 89 (WebCore::SVGSwitchElement::childShouldCreateRenderer): 90 * svg/SVGSwitchElement.h: 91 * svg/SVGTRefElement.cpp: 92 (WebCore::SVGTRefElement::childShouldCreateRenderer): 93 * svg/SVGTRefElement.h: 94 * svg/SVGTSpanElement.cpp: 95 (WebCore::SVGTSpanElement::childShouldCreateRenderer): 96 * svg/SVGTSpanElement.h: 97 * svg/SVGTextElement.cpp: 98 (WebCore::SVGTextElement::childShouldCreateRenderer): 99 * svg/SVGTextElement.h: 100 * svg/SVGTextPathElement.cpp: 101 (WebCore::SVGTextPathElement::childShouldCreateRenderer): 102 * svg/SVGTextPathElement.h: 103 1 104 2013-08-20 Benjamin Poulain <benjamin@webkit.org> 2 105 -
trunk/Source/WebCore/dom/CharacterData.cpp
r154286 r154371 31 31 #include "MutationObserverInterestGroup.h" 32 32 #include "MutationRecord.h" 33 #include "NodeRenderingContext.h"34 33 #include "RenderText.h" 35 34 #include "StyleInheritedData.h" -
trunk/Source/WebCore/dom/ContainerNode.h
r154365 r154371 119 119 void disconnectDescendantFrames(); 120 120 121 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const { return true; }121 virtual bool childShouldCreateRenderer(const Node*) const { return true; } 122 122 123 123 protected: -
trunk/Source/WebCore/dom/Element.cpp
r154365 r154371 71 71 #include "NodeList.h" 72 72 #include "NodeRenderStyle.h" 73 #include "NodeRenderingContext.h"74 73 #include "Page.h" 75 74 #include "PointerLockController.h" … … 2501 2500 2502 2501 #if ENABLE(SVG) 2503 bool Element::childShouldCreateRenderer(const Node RenderingContext& childContext) const2502 bool Element::childShouldCreateRenderer(const Node* child) const 2504 2503 { 2505 2504 // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments. 2506 if (child Context.node()->isSVGElement())2507 return child Context.node()->hasTagName(SVGNames::svgTag) || isSVGElement();2508 2509 return ContainerNode::childShouldCreateRenderer(child Context);2505 if (child->isSVGElement()) 2506 return child->hasTagName(SVGNames::svgTag) || isSVGElement(); 2507 2508 return ContainerNode::childShouldCreateRenderer(child); 2510 2509 } 2511 2510 #endif -
trunk/Source/WebCore/dom/Element.h
r154365 r154371 482 482 483 483 #if ENABLE(SVG) 484 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;484 virtual bool childShouldCreateRenderer(const Node*) const; 485 485 bool hasPendingResources() const; 486 486 void setHasPendingResources(); -
trunk/Source/WebCore/dom/Node.h
r154254 r154371 71 71 class NodeListsNodeData; 72 72 class NodeRareData; 73 class NodeRenderingContext;74 73 class PlatformKeyboardEvent; 75 74 class PlatformMouseEvent; -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r154365 r154371 191 191 if (!parentRenderer->canHaveChildren() && !(m_node->isPseudoElement() && parentRenderer->canHaveGeneratedChildren())) 192 192 return false; 193 if (!m_renderingParent->childShouldCreateRenderer( *this))193 if (!m_renderingParent->childShouldCreateRenderer(m_node)) 194 194 return false; 195 195 return true; … … 236 236 } 237 237 238 bool NodeRenderingContext::isOnEncapsulationBoundary() const239 {240 return isOnUpperEncapsulationBoundary()241 || isLowerEncapsulationBoundary(findInsertionPointOf(m_node))242 || isLowerEncapsulationBoundary(m_node->parentNode());243 }244 245 bool NodeRenderingContext::isOnUpperEncapsulationBoundary() const246 {247 return m_node->parentNode() && m_node->parentNode()->isShadowRoot();248 }249 250 238 void NodeRenderingContext::createRendererForElementIfNeeded() 251 239 { -
trunk/Source/WebCore/dom/NodeRenderingContext.h
r154365 r154371 63 63 const RenderStyle* style() const; 64 64 65 bool isOnUpperEncapsulationBoundary() const;66 bool isOnEncapsulationBoundary() const;67 68 65 private: 69 66 bool shouldCreateRenderer() const; -
trunk/Source/WebCore/dom/PseudoElement.cpp
r154358 r154371 30 30 #include "ContentData.h" 31 31 #include "InspectorInstrumentation.h" 32 #include "NodeRenderingContext.h"33 32 #include "RenderObject.h" 34 33 #include "RenderQuote.h" -
trunk/Source/WebCore/dom/ShadowRoot.h
r154365 r154371 136 136 } 137 137 138 inline bool hasShadowRootParent(const Node* node) 139 { 140 return node->parentNode() && node->parentNode()->isShadowRoot(); 141 } 142 138 143 } // namespace 139 144 -
trunk/Source/WebCore/dom/Text.h
r154240 r154371 29 29 namespace WebCore { 30 30 31 class NodeRenderingContext; 31 32 class RenderText; 32 33 -
trunk/Source/WebCore/html/HTMLDetailsElement.cpp
r154365 r154371 28 28 #include "LocalizedStrings.h" 29 29 #include "MouseEvent.h" 30 #include "NodeRenderingContext.h"31 30 #include "RenderBlock.h" 32 31 #include "ShadowRoot.h" … … 145 144 } 146 145 147 bool HTMLDetailsElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const146 bool HTMLDetailsElement::childShouldCreateRenderer(const Node* child) const 148 147 { 149 if (child Context.node()->isPseudoElement())150 return HTMLElement::childShouldCreateRenderer(child Context);148 if (child->isPseudoElement()) 149 return HTMLElement::childShouldCreateRenderer(child); 151 150 152 if (! childContext.isOnEncapsulationBoundary())151 if (!hasShadowRootOrActiveInsertionPointParent(child)) 153 152 return false; 154 153 155 154 if (m_isOpen) 156 return HTMLElement::childShouldCreateRenderer(child Context);155 return HTMLElement::childShouldCreateRenderer(child); 157 156 158 if (!child Context.node()->hasTagName(summaryTag))157 if (!child->hasTagName(summaryTag)) 159 158 return false; 160 159 161 return child Context.node() == findMainSummary() && HTMLElement::childShouldCreateRenderer(childContext);160 return child == findMainSummary() && HTMLElement::childShouldCreateRenderer(child); 162 161 } 163 162 -
trunk/Source/WebCore/html/HTMLDetailsElement.h
r154365 r154371 37 37 38 38 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 39 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;39 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 40 40 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 41 41 -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r154365 r154371 453 453 } 454 454 455 bool HTMLFormControlElement::validationMessageShadowTreeContains( Node* node) const455 bool HTMLFormControlElement::validationMessageShadowTreeContains(const Node* node) const 456 456 { 457 457 return m_validationMessage && m_validationMessage->shadowTreeContains(node); -
trunk/Source/WebCore/html/HTMLFormControlElement.h
r154365 r154371 129 129 virtual bool recalcWillValidate() const; 130 130 131 bool validationMessageShadowTreeContains( Node*) const;131 bool validationMessageShadowTreeContains(const Node*) const; 132 132 133 133 private: -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r154358 r154371 42 42 #include "HTMLNames.h" 43 43 #include "HTMLTableElement.h" 44 #include "NodeRenderingContext.h"45 44 #include "Page.h" 46 45 #include "RenderTextControl.h" -
trunk/Source/WebCore/html/HTMLFrameSetElement.cpp
r154358 r154371 36 36 #include "Length.h" 37 37 #include "MouseEvent.h" 38 #include "NodeRenderingContext.h"39 38 #include "RenderFrameSet.h" 40 39 #include "ScriptEventListener.h" -
trunk/Source/WebCore/html/HTMLIFrameElement.cpp
r154358 r154371 31 31 #include "HTMLDocument.h" 32 32 #include "HTMLNames.h" 33 #include "NodeRenderingContext.h"34 33 #include "RenderIFrame.h" 35 34 #include "ScriptableDocumentParser.h" -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r154365 r154371 68 68 #include "MouseEvent.h" 69 69 #include "MIMETypeRegistry.h" 70 #include "NodeRenderingContext.h"71 70 #include "Page.h" 72 71 #include "PageActivityAssertionToken.h" … … 577 576 } 578 577 579 bool HTMLMediaElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const578 bool HTMLMediaElement::childShouldCreateRenderer(const Node* child) const 580 579 { 581 580 if (!hasMediaControls()) … … 585 584 // One exception is a shadow tree built for rendering controls which should be visible. 586 585 // So we let them go here by comparing its subtree root with one of the controls. 587 return (mediaControls()->treeScope() == childContext.node()->treeScope() 588 && childContext.isOnUpperEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext)); 586 return mediaControls()->treeScope() == child->treeScope() 587 && hasShadowRootParent(child) 588 && HTMLElement::childShouldCreateRenderer(child); 589 589 } 590 590 -
trunk/Source/WebCore/html/HTMLMediaElement.h
r154365 r154371 435 435 virtual bool rendererIsNeeded(const RenderStyle&); 436 436 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 437 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;437 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 438 438 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 439 439 virtual void removedFrom(ContainerNode*) OVERRIDE; -
trunk/Source/WebCore/html/HTMLMeterElement.cpp
r154365 r154371 27 27 #include "ExceptionCode.h" 28 28 #include "FormDataList.h" 29 #include "NodeRenderingContext.h"30 29 #include "HTMLFormElement.h" 31 30 #include "HTMLNames.h" … … 66 65 } 67 66 68 bool HTMLMeterElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const69 { 70 return childContext.isOnUpperEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext);67 bool HTMLMeterElement::childShouldCreateRenderer(const Node* child) const 68 { 69 return hasShadowRootParent(child) && HTMLElement::childShouldCreateRenderer(child); 71 70 } 72 71 -
trunk/Source/WebCore/html/HTMLMeterElement.h
r154365 r154371 74 74 virtual bool recalcWillValidate() const { return false; } 75 75 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 76 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;76 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 77 77 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 78 78 -
trunk/Source/WebCore/html/HTMLOptGroupElement.cpp
r154254 r154371 31 31 #include "RenderMenuList.h" 32 32 #include "NodeRenderStyle.h" 33 #include "NodeRenderingContext.h"34 33 #include "StyleResolver.h" 35 34 #include <wtf/StdLibExtras.h> -
trunk/Source/WebCore/html/HTMLOptGroupElement.h
r154365 r154371 64 64 }; 65 65 66 inline bool isHTMLOptGroupElement( Node* node)66 inline bool isHTMLOptGroupElement(const Node* node) 67 67 { 68 68 return node->hasTagName(HTMLNames::optgroupTag); 69 69 } 70 70 71 inline bool isHTMLOptGroupElement( Element* element)71 inline bool isHTMLOptGroupElement(const Element* element) 72 72 { 73 73 return element->hasTagName(HTMLNames::optgroupTag); -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r154254 r154371 37 37 #include "HTMLSelectElement.h" 38 38 #include "NodeRenderStyle.h" 39 #include "NodeRenderingContext.h"40 39 #include "NodeTraversal.h" 41 40 #include "RenderMenuList.h" -
trunk/Source/WebCore/html/HTMLOptionElement.h
r154365 r154371 96 96 }; 97 97 98 inline bool isHTMLOptionElement( Node* node)98 inline bool isHTMLOptionElement(const Node* node) 99 99 { 100 100 return node->hasTagName(HTMLNames::optionTag); 101 101 } 102 102 103 inline bool isHTMLOptionElement( Element* element)103 inline bool isHTMLOptionElement(const Element* element) 104 104 { 105 105 return element->hasTagName(HTMLNames::optionTag); -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r154365 r154371 29 29 #include "HTMLNames.h" 30 30 #include "HTMLParserIdioms.h" 31 #include "NodeRenderingContext.h"32 31 #include "ProgressShadowElement.h" 33 32 #include "RenderProgress.h" … … 68 67 } 69 68 70 bool HTMLProgressElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const69 bool HTMLProgressElement::childShouldCreateRenderer(const Node* child) const 71 70 { 72 return childContext.isOnUpperEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext);71 return hasShadowRootParent(child) && HTMLElement::childShouldCreateRenderer(child); 73 72 } 74 73 -
trunk/Source/WebCore/html/HTMLProgressElement.h
r154365 r154371 56 56 57 57 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 58 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;58 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 59 59 RenderProgress* renderProgress() const; 60 60 -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r154365 r154371 48 48 #include "LocalizedStrings.h" 49 49 #include "MouseEvent.h" 50 #include "NodeRenderingContext.h"51 50 #include "Page.h" 52 51 #include "PlatformMouseEvent.h" … … 346 345 } 347 346 348 bool HTMLSelectElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const349 { 350 if (!HTMLFormControlElementWithState::childShouldCreateRenderer(child Context))347 bool HTMLSelectElement::childShouldCreateRenderer(const Node* child) const 348 { 349 if (!HTMLFormControlElementWithState::childShouldCreateRenderer(child)) 351 350 return false; 352 351 if (!usesMenuList()) 353 return isHTMLOptionElement(child Context.node()) || isHTMLOptGroupElement(childContext.node()) || validationMessageShadowTreeContains(childContext.node());354 return validationMessageShadowTreeContains(child Context.node());352 return isHTMLOptionElement(child) || isHTMLOptGroupElement(child) || validationMessageShadowTreeContains(child); 353 return validationMessageShadowTreeContains(child); 355 354 } 356 355 -
trunk/Source/WebCore/html/HTMLSelectElement.h
r154365 r154371 129 129 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; 130 130 131 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;131 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 132 132 virtual RenderObject* createRenderer(RenderArena*, RenderStyle *); 133 133 virtual bool appendFormData(FormDataList&, bool); -
trunk/Source/WebCore/html/HTMLSummaryElement.cpp
r154365 r154371 29 29 #include "KeyboardEvent.h" 30 30 #include "MouseEvent.h" 31 #include "NodeRenderingContext.h"32 31 #include "PlatformMouseEvent.h" 33 32 #include "RenderBlock.h" … … 72 71 } 73 72 74 bool HTMLSummaryElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const73 bool HTMLSummaryElement::childShouldCreateRenderer(const Node* child) const 75 74 { 76 if (child Context.node()->isPseudoElement())77 return HTMLElement::childShouldCreateRenderer(child Context);75 if (child->isPseudoElement()) 76 return HTMLElement::childShouldCreateRenderer(child); 78 77 79 return childContext.isOnEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext);78 return hasShadowRootOrActiveInsertionPointParent(child) && HTMLElement::childShouldCreateRenderer(child); 80 79 } 81 80 -
trunk/Source/WebCore/html/HTMLSummaryElement.h
r154365 r154371 38 38 39 39 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 40 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;40 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 41 41 virtual void defaultEventHandler(Event*); 42 42 -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r154365 r154371 39 39 #include "HTMLInputElement.h" 40 40 #include "HTMLNames.h" 41 #include "NodeRenderingContext.h"42 41 #include "NodeTraversal.h" 43 42 #include "RenderBox.h" … … 45 44 #include "RenderTheme.h" 46 45 #include "ScriptEventListener.h" 46 #include "ShadowRoot.h" 47 47 #include "Text.h" 48 48 #include "TextIterator.h" … … 67 67 } 68 68 69 bool HTMLTextFormControlElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const69 bool HTMLTextFormControlElement::childShouldCreateRenderer(const Node* child) const 70 70 { 71 71 // FIXME: We shouldn't force the pseudo elements down into the shadow, but 72 72 // this perserves the current behavior of WebKit. 73 if (child Context.node()->isPseudoElement())74 return HTMLFormControlElementWithState::childShouldCreateRenderer(child Context);75 return childContext.isOnEncapsulationBoundary() && HTMLFormControlElementWithState::childShouldCreateRenderer(childContext);73 if (child->isPseudoElement()) 74 return HTMLFormControlElementWithState::childShouldCreateRenderer(child); 75 return hasShadowRootParent(child) && HTMLFormControlElementWithState::childShouldCreateRenderer(child); 76 76 } 77 77 … … 627 627 ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOffsetInAnchor 628 628 || position.containerNode() || !position.anchorNode()->shadowHost() 629 || (position.anchorNode()->parentNode() && position.anchorNode()->parentNode()->isShadowRoot()));629 || hasShadowRootParent(position.anchorNode())); 630 630 631 631 Node* container = position.containerNode(); -
trunk/Source/WebCore/html/HTMLTextFormControlElement.h
r154365 r154371 119 119 virtual void dispatchFocusEvent(PassRefPtr<Element> oldFocusedElement, FocusDirection) OVERRIDE FINAL; 120 120 virtual void dispatchBlurEvent(PassRefPtr<Element> newFocusedElement) OVERRIDE FINAL; 121 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;121 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 122 122 123 123 // Returns true if user-editable value is empty. Used to check placeholder visibility. -
trunk/Source/WebCore/html/ValidationMessage.cpp
r154365 r154371 227 227 } 228 228 229 bool ValidationMessage::shadowTreeContains( Node* node) const229 bool ValidationMessage::shadowTreeContains(const Node* node) const 230 230 { 231 231 if (validationMessageClient() || !m_bubble) -
trunk/Source/WebCore/html/ValidationMessage.h
r154365 r154371 55 55 void requestToHideMessage(); 56 56 bool isVisible() const; 57 bool shadowTreeContains( Node*) const;57 bool shadowTreeContains(const Node*) const; 58 58 59 59 private: -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r154365 r154371 89 89 } 90 90 91 bool InsertionPoint::isShadowBoundary() const92 {93 return treeScope()->rootNode()->isShadowRoot() && isActive();94 }95 96 91 bool InsertionPoint::isActive() const 97 92 { … … 110 105 bool InsertionPoint::rendererIsNeeded(const RenderStyle& style) 111 106 { 112 return !is ShadowBoundary() && HTMLElement::rendererIsNeeded(style);107 return !isActive() && HTMLElement::rendererIsNeeded(style); 113 108 } 114 109 -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r154365 r154371 57 57 void setHasDistribution() { m_hasDistribution = true; } 58 58 void clearDistribution() { m_hasDistribution = false; } 59 bool isShadowBoundary() const;60 59 bool isActive() const; 61 60 … … 100 99 inline bool isActiveInsertionPoint(const Node* node) 101 100 { 102 return node->isInsertionPoint() && toInsertionPoint(node)->isActive(); 103 } 104 105 inline bool isLowerEncapsulationBoundary(Node* node) 106 { 107 if (!node || !node->isInsertionPoint()) 108 return false; 109 return toInsertionPoint(node)->isShadowBoundary(); 101 return node && node->isInsertionPoint() && toInsertionPoint(node)->isActive(); 110 102 } 111 103 … … 144 136 InsertionPoint* findInsertionPointOf(const Node*); 145 137 138 inline bool hasShadowRootOrActiveInsertionPointParent(const Node* node) 139 { 140 return hasShadowRootParent(node) 141 || isActiveInsertionPoint(findInsertionPointOf(node)) 142 || isActiveInsertionPoint(node->parentNode()); 143 } 144 146 145 } // namespace WebCore 147 146 -
trunk/Source/WebCore/svg/SVGAElement.cpp
r154365 r154371 38 38 #include "KeyboardEvent.h" 39 39 #include "MouseEvent.h" 40 #include "NodeRenderingContext.h"41 40 #include "PlatformMouseEvent.h" 42 41 #include "RenderSVGInline.h" … … 225 224 } 226 225 227 bool SVGAElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const226 bool SVGAElement::childShouldCreateRenderer(const Node* child) const 228 227 { 229 228 // http://www.w3.org/2003/01/REC-SVG11-20030114-errata#linking-text-environment 230 229 // The 'a' element may contain any element that its parent may contain, except itself. 231 if (child Context.node()->hasTagName(SVGNames::aTag))230 if (child->hasTagName(SVGNames::aTag)) 232 231 return false; 233 232 if (parentNode() && parentNode()->isSVGElement()) 234 return parentNode()->childShouldCreateRenderer(child Context);235 236 return SVGElement::childShouldCreateRenderer(child Context);233 return parentNode()->childShouldCreateRenderer(child); 234 235 return SVGElement::childShouldCreateRenderer(child); 237 236 } 238 237 -
trunk/Source/WebCore/svg/SVGAElement.h
r154365 r154371 59 59 virtual bool isURLAttribute(const Attribute&) const; 60 60 61 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;61 virtual bool childShouldCreateRenderer(const Node*) const; 62 62 63 63 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAElement) -
trunk/Source/WebCore/svg/SVGAltGlyphElement.cpp
r154365 r154371 27 27 28 28 #include "ExceptionCode.h" 29 #include "NodeRenderingContext.h"30 29 #include "RenderInline.h" 31 30 #include "RenderSVGTSpan.h" … … 77 76 } 78 77 79 bool SVGAltGlyphElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const78 bool SVGAltGlyphElement::childShouldCreateRenderer(const Node* child) const 80 79 { 81 if (child Context.node()->isTextNode())80 if (child->isTextNode()) 82 81 return true; 83 82 return false; -
trunk/Source/WebCore/svg/SVGAltGlyphElement.h
r154365 r154371 48 48 49 49 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 50 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;50 virtual bool childShouldCreateRenderer(const Node*) const; 51 51 52 52 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAltGlyphElement) -
trunk/Source/WebCore/svg/SVGDocument.cpp
r154365 r154371 26 26 #include "ExceptionCode.h" 27 27 #include "FrameView.h" 28 #include "NodeRenderingContext.h"29 28 #include "RenderView.h" 30 29 #include "SVGElement.h" … … 95 94 } 96 95 97 bool SVGDocument::childShouldCreateRenderer(const Node RenderingContext& childContext) const96 bool SVGDocument::childShouldCreateRenderer(const Node* child) const 98 97 { 99 if (child Context.node()->hasTagName(SVGNames::svgTag))100 return toSVGSVGElement(child Context.node())->isValid();98 if (child->hasTagName(SVGNames::svgTag)) 99 return toSVGSVGElement(child)->isValid(); 101 100 return true; 102 101 } -
trunk/Source/WebCore/svg/SVGDocument.h
r154365 r154371 52 52 SVGDocument(Frame*, const KURL&); 53 53 54 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;54 virtual bool childShouldCreateRenderer(const Node*) const; 55 55 56 56 FloatPoint m_translate; -
trunk/Source/WebCore/svg/SVGElement.cpp
r154365 r154371 32 32 #include "Event.h" 33 33 #include "HTMLNames.h" 34 #include "NodeRenderingContext.h"35 34 #include "RenderObject.h" 36 35 #include "SVGCursorElement.h" … … 523 522 } 524 523 525 bool SVGElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const524 bool SVGElement::childShouldCreateRenderer(const Node* child) const 526 525 { 527 526 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, invalidTextContent, ()); … … 535 534 invalidTextContent.add(SVGNames::tspanTag); 536 535 } 537 if (child Context.node()->isSVGElement()) {538 SVGElement* svgChild = toSVGElement(childContext.node());536 if (child->isSVGElement()) { 537 const SVGElement* svgChild = toSVGElement(child); 539 538 if (invalidTextContent.contains(svgChild->tagQName())) 540 539 return false; -
trunk/Source/WebCore/svg/SVGElement.h
r154365 r154371 132 132 virtual void finishParsingChildren(); 133 133 virtual void attributeChanged(const QualifiedName&, const AtomicString&, AttributeModificationReason = ModifiedDirectly) OVERRIDE; 134 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;134 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 135 135 136 136 virtual void removedFrom(ContainerNode*) OVERRIDE; -
trunk/Source/WebCore/svg/SVGFilterElement.cpp
r154365 r154371 28 28 29 29 #include "Attr.h" 30 #include "NodeRenderingContext.h"31 30 #include "RenderSVGResourceFilter.h" 32 31 #include "SVGElementInstance.h" … … 195 194 } 196 195 197 bool SVGFilterElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const198 { 199 if (!child Context.node()->isSVGElement())196 bool SVGFilterElement::childShouldCreateRenderer(const Node* child) const 197 { 198 if (!child->isSVGElement()) 200 199 return false; 201 200 202 SVGElement* svgElement = toSVGElement(childContext.node());201 const SVGElement* svgElement = toSVGElement(child); 203 202 204 203 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, allowedChildElementTags, ()); -
trunk/Source/WebCore/svg/SVGFilterElement.h
r154365 r154371 56 56 57 57 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE; 58 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE;58 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE; 59 59 60 60 virtual bool selfHasRelativeLengths() const; -
trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
r154365 r154371 71 71 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE; 72 72 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; 73 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const OVERRIDE { return false; }73 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE { return false; } 74 74 75 75 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) -
trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp
r154365 r154371 26 26 #include "Attribute.h" 27 27 #include "CSSPropertyNames.h" 28 #include "NodeRenderingContext.h"29 28 #include "RenderSVGForeignObject.h" 30 29 #include "RenderSVGResource.h" … … 133 132 } 134 133 135 bool SVGForeignObjectElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const134 bool SVGForeignObjectElement::childShouldCreateRenderer(const Node* child) const 136 135 { 137 136 // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS"> subdocuments. 138 if (child Context.node()->isSVGElement())139 return child Context.node()->hasTagName(SVGNames::svgTag);137 if (child->isSVGElement()) 138 return child->hasTagName(SVGNames::svgTag); 140 139 141 140 // Skip over SVG rules which disallow non-SVG kids 142 return StyledElement::childShouldCreateRenderer(child Context);141 return StyledElement::childShouldCreateRenderer(child); 143 142 } 144 143 -
trunk/Source/WebCore/svg/SVGForeignObjectElement.h
r154365 r154371 44 44 45 45 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; 46 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;46 virtual bool childShouldCreateRenderer(const Node*) const; 47 47 virtual RenderObject* createRenderer(RenderArena* arena, RenderStyle* style); 48 48 -
trunk/Source/WebCore/svg/SVGSVGElement.h
r154365 r154371 193 193 } 194 194 195 inline const SVGSVGElement* toSVGSVGElement(const Node* node) 196 { 197 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement()); 198 ASSERT_WITH_SECURITY_IMPLICATION(!node || toSVGElement(node)->isSVGSVGElement()); 199 return static_cast<const SVGSVGElement*>(node); 200 } 201 195 202 } // namespace WebCore 196 203 -
trunk/Source/WebCore/svg/SVGSwitchElement.cpp
r154365 r154371 24 24 #include "SVGSwitchElement.h" 25 25 26 #include "NodeRenderingContext.h"27 26 #include "RenderSVGTransformableContainer.h" 28 27 #include "SVGNames.h" … … 50 49 } 51 50 52 bool SVGSwitchElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const51 bool SVGSwitchElement::childShouldCreateRenderer(const Node* child) const 53 52 { 54 53 // FIXME: This function does not do what the comment below implies it does. … … 62 61 continue; 63 62 64 return node == child Context.node(); // Only allow this child if it's the first valid child63 return node == child; // Only allow this child if it's the first valid child 65 64 } 66 65 -
trunk/Source/WebCore/svg/SVGSwitchElement.h
r154365 r154371 40 40 virtual bool supportsFocus() const OVERRIDE { return true; } 41 41 42 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;42 virtual bool childShouldCreateRenderer(const Node*) const; 43 43 44 44 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/svg/SVGTRefElement.cpp
r154365 r154371 29 29 #include "ExceptionCodePlaceholder.h" 30 30 #include "MutationEvent.h" 31 #include "NodeRenderingContext.h"32 31 #include "RenderSVGInline.h" 33 32 #include "RenderSVGInlineText.h" … … 227 226 } 228 227 229 bool SVGTRefElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const230 { 231 return child Context.node()->isInShadowTree();228 bool SVGTRefElement::childShouldCreateRenderer(const Node* child) const 229 { 230 return child->isInShadowTree(); 232 231 } 233 232 -
trunk/Source/WebCore/svg/SVGTRefElement.h
r154365 r154371 46 46 47 47 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 48 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;48 virtual bool childShouldCreateRenderer(const Node*) const; 49 49 virtual bool rendererIsNeeded(const RenderStyle&); 50 50 -
trunk/Source/WebCore/svg/SVGTSpanElement.cpp
r154365 r154371 24 24 #include "SVGTSpanElement.h" 25 25 26 #include "NodeRenderingContext.h"27 26 #include "RenderInline.h" 28 27 #include "RenderSVGTSpan.h" … … 47 46 } 48 47 49 bool SVGTSpanElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const48 bool SVGTSpanElement::childShouldCreateRenderer(const Node* child) const 50 49 { 51 if (child Context.node()->isTextNode()52 || child Context.node()->hasTagName(SVGNames::aTag)50 if (child->isTextNode() 51 || child->hasTagName(SVGNames::aTag) 53 52 #if ENABLE(SVG_FONTS) 54 || child Context.node()->hasTagName(SVGNames::altGlyphTag)53 || child->hasTagName(SVGNames::altGlyphTag) 55 54 #endif 56 || child Context.node()->hasTagName(SVGNames::trefTag)57 || child Context.node()->hasTagName(SVGNames::tspanTag))55 || child->hasTagName(SVGNames::trefTag) 56 || child->hasTagName(SVGNames::tspanTag)) 58 57 return true; 59 58 -
trunk/Source/WebCore/svg/SVGTSpanElement.h
r154365 r154371 35 35 36 36 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 37 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;37 virtual bool childShouldCreateRenderer(const Node*) const; 38 38 virtual bool rendererIsNeeded(const RenderStyle&); 39 39 }; -
trunk/Source/WebCore/svg/SVGTextElement.cpp
r154365 r154371 25 25 26 26 #include "Attribute.h" 27 #include "NodeRenderingContext.h"28 27 #include "RenderSVGResource.h" 29 28 #include "RenderSVGText.h" … … 75 74 } 76 75 77 bool SVGTextElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const76 bool SVGTextElement::childShouldCreateRenderer(const Node* child) const 78 77 { 79 if (child Context.node()->isTextNode()80 || child Context.node()->hasTagName(SVGNames::aTag)78 if (child->isTextNode() 79 || child->hasTagName(SVGNames::aTag) 81 80 #if ENABLE(SVG_FONTS) 82 || child Context.node()->hasTagName(SVGNames::altGlyphTag)81 || child->hasTagName(SVGNames::altGlyphTag) 83 82 #endif 84 || child Context.node()->hasTagName(SVGNames::textPathTag)85 || child Context.node()->hasTagName(SVGNames::trefTag)86 || child Context.node()->hasTagName(SVGNames::tspanTag))83 || child->hasTagName(SVGNames::textPathTag) 84 || child->hasTagName(SVGNames::trefTag) 85 || child->hasTagName(SVGNames::tspanTag)) 87 86 return true; 88 87 -
trunk/Source/WebCore/svg/SVGTextElement.h
r154365 r154371 39 39 40 40 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 41 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;41 virtual bool childShouldCreateRenderer(const Node*) const; 42 42 }; 43 43 -
trunk/Source/WebCore/svg/SVGTextPathElement.cpp
r154365 r154371 25 25 26 26 #include "Attribute.h" 27 #include "NodeRenderingContext.h"28 27 #include "RenderSVGResource.h" 29 28 #include "RenderSVGTextPath.h" … … 135 134 } 136 135 137 bool SVGTextPathElement::childShouldCreateRenderer(const Node RenderingContext& childContext) const138 { 139 if (child Context.node()->isTextNode()140 || child Context.node()->hasTagName(SVGNames::aTag)141 || child Context.node()->hasTagName(SVGNames::trefTag)142 || child Context.node()->hasTagName(SVGNames::tspanTag))136 bool SVGTextPathElement::childShouldCreateRenderer(const Node* child) const 137 { 138 if (child->isTextNode() 139 || child->hasTagName(SVGNames::aTag) 140 || child->hasTagName(SVGNames::trefTag) 141 || child->hasTagName(SVGNames::tspanTag)) 143 142 return true; 144 143 -
trunk/Source/WebCore/svg/SVGTextPathElement.h
r154365 r154371 129 129 130 130 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 131 virtual bool childShouldCreateRenderer(const Node RenderingContext&) const;131 virtual bool childShouldCreateRenderer(const Node*) const; 132 132 virtual bool rendererIsNeeded(const RenderStyle&); 133 133 -
trunk/Source/WebCore/testing/Internals.cpp
r154348 r154371 73 73 #include "MemoryCache.h" 74 74 #include "MemoryInfo.h" 75 #include "NodeRenderingContext.h"76 75 #include "Page.h" 77 76 #include "PrintContext.h"
Note: See TracChangeset
for help on using the changeset viewer.