Title: [88331] trunk
Revision
88331
Author
ca...@chromium.org
Date
2011-06-08 01:27:23 -0700 (Wed, 08 Jun 2011)

Log Message

2011-06-07  Andrey Kosyakov  <ca...@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: remove shadow dom inspection from Elements panel by default.
        https://bugs.webkit.org/show_bug.cgi?id=62188

        This reverts r85751

        * dom/Element.cpp:
        (WebCore::Element::ensureShadowRoot):
        (WebCore::Element::removeShadowRoot):
        * inspector/Inspector.json:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
        (WebCore::InspectorDOMAgent::buildObjectForNode):
        (WebCore::InspectorDOMAgent::didInsertDOMNode):
        (WebCore::InspectorDOMAgent::didRemoveDOMNode):
        * inspector/InspectorDOMAgent.h:
        * inspector/front-end/DOMAgent.js:
        (WebInspector.DOMNode):
        (WebInspector.DOMNode.prototype._renumber):
        (WebInspector.DOMAgent.prototype._bindNodes):
        (WebInspector.DOMAgent.prototype.querySelectorAll):
        (WebInspector.DOMDispatcher.prototype.searchResults):
        * inspector/front-end/ElementsPanel.js:
        (WebInspector.ElementsPanel):
        (WebInspector.ElementsPanel.prototype._attributesUpdated):
        (WebInspector.ElementsPanel.prototype._characterDataModified):
        (WebInspector.ElementsPanel.prototype._nodeInserted):
        (WebInspector.ElementsPanel.prototype._nodeRemoved):
        (WebInspector.ElementsPanel.prototype.updateModifiedNodes):
        (WebInspector.ElementsPanel.prototype.updateBreadcrumb):
        * inspector/front-end/ElementsTreeOutline.js:
        (WebInspector.ElementsTreeElement):
        (WebInspector.ElementsTreeElement.prototype._updateChildren.updateChildrenOfNode):
        (WebInspector.ElementsTreeElement.prototype._updateChildren):
        ():
        * inspector/front-end/inspector.css:
        * inspector/front-end/utilities.js:
        (Element.prototype.query):

2011-06-07  Andrey Kosyakov  <ca...@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: remove shadow dom inspection from Elements panel by default.
        https://bugs.webkit.org/show_bug.cgi?id=62188

        This reverts r85751

        * http/tests/inspector/elements-test.js:
        (initialize_ElementTest.InspectorTest.findNode.processChildren):
        (initialize_ElementTest.InspectorTest.findNode.documentRequested):
        (initialize_ElementTest.InspectorTest.findNode):
        * inspector/console/console-shadow-dom-access.html: Removed.
        * inspector/elements/shadow-dom-expected.txt: Removed.
        * inspector/elements/shadow-dom.html: Removed.
        * platform/win/Skipped:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88330 => 88331)


--- trunk/LayoutTests/ChangeLog	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/LayoutTests/ChangeLog	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1,3 +1,21 @@
+2011-06-07  Andrey Kosyakov  <ca...@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: remove shadow dom inspection from Elements panel by default.
+        https://bugs.webkit.org/show_bug.cgi?id=62188
+
+        This reverts r85751
+
+        * http/tests/inspector/elements-test.js:
+        (initialize_ElementTest.InspectorTest.findNode.processChildren):
+        (initialize_ElementTest.InspectorTest.findNode.documentRequested):
+        (initialize_ElementTest.InspectorTest.findNode):
+        * inspector/console/console-shadow-dom-access.html: Removed.
+        * inspector/elements/shadow-dom-expected.txt: Removed.
+        * inspector/elements/shadow-dom.html: Removed.
+        * platform/win/Skipped:
+
 2011-06-07  Csaba Osztrogonác  <o...@webkit.org>
 
         [Qt] Skip new failing tests.

Modified: trunk/LayoutTests/http/tests/inspector/elements-test.js (88330 => 88331)


