Title: [110320] trunk/Source/WebCore
Revision
110320
Author
[email protected]
Date
2012-03-09 12:34:16 -0800 (Fri, 09 Mar 2012)

Log Message

Cleanup incDOMTreeVersion callers
https://bugs.webkit.org/show_bug.cgi?id=80452

Reviewed by Andreas Kling.

Unify various calls to incDOMTreeVersion and namely remove the call inside dispatchSubtreeModifiedEvent.
There should be no behavioral change and therefore there is no new test.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/ContainerNode.cpp:
(WebCore::willRemoveChild):
(WebCore::willRemoveChildren):
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::childrenChanged):
(WebCore::notifyChildInserted):
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore::Element::parserSetAttributes):
(WebCore::Element::willModifyAttribute):
* dom/Node.cpp:
(WebCore::Node::dispatchSubtreeModifiedEvent):
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::childrenChanged):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::childrenChanged):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::childrenChanged):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::childrenChanged):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::childrenChanged):
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::childrenChanged):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::childrenChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110319 => 110320)


--- trunk/Source/WebCore/ChangeLog	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/ChangeLog	2012-03-09 20:34:16 UTC (rev 110320)
@@ -1,3 +1,44 @@
+2012-03-09  Ryosuke Niwa  <[email protected]>
+
+        Cleanup incDOMTreeVersion callers
+        https://bugs.webkit.org/show_bug.cgi?id=80452
+
+        Reviewed by Andreas Kling.
+
+        Unify various calls to incDOMTreeVersion and namely remove the call inside dispatchSubtreeModifiedEvent.
+        There should be no behavioral change and therefore there is no new test.
+
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::parserAppendData):
+        (WebCore::CharacterData::setDataAndUpdate):
+        * dom/ContainerNode.cpp:
+        (WebCore::willRemoveChild):
+        (WebCore::willRemoveChildren):
+        (WebCore::ContainerNode::removeChild):
+        (WebCore::ContainerNode::removeChildren):
+        (WebCore::ContainerNode::childrenChanged):
+        (WebCore::notifyChildInserted):
+        * dom/Element.cpp:
+        (WebCore::Element::attributeChanged):
+        (WebCore::Element::parserSetAttributes):
+        (WebCore::Element::willModifyAttribute):
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchSubtreeModifiedEvent):
+        * html/HTMLOutputElement.cpp:
+        (WebCore::HTMLOutputElement::childrenChanged):
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::childrenChanged):
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::childrenChanged):
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::childrenChanged):
+        * html/HTMLTitleElement.cpp:
+        (WebCore::HTMLTitleElement::childrenChanged):
+        * svg/SVGScriptElement.cpp:
+        (WebCore::SVGScriptElement::childrenChanged):
+        * svg/SVGStyleElement.cpp:
+        (WebCore::SVGStyleElement::childrenChanged):
+
 2012-03-09  Patrick Gansterer  <[email protected]>
 
         Build fix for !ENABLE(FILTERS) after r110285.

Modified: trunk/Source/WebCore/dom/CharacterData.cpp (110319 => 110320)


--- trunk/Source/WebCore/dom/CharacterData.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/dom/CharacterData.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -81,6 +81,7 @@
     m_data.append(data, end);
 
     updateRenderer(oldLength, 0);
+    document()->incDOMTreeVersion();
     // We don't call dispatchModifiedEvent here because we don't want the
     // parser to dispatch DOM mutation events.
     if (parentNode())
@@ -178,6 +179,7 @@
     String oldData = m_data;
     m_data = newData;
     updateRenderer(offsetOfReplacedData, oldLength);
