Changeset 154957 in webkit
- Timestamp:
- Sep 2, 2013, 8:17:50 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 68 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r154955 r154957 1 2013-09-02 Antti Koivisto <antti@apple.com> 2 3 Clean up ContainerNode::childrenChanged 4 https://bugs.webkit.org/show_bug.cgi?id=120599 5 6 Reviewed by Andreas Kling. 7 8 - Make childrenChanged take a single struct argument instead of a long list of arguments. 9 - Use enum instead of childCountDelta. It was always -1, 0, 1 or the total number of children (in case of removing them all). 10 - Remove use of Node*, give the change range as Elements. 11 - Related cleanups. 12 13 * dom/Attr.cpp: 14 (WebCore::Attr::childrenChanged): 15 * dom/Attr.h: 16 * dom/CharacterData.cpp: 17 (WebCore::CharacterData::parserAppendData): 18 (WebCore::CharacterData::dispatchModifiedEvent): 19 * dom/ContainerNode.cpp: 20 (WebCore::ContainerNode::insertBefore): 21 (WebCore::ContainerNode::notifyChildInserted): 22 (WebCore::ContainerNode::notifyChildRemoved): 23 24 Add private helpers for setting up the struct. 25 26 (WebCore::ContainerNode::parserInsertBefore): 27 (WebCore::ContainerNode::replaceChild): 28 (WebCore::ContainerNode::removeChild): 29 (WebCore::ContainerNode::parserRemoveChild): 30 (WebCore::ContainerNode::removeChildren): 31 (WebCore::ContainerNode::appendChild): 32 (WebCore::ContainerNode::parserAppendChild): 33 (WebCore::ContainerNode::childrenChanged): 34 (WebCore::ContainerNode::updateTreeAfterInsertion): 35 * dom/ContainerNode.h: 36 * dom/Document.cpp: 37 (WebCore::Document::childrenChanged): 38 * dom/Document.h: 39 * dom/Element.cpp: 40 (WebCore::checkForSiblingStyleChanges): 41 42 Clean up and simplify. Since we now get element range automatically we don't need to compute it. 43 44 (WebCore::Element::childrenChanged): 45 (WebCore::Element::finishParsingChildren): 46 * dom/Element.h: 47 * dom/ShadowRoot.cpp: 48 (WebCore::ShadowRoot::childrenChanged): 49 * dom/ShadowRoot.h: 50 * html/HTMLElement.cpp: 51 (WebCore::HTMLElement::childrenChanged): 52 (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged): 53 54 Try to keep the existing behavior. This code needs more cleanup to be sane. It shouldn't operate on Nodes 55 as it only really cares about Elements. 56 57 * html/HTMLElement.h: 58 * html/HTMLFieldSetElement.cpp: 59 (WebCore::HTMLFieldSetElement::childrenChanged): 60 * html/HTMLFieldSetElement.h: 61 * html/HTMLObjectElement.cpp: 62 (WebCore::HTMLObjectElement::childrenChanged): 63 * html/HTMLObjectElement.h: 64 * html/HTMLOptGroupElement.cpp: 65 (WebCore::HTMLOptGroupElement::childrenChanged): 66 * html/HTMLOptGroupElement.h: 67 * html/HTMLOptionElement.cpp: 68 (WebCore::HTMLOptionElement::childrenChanged): 69 * html/HTMLOptionElement.h: 70 * html/HTMLOutputElement.cpp: 71 (WebCore::HTMLOutputElement::childrenChanged): 72 * html/HTMLOutputElement.h: 73 * html/HTMLScriptElement.cpp: 74 (WebCore::HTMLScriptElement::childrenChanged): 75 * html/HTMLScriptElement.h: 76 * html/HTMLSelectElement.cpp: 77 (WebCore::HTMLSelectElement::childrenChanged): 78 * html/HTMLSelectElement.h: 79 * html/HTMLStyleElement.cpp: 80 (WebCore::HTMLStyleElement::childrenChanged): 81 * html/HTMLStyleElement.h: 82 * html/HTMLTextAreaElement.cpp: 83 (WebCore::HTMLTextAreaElement::childrenChanged): 84 * html/HTMLTextAreaElement.h: 85 * html/HTMLTitleElement.cpp: 86 (WebCore::HTMLTitleElement::childrenChanged): 87 * html/HTMLTitleElement.h: 88 * html/shadow/InsertionPoint.cpp: 89 (WebCore::InsertionPoint::childrenChanged): 90 * html/shadow/InsertionPoint.h: 91 * svg/SVGClipPathElement.cpp: 92 (WebCore::SVGClipPathElement::childrenChanged): 93 * svg/SVGClipPathElement.h: 94 * svg/SVGElement.cpp: 95 (WebCore::SVGElement::childrenChanged): 96 * svg/SVGElement.h: 97 * svg/SVGFELightElement.cpp: 98 (WebCore::SVGFELightElement::childrenChanged): 99 * svg/SVGFELightElement.h: 100 * svg/SVGFilterElement.cpp: 101 (WebCore::SVGFilterElement::childrenChanged): 102 * svg/SVGFilterElement.h: 103 * svg/SVGFilterPrimitiveStandardAttributes.cpp: 104 (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged): 105 * svg/SVGFilterPrimitiveStandardAttributes.h: 106 * svg/SVGFontFaceElement.cpp: 107 (WebCore::SVGFontFaceElement::childrenChanged): 108 * svg/SVGFontFaceElement.h: 109 * svg/SVGFontFaceFormatElement.cpp: 110 (WebCore::SVGFontFaceFormatElement::childrenChanged): 111 * svg/SVGFontFaceFormatElement.h: 112 * svg/SVGFontFaceSrcElement.cpp: 113 (WebCore::SVGFontFaceSrcElement::childrenChanged): 114 * svg/SVGFontFaceSrcElement.h: 115 * svg/SVGFontFaceUriElement.cpp: 116 (WebCore::SVGFontFaceUriElement::childrenChanged): 117 * svg/SVGFontFaceUriElement.h: 118 * svg/SVGGradientElement.cpp: 119 (WebCore::SVGGradientElement::childrenChanged): 120 * svg/SVGGradientElement.h: 121 * svg/SVGMarkerElement.cpp: 122 (WebCore::SVGMarkerElement::childrenChanged): 123 * svg/SVGMarkerElement.h: 124 * svg/SVGMaskElement.cpp: 125 (WebCore::SVGMaskElement::childrenChanged): 126 * svg/SVGMaskElement.h: 127 * svg/SVGPatternElement.cpp: 128 (WebCore::SVGPatternElement::childrenChanged): 129 * svg/SVGPatternElement.h: 130 * svg/SVGScriptElement.cpp: 131 (WebCore::SVGScriptElement::childrenChanged): 132 * svg/SVGScriptElement.h: 133 * svg/SVGStyleElement.cpp: 134 (WebCore::SVGStyleElement::childrenChanged): 135 * svg/SVGStyleElement.h: 136 * svg/SVGTitleElement.cpp: 137 (WebCore::SVGTitleElement::childrenChanged): 138 * svg/SVGTitleElement.h: 139 1 140 2013-09-02 Andreas Kling <akling@apple.com> 2 141 -
trunk/Source/WebCore/dom/Attr.cpp
r154877 r154957 160 160 } 161 161 162 void Attr::childrenChanged( bool, Node*, Node*, int)162 void Attr::childrenChanged(const ChildChange&) 163 163 { 164 164 if (m_ignoreChildrenChanged > 0) -
trunk/Source/WebCore/dom/Attr.h
r149974 r154957 87 87 virtual bool childTypeAllowed(NodeType) const; 88 88 89 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);89 virtual void childrenChanged(const ChildChange&) OVERRIDE; 90 90 91 91 Attribute& elementAttribute(); -
trunk/Source/WebCore/dom/CharacterData.cpp
r154877 r154957 24 24 25 25 #include "Document.h" 26 #include "ElementTraversal.h" 26 27 #include "EventNames.h" 27 28 #include "ExceptionCode.h" … … 97 98 // We don't call dispatchModifiedEvent here because we don't want the 98 99 // parser to dispatch DOM mutation events. 99 if (parentNode()) 100 parentNode()->childrenChanged(); 100 if (parentNode()) { 101 ContainerNode::ChildChange change = { 102 ContainerNode::TextChanged, 103 ElementTraversal::previousSibling(this), 104 ElementTraversal::nextSibling(this), 105 ContainerNode::ChildChangeSourceParser 106 }; 107 parentNode()->childrenChanged(change); 108 } 101 109 102 110 return characterLengthLimit; … … 206 214 mutationRecipients->enqueueMutationRecord(MutationRecord::createCharacterData(this, oldData)); 207 215 if (!isInShadowTree()) { 208 if (parentNode()) 209 parentNode()->childrenChanged(); 216 if (parentNode()) { 217 ContainerNode::ChildChange change = { 218 ContainerNode::TextChanged, 219 ElementTraversal::previousSibling(this), 220 ElementTraversal::nextSibling(this), 221 ContainerNode::ChildChangeSourceAPI 222 }; 223 parentNode()->childrenChanged(change); 224 } 210 225 if (document().hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER)) 211 226 dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, 0, oldData, m_data)); -
trunk/Source/WebCore/dom/ContainerNode.cpp
r154903 r154957 30 30 #include "ContainerNodeAlgorithms.h" 31 31 #include "Editor.h" 32 #include "ElementTraversal.h" 32 33 #include "EventNames.h" 33 34 #include "ExceptionCode.h" … … 67 68 static void dispatchChildInsertionEvents(Node*); 68 69 static void dispatchChildRemovalEvents(Node*); 69 static void updateTreeAfterInsertion(ContainerNode*, Node*, AttachBehavior);70 70 71 71 typedef pair<RefPtr<Node>, unsigned> CallbackParameters; … … 316 316 insertBeforeCommon(next.get(), child); 317 317 318 updateTreeAfterInsertion( this,child, attachBehavior);318 updateTreeAfterInsertion(child, attachBehavior); 319 319 } 320 320 … … 349 349 } 350 350 351 void ContainerNode::notifyChildInserted(Node* child, ChildChangeSource source) 352 { 353 ChildChange change; 354 change.type = child->isElementNode() ? ElementInserted : child->isTextNode() ? TextInserted : NonContentsChildChanged; 355 change.previousSiblingElement = ElementTraversal::previousSibling(child); 356 change.nextSiblingElement = ElementTraversal::nextSibling(child); 357 change.source = source; 358 359 childrenChanged(change); 360 } 361 362 void ContainerNode::notifyChildRemoved(Node* child, Node* previousSibling, Node* nextSibling, ChildChangeSource source) 363 { 364 ChildChange change; 365 change.type = child->isElementNode() ? ElementRemoved : child->isTextNode() ? TextRemoved : NonContentsChildChanged; 366 change.previousSiblingElement = (!previousSibling || previousSibling->isElementNode()) ? toElement(previousSibling) : ElementTraversal::previousSibling(previousSibling); 367 change.nextSiblingElement = (!nextSibling || nextSibling->isElementNode()) ? toElement(nextSibling) : ElementTraversal::nextSibling(nextSibling); 368 change.source = source; 369 370 childrenChanged(change); 371 } 372 351 373 void ContainerNode::parserInsertBefore(PassRefPtr<Node> newChild, Node* nextChild) 352 374 { … … 371 393 ChildListMutationScope(this).childAdded(newChild.get()); 372 394 373 childrenChanged(true, newChild->previousSibling(), nextChild, 1); 395 notifyChildInserted(newChild.get(), ChildChangeSourceParser); 396 374 397 ChildNodeInsertionNotifier(this).notify(newChild.get()); 375 398 } … … 455 478 } 456 479 457 updateTreeAfterInsertion( this,child, attachBehavior);480 updateTreeAfterInsertion(child, attachBehavior); 458 481 } 459 482 … … 549 572 Node* next = child->nextSibling(); 550 573 removeBetween(prev, next, child.get()); 551 childrenChanged(false, prev, next, -1); 574 575 notifyChildRemoved(child.get(), prev, next, ChildChangeSourceAPI); 576 552 577 ChildNodeRemovalNotifier(this).notify(child.get()); 553 578 } … … 600 625 removeBetween(prev, next, oldChild); 601 626 602 childrenChanged(true, prev, next, -1); 627 notifyChildRemoved(oldChild, prev, next, ChildChangeSourceParser); 628 603 629 ChildNodeRemovalNotifier(this).notify(oldChild); 604 630 } … … 637 663 } 638 664 639 childrenChanged(false, 0, 0, -static_cast<int>(removedChildren.size())); 665 ChildChange change = { AllChildrenRemoved, nullptr, nullptr, ChildChangeSourceAPI }; 666 childrenChanged(change); 640 667 641 668 for (size_t i = 0; i < removedChildren.size(); ++i) … … 696 723 } 697 724 698 updateTreeAfterInsertion( this,child, attachBehavior);725 updateTreeAfterInsertion(child, attachBehavior); 699 726 } 700 727 … … 715 742 document().adoptNode(newChild.get(), ASSERT_NO_EXCEPTION); 716 743 717 Node* last = m_lastChild;718 744 { 719 745 NoEventDispatchAssertion assertNoEventDispatch; … … 727 753 ChildListMutationScope(this).childAdded(newChild.get()); 728 754 729 childrenChanged(true, last, 0, 1); 755 notifyChildInserted(newChild.get(), ChildChangeSourceParser); 756 730 757 ChildNodeInsertionNotifier(this).notify(newChild.get()); 731 758 } … … 805 832 } 806 833 807 void ContainerNode::childrenChanged( bool changedByParser, Node*, Node*, int childCountDelta)834 void ContainerNode::childrenChanged(const ChildChange& change) 808 835 { 809 836 document().incDOMTreeVersion(); 810 if ( !changedByParser && childCountDelta)837 if (change.source == ChildChangeSourceAPI && change.type != TextChanged) 811 838 document().updateRangesAfterChildrenChanged(this); 812 839 invalidateNodeListCachesInAncestors(); … … 1037 1064 } 1038 1065 1039 static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, AttachBehavior attachBehavior) 1040 { 1041 ASSERT(parent->refCount()); 1066 void ContainerNode::updateTreeAfterInsertion(Node* child, AttachBehavior attachBehavior) 1067 { 1042 1068 ASSERT(child->refCount()); 1043 1069 1044 ChildListMutationScope( parent).childAdded(child);1045 1046 parent->childrenChanged(false, child->previousSibling(), child->nextSibling(), 1);1047 1048 ChildNodeInsertionNotifier( parent).notify(child);1070 ChildListMutationScope(this).childAdded(child); 1071 1072 notifyChildInserted(child, ChildChangeSourceAPI); 1073 1074 ChildNodeInsertionNotifier(this).notify(child); 1049 1075 1050 1076 // FIXME: Attachment should be the first operation in this function, but some code 1051 1077 // (for example, HTMLFormControlElement's autofocus support) requires this ordering. 1052 if ( parent->attached() && !child->attached() && child->parentNode() == parent) {1078 if (attached() && !child->attached() && child->parentNode() == this) { 1053 1079 if (attachBehavior == AttachLazily) { 1054 1080 if (child->isElementNode()) -
trunk/Source/WebCore/dom/ContainerNode.h
r154929 r154957 110 110 virtual void scheduleSetNeedsStyleRecalc(StyleChangeType = FullStyleChange) OVERRIDE FINAL; 111 111 112 // ----------------------------------------------------------------------------- 113 // Notification of document structure changes (see Node.h for more notification methods) 114 115 // Notifies the node that it's list of children have changed (either by adding or removing child nodes), or a child 116 // node that is of the type CDATA_SECTION_NODE, TEXT_NODE or COMMENT_NODE has changed its value. 117 virtual void childrenChanged(bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 112 enum ChildChangeType { ElementInserted, ElementRemoved, TextInserted, TextRemoved, TextChanged, AllChildrenRemoved, NonContentsChildChanged }; 113 enum ChildChangeSource { ChildChangeSourceParser, ChildChangeSourceAPI }; 114 struct ChildChange { 115 ChildChangeType type; 116 Element* previousSiblingElement; 117 Element* nextSiblingElement; 118 ChildChangeSource source; 119 }; 120 virtual void childrenChanged(const ChildChange&); 118 121 119 122 void disconnectDescendantFrames(); … … 147 150 bool getUpperLeftCorner(FloatPoint&) const; 148 151 bool getLowerRightCorner(FloatPoint&) const; 152 153 void notifyChildInserted(Node* child, ChildChangeSource); 154 void notifyChildRemoved(Node* child, Node* previousSibling, Node* nextSibling, ChildChangeSource); 155 156 void updateTreeAfterInsertion(Node* child, AttachBehavior); 149 157 150 158 bool isContainerNode() const WTF_DELETED_FUNCTION; -
trunk/Source/WebCore/dom/Document.cpp
r154929 r154957 773 773 } 774 774 775 void Document::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)776 { 777 ContainerNode::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);775 void Document::childrenChanged(const ChildChange& change) 776 { 777 ContainerNode::childrenChanged(change); 778 778 779 779 Element* newDocumentElement = 0; -
trunk/Source/WebCore/dom/Document.h
r154877 r154957 1202 1202 virtual bool isDocument() const OVERRIDE { return true; } 1203 1203 1204 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);1204 virtual void childrenChanged(const ChildChange&) OVERRIDE; 1205 1205 1206 1206 virtual String nodeName() const; -
trunk/Source/WebCore/dom/Element.cpp
r154903 r154957 1536 1536 } 1537 1537 1538 static void checkForSiblingStyleChanges(Element* e, RenderStyle* style, bool finishedParsingCallback, 1539 Node* beforeChange, Node* afterChange, int childCountDelta) 1540 { 1538 enum SiblingCheckType { FinishedParsingChildren, SiblingElementRemoved, Other }; 1539 1540 static void checkForSiblingStyleChanges(Element* parent, SiblingCheckType checkType, Element* elementBeforeChange, Element* elementAfterChange) 1541 { 1542 RenderStyle* style = parent->renderStyle(); 1541 1543 // :empty selector. 1542 checkForEmptyStyleChange( e, style);1544 checkForEmptyStyleChange(parent, style); 1543 1545 1544 if (!style || ( e->needsStyleRecalc() && e->childrenAffectedByPositionalRules()))1546 if (!style || (parent->needsStyleRecalc() && parent->childrenAffectedByPositionalRules())) 1545 1547 return; 1546 1548 … … 1548 1550 // In the DOM case, we only need to do something if |afterChange| is not 0. 1549 1551 // |afterChange| is 0 in the parser case, so it works out that we'll skip this block. 1550 if ( e->childrenAffectedByFirstChildRules() && afterChange) {1552 if (parent->childrenAffectedByFirstChildRules() && elementAfterChange) { 1551 1553 // Find our new first child. 1552 Node* newFirstChild = 0; 1553 for (newFirstChild = e->firstChild(); newFirstChild && !newFirstChild->isElementNode(); newFirstChild = newFirstChild->nextSibling()) {}; 1554 1554 Element* newFirstElement = ElementTraversal::firstChild(parent); 1555 1555 // Find the first element node following |afterChange| 1556 Node* firstElementAfterInsertion = 0; 1557 for (firstElementAfterInsertion = afterChange; 1558 firstElementAfterInsertion && !firstElementAfterInsertion->isElementNode(); 1559 firstElementAfterInsertion = firstElementAfterInsertion->nextSibling()) {}; 1560 1556 1561 1557 // This is the insert/append case. 1562 if (newFirst Child != firstElementAfterInsertion && firstElementAfterInsertion && firstElementAfterInsertion->attached() &&1563 firstElementAfterInsertion->renderStyle() && firstElementAfterInsertion->renderStyle()->firstChildState())1564 firstElementAfterInsertion->setNeedsStyleRecalc();1558 if (newFirstElement != elementAfterChange && elementAfterChange->attached() 1559 && elementAfterChange->renderStyle() && elementAfterChange->renderStyle()->firstChildState()) 1560 elementAfterChange->setNeedsStyleRecalc(); 1565 1561 1566 1562 // We also have to handle node removal. 1567 if (ch ildCountDelta < 0 && newFirstChild == firstElementAfterInsertion && newFirstChild && (!newFirstChild->renderStyle() || !newFirstChild->renderStyle()->firstChildState()))1568 newFirst Child->setNeedsStyleRecalc();1563 if (checkType == SiblingElementRemoved && newFirstElement == elementAfterChange && newFirstElement && (!newFirstElement->renderStyle() || !newFirstElement->renderStyle()->firstChildState())) 1564 newFirstElement->setNeedsStyleRecalc(); 1569 1565 } 1570 1566 1571 1567 // :last-child. In the parser callback case, we don't have to check anything, since we were right the first time. 1572 1568 // In the DOM case, we only need to do something if |afterChange| is not 0. 1573 if ( e->childrenAffectedByLastChildRules() && beforeChange) {1569 if (parent->childrenAffectedByLastChildRules() && elementBeforeChange) { 1574 1570 // Find our new last child. 1575 Node* newLastChild = 0; 1576 for (newLastChild = e->lastChild(); newLastChild && !newLastChild->isElementNode(); newLastChild = newLastChild->previousSibling()) {}; 1577 1578 // Find the last element node going backwards from |beforeChange| 1579 Node* lastElementBeforeInsertion = 0; 1580 for (lastElementBeforeInsertion = beforeChange; 1581 lastElementBeforeInsertion && !lastElementBeforeInsertion->isElementNode(); 1582 lastElementBeforeInsertion = lastElementBeforeInsertion->previousSibling()) {}; 1583 1584 if (newLastChild != lastElementBeforeInsertion && lastElementBeforeInsertion && lastElementBeforeInsertion->attached() && 1585 lastElementBeforeInsertion->renderStyle() && lastElementBeforeInsertion->renderStyle()->lastChildState()) 1586 lastElementBeforeInsertion->setNeedsStyleRecalc(); 1571 Element* newLastElement = ElementTraversal::lastChild(parent); 1572 1573 if (newLastElement != elementBeforeChange && elementBeforeChange->attached() 1574 && elementBeforeChange->renderStyle() && elementBeforeChange->renderStyle()->lastChildState()) 1575 elementBeforeChange->setNeedsStyleRecalc(); 1587 1576 1588 1577 // We also have to handle node removal. The parser callback case is similar to node removal as well in that we need to change the last child 1589 1578 // to match now. 1590 if ((childCountDelta < 0 || finishedParsingCallback) && newLastChild == lastElementBeforeInsertion && newLastChild && (!newLastChild->renderStyle() || !newLastChild->renderStyle()->lastChildState())) 1591 newLastChild->setNeedsStyleRecalc(); 1579 if ((checkType == SiblingElementRemoved || checkType == FinishedParsingChildren) && newLastElement == elementBeforeChange && newLastElement 1580 && (!newLastElement->renderStyle() || !newLastElement->renderStyle()->lastChildState())) 1581 newLastElement->setNeedsStyleRecalc(); 1592 1582 } 1593 1583 1594 1584 // The + selector. We need to invalidate the first element following the insertion point. It is the only possible element 1595 1585 // that could be affected by this DOM change. 1596 if (e->childrenAffectedByDirectAdjacentRules() && afterChange) { 1597 Node* firstElementAfterInsertion = 0; 1598 for (firstElementAfterInsertion = afterChange; 1599 firstElementAfterInsertion && !firstElementAfterInsertion->isElementNode(); 1600 firstElementAfterInsertion = firstElementAfterInsertion->nextSibling()) {}; 1601 if (firstElementAfterInsertion && firstElementAfterInsertion->attached()) 1602 firstElementAfterInsertion->setNeedsStyleRecalc(); 1586 if (parent->childrenAffectedByDirectAdjacentRules() && elementAfterChange) { 1587 if (elementAfterChange->attached()) 1588 elementAfterChange->setNeedsStyleRecalc(); 1603 1589 } 1604 1590 … … 1610 1596 // For performance reasons we just mark the parent node as changed, since we don't want to make childrenChanged O(n^2) by crawling all our kids 1611 1597 // here. recalcStyle will then force a walk of the children when it sees that this has happened. 1612 if ((e->childrenAffectedByForwardPositionalRules() && afterChange) 1613 || (e->childrenAffectedByBackwardPositionalRules() && beforeChange)) 1614 e->setNeedsStyleRecalc(); 1615 } 1616 1617 void Element::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) 1618 { 1619 ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); 1620 if (changedByParser) 1598 if (parent->childrenAffectedByForwardPositionalRules() && elementAfterChange) 1599 parent->setNeedsStyleRecalc(); 1600 if (parent->childrenAffectedByBackwardPositionalRules() && elementBeforeChange) 1601 parent->setNeedsStyleRecalc(); 1602 } 1603 1604 void Element::childrenChanged(const ChildChange& change) 1605 { 1606 ContainerNode::childrenChanged(change); 1607 if (change.source == ChildChangeSourceParser) 1621 1608 checkForEmptyStyleChange(this, renderStyle()); 1622 else 1623 checkForSiblingStyleChanges(this, renderStyle(), false, beforeChange, afterChange, childCountDelta); 1609 else { 1610 SiblingCheckType checkType = change.type == ElementRemoved ? SiblingElementRemoved : Other; 1611 checkForSiblingStyleChanges(this, checkType, change.previousSiblingElement, change.nextSiblingElement); 1612 } 1624 1613 1625 1614 if (ShadowRoot* shadowRoot = this->shadowRoot()) … … 1646 1635 ContainerNode::finishParsingChildren(); 1647 1636 setIsParsingChildrenFinished(); 1648 checkForSiblingStyleChanges(this, renderStyle(), true, lastChild(), 0, 0);1637 checkForSiblingStyleChanges(this, FinishedParsingChildren, ElementTraversal::lastChild(this), nullptr); 1649 1638 if (StyleResolver* styleResolver = document().styleResolverIfExists()) 1650 1639 styleResolver->popParentElement(this); -
trunk/Source/WebCore/dom/Element.h
r154877 r154957 560 560 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 561 561 virtual void removedFrom(ContainerNode*) OVERRIDE; 562 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;562 virtual void childrenChanged(const ChildChange&) OVERRIDE; 563 563 virtual void removeAllEventListeners() OVERRIDE FINAL; 564 564 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r154903 r154957 149 149 } 150 150 151 void ShadowRoot::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)151 void ShadowRoot::childrenChanged(const ChildChange& change) 152 152 { 153 153 if (isOrphan()) 154 154 return; 155 155 156 ContainerNode::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);156 ContainerNode::childrenChanged(change); 157 157 invalidateDistribution(); 158 158 } -
trunk/Source/WebCore/dom/ShadowRoot.h
r154809 r154957 87 87 virtual void dispose() OVERRIDE; 88 88 virtual bool childTypeAllowed(NodeType) const OVERRIDE; 89 virtual void childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) OVERRIDE;89 virtual void childrenChanged(const ChildChange&) OVERRIDE; 90 90 91 91 // ShadowRoots should never be cloned. -
trunk/Source/WebCore/html/HTMLElement.cpp
r154940 r154957 806 806 } 807 807 808 void HTMLElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)809 { 810 StyledElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);811 adjustDirectionalityIfNeededAfterChildrenChanged( beforeChange, childCountDelta);808 void HTMLElement::childrenChanged(const ChildChange& change) 809 { 810 StyledElement::childrenChanged(change); 811 adjustDirectionalityIfNeededAfterChildrenChanged(change.previousSiblingElement, change.type); 812 812 } 813 813 … … 911 911 } 912 912 913 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeChange, int childCountDelta) 914 { 915 if (document().renderer() && childCountDelta < 0) { 916 Node* node = beforeChange ? NodeTraversal::nextSkippingChildren(beforeChange) : 0; 917 for (int counter = 0; node && counter < childCountDelta; counter++, node = NodeTraversal::nextSkippingChildren(node)) { 913 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChangeType changeType) 914 { 915 // FIXME: This function looks suspicious. 916 if (document().renderer() && (changeType == ElementRemoved || changeType == TextRemoved)) { 917 Node* node = beforeChange ? beforeChange->nextSibling() : 0; 918 for (; node; node = node->nextSibling()) { 918 919 if (elementAffectsDirectionality(node)) 919 920 continue; … … 926 927 return; 927 928 928 Node* oldMarkedNode = beforeChange ? NodeTraversal::nextSkippingChildren(beforeChange) : 0; 929 Node* oldMarkedNode = 0; 930 if (beforeChange) 931 oldMarkedNode = changeType == ElementInserted ? ElementTraversal::nextSibling(beforeChange) : beforeChange->nextSibling(); 932 929 933 while (oldMarkedNode && elementAffectsDirectionality(oldMarkedNode)) 930 oldMarkedNode = NodeTraversal::nextSkippingChildren(oldMarkedNode, this);934 oldMarkedNode = oldMarkedNode->nextSibling(); 931 935 if (oldMarkedNode) 932 936 setHasDirAutoFlagRecursively(oldMarkedNode, false); -
trunk/Source/WebCore/html/HTMLElement.h
r154955 r154957 110 110 unsigned parseBorderWidthAttribute(const AtomicString&) const; 111 111 112 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);112 virtual void childrenChanged(const ChildChange&) OVERRIDE; 113 113 void calculateAndAdjustDirectionality(); 114 114 … … 127 127 void dirAttributeChanged(const AtomicString&); 128 128 void adjustDirectionalityIfNeededAfterChildAttributeChanged(Element* child); 129 void adjustDirectionalityIfNeededAfterChildrenChanged( Node* beforeChange, int childCountDelta);129 void adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChangeType); 130 130 TextDirection directionality(Node** strongDirectionalityTextNode= 0) const; 131 131 -
trunk/Source/WebCore/html/HTMLFieldSetElement.cpp
r154928 r154957 64 64 } 65 65 66 void HTMLFieldSetElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)66 void HTMLFieldSetElement::childrenChanged(const ChildChange& change) 67 67 { 68 HTMLFormControlElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);68 HTMLFormControlElement::childrenChanged(change); 69 69 70 70 auto legendChildren = childrenOfType<HTMLLegendElement>(this); -
trunk/Source/WebCore/html/HTMLFieldSetElement.h
r154955 r154957 53 53 virtual const AtomicString& formControlType() const; 54 54 virtual bool recalcWillValidate() const { return false; } 55 virtual void childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) OVERRIDE;55 virtual void childrenChanged(const ChildChange&) OVERRIDE; 56 56 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } 57 57 -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r154928 r154957 345 345 } 346 346 347 void HTMLObjectElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)347 void HTMLObjectElement::childrenChanged(const ChildChange& change) 348 348 { 349 349 updateDocNamedItem(); … … 352 352 setNeedsStyleRecalc(); 353 353 } 354 HTMLPlugInImageElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);354 HTMLPlugInImageElement::childrenChanged(change); 355 355 } 356 356 -
trunk/Source/WebCore/html/HTMLObjectElement.h
r154761 r154957 77 77 virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE; 78 78 79 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);79 virtual void childrenChanged(const ChildChange&) OVERRIDE; 80 80 81 81 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; -
trunk/Source/WebCore/html/HTMLOptGroupElement.cpp
r154877 r154957 67 67 } 68 68 69 void HTMLOptGroupElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)69 void HTMLOptGroupElement::childrenChanged(const ChildChange& change) 70 70 { 71 71 recalcSelectOptions(); 72 HTMLElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);72 HTMLElement::childrenChanged(change); 73 73 } 74 74 -
trunk/Source/WebCore/html/HTMLOptGroupElement.h
r154955 r154957 50 50 virtual void willDetachRenderers() OVERRIDE; 51 51 52 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);52 virtual void childrenChanged(const ChildChange&) OVERRIDE; 53 53 54 54 virtual void accessKeyAction(bool sendMouseEvents); -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r154877 r154957 254 254 } 255 255 256 void HTMLOptionElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)256 void HTMLOptionElement::childrenChanged(const ChildChange& change) 257 257 { 258 258 #if ENABLE(DATALIST_ELEMENT) … … 263 263 if (HTMLSelectElement* select = ownerSelectElement()) 264 264 select->optionElementChildrenChanged(); 265 HTMLElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);265 HTMLElement::childrenChanged(change); 266 266 } 267 267 -
trunk/Source/WebCore/html/HTMLOptionElement.h
r154955 r154957 80 80 virtual void accessKeyAction(bool); 81 81 82 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);82 virtual void childrenChanged(const ChildChange&) OVERRIDE; 83 83 84 84 // <option> never has a renderer so we manually manage a cached style. -
trunk/Source/WebCore/html/HTMLOutputElement.cpp
r146417 r154957 81 81 } 82 82 83 void HTMLOutputElement::childrenChanged( bool createdByParser, Node* beforeChange, Node* afterChange, int childCountDelta)83 void HTMLOutputElement::childrenChanged(const ChildChange& change) 84 84 { 85 HTMLFormControlElement::childrenChanged(c reatedByParser, beforeChange, afterChange, childCountDelta);85 HTMLFormControlElement::childrenChanged(change); 86 86 87 if (c reatedByParser || m_isSetTextContentInProgress) {87 if (change.source == ChildChangeSourceParser || m_isSetTextContentInProgress) { 88 88 m_isSetTextContentInProgress = false; 89 89 return; -
trunk/Source/WebCore/html/HTMLOutputElement.h
r151947 r154957 60 60 virtual bool supportLabels() const OVERRIDE { return true; } 61 61 virtual bool supportsFocus() const OVERRIDE; 62 virtual void childrenChanged( bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);62 virtual void childrenChanged(const ChildChange&) OVERRIDE; 63 63 virtual void reset(); 64 64 -
trunk/Source/WebCore/html/HTMLScriptElement.cpp
r154877 r154957 53 53 } 54 54 55 void HTMLScriptElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)55 void HTMLScriptElement::childrenChanged(const ChildChange& change) 56 56 { 57 HTMLElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);57 HTMLElement::childrenChanged(change); 58 58 ScriptElement::childrenChanged(); 59 59 } -
trunk/Source/WebCore/html/HTMLScriptElement.h
r154955 r154957 47 47 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 48 48 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 49 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);49 virtual void childrenChanged(const ChildChange&) OVERRIDE; 50 50 51 51 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r154903 r154957 370 370 } 371 371 372 void HTMLSelectElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)372 void HTMLSelectElement::childrenChanged(const ChildChange& change) 373 373 { 374 374 setRecalcListItems(); … … 376 376 m_lastOnChangeSelection.clear(); 377 377 378 HTMLFormControlElementWithState::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);378 HTMLFormControlElementWithState::childrenChanged(change); 379 379 } 380 380 -
trunk/Source/WebCore/html/HTMLSelectElement.h
r154371 r154957 180 180 int nextSelectableListIndexPageAway(int startIndex, SkipDirection) const; 181 181 182 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);182 virtual void childrenChanged(const ChildChange&) OVERRIDE; 183 183 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } 184 184 -
trunk/Source/WebCore/html/HTMLStyleElement.cpp
r154877 r154957 207 207 } 208 208 209 void HTMLStyleElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)210 { 211 HTMLElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);209 void HTMLStyleElement::childrenChanged(const ChildChange& change) 210 { 211 HTMLElement::childrenChanged(change); 212 212 m_styleSheetOwner.childrenChanged(this); 213 213 } -
trunk/Source/WebCore/html/HTMLStyleElement.h
r154955 r154957 67 67 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 68 68 virtual void removedFrom(ContainerNode*) OVERRIDE; 69 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);69 virtual void childrenChanged(const ChildChange&) OVERRIDE; 70 70 71 71 virtual void finishParsingChildren(); -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r154877 r154957 129 129 } 130 130 131 void HTMLTextAreaElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)132 { 133 HTMLElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);131 void HTMLTextAreaElement::childrenChanged(const ChildChange& change) 132 { 133 HTMLElement::childrenChanged(change); 134 134 setLastChangeWasNotUserEdit(); 135 135 if (m_isDirty) -
trunk/Source/WebCore/html/HTMLTextAreaElement.h
r154955 r154957 97 97 virtual bool isTextFormControl() const { return true; } 98 98 99 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);99 virtual void childrenChanged(const ChildChange&) OVERRIDE; 100 100 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 101 101 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; -
trunk/Source/WebCore/html/HTMLTitleElement.cpp
r154877 r154957 62 62 } 63 63 64 void HTMLTitleElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)64 void HTMLTitleElement::childrenChanged(const ChildChange& change) 65 65 { 66 HTMLElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);66 HTMLElement::childrenChanged(change); 67 67 m_title = textWithDirection(); 68 68 if (inDocument()) { -
trunk/Source/WebCore/html/HTMLTitleElement.h
r154955 r154957 42 42 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 43 43 virtual void removedFrom(ContainerNode*) OVERRIDE; 44 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);44 virtual void childrenChanged(const ChildChange&) OVERRIDE; 45 45 46 46 StringWithDirection m_title; -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r154903 r154957 108 108 } 109 109 110 void InsertionPoint::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)110 void InsertionPoint::childrenChanged(const ChildChange& change) 111 111 { 112 HTMLElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);112 HTMLElement::childrenChanged(change); 113 113 if (ShadowRoot* root = containingShadowRoot()) 114 114 root->invalidateDistribution(); -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r154371 r154957 75 75 InsertionPoint(const QualifiedName&, Document*); 76 76 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; 77 virtual void childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) OVERRIDE;77 virtual void childrenChanged(const ChildChange&) OVERRIDE; 78 78 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 79 79 virtual void removedFrom(ContainerNode*) OVERRIDE; -
trunk/Source/WebCore/svg/SVGClipPathElement.cpp
r152343 r154957 104 104 } 105 105 106 void SVGClipPathElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)106 void SVGClipPathElement::childrenChanged(const ChildChange& change) 107 107 { 108 SVGGraphicsElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);108 SVGGraphicsElement::childrenChanged(change); 109 109 110 if (change dByParser)110 if (change.source == ChildChangeSourceParser) 111 111 return; 112 112 -
trunk/Source/WebCore/svg/SVGClipPathElement.h
r152167 r154957 47 47 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 48 48 virtual void svgAttributeChanged(const QualifiedName&); 49 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);49 virtual void childrenChanged(const ChildChange&) OVERRIDE; 50 50 51 51 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/svg/SVGElement.cpp
r154928 r154957 1057 1057 } 1058 1058 1059 void SVGElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)1060 { 1061 StyledElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);1062 1063 // Invalidate all SVGElementInstances associated with us1064 if (!changedByParser)1065 1059 void SVGElement::childrenChanged(const ChildChange& change) 1060 { 1061 StyledElement::childrenChanged(change); 1062 1063 if (change.source == ChildChangeSourceParser) 1064 return; 1065 SVGElementInstance::invalidateAllInstancesOfElement(this); 1066 1066 } 1067 1067 -
trunk/Source/WebCore/svg/SVGElement.h
r154955 r154957 162 162 virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE; 163 163 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 164 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);164 virtual void childrenChanged(const ChildChange&) OVERRIDE; 165 165 virtual bool selfHasRelativeLengths() const { return false; } 166 166 void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(selfHasRelativeLengths(), this); } -
trunk/Source/WebCore/svg/SVGFELightElement.cpp
r151800 r154957 208 208 } 209 209 210 void SVGFELightElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) 211 { 212 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); 213 214 if (!changedByParser) { 215 if (ContainerNode* parent = parentNode()) { 216 RenderObject* renderer = parent->renderer(); 217 if (renderer && renderer->isSVGResourceFilterPrimitive()) 218 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 219 } 220 } 210 void SVGFELightElement::childrenChanged(const ChildChange& change) 211 { 212 SVGElement::childrenChanged(change); 213 214 if (change.source == ChildChangeSourceParser) 215 return; 216 ContainerNode* parent = parentNode(); 217 if (!parent) 218 return; 219 RenderObject* renderer = parent->renderer(); 220 if (renderer && renderer->isSVGResourceFilterPrimitive()) 221 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 221 222 } 222 223 -
trunk/Source/WebCore/svg/SVGFELightElement.h
r154462 r154957 45 45 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 46 46 virtual void svgAttributeChanged(const QualifiedName&); 47 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);47 virtual void childrenChanged(const ChildChange&) OVERRIDE; 48 48 49 49 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFELightElement) -
trunk/Source/WebCore/svg/SVGFilterElement.cpp
r154462 r154957 178 178 } 179 179 180 void SVGFilterElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)181 { 182 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);183 184 if (change dByParser)180 void SVGFilterElement::childrenChanged(const ChildChange& change) 181 { 182 SVGElement::childrenChanged(change); 183 184 if (change.source == ChildChangeSourceParser) 185 185 return; 186 186 -
trunk/Source/WebCore/svg/SVGFilterElement.h
r154462 r154957 53 53 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 54 54 virtual void svgAttributeChanged(const QualifiedName&); 55 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);55 virtual void childrenChanged(const ChildChange&) OVERRIDE; 56 56 57 57 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE; -
trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
r154462 r154957 118 118 } 119 119 120 void SVGFilterPrimitiveStandardAttributes::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)120 void SVGFilterPrimitiveStandardAttributes::childrenChanged(const ChildChange& change) 121 121 { 122 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);122 SVGElement::childrenChanged(change); 123 123 124 if (!changedByParser) 125 invalidate(); 124 if (change.source == ChildChangeSourceParser) 125 return; 126 invalidate(); 126 127 } 127 128 -
trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
r154679 r154957 52 52 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 53 53 virtual void svgAttributeChanged(const QualifiedName&); 54 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);54 virtual void childrenChanged(const ChildChange&) OVERRIDE; 55 55 56 56 inline void invalidate() -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r154877 r154957 297 297 } 298 298 299 void SVGFontFaceElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)300 { 301 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);299 void SVGFontFaceElement::childrenChanged(const ChildChange& change) 300 { 301 SVGElement::childrenChanged(change); 302 302 rebuildFontFace(); 303 303 } -
trunk/Source/WebCore/svg/SVGFontFaceElement.h
r154955 r154957 58 58 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 59 59 60 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);60 virtual void childrenChanged(const ChildChange&) OVERRIDE; 61 61 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 62 62 virtual void removedFrom(ContainerNode*) OVERRIDE; -
trunk/Source/WebCore/svg/SVGFontFaceFormatElement.cpp
r153561 r154957 41 41 } 42 42 43 void SVGFontFaceFormatElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)43 void SVGFontFaceFormatElement::childrenChanged(const ChildChange& change) 44 44 { 45 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);45 SVGElement::childrenChanged(change); 46 46 47 47 if (!parentNode() || !parentNode()->hasTagName(font_face_uriTag)) -
trunk/Source/WebCore/svg/SVGFontFaceFormatElement.h
r154462 r154957 33 33 SVGFontFaceFormatElement(const QualifiedName&, Document*); 34 34 35 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);35 virtual void childrenChanged(const ChildChange&) OVERRIDE; 36 36 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { return false; } 37 37 }; -
trunk/Source/WebCore/svg/SVGFontFaceSrcElement.cpp
r153561 r154957 60 60 } 61 61 62 void SVGFontFaceSrcElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)62 void SVGFontFaceSrcElement::childrenChanged(const ChildChange& change) 63 63 { 64 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);64 SVGElement::childrenChanged(change); 65 65 if (parentNode() && parentNode()->hasTagName(font_faceTag)) 66 66 toSVGFontFaceElement(parentNode())->rebuildFontFace(); -
trunk/Source/WebCore/svg/SVGFontFaceSrcElement.h
r154462 r154957 37 37 SVGFontFaceSrcElement(const QualifiedName&, Document*); 38 38 39 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);39 virtual void childrenChanged(const ChildChange&) OVERRIDE; 40 40 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { return false; } 41 41 }; -
trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp
r154877 r154957 71 71 } 72 72 73 void SVGFontFaceUriElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)73 void SVGFontFaceUriElement::childrenChanged(const ChildChange& change) 74 74 { 75 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);75 SVGElement::childrenChanged(change); 76 76 77 77 if (!parentNode() || !parentNode()->hasTagName(font_face_srcTag)) -
trunk/Source/WebCore/svg/SVGFontFaceUriElement.h
r154462 r154957 42 42 43 43 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 44 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);44 virtual void childrenChanged(const ChildChange&) OVERRIDE; 45 45 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 46 46 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { return false; } -
trunk/Source/WebCore/svg/SVGGradientElement.cpp
r154462 r154957 127 127 } 128 128 129 void SVGGradientElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)129 void SVGGradientElement::childrenChanged(const ChildChange& change) 130 130 { 131 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);131 SVGElement::childrenChanged(change); 132 132 133 if (change dByParser)133 if (change.source == ChildChangeSourceParser) 134 134 return; 135 135 -
trunk/Source/WebCore/svg/SVGGradientElement.h
r154462 r154957 98 98 virtual bool needsPendingResourceHandling() const { return false; } 99 99 100 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);100 virtual void childrenChanged(const ChildChange&) OVERRIDE; 101 101 102 102 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGradientElement) -
trunk/Source/WebCore/svg/SVGMarkerElement.cpp
r154462 r154957 180 180 } 181 181 182 void SVGMarkerElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)183 { 184 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);185 186 if (change dByParser)182 void SVGMarkerElement::childrenChanged(const ChildChange& change) 183 { 184 SVGElement::childrenChanged(change); 185 186 if (change.source == ChildChangeSourceParser) 187 187 return; 188 188 -
trunk/Source/WebCore/svg/SVGMarkerElement.h
r154462 r154957 129 129 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 130 130 virtual void svgAttributeChanged(const QualifiedName&); 131 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);131 virtual void childrenChanged(const ChildChange&) OVERRIDE; 132 132 133 133 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/svg/SVGMaskElement.cpp
r154462 r154957 147 147 } 148 148 149 void SVGMaskElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)149 void SVGMaskElement::childrenChanged(const ChildChange& change) 150 150 { 151 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);151 SVGElement::childrenChanged(change); 152 152 153 if (change dByParser)153 if (change.source == ChildChangeSourceParser) 154 154 return; 155 155 -
trunk/Source/WebCore/svg/SVGMaskElement.h
r154462 r154957 48 48 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 49 49 virtual void svgAttributeChanged(const QualifiedName&); 50 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);50 virtual void childrenChanged(const ChildChange&) OVERRIDE; 51 51 52 52 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/svg/SVGPatternElement.cpp
r154877 r154957 172 172 } 173 173 174 void SVGPatternElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)175 { 176 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);177 178 if (change dByParser)174 void SVGPatternElement::childrenChanged(const ChildChange& change) 175 { 176 SVGElement::childrenChanged(change); 177 178 if (change.source == ChildChangeSourceParser) 179 179 return; 180 180 -
trunk/Source/WebCore/svg/SVGPatternElement.h
r154462 r154957 62 62 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 63 63 virtual void svgAttributeChanged(const QualifiedName&); 64 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);64 virtual void childrenChanged(const ChildChange&) OVERRIDE; 65 65 66 66 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/svg/SVGScriptElement.cpp
r154877 r154957 128 128 } 129 129 130 void SVGScriptElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)131 { 132 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);130 void SVGScriptElement::childrenChanged(const ChildChange& change) 131 { 132 SVGElement::childrenChanged(change); 133 133 ScriptElement::childrenChanged(); 134 134 } -
trunk/Source/WebCore/svg/SVGScriptElement.h
r154955 r154957 49 49 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 50 50 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 51 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);51 virtual void childrenChanged(const ChildChange&) OVERRIDE; 52 52 53 53 virtual void svgAttributeChanged(const QualifiedName&); -
trunk/Source/WebCore/svg/SVGStyleElement.cpp
r154877 r154957 156 156 } 157 157 158 void SVGStyleElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)158 void SVGStyleElement::childrenChanged(const ChildChange& change) 159 159 { 160 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);160 SVGElement::childrenChanged(change); 161 161 m_styleSheetOwner.childrenChanged(this); 162 162 } -
trunk/Source/WebCore/svg/SVGStyleElement.h
r154877 r154957 55 55 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 56 56 virtual void removedFrom(ContainerNode*) OVERRIDE; 57 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);57 virtual void childrenChanged(const ChildChange&) OVERRIDE; 58 58 59 59 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { return false; } -
trunk/Source/WebCore/svg/SVGTitleElement.cpp
r154877 r154957 57 57 } 58 58 59 void SVGTitleElement::childrenChanged( bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)59 void SVGTitleElement::childrenChanged(const ChildChange& change) 60 60 { 61 SVGElement::childrenChanged(change dByParser, beforeChange, afterChange, childCountDelta);61 SVGElement::childrenChanged(change); 62 62 if (inDocument()) 63 63 // FIXME: does SVG have title text direction? -
trunk/Source/WebCore/svg/SVGTitleElement.h
r154481 r154957 37 37 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 38 38 virtual void removedFrom(ContainerNode*) OVERRIDE; 39 virtual void childrenChanged( bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);39 virtual void childrenChanged(const ChildChange&) OVERRIDE; 40 40 41 41 virtual bool rendererIsNeeded(const RenderStyle&) { return false; }
Note:
See TracChangeset
for help on using the changeset viewer.