--- trunk/LayoutTests/http/tests/inspector/elements-test.js	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/LayoutTests/http/tests/inspector/elements-test.js	2011-06-08 08:27:23 UTC (rev 88331)
@@ -26,10 +26,6 @@
             }
             pendingRequests++;
             childNode.getChildNodes(processChildren.bind(null, false));
-            if (childNode.shadowRoot) {
-                pendingRequests++;
-                childNode.shadowRoot.getChildNodes(processChildren.bind(null, false));
-            }
         }
 
         if (topLevel)
@@ -42,7 +38,7 @@
     WebInspector.domAgent.requestDocument(documentRequested.bind(this));
     function documentRequested(doc)
     {
-        doc.getChildNodes(processChildren.bind(null, true));
+        doc.getChildNodes(processChildren.bind(this, true));
     }
 };
 

Deleted: trunk/LayoutTests/inspector/console/console-shadow-dom-access.html (88330 => 88331)


--- trunk/LayoutTests/inspector/console/console-shadow-dom-access.html	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/LayoutTests/inspector/console/console-shadow-dom-access.html	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1,42 +0,0 @@
-<html>
-<head>
-<script src=""
-<script src=""
-<script>
-
-var test = function()
-{
-    var expressions = [
-        "$0.toString()",
-        "$0.firstChild.toString()",
-        "$0.firstChild.firstChild.style.width"
-    ];
-    function isShadowRoot(node)
-    {
-        return node.nodeType() === Node.SHADOW_ROOT_NODE;
-    }
-    function processExpression()
-    {
-        if (!expressions.length) {
-            InspectorTest.completeTest();
-            return;
-        }
-        var _expression_ = expressions.shift();
-        InspectorTest.evaluateInConsoleAndDump(_expression_, processExpression);
-    }
-    InspectorTest.findNode(isShadowRoot, function(node) {
-        InspectorTest.selectNode(node, processExpression);
-    });
-}
-
-</script>
-</head>
-
-<body _onload_="runTest()">
-<p>
-Tests that $0 may successfully be used to refer to shadow DOM elements.
-</p>
-
-<meter min="0" max="100" value="42"></meter>
-</body>
-</html>

Deleted: trunk/LayoutTests/inspector/elements/shadow-dom-expected.txt (88330 => 88331)


--- trunk/LayoutTests/inspector/elements/shadow-dom-expected.txt	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/LayoutTests/inspector/elements/shadow-dom-expected.txt	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1,23 +0,0 @@
-Tests that shadow DOM tree is properly displayed.
-
-
-
-Running: testDumpInitial
-- <meter id="meter" min="0" max="100" value="20">
-    - (shadow)
-    - <div>
-          <div style="width: 20%; "></div>
-      </div>
-  </meter>
-
-Running: testDumpUpdated
-Before shadow root added
-  <div id="delayed-shadow-host"></div>
-After shadow root added
-- <div id="delayed-shadow-host">
-    - (shadow)
-    - <div>
-          <span>text</span>
-      </div>
-  </div>
-

Deleted: trunk/LayoutTests/inspector/elements/shadow-dom.html (88330 => 88331)


--- trunk/LayoutTests/inspector/elements/shadow-dom.html	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/LayoutTests/inspector/elements/shadow-dom.html	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1,70 +0,0 @@
-<html>
-<head>
-<script src=""
-<script src=""
-<script>
-
-function addShadowRoot()
-{
-    if (!window.layoutTestController)
-        return;
-    var element = document.getElementById("delayed-shadow-host");
-    var shadowRoot = layoutTestController.ensureShadowRoot(element);
-    var shadowChild = document.createElement("div");
-    shadowRoot.appendChild(shadowChild);
-    var span = document.createElement("span");
-    span.textContent = "text";
-    shadowChild.appendChild(span);
-}
-
-function test()
-{
-    InspectorTest.runTestSuite([
-        function testDumpInitial(next)
-        {
-            InspectorTest.expandElementsTree(function() {
-                InspectorTest.selectNodeWithId("meter", function(node) {
-                    InspectorTest.dumpElementsTree(node);
-                    next();
-                });
-            });
-        },
-
-        function testDumpUpdated(next) {
-            var host;
-
-            function dumpWithShadowRoot()
-            {
-                InspectorTest.addResult("After shadow root added");
-                InspectorTest.runAfterPendingDispatches(function() {
-                    InspectorTest.dumpElementsTree(host);
-                    next();
-                });
-            }
-
-            InspectorTest.selectNodeWithId("delayed-shadow-host", function(node) {
-                host = node;
-                InspectorTest.addResult("Before shadow root added");
-                InspectorTest.dumpElementsTree(node);
-
-                WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.ShadowRootUpdated, function() {
-                    InspectorTest.expandElementsTree(dumpWithShadowRoot);
-                });
-                InspectorTest.evaluateInPage("addShadowRoot()");
-            });
-        }
-    ]);
-}
-
-</script>
-</head>
-
-<body _onload_="runTest()">
-<p>
-Tests that shadow DOM tree is properly displayed.
-</p>
-
-<meter id="meter" min="0" max="100" value="20"></meter>
-<div id="delayed-shadow-host"></div>
-</body>
-</html>