+    document()->incDOMTreeVersion();
     dispatchModifiedEvent(oldData);
 }
 

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (110319 => 110320)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -386,7 +386,6 @@
 {
     // update auxiliary doc info (e.g. iterators) to note that node is being removed
     child->document()->nodeWillBeRemoved(child);
-    child->document()->incDOMTreeVersion();
 
     // fire removed from document mutation events.
     dispatchChildRemovalEvents(child);
@@ -396,7 +395,6 @@
 static void willRemoveChildren(ContainerNode* container)
 {
     container->document()->nodeChildrenWillBeRemoved(container);
-    container->document()->incDOMTreeVersion();
 
     NodeVector children;
     collectNodes(container, children);
@@ -450,7 +448,6 @@
     document()->removeFullScreenElementOfSubtree(child.get());
 #endif
 
-
     // Events fired when blurring currently focused node might have moved this
     // child into a different parent.
     if (child->parentNode() != this) {
@@ -687,7 +684,6 @@
     allowEventDispatch();
 
     // FIXME: Why doesn't this use notifyChildInserted(newChild) instead?
-    document()->incDOMTreeVersion();
     if (inDocument())
         newChild->insertedIntoDocument();
     childrenChanged(true, last, 0, 1);
@@ -842,6 +838,7 @@
 
 void ContainerNode::childrenChanged(bool changedByParser, Node*, Node*, int childCountDelta)
 {
+    document()->incDOMTreeVersion();
     if (!changedByParser && childCountDelta)
         document()->updateRangesAfterChildrenChanged(this);
     invalidateNodeListsCacheAfterChildrenChanged();
@@ -1102,8 +1099,6 @@
         c->insertedIntoDocument();
     else if (c->isContainerNode())
         toContainerNode(c.get())->insertedIntoTree(true);
-
-    document->incDOMTreeVersion();
 }
 
 static void dispatchChildInsertionEvents(Node* child)

Modified: trunk/Source/WebCore/dom/Element.cpp (110319 => 110320)


--- trunk/Source/WebCore/dom/Element.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/dom/Element.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -668,6 +668,8 @@
 
 void Element::attributeChanged(Attribute* attr)
 {
+    document()->incDOMTreeVersion();
+
     if (isIdAttributeName(attr->name()))
         idAttributeChanged(attr);
     else if (attr->name() == HTMLNames::nameAttr)
@@ -742,8 +744,6 @@
     ASSERT(!inDocument());
     ASSERT(!parentNode());
 
-    document()->incDOMTreeVersion();
-
     ASSERT(!m_attributeData);
 
     if (!attributeVector)
@@ -1990,8 +1990,6 @@
 
 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue)
 {
-    document()->incDOMTreeVersion();
-
     if (isIdAttributeName(name))
         updateId(oldValue, newValue);
     else if (name == HTMLNames::nameAttr)

Modified: trunk/Source/WebCore/dom/Node.cpp (110319 => 110320)


--- trunk/Source/WebCore/dom/Node.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/dom/Node.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -2776,10 +2776,6 @@
 
 void Node::dispatchSubtreeModifiedEvent()
 {
-    // FIXME: This call shouldn't be necessary, since it should have already been
-    // called whenever any child is inserted or removed, or an attribute changed.
-    document()->incDOMTreeVersion();
-
     if (isInShadowTree())
         return;
 

Modified: trunk/Source/WebCore/html/HTMLOutputElement.cpp (110319 => 110320)


--- trunk/Source/WebCore/html/HTMLOutputElement.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/html/HTMLOutputElement.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -81,6 +81,8 @@
 
 void HTMLOutputElement::childrenChanged(bool createdByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    HTMLFormControlElement::childrenChanged(createdByParser, beforeChange, afterChange, childCountDelta);
+
     if (createdByParser || m_isSetTextContentInProgress) {
         m_isSetTextContentInProgress = false;
         return;
@@ -88,7 +90,6 @@
 
     if (m_isDefaultValueMode)
         m_defaultValue = textContent();
-    HTMLFormControlElement::childrenChanged(createdByParser, beforeChange, afterChange, childCountDelta);
 }
 
 void HTMLOutputElement::reset()

Modified: trunk/Source/WebCore/html/HTMLScriptElement.cpp (110319 => 110320)


--- trunk/Source/WebCore/html/HTMLScriptElement.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/html/HTMLScriptElement.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -54,8 +54,8 @@
 
 void HTMLScriptElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
     ScriptElement::childrenChanged();
-    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
 }
 
 void HTMLScriptElement::parseAttribute(Attribute* attr)

Modified: trunk/Source/WebCore/html/HTMLStyleElement.cpp (110319 => 110320)


--- trunk/Source/WebCore/html/HTMLStyleElement.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/html/HTMLStyleElement.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -190,8 +190,8 @@
 
 void HTMLStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
     StyleElement::childrenChanged(this);
-    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
 }
 
 const AtomicString& HTMLStyleElement::media() const

Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (110319 => 110320)


--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -112,11 +112,11 @@
 
 void HTMLTextAreaElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
     setLastChangeWasNotUserEdit();
     if (!m_isDirty)
         setNonDirtyValue(defaultValue());
     setInnerTextValue(value());
-    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
 }
 
 bool HTMLTextAreaElement::isPresentationAttribute(const QualifiedName& name) const

Modified: trunk/Source/WebCore/html/HTMLTitleElement.cpp (110319 => 110320)


--- trunk/Source/WebCore/html/HTMLTitleElement.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/html/HTMLTitleElement.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -58,10 +58,10 @@
 
 void HTMLTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
     m_title = textWithDirection();
     if (inDocument())
         document()->setTitleElement(m_title, this);
-    HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
 }
 
 String HTMLTitleElement::text() const

Modified: trunk/Source/WebCore/svg/SVGScriptElement.cpp (110319 => 110320)


--- trunk/Source/WebCore/svg/SVGScriptElement.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/svg/SVGScriptElement.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -144,8 +144,8 @@
 
 void SVGScriptElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
     ScriptElement::childrenChanged();
-    SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
 }
 
 bool SVGScriptElement::isURLAttribute(Attribute* attr) const

Modified: trunk/Source/WebCore/svg/SVGStyleElement.cpp (110319 => 110320)


--- trunk/Source/WebCore/svg/SVGStyleElement.cpp	2012-03-09 20:29:09 UTC (rev 110319)
+++ trunk/Source/WebCore/svg/SVGStyleElement.cpp	2012-03-09 20:34:16 UTC (rev 110320)
@@ -148,8 +148,8 @@
 
 void SVGStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
+    SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
     StyleElement::childrenChanged(this);
-    SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to