Title: [116644] trunk/Source/WebCore
Revision
116644
Author
[email protected]
Date
2012-05-10 07:43:27 -0700 (Thu, 10 May 2012)

Log Message

Node::InDetachFlag could be removed.
https://bugs.webkit.org/show_bug.cgi?id=85963

Reviewed by Antti Koivisto.

Removed Node::inDetach() since it can never true
on the only call site setFocusedNode().

No new test. Covered by existing tests.

* dom/Document.cpp:
(WebCore::Document::setFocusedNode):
* dom/Node.cpp:
(WebCore::Node::detach):
* dom/Node.h:
(WebCore):
(Node):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116643 => 116644)


--- trunk/Source/WebCore/ChangeLog	2012-05-10 14:23:01 UTC (rev 116643)
+++ trunk/Source/WebCore/ChangeLog	2012-05-10 14:43:27 UTC (rev 116644)
@@ -1,3 +1,23 @@
+2012-05-10  MORITA Hajime <[email protected]>
+
+        Node::InDetachFlag could be removed.
+        https://bugs.webkit.org/show_bug.cgi?id=85963
+
+        Reviewed by Antti Koivisto.
+
+        Removed Node::inDetach() since it can never true
+        on the only call site setFocusedNode().
+
+        No new test. Covered by existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::setFocusedNode):
+        * dom/Node.cpp:
+        (WebCore::Node::detach):
+        * dom/Node.h:
+        (WebCore):
+        (Node):
+
 2012-05-10  Keishi Hattori  <[email protected]>
 
         Crash in HTMLFormControlElement::m_fieldSetAncestor

Modified: trunk/Source/WebCore/dom/Document.cpp (116643 => 116644)


--- trunk/Source/WebCore/dom/Document.cpp	2012-05-10 14:23:01 UTC (rev 116643)
+++ trunk/Source/WebCore/dom/Document.cpp	2012-05-10 14:43:27 UTC (rev 116644)
@@ -3646,7 +3646,7 @@
     m_focusedNode = 0;
 
     // Remove focus from the existing focus node (if any)
-    if (oldFocusedNode && !oldFocusedNode->inDetach()) {
+    if (oldFocusedNode) {
         if (oldFocusedNode->active())
             oldFocusedNode->setActive(false);
 

Modified: trunk/Source/WebCore/dom/Node.cpp (116643 => 116644)


--- trunk/Source/WebCore/dom/Node.cpp	2012-05-10 14:23:01 UTC (rev 116643)
+++ trunk/Source/WebCore/dom/Node.cpp	2012-05-10 14:43:27 UTC (rev 116644)
@@ -1344,8 +1344,6 @@
 
 void Node::detach()
 {
-    setFlag(InDetachFlag);
-
     if (renderer())
         renderer()->destroyAndCleanupAnonymousWrappers();
     setRenderer(0);
@@ -1360,8 +1358,6 @@
     clearFlag(IsHoveredFlag);
     clearFlag(InActiveChainFlag);
     clearFlag(IsAttachedFlag);
-
-    clearFlag(InDetachFlag);
 }
 
 // FIXME: This code is used by editing.  Seems like it could move over there and not pollute Node.

Modified: trunk/Source/WebCore/dom/Node.h (116643 => 116644)


--- trunk/Source/WebCore/dom/Node.h	2012-05-10 14:23:01 UTC (rev 116643)
+++ trunk/Source/WebCore/dom/Node.h	2012-05-10 14:43:27 UTC (rev 116644)
@@ -91,7 +91,7 @@
 
 typedef int ExceptionCode;
 
-const int nodeStyleChangeShift = 21;
+const int nodeStyleChangeShift = 20;
 
 // SyntheticStyleChange means that we need to go through the entire style change logic even though
 // no style property has actually changed. It is used to restructure the tree when, for instance,
@@ -298,10 +298,9 @@
     bool hasName() const { return getFlag(HasNameFlag); }
     bool hasID() const;
     bool hasClass() const;
-    
+
     bool active() const { return getFlag(IsActiveFlag); }
     bool inActiveChain() const { return getFlag(InActiveChainFlag); }
-    bool inDetach() const { return getFlag(InDetachFlag); }
     bool hovered() const { return getFlag(IsHoveredFlag); }
     bool focused() const { return hasRareData() ? rareDataFocused() : false; }
     bool attached() const { return getFlag(IsAttachedFlag); }
@@ -664,41 +663,40 @@
         IsActiveFlag = 1 << 10,
         IsHoveredFlag = 1 << 11,
         InActiveChainFlag = 1 << 12,
-        InDetachFlag = 1 << 13,
-        HasRareDataFlag = 1 << 14,
-        IsShadowRootFlag = 1 << 15,
+        HasRareDataFlag = 1 << 13,
+        IsShadowRootFlag = 1 << 14,
 
         // These bits are used by derived classes, pulled up here so they can
         // be stored in the same memory word as the Node bits above.
-        IsParsingChildrenFinishedFlag = 1 << 16, // Element
-        IsStyleAttributeValidFlag = 1 << 17, // StyledElement
+        IsParsingChildrenFinishedFlag = 1 << 15, // Element
+        IsStyleAttributeValidFlag = 1 << 16, // StyledElement
 #if ENABLE(SVG)
-        AreSVGAttributesValidFlag = 1 << 18, // Element
-        IsSynchronizingSVGAttributesFlag = 1 << 19, // SVGElement
-        HasSVGRareDataFlag = 1 << 20, // SVGElement
+        AreSVGAttributesValidFlag = 1 << 17, // Element
+        IsSynchronizingSVGAttributesFlag = 1 << 18, // SVGElement
+        HasSVGRareDataFlag = 1 << 19, // SVGElement
 #endif
 
         StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
 
-        SelfOrAncestorHasDirAutoFlag = 1 << 23,
-        HasCustomWillOrDidRecalcStyleFlag = 1 << 24,
-        HasCustomStyleForRendererFlag = 1 << 25,
+        SelfOrAncestorHasDirAutoFlag = 1 << 22,
+        HasCustomWillOrDidRecalcStyleFlag = 1 << 23,
+        HasCustomStyleForRendererFlag = 1 << 24,
 
-        HasNameFlag = 1 << 26,
+        HasNameFlag = 1 << 25,
 
-        AttributeStyleDirtyFlag = 1 << 27,
+        AttributeStyleDirtyFlag = 1 << 26,
 
 #if ENABLE(SVG)
         DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag | AreSVGAttributesValidFlag,
 #else
         DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag,
 #endif
-        InNamedFlowFlag = 1 << 29,
-        HasAttrListFlag = 1 << 30,
-        IsFrameOwnerElementFlag = 1 << 31
+        InNamedFlowFlag = 1 << 28,
+        HasAttrListFlag = 1 << 29,
+        IsFrameOwnerElementFlag = 1 << 30
     };
 
-    // 1 bits remaining
+    // 2 bits remaining
 
     bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
     void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); } 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to