Modified: trunk/LayoutTests/platform/win/Skipped (88330 => 88331)


--- trunk/LayoutTests/platform/win/Skipped	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/LayoutTests/platform/win/Skipped	2011-06-08 08:27:23 UTC (rev 88331)
@@ -336,9 +336,6 @@
 # Sometimes fails https://webkit.org/b/49412
 inspector/timeline/timeline-network-resource.html
 
-# Times out all the time: http://webkit.org/b/60195
-inspector/elements/shadow-dom.html
-
 # Sometimes fails http://webkit.org/b/46998
 svg/dom/SVGScriptElement/script-load-and-error-events.svg
 
@@ -1290,7 +1287,6 @@
 fast/html/clone-keygen.html
 fast/html/clone-range.html
 fast/html/details-clone.html
-inspector/elements/shadow-dom.html
 media/audio-controls-do-not-fade-out.html
 media/video-controls-visible-audio-only.html
 fast/events/shadow-boundary-crossing.html

Modified: trunk/Source/WebCore/ChangeLog (88330 => 88331)


--- trunk/Source/WebCore/ChangeLog	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/ChangeLog	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1,3 +1,45 @@
+2011-06-07  Andrey Kosyakov  <ca...@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: remove shadow dom inspection from Elements panel by default.
+        https://bugs.webkit.org/show_bug.cgi?id=62188
+
+        This reverts r85751
+
+        * dom/Element.cpp:
+        (WebCore::Element::ensureShadowRoot):
+        (WebCore::Element::removeShadowRoot):
+        * inspector/Inspector.json:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        (WebCore::InspectorDOMAgent::didInsertDOMNode):
+        (WebCore::InspectorDOMAgent::didRemoveDOMNode):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMNode):
+        (WebInspector.DOMNode.prototype._renumber):
+        (WebInspector.DOMAgent.prototype._bindNodes):
+        (WebInspector.DOMAgent.prototype.querySelectorAll):
+        (WebInspector.DOMDispatcher.prototype.searchResults):
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel):
+        (WebInspector.ElementsPanel.prototype._attributesUpdated):
+        (WebInspector.ElementsPanel.prototype._characterDataModified):
+        (WebInspector.ElementsPanel.prototype._nodeInserted):
+        (WebInspector.ElementsPanel.prototype._nodeRemoved):
+        (WebInspector.ElementsPanel.prototype.updateModifiedNodes):
+        (WebInspector.ElementsPanel.prototype.updateBreadcrumb):
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement):
+        (WebInspector.ElementsTreeElement.prototype._updateChildren.updateChildrenOfNode):
+        (WebInspector.ElementsTreeElement.prototype._updateChildren):
+        ():
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/utilities.js:
+        (Element.prototype.query):
+
 2011-06-08  Mark Rowe  <mr...@apple.com>
 
         Fix the build.

Modified: trunk/Source/WebCore/dom/Element.cpp (88330 => 88331)


--- trunk/Source/WebCore/dom/Element.cpp	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/dom/Element.cpp	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1202,13 +1202,11 @@
 
     RefPtr<ShadowRoot> newRoot = ShadowRoot::create(document());
     ensureRareData()->m_shadowRoot = newRoot.get();
-    InspectorInstrumentation::willInsertDOMNode(document(), newRoot.get(), this);
     newRoot->setShadowHost(this);
     if (inDocument())
         newRoot->insertedIntoDocument();
     if (attached())
         newRoot->lazyAttach();
-    InspectorInstrumentation::didInsertDOMNode(document(), newRoot.get());
     return newRoot.get();
 }
 
@@ -1219,7 +1217,6 @@
 
     ElementRareData* data = ""
     if (RefPtr<Node> oldRoot = data->m_shadowRoot) {
-        InspectorInstrumentation::willRemoveDOMNode(document(), oldRoot.get());
         data->m_shadowRoot = 0;
         document()->removeFocusedNodeOfSubtree(oldRoot.get());
 

Modified: trunk/Source/WebCore/inspector/Inspector.json (88330 => 88331)


--- trunk/Source/WebCore/inspector/Inspector.json	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/Inspector.json	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1035,14 +1035,6 @@
                     { "name": "nodeIds", "type": "array", "items": { "type": "integer" }, "description": "Ids of the search result nodes." }
                 ],
                 "description": "Pushes search results initiated using <code>performSearch</code> to the client."
-            },
-            {
-                "name": "shadowRootUpdated",
-                "parameters": [
-                    { "name": "hostId", "type": "integer", "description": "Id of the host node that had shadow root changed." },
-                    { "name": "shadowRoot", "$ref": "DOMNode", "description": "Data for new shadow root (null if shadow root removed)." }
-                ],
-                "description": "Fired when shadow root is added or removed from a node."
             }
         ]
     },

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (88330 => 88331)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2011-06-08 08:27:23 UTC (rev 88331)
@@ -75,7 +75,6 @@
 #include "RenderStyle.h"
 #include "RenderStyleConstants.h"
 #include "ScriptEventListener.h"
-#include "ShadowRoot.h"
 #include "StyleSheetList.h"
 #include "Text.h"
 
@@ -451,7 +450,7 @@
 void InspectorDOMAgent::pushChildNodesToFrontend(int nodeId)
 {
     Node* node = nodeForId(nodeId);
-    if (!node || !isContainerNode(*node))
+    if (!node || (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE && node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE))
         return;
     if (m_childrenRequested.contains(nodeId))
         return;
@@ -1058,7 +1057,6 @@
         case Node::ATTRIBUTE_NODE:
             localName = node->localName();
             break;
-        case Node::SHADOW_ROOT_NODE:
         case Node::DOCUMENT_FRAGMENT_NODE:
             break;
         case Node::DOCUMENT_NODE:
@@ -1075,7 +1073,7 @@
     value->setString("localName", localName);
     value->setString("nodeValue", nodeValue);
 
-    if (isContainerNode(*node)) {
+    if (node->nodeType() == Node::ELEMENT_NODE || node->nodeType() == Node::DOCUMENT_NODE || node->nodeType() == Node::DOCUMENT_FRAGMENT_NODE) {
         int nodeCount = innerChildNodeCount(node);
         value->setNumber("childNodeCount", nodeCount);
         RefPtr<InspectorArray> children = buildArrayForContainerChildren(node, depth, nodesMap);
@@ -1089,8 +1087,6 @@
                 HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(node);
                 value->setString("documentURL", documentURLString(frameOwner->contentDocument()));
             }
-            if (ShadowRoot* shadowRoot = element->shadowRoot())
-                value->setObject("shadowRoot", buildObjectForNode(shadowRoot, depth, nodesMap));
         } else if (node->nodeType() == Node::DOCUMENT_NODE) {
             Document* document = static_cast<Document*>(node);
             value->setString("documentURL", documentURLString(document));
@@ -1263,17 +1259,12 @@
     // We could be attaching existing subtree. Forget the bindings.
     unbind(node, &m_documentNodeToIdMap);
 
-    ContainerNode* parent = node->isShadowRoot() ? node->shadowHost() : node->parentNode();
+    ContainerNode* parent = node->parentNode();
     int parentId = m_documentNodeToIdMap.get(parent);
     // Return if parent is not mapped yet.
     if (!parentId)
         return;
 
-    if (node->isShadowRoot()) {
-        RefPtr<InspectorObject> value = buildObjectForNode(node, 0, &m_documentNodeToIdMap);
-        m_frontend->shadowRootUpdated(parentId, value.release());
-        return;
-    }
     if (!m_childrenRequested.contains(parentId)) {
         // No children are mapped yet -> only notify on changes of hasChildren.
         m_frontend->childNodeCountUpdated(parentId, innerChildNodeCount(parent));
@@ -1291,7 +1282,7 @@
     if (isWhitespace(node))
         return;
 
-    ContainerNode* parent = node->isShadowRoot() ? node->shadowHost() : node->parentNode();
+    ContainerNode* parent = node->parentNode();
     int parentId = m_documentNodeToIdMap.get(parent);
     // If parent is not mapped yet -> ignore the event.
     if (!parentId)
@@ -1300,9 +1291,7 @@
     if (m_domListener)
         m_domListener->didRemoveDOMNode(node);
 
-    if (node->isShadowRoot())
-        m_frontend->shadowRootUpdated(parentId, 0);
-    else if (!m_childrenRequested.contains(parentId)) {
+    if (!m_childrenRequested.contains(parentId)) {
         // No children are mapped yet -> only notify on changes of hasChildren.
         if (innerChildNodeCount(parent) == 1)
             m_frontend->childNodeCountUpdated(parentId, 0);
@@ -1451,15 +1440,6 @@
     DOMNodeHighlighter::DrawNodeHighlight(context, m_highlightedNode.get(), mode);
 }
 
-bool InspectorDOMAgent::isContainerNode(const Node& node)
-{
-     Node::NodeType type = node.nodeType();
-     return type == Node::ELEMENT_NODE
-         || type == Node::DOCUMENT_NODE
-         || type == Node::DOCUMENT_FRAGMENT_NODE
-         || type == Node::SHADOW_ROOT_NODE;
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.h (88330 => 88331)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2011-06-08 08:27:23 UTC (rev 88331)
@@ -207,7 +207,6 @@
 
     void discardBindings();
 
-    static bool isContainerNode(const Node&);
     InstrumentingAgents* m_instrumentingAgents;
     InspectorPageAgent* m_pageAgent;
     InspectorClient* m_client;

Modified: trunk/Source/WebCore/inspector/front-end/DOMAgent.js (88330 => 88331)


--- trunk/Source/WebCore/inspector/front-end/DOMAgent.js	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/front-end/DOMAgent.js	2011-06-08 08:27:23 UTC (rev 88331)
@@ -67,8 +67,6 @@
             this.ownerDocument.body = this;
         if (payload.documentURL)
             this.documentURL = payload.documentURL;
-        if (payload.shadowRoot)
-            this._setShadowRootPayload(payload.shadowRoot);
     } else if (this._nodeType === Node.DOCUMENT_TYPE_NODE) {
         this.publicId = payload.publicId;
         this.systemId = payload.systemId;
@@ -98,11 +96,6 @@
         return this._nodeType;
     },
 
-    inShadowTree: function()
-    {
-        return this._inShadowTree;
-    },
-
     nodeName: function()
     {
         return this._nodeName;
@@ -279,17 +272,6 @@
         this._renumber();
     },
 
-    _setShadowRootPayload: function(payload)
-    {
-        if (!payload) {
-            this.shadowRoot = null;
-            return;
-        }
-        this.shadowRoot = new WebInspector.DOMNode(this.ownerDocument, payload);
-        this.shadowRoot.parentNode = this;
-        this.shadowRoot._inShadowTree = true;
-    },
-
     _renumber: function()
     {
         this._childNodeCount = this.children.length;
@@ -306,7 +288,6 @@
             child.nextSibling = i + 1 < this._childNodeCount ? this.children[i + 1] : null;
             child.prevSibling = i - 1 >= 0 ? this.children[i - 1] : null;
             child.parentNode = this;
-            child._inShadowTree = this._inShadowTree;
         }
     },
 
@@ -353,8 +334,7 @@
     NodeInserted: "NodeInserted",
     NodeRemoved: "NodeRemoved",
     DocumentUpdated: "DocumentUpdated",
-    ChildNodeCountUpdated: "ChildNodeCountUpdated",
-    ShadowRootUpdated: "ShadowRootUpdated"
+    ChildNodeCountUpdated: "ChildNodeCountUpdated"
 }
 
 WebInspector.DOMAgent.prototype = {
@@ -494,9 +474,6 @@
         for (var i = 0; i < children.length; ++i) {
             var child = children[i];
             this._idToDOMNode[child.id] = child;
-            if (child.shadowRoot)
-                this._idToDOMNode[child.shadowRoot.id] = child.shadowRoot;
-
             if (child.children)
                 this._bindNodes(child.children);
         }
@@ -549,17 +526,6 @@
     querySelectorAll: function(nodeId, selectors, callback)
     {
         DOMAgent.querySelectorAll(nodeId, selectors, this._wrapClientCallback(callback));
-    },
-
-    _shadowRootUpdated: function(hostId, payload)
-    {
-        var host = this._idToDOMNode[hostId];
-        if (host.shadowRoot && !payload)
-            delete this._idToDOMNode[host.shadowRoot.id];
-        host._setShadowRootPayload(payload);
-        if (host.shadowRoot)
-            this._idToDOMNode[host.shadowRoot.id] = host.shadowRoot;
-        this.dispatchEventToListeners(WebInspector.DOMAgent.Events.ShadowRootUpdated, host);
     }
 }
 
@@ -615,10 +581,5 @@
     {
         if (this._domAgent._searchResultCollector)
             this._domAgent._searchResultCollector(nodeIds);
-    },
-
-    shadowRootUpdated: function(hostId, shadowRoot)
-    {
-        this._domAgent._shadowRootUpdated(hostId, shadowRoot);
     }
 }

Modified: trunk/Source/WebCore/inspector/front-end/ElementsPanel.js (88330 => 88331)


--- trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2011-06-08 08:27:23 UTC (rev 88331)
@@ -113,13 +113,12 @@
 
     this._registerShortcuts();
 
-    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeInserted, this._nodeUpdated.bind(this, true));
+    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeInserted, this._nodeInserted, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemoved, this._nodeRemoved, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified, this._attributesUpdated, this);
-    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.CharacterDataModified, this._nodeUpdated.bind(this, false));
+    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.CharacterDataModified, this._characterDataModified, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated, this._documentUpdated, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.ChildNodeCountUpdated, this._childNodeCountUpdated, this);
-    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.ShadowRootUpdated, this._nodeUpdated.bind(this, true));
 
     this.recentlyModifiedNodes = [];
 }
@@ -432,27 +431,33 @@
         delete this._isEditingStyle;
     },
 
-    _nodeUpdated: function(hierarchyUpdated, event)
+    _attributesUpdated: function(event)
     {
-        var updatedNodeDetails = { node: event.data };
-        if (hierarchyUpdated)
-            updatedNodeDetails.parent = event.data.parentNode;
-        this.recentlyModifiedNodes.push(updatedNodeDetails);
+        this.recentlyModifiedNodes.push({node: event.data, updated: true});
         if (this.visible)
             this._updateModifiedNodesSoon();
+
+        if (!this._isEditingStyle && event.data ="" this.focusedDOMNode)
+            this._styleSheetChanged();
     },
 
-    _attributesUpdated: function(event)
+    _characterDataModified: function(event)
     {
-        this._nodeUpdated(false, event);
+        this.recentlyModifiedNodes.push({node: event.data, updated: true});
+        if (this.visible)
+            this._updateModifiedNodesSoon();
+    },
 
-        if (!this._isEditingStyle && event.data ="" this.focusedDOMNode)
-            this._styleSheetChanged();
+    _nodeInserted: function(event)
+    {
+        this.recentlyModifiedNodes.push({node: event.data, parent: event.data.parentNode, inserted: true});
+        if (this.visible)
+            this._updateModifiedNodesSoon();
     },
 
     _nodeRemoved: function(event)
     {
-        this.recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent});
+        this.recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent, removed: true});
         if (this.visible)
             this._updateModifiedNodesSoon();
     },
@@ -485,13 +490,16 @@
             var parent = this.recentlyModifiedNodes[i].parent;
             var node = this.recentlyModifiedNodes[i].node;
 
-            if (!parent) {
+            if (this.recentlyModifiedNodes[i].updated) {
                 var nodeItem = this.treeOutline.findTreeElement(node);
                 if (nodeItem)
                     nodeItem.updateTitle();
                 continue;
             }
 
+            if (!parent)
+                continue;
+
             var parentNodeItem = this.treeOutline.findTreeElement(parent);
             if (parentNodeItem && !parentNodeItem.alreadyUpdatedChildren) {
                 parentNodeItem.updateChildren();
@@ -661,10 +669,6 @@
                     crumbTitle = "<!DOCTYPE>";
                     break;
 
-                case Node.SHADOW_ROOT_NODE:
-                    crumbTitle = "(shadow)";
-                    break;
-
                 default:
                     crumbTitle = this.treeOutline.nodeNameToCorrectCase(current.nodeName());
             }

Modified: trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js (88330 => 88331)


--- trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js	2011-06-08 08:27:23 UTC (rev 88331)
@@ -300,7 +300,7 @@
 WebInspector.ElementsTreeElement = function(node, elementCloseTag)
 {
     this._elementCloseTag = elementCloseTag;
-    var hasChildrenOverride = !elementCloseTag && (node.hasChildNodes() || node.shadowRoot) && !this._showInlineText(node);
+    var hasChildrenOverride = !elementCloseTag && node.hasChildNodes() && !this._showInlineText(node);
 
     // The title will be updated in onattach.
     TreeElement.call(this, "", node, hasChildrenOverride);
@@ -609,15 +609,6 @@
                 child = child.nextSibling;
                 ++treeChildIndex;
             }
-            // If we ever had shadow root child, it's going to be second to last (before closing tag)
-            var shadowRootChild = treeElement.children[treeElement.children.length - 2];
-            if (shadowRootChild && shadowRootChild.representedObject.nodeType() === Node.SHADOW_ROOT_NODE) {
-            if (!node.shadowRoot)
-                treeElement.removeChild(shadowRootChild);
-            else
-                treeElement.representedObject = node.shadowRoot;
-            } else if (node.shadowRoot)
-                treeElement.insertChildElement(node.shadowRoot, treeChildIndex);
         }
 
         // Remove any tree elements that no longer have this node (or this node's contentDocument) as their parent.
@@ -1262,19 +1253,16 @@
             attrSpanElement.appendChild(document.createTextNode("\""));
     },
 
-    _buildTagDOM: function(parentElement, tagName, isClosingTag, isDistinctTreeElement, linkify, isShadow)
+    _buildTagDOM: function(parentElement, tagName, isClosingTag, isDistinctTreeElement, linkify)
     {
         var node = this.representedObject;
         var classes = [ "webkit-html-tag" ];
         if (isClosingTag && isDistinctTreeElement)
             classes.push("close");
-        if (isShadow)
-            classes.push("shadow");
         var tagElement = parentElement.createChild("span", classes.join(" "));
         tagElement.appendChild(document.createTextNode("<"));
         var tagNameElement = tagElement.createChild("span", isClosingTag ? "" : "webkit-html-tag-name");
         tagNameElement.textContent = (isClosingTag ? "/" : "") + tagName;
-
         if (!isClosingTag && node.hasAttributes()) {
             var attributes = node.attributes();
             for (var i = 0; i < attributes.length; ++i) {
@@ -1309,12 +1297,12 @@
             case Node.ELEMENT_NODE:
                 var tagName = this.treeOutline.nodeNameToCorrectCase(node.nodeName()).escapeHTML();
                 if (this._elementCloseTag) {
-                    this._buildTagDOM(info.titleDOM, tagName, true, true, false, node.inShadowTree());
+                    this._buildTagDOM(info.titleDOM, tagName, true, true);
                     info.hasChildren = false;
                     break;
                 }
 
-                this._buildTagDOM(info.titleDOM, tagName, false, false, linkify, node.inShadowTree());
+                this._buildTagDOM(info.titleDOM, tagName, false, false, linkify);
 
                 var textChild = this._singleTextChild(node);
                 var showInlineText = textChild && textChild.nodeValue().length < Preferences.maxInlineTextChildLength;
@@ -1325,7 +1313,7 @@
                         textNodeElement.textContent = "\u2026";
                         info.titleDOM.appendChild(document.createTextNode("\u200B"));
                     }
-                    this._buildTagDOM(info.titleDOM, tagName, true, false, false, node.inShadowTree());
+                    this._buildTagDOM(info.titleDOM, tagName, true, false, false);
                 }
 
                 // If this element only has a single child that is a text node,
@@ -1335,7 +1323,7 @@
                     var textNodeElement = info.titleDOM.createChild("span", "webkit-html-text-node");
                     textNodeElement.textContent = textChild.nodeValue().escapeHTML();
                     info.titleDOM.appendChild(document.createTextNode("\u200B"));
-                    this._buildTagDOM(info.titleDOM, tagName, true, false, node.inShadowTree());
+                    this._buildTagDOM(info.titleDOM, tagName, true, false);
                     info.hasChildren = false;
                 }
                 break;
@@ -1390,12 +1378,6 @@
                 var cdataElement = info.titleDOM.createChild("span", "webkit-html-text-node");
                 cdataElement.appendChild(document.createTextNode("<![CDATA[" + node.nodeValue().escapeHTML() + "]]>"));
                 break;
-
-            case Node.SHADOW_ROOT_NODE:
-                var cdataElement = info.titleDOM.createChild("span", "dom-shadow-root");
-                cdataElement.appendChild(document.createTextNode("(shadow)"));
-                break;
-
             default:
                 var defaultElement = info.titleDOM.appendChild(document.createTextNode(this.treeOutline.nodeNameToCorrectCase(node.nodeName()).collapseWhitespace().escapeHTML()));
         }
@@ -1405,7 +1387,7 @@
 
     _singleTextChild: function(node)
     {
-        if (!node || node.shadowRoot)
+        if (!node)
             return null;
 
         var firstChild = node.firstChild;

Modified: trunk/Source/WebCore/inspector/front-end/inspector.css (88330 => 88331)


--- trunk/Source/WebCore/inspector/front-end/inspector.css	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/front-end/inspector.css	2011-06-08 08:27:23 UTC (rev 88331)
@@ -1056,10 +1056,6 @@
     display: inline-block;
 }
 
-#elements-content .dom-shadow-root {
-    color: rgb(90, 90, 90);
-}
-
 #elements-sidebar {
     position: absolute;
     top: 0;
@@ -1236,10 +1232,6 @@
     text-indent: -12px
 }
 
-.outline-disclosure li .webkit-html-tag.shadow {
-    opacity: 0.7;
-}
-
 .outline-disclosure li .webkit-html-tag.close {
     margin-left: -12px;
 }

Modified: trunk/Source/WebCore/inspector/front-end/utilities.js (88330 => 88331)


--- trunk/Source/WebCore/inspector/front-end/utilities.js	2011-06-08 07:20:23 UTC (rev 88330)
+++ trunk/Source/WebCore/inspector/front-end/utilities.js	2011-06-08 08:27:23 UTC (rev 88331)
@@ -228,9 +228,7 @@
     return this.parentNode.enclosingNodeOrSelfWithClass(className);
 }
 
-Node.SHADOW_ROOT_NODE = 14;
-
-Element.prototype.query = function(query)
+Element.prototype.query = function(query) 
 {
     return this.ownerDocument.evaluate(query, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to