Unreviewed, rolling out r90976, r90981, and r90985.
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jul 2011 09:00:26 +0000 (09:00 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jul 2011 09:00:26 +0000 (09:00 +0000)
http://trac.webkit.org/changeset/90976
http://trac.webkit.org/changeset/90981
http://trac.webkit.org/changeset/90985
https://bugs.webkit.org/show_bug.cgi?id=64251

build break

.:

* Source/autotools/symbols.filter:

Source/WebCore:

* WebCore.exp.in:
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::NodeRenderingContext):
(WebCore::NodeRenderingContext::nextRenderer):
(WebCore::NodeRenderingContext::previousRenderer):
* dom/NodeRenderingContext.h:
* dom/ShadowContentElement.cpp:
(WebCore::ShadowContentElement::attach):
(WebCore::ShadowContentElement::detach):
* dom/ShadowContentElement.h:
* dom/ShadowContentSelector.cpp:
(WebCore::ShadowContentSelector::ShadowContentSelector):
(WebCore::ShadowContentSelector::selectInclusion):
(WebCore::ShadowContentSelector::willAttachContentFor):
(WebCore::ShadowContentSelector::didAttachContent):
(WebCore::ShadowContentSelector::activeElement):
* dom/ShadowContentSelector.h:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::~ShadowRoot):
(WebCore::ShadowRoot::activeContentElement):
* dom/ShadowRoot.h:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

* win/WebKit2.def:
* win/WebKit2CFLite.def:

LayoutTests:

* fast/dom/shadow/content-element-includer-expected.txt: Removed.
* fast/dom/shadow/content-element-includer.html: Removed.
* platform/chromium-win/fast/html/details-nested-2-expected.txt:
* platform/gtk/fast/html/details-nested-2-expected.txt:
* platform/mac/fast/html/details-nested-2-expected.txt:
* platform/qt/fast/html/details-nested-2-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90987 268f45cc-cd09-0410-ab3c-d52691b4dbfc

25 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/content-element-includer-expected.txt [deleted file]
LayoutTests/fast/dom/shadow/content-element-includer.html [deleted file]
LayoutTests/platform/chromium-win/fast/html/details-nested-2-expected.txt
LayoutTests/platform/gtk/fast/html/details-nested-2-expected.txt
LayoutTests/platform/mac/fast/html/details-nested-2-expected.txt
LayoutTests/platform/qt/fast/html/details-nested-2-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/NodeRenderingContext.cpp
Source/WebCore/dom/NodeRenderingContext.h
Source/WebCore/dom/ShadowContentElement.cpp
Source/WebCore/dom/ShadowContentElement.h
Source/WebCore/dom/ShadowContentSelector.cpp
Source/WebCore/dom/ShadowContentSelector.h
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/dom/ShadowRoot.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter

index 2b08d5806fa4381105b5950cd55b26c5fa93f45c..4319e58587b82c35457a0b6cd061a6e5d5278790 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-07-14  MORITA Hajime  <morrita@google.com>
+
+        Unreviewed, rolling out r90976, r90981, and r90985.
+        http://trac.webkit.org/changeset/90976
+        http://trac.webkit.org/changeset/90981
+        http://trac.webkit.org/changeset/90985
+        https://bugs.webkit.org/show_bug.cgi?id=64251
+
+        build break
+
+        * Source/autotools/symbols.filter:
+
 2011-07-14  MORITA Hajime <morrita@google.com>
 
         Unreviewed attempt to build fix.
index 90ce3c9607dd36ffaed62702f33cf9f2feb22fb1..e4159a92f18cdcaa3f05094468cbe7c3fc74b464 100644 (file)
@@ -1,3 +1,20 @@
+2011-07-14  MORITA Hajime  <morrita@google.com>
+
+        Unreviewed, rolling out r90976, r90981, and r90985.
+        http://trac.webkit.org/changeset/90976
+        http://trac.webkit.org/changeset/90981
+        http://trac.webkit.org/changeset/90985
+        https://bugs.webkit.org/show_bug.cgi?id=64251
+
+        build break
+
+        * fast/dom/shadow/content-element-includer-expected.txt: Removed.
+        * fast/dom/shadow/content-element-includer.html: Removed.
+        * platform/chromium-win/fast/html/details-nested-2-expected.txt:
+        * platform/gtk/fast/html/details-nested-2-expected.txt:
+        * platform/mac/fast/html/details-nested-2-expected.txt:
+        * platform/qt/fast/html/details-nested-2-expected.txt:
+
 2011-07-14  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt] Unreviewed gardening.
diff --git a/LayoutTests/fast/dom/shadow/content-element-includer-expected.txt b/LayoutTests/fast/dom/shadow/content-element-includer-expected.txt
deleted file mode 100644 (file)
index c0eb073..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-This tests the correctness of includers of forwarded children.
-Note that this test needs internals object thus cannot run outside DRT.
-PASS internals.includerFor(childOfElementWithoutShadow) is null
-PASS internals.includerFor(childOfElementWithShadow) is null
-PASS internals.includerFor(childOfElementWithShadowContent) is shadowContentOfElementWithShadowContent
-PASS internals.includerFor(movingChild) is null
-PASS internals.includerFor(movingChild) is null
-PASS internals.includerFor(movingChild) is anotherShadowContentOfElementWithShadowContent
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/dom/shadow/content-element-includer.html b/LayoutTests/fast/dom/shadow/content-element-includer.html
deleted file mode 100644 (file)
index e2573b9..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<pre id="console">
-This tests the correctness of includers of forwarded children.
-Note that this test needs internals object thus cannot run outside DRT.
-</pre>
-<div id="container"></div>
-<script>
-var container = document.getElementById("container");
-
-var shadowRoot = null;
-
-var elementWithoutShadow = document.createElement("div");
-container.appendChild(elementWithoutShadow);
-var childOfElementWithoutShadow = document.createElement("span");
-elementWithoutShadow.appendChild(childOfElementWithoutShadow);
-container.offsetLeft;
-shouldBe("internals.includerFor(childOfElementWithoutShadow)", "null");
-
-var elementWithShadow = document.createElement("div");
-container.appendChild(elementWithShadow);
-var shadowRootOfElementWithShadow = internals.ensureShadowRoot(elementWithShadow);
-shadowRootOfElementWithShadow.appendChild(document.createElement("div")); // Gives non-content child. 
-var childOfElementWithShadow = document.createElement("span");
-elementWithShadow.appendChild(childOfElementWithShadow);
-container.offsetLeft;
-shouldBe("internals.includerFor(childOfElementWithShadow)", "null");
-
-var elementWithShadowContent = document.createElement("div");
-container.appendChild(elementWithShadowContent);
-var shadowRootOfElementWithShadowContent = internals.ensureShadowRoot(elementWithShadowContent);
-var shadowContentOfElementWithShadowContent = internals.createShadowContentElement(document);
-shadowRootOfElementWithShadowContent.appendChild(shadowContentOfElementWithShadowContent);
-var childOfElementWithShadowContent = document.createElement("span");
-elementWithShadowContent.appendChild(childOfElementWithShadowContent);
-container.offsetLeft;
-shouldBe("internals.includerFor(childOfElementWithShadowContent)", "shadowContentOfElementWithShadowContent");
-
-//
-// Testing dynamic change
-//
-var movingChild = childOfElementWithShadowContent;
-
-// Removing
-elementWithShadowContent.removeChild(movingChild);
-shouldBe("internals.includerFor(movingChild)", "null");
-
-// Moving to content-less tree
-elementWithShadow.appendChild(movingChild);
-shouldBe("internals.includerFor(movingChild)", "null");
-elementWithShadow.removeChild(movingChild);
-
-// Moving to another content-full tree
-var anotherElementWithShadowContent = document.createElement("div");
-container.appendChild(anotherElementWithShadowContent);
-var anotherShadowRootOfElementWithShadowContent = internals.ensureShadowRoot(anotherElementWithShadowContent);
-var anotherShadowContentOfElementWithShadowContent = internals.createShadowContentElement(document);
-anotherShadowRootOfElementWithShadowContent.appendChild(anotherShadowContentOfElementWithShadowContent);
-
-anotherElementWithShadowContent.appendChild(movingChild);
-container.offsetLeft;
-shouldBe("internals.includerFor(movingChild)", "anotherShadowContentOfElementWithShadowContent");
-
-var successfullyParsed = true;
-</script>
-<script src="../../js/resources/js-test-post.js"></script>
-</body>
-</html>
index 1d9ff835317ef16e4ec85433b34ba44b25680d38..b11888f4df1450439feeb7855fb4d0907b3ac4ca 100644 (file)
@@ -9,6 +9,7 @@ layer at (0,0) size 800x600
           RenderText {#text} at (24,8) size 58x19
             text run at (24,8) width 4: " "
             text run at (28,8) width 54: "summary"
+        RenderBlock (anonymous) at (8,44) size 768x0
         RenderDetails {DETAILS} at (8,44) size 768x72 [border: (8px solid #995555)]
           RenderSummary {SUMMARY} at (8,8) size 752x36 [border: (8px solid #CC9999)]
             RenderDetailsMarker {DIV} at (8,13) size 10x10: down
index 730d49b58b44fbca741019816e269c6d87861a3f..11e97c988be576b2b19ac267334252be431363e1 100644 (file)
@@ -9,6 +9,7 @@ layer at (0,0) size 800x600
           RenderText {#text} at (24,8) size 62x19
             text run at (24,8) width 4: " "
             text run at (28,8) width 58: "summary"
+        RenderBlock (anonymous) at (8,43) size 768x0
         RenderDetails {DETAILS} at (8,43) size 768x70 [border: (8px solid #995555)]
           RenderSummary {SUMMARY} at (8,8) size 752x35 [border: (8px solid #CC9999)]
             RenderDetailsMarker {DIV} at (8,13) size 10x10: down
index 74d8f0f5d9f89c50429f76aadca3ec565df1dda2..35c80d890f40917df4c4f88d173db54fcb2b2663 100644 (file)
@@ -9,6 +9,7 @@ layer at (0,0) size 800x600
           RenderText {#text} at (24,8) size 62x18
             text run at (24,8) width 4: " "
             text run at (28,8) width 58: "summary"
+        RenderBlock (anonymous) at (8,42) size 768x0
         RenderDetails {DETAILS} at (8,42) size 768x68 [border: (8px solid #995555)]
           RenderSummary {SUMMARY} at (8,8) size 752x34 [border: (8px solid #CC9999)]
             RenderDetailsMarker {DIV} at (8,12) size 10x10: down
index 76b71cf5b80236ed1e79387f60bb004a02ee41e8..5af259246083bc4f105cb7980aaf7dee9acbeae6 100644 (file)
@@ -9,6 +9,7 @@ layer at (0,0) size 800x600
           RenderText {#text} at (24,8) size 68x22
             text run at (24,8) width 4: " "
             text run at (28,8) width 64: "summary"
+        RenderBlock (anonymous) at (8,46) size 768x0
         RenderDetails {DETAILS} at (8,46) size 768x76 [border: (8px solid #995555)]
           RenderSummary {SUMMARY} at (8,8) size 752x38 [border: (8px solid #CC9999)]
             RenderDetailsMarker {DIV} at (8,14) size 10x10: down
index 12374e76102ed5225396436d158f5a1bd128f3c3..308476a16f99953123afcc39932f2bc73ae90a00 100644 (file)
@@ -1,3 +1,38 @@
+2011-07-14  MORITA Hajime  <morrita@google.com>
+
+        Unreviewed, rolling out r90976, r90981, and r90985.
+        http://trac.webkit.org/changeset/90976
+        http://trac.webkit.org/changeset/90981
+        http://trac.webkit.org/changeset/90985
+        https://bugs.webkit.org/show_bug.cgi?id=64251
+
+        build break
+
+        * WebCore.exp.in:
+        * dom/NodeRenderingContext.cpp:
+        (WebCore::NodeRenderingContext::NodeRenderingContext):
+        (WebCore::NodeRenderingContext::nextRenderer):
+        (WebCore::NodeRenderingContext::previousRenderer):
+        * dom/NodeRenderingContext.h:
+        * dom/ShadowContentElement.cpp:
+        (WebCore::ShadowContentElement::attach):
+        (WebCore::ShadowContentElement::detach):
+        * dom/ShadowContentElement.h:
+        * dom/ShadowContentSelector.cpp:
+        (WebCore::ShadowContentSelector::ShadowContentSelector):
+        (WebCore::ShadowContentSelector::selectInclusion):
+        (WebCore::ShadowContentSelector::willAttachContentFor):
+        (WebCore::ShadowContentSelector::didAttachContent):
+        (WebCore::ShadowContentSelector::activeElement):
+        * dom/ShadowContentSelector.h:
+        * dom/ShadowRoot.cpp:
+        (WebCore::ShadowRoot::~ShadowRoot):
+        (WebCore::ShadowRoot::activeContentElement):
+        * dom/ShadowRoot.h:
+        * testing/Internals.cpp:
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2011-07-13  Ryosuke Niwa  <rniwa@webkit.org>
 
         Move forwardEvent from RenderTextControl to HTMLTextFormControlElement
index 763fb14f8224edae511e593fcd470ce134f64b2d..1c056ac72519480e3734c2b7c6f820805e76c9d8 100644 (file)
@@ -542,8 +542,6 @@ __ZN7WebCore19TextResourceDecoder6decodeEPKcm
 __ZN7WebCore19TextResourceDecoderC1ERKN3WTF6StringERKNS_12TextEncodingEb
 __ZN7WebCore19TextResourceDecoderD1Ev
 __ZN7WebCore19applicationIsSafariEv
-__ZN7WebCore20NodeRenderingContextC1EPNS_4NodeE
-__ZN7WebCore20NodeRenderingContextD1Ev
 __ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
 __ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
 __ZN7WebCore20ResourceResponseBaseC2Ev
index 3a172d05c115b9fde61d992fbbfd91f375c6bed1..507399f31e82836626ce6b121705f3b5b4bc0932 100644 (file)
@@ -41,7 +41,7 @@ NodeRenderingContext::NodeRenderingContext(Node* node)
     , m_node(node)
     , m_parentNodeForRenderingAndStyle(0)
     , m_visualParentShadowRoot(0)
-    , m_includer(0)
+    , m_contentElement(0)
     , m_style(0)
 {
     ContainerNode* parent = m_node->parentOrHostNode();
@@ -60,9 +60,9 @@ NodeRenderingContext::NodeRenderingContext(Node* node)
         m_visualParentShadowRoot = toElement(parent)->shadowRoot();
 
         if (m_visualParentShadowRoot) {
-            if ((m_includer = m_visualParentShadowRoot->includerFor(m_node))) {
+            if ((m_contentElement = m_visualParentShadowRoot->activeContentElement())) {
                 m_phase = AttachContentForwarded;
-                m_parentNodeForRenderingAndStyle = NodeRenderingContext(m_includer).parentNodeForRenderingAndStyle();
+                m_parentNodeForRenderingAndStyle = NodeRenderingContext(m_contentElement).parentNodeForRenderingAndStyle();
                 return;
             } 
                 
@@ -81,7 +81,7 @@ NodeRenderingContext::NodeRenderingContext(Node* node, RenderStyle* style)
     , m_node(node)
     , m_parentNodeForRenderingAndStyle(0)
     , m_visualParentShadowRoot(0)
-    , m_includer(0)
+    , m_contentElement(0)
     , m_style(style)
 {
 }
@@ -155,9 +155,9 @@ RenderObject* NodeRenderingContext::nextRenderer() const
         return renderer->nextSibling();
 
     if (m_phase == AttachContentForwarded) {
-        if (RenderObject* found = nextRendererOf(m_includer, m_node))
+        if (RenderObject* found = nextRendererOf(m_contentElement, m_node))
             return found;
-        return NodeRenderingContext(m_includer).nextRenderer();
+        return NodeRenderingContext(m_contentElement).nextRenderer();
     }
 
     // Avoid an O(n^2) problem with this function by not checking for
@@ -184,9 +184,9 @@ RenderObject* NodeRenderingContext::previousRenderer() const
         return renderer->previousSibling();
 
     if (m_phase == AttachContentForwarded) {
-        if (RenderObject* found = previousRendererOf(m_includer, m_node))
+        if (RenderObject* found = previousRendererOf(m_contentElement, m_node))
             return found;
-        return NodeRenderingContext(m_includer).previousRenderer();
+        return NodeRenderingContext(m_contentElement).previousRenderer();
     }
 
     // FIXME: We should have the same O(N^2) avoidance as nextRenderer does
index 9a623e4b76331b67fa88a17c32b9a46c612550a6..95775f03d56e04c0d64568b4f096a62a3a4e2a7b 100644 (file)
@@ -50,7 +50,6 @@ public:
     RenderObject* parentRenderer() const;
     RenderObject* nextRenderer() const;
     RenderObject* previousRenderer() const;
-    ShadowContentElement* includer() const;
 
     RenderStyle* style() const;
     void setStyle(PassRefPtr<RenderStyle>);
@@ -80,7 +79,7 @@ private:
     Node* m_node;
     ContainerNode* m_parentNodeForRenderingAndStyle;
     ShadowRoot* m_visualParentShadowRoot;
-    ShadowContentElement* m_includer;
+    ShadowContentElement* m_contentElement;
     RefPtr<RenderStyle> m_style;
 };
 
@@ -100,11 +99,6 @@ inline RenderStyle* NodeRenderingContext::style() const
     return m_style.get();
 }
 
-inline ShadowContentElement* NodeRenderingContext::includer() const
-{
-    return m_includer;
-}
-
 class NodeRendererFactory {
     WTF_MAKE_NONCOPYABLE(NodeRendererFactory);
     WTF_MAKE_FAST_ALLOCATED;
index c3c191861cf3e1d93542a1c976804192c9a1fde8..6d7e747b4b4dce13009cf6bafc70ea8cb4afcb2e 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "HTMLNames.h"
 #include "ShadowContentSelector.h"
-#include "ShadowRoot.h"
 
 namespace WebCore {
 
@@ -98,6 +97,7 @@ void ShadowInclusionList::append(PassRefPtr<ShadowInclusion> child)
     m_last = m_last->next();
 }
 
+
 PassRefPtr<ShadowContentElement> ShadowContentElement::create(Document* document)
 {
     DEFINE_STATIC_LOCAL(QualifiedName, tagName, (nullAtom, "webkitShadowContent", HTMLNames::divTag.namespaceURI()));
@@ -113,44 +113,24 @@ ShadowContentElement::~ShadowContentElement()
 {
 }
 
-static void removeFromSet(ShadowInclusionList* list, ShadowInclusionSet* set)
-{
-    for (ShadowInclusion* inclusion = list->first(); inclusion; inclusion = inclusion->next())
-        set->remove(inclusion);
-}
-
-static void addToSet(ShadowInclusionList* list, ShadowInclusionSet* set)
-{
-    for (ShadowInclusion* inclusion = list->first(); inclusion; inclusion = inclusion->next())
-        set->add(inclusion);
-}
-
 void ShadowContentElement::attach()
 {
     ASSERT(!firstChild()); // Currently doesn't support any light child.
     StyledElement::attach();
     if (ShadowContentSelector* selector = ShadowContentSelector::currentInstance()) {
-
-        removeFromSet(&m_inclusions, selector->shadowRoot()->ensureInclusions());
-        m_inclusions.clear();
-        selector->selectInclusion(this, &m_inclusions);
-        addToSet(&m_inclusions, selector->shadowRoot()->ensureInclusions());
-
+        selector->willAttachContentFor(this);
+        selector->selectInclusion(&m_inclusions);
         for (ShadowInclusion* inclusion = m_inclusions.first(); inclusion; inclusion = inclusion->next())
             inclusion->content()->detach();
         for (ShadowInclusion* inclusion = m_inclusions.first(); inclusion; inclusion = inclusion->next())
             inclusion->content()->attach();
+        selector->didAttachContent();
     }
 }
 
 void ShadowContentElement::detach()
 {
-    if (ShadowRoot* root = toShadowRoot(shadowTreeRootNode())) {
-        removeFromSet(&m_inclusions, root->ensureInclusions());
-        m_inclusions.clear();
-    }
-
-    ASSERT(m_inclusions.isEmpty());
+    m_inclusions.clear();
     StyledElement::detach();
 }
 
index bda482bdb1d6aeca53ad3b9955949ac61e912bc8..5d6b0c336d9655522d244cdb628ede609530baf0 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "StyledElement.h"
 #include <wtf/Forward.h>
-#include <wtf/HashSet.h>
 
 namespace WebCore {
 
@@ -67,6 +66,7 @@ inline PassRefPtr<ShadowInclusion> ShadowInclusion::create(ShadowContentElement*
     return adoptRef(new ShadowInclusion(includer, content));
 }
 
+
 class ShadowInclusionList {
 public:
     ShadowInclusionList();
@@ -91,36 +91,6 @@ inline void ShadowInclusionList::append(ShadowContentElement* includer, Node* no
     append(ShadowInclusion::create(includer, node));
 }
 
-class ShadowInclusionSet {
-public:
-    void add(ShadowInclusion* value) { m_set.add(value); }
-    void remove(ShadowInclusion* value) { m_set.remove(value); }
-    bool isEmpty() const { return m_set.isEmpty(); }
-    ShadowInclusion* find(Node* key) const;
-
-private:
-    struct Translator {
-    public:
-        static unsigned hash(const Node* key) { return PtrHash<const Node*>::hash(key); }
-        static bool equal(const ShadowInclusion* inclusion, const Node* content) { return inclusion->content() == content; }
-    };
-
-    struct Hash {
-        static unsigned hash(ShadowInclusion* key) { return PtrHash<const Node*>::hash(key->content()); }
-        static bool equal(ShadowInclusion* a, ShadowInclusion* b) { return a->content() == b->content(); }
-        static const bool safeToCompareToEmptyOrDeleted = false;
-    };
-
-    typedef HashSet<ShadowInclusion*, Hash> PointerSet;
-
-    PointerSet m_set;
-};
-
-inline ShadowInclusion* ShadowInclusionSet::find(Node* key) const
-{
-    PointerSet::iterator found = m_set.find<Node*, ShadowInclusionSet::Translator>(key);
-    return found != m_set.end() ? *found : 0;
-}
 
 // NOTE: Current implementation doesn't support dynamic insertion/deletion of ShadowContentElement.
 // You should create ShadowContentElement during the host construction.
index b08fc75b8e304a9efa32963fee2234042960dbc1..016a447ae1c0da96216810cbe68b92713acd3aa7 100644 (file)
@@ -38,6 +38,7 @@ ShadowContentSelector* ShadowContentSelector::s_currentInstance = 0;
 ShadowContentSelector::ShadowContentSelector(ShadowRoot* shadowRoot)
     : m_parent(s_currentInstance)
     , m_shadowRoot(shadowRoot)
+    , m_activeElement(0)
 {
     s_currentInstance = this;
     for (Node* node = shadowRoot->shadowHost()->firstChild(); node; node = node->nextSibling())
@@ -50,20 +51,38 @@ ShadowContentSelector::~ShadowContentSelector()
     s_currentInstance = m_parent;
 }
 
-void ShadowContentSelector::selectInclusion(ShadowContentElement* contentElement, ShadowInclusionList* inclusions)
+void ShadowContentSelector::selectInclusion(ShadowInclusionList* inclusions)
 {
-    ASSERT(inclusions->isEmpty());
+    inclusions->clear();
 
     for (size_t i = 0; i < m_children.size(); ++i) {
         Node* child = m_children[i].get();
         if (!child)
             continue;
-        if (!contentElement->shouldInclude(child))
+        if (!m_activeElement->shouldInclude(child))
             continue;
 
-        inclusions->append(contentElement, child);
+        inclusions->append(m_activeElement, child);
         m_children[i] = 0;
     }
+
+}
+
+void ShadowContentSelector::willAttachContentFor(ShadowContentElement* element)
+{
+    ASSERT(!m_activeElement);
+    m_activeElement = element;
+}
+
+void ShadowContentSelector::didAttachContent()
+{
+    ASSERT(m_activeElement);
+    m_activeElement = 0;
+}
+
+ShadowContentElement* ShadowContentSelector::activeElement() const
+{
+    return m_activeElement;
 }
 
 }
index b1960ef21f24583ce408fef1e5120d0595aaa8e6..b5f671439f3b59682ad64592ddc82831cf899c4c 100644 (file)
@@ -49,14 +49,18 @@ public:
     explicit ShadowContentSelector(ShadowRoot*);
     ~ShadowContentSelector();
 
-    void selectInclusion(ShadowContentElement*, ShadowInclusionList*);
+    void willAttachContentFor(ShadowContentElement*);
+    void didAttachContent();
+    void selectInclusion(ShadowInclusionList*);
 
     ShadowRoot* shadowRoot() const { return m_shadowRoot; }
+    ShadowContentElement* activeElement() const;
     static ShadowContentSelector* currentInstance() { return s_currentInstance; }
 
 private:
     ShadowContentSelector* m_parent;
     ShadowRoot* m_shadowRoot;
+    ShadowContentElement* m_activeElement;
     Vector<RefPtr<Node> > m_children;
 
     static ShadowContentSelector* s_currentInstance;
index 1cb04a473d3a9ce07ea8ce4a4a9b8ca96bd485cf..95e37700a3d88345763117b2d8e6131c62caa011 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "Document.h"
 #include "NodeRareData.h"
-#include "ShadowContentElement.h"
 #include "ShadowContentSelector.h"
 
 namespace WebCore {
@@ -50,7 +49,6 @@ ShadowRoot::ShadowRoot(Document* document)
 
 ShadowRoot::~ShadowRoot()
 {
-    ASSERT(!m_inclusions || m_inclusions->isEmpty());
 }
 
 String ShadowRoot::nodeName() const
@@ -97,14 +95,12 @@ void ShadowRoot::recalcStyle(StyleChange change)
     clearChildNeedsStyleRecalc();
 }
 
-ShadowContentElement* ShadowRoot::includerFor(Node* node) const
+ShadowContentElement* ShadowRoot::activeContentElement()
 {
-    if (!m_inclusions)
+    ShadowContentSelector* selector = ShadowContentSelector::currentInstance();
+    if (!selector || selector->shadowRoot() != this)
         return 0;
-    ShadowInclusion* found = m_inclusions->find(node);
-    if (!found)
-        return 0;
-    return found->includer();
+    return selector->activeElement();
 }
 
 void ShadowRoot::hostChildrenChanged()
@@ -141,17 +137,4 @@ void ShadowRoot::attach()
     TreeScope::attach();
 }
 
-ShadowInclusionSet* ShadowRoot::inclusions() const
-{
-    return m_inclusions.get();
-}
-
-ShadowInclusionSet* ShadowRoot::ensureInclusions()
-{
-    if (!m_inclusions)
-        m_inclusions = adoptPtr(new ShadowInclusionSet());
-    return m_inclusions.get();
-}
-
-
 }
index ed0e787aaedaa2cd6d63568fe09bec7a69cbd26e..62122de18700dc1b0f9e68080b42ff68032e8887 100644 (file)
@@ -33,7 +33,6 @@ namespace WebCore {
 
 class Document;
 class ShadowContentElement;
-class ShadowInclusionSet;
 
 class ShadowRoot : public TreeScope {
 public:
@@ -41,7 +40,7 @@ public:
 
     virtual void recalcStyle(StyleChange = NoChange);
 
-    ShadowContentElement* includerFor(Node*) const;
+    ShadowContentElement* activeContentElement();
     void hostChildrenChanged();
 
     virtual void attach();
@@ -49,9 +48,6 @@ public:
     virtual bool applyAuthorSheets() const;
     void setApplyAuthorSheets(bool);
 
-    ShadowInclusionSet* inclusions() const;
-    ShadowInclusionSet* ensureInclusions();
-
 private:
     ShadowRoot(Document*);
     virtual ~ShadowRoot();
@@ -64,7 +60,6 @@ private:
     bool hasContentElement() const;
 
     bool m_applyAuthorSheets;
-    OwnPtr<ShadowInclusionSet> m_inclusions;
 };
 
 inline PassRefPtr<ShadowRoot> ShadowRoot::create(Document* document)
@@ -72,12 +67,6 @@ inline PassRefPtr<ShadowRoot> ShadowRoot::create(Document* document)
     return adoptRef(new ShadowRoot(document));
 }
 
-inline ShadowRoot* toShadowRoot(Node* node)
-{
-    ASSERT(!node || node->nodeType() == Node::SHADOW_ROOT_NODE);
-    return static_cast<ShadowRoot*>(node);
-}
-
 } // namespace
 
 #endif
index 4d7b6aae27db0be427359d869f009c9e89209f54..fb95e1b96e83ab3f5f165d0a1f69bc4fcf3d80a7 100644 (file)
@@ -31,7 +31,6 @@
 #include "Element.h"
 #include "ExceptionCode.h"
 #include "InspectorController.h"
-#include "NodeRenderingContext.h"
 #include "Page.h"
 #include "RenderTreeAsText.h"
 #include "ShadowContentElement.h"
@@ -116,16 +115,6 @@ void Internals::removeShadowRoot(Element* host, ExceptionCode& ec)
     host->removeShadowRoot();
 }
 
-Element* Internals::includerFor(Node* node, ExceptionCode& ec)
-{
-    if (!node) {
-        ec = INVALID_ACCESS_ERR;
-        return 0;
-    }
-
-    return NodeRenderingContext(node).includer();
-}
-
 String Internals::shadowPseudoId(Element* element, ExceptionCode& ec)
 {
     if (!element) {
index b626b59a0f0ae9ff8bf068a2dca02af105188a41..b0c1d673dee746791ec710e7a8259dd85fae9ded 100644 (file)
@@ -50,7 +50,6 @@ public:
     Node* ensureShadowRoot(Element* host, ExceptionCode&);
     Node* shadowRoot(Element* host, ExceptionCode&);
     void removeShadowRoot(Element* host, ExceptionCode&);
-    Element* includerFor(Node*, ExceptionCode&);
     String shadowPseudoId(Element*, ExceptionCode&);
     PassRefPtr<Element> createShadowContentElement(Document*, ExceptionCode&);
 
index d7b2183bd1c5557629b189827657147a7dd306f1..6aba8039f8b1559acec971fffb8ce452d5386bb7 100644 (file)
@@ -32,7 +32,6 @@ module window {
 
         Node ensureShadowRoot(in Element host) raises (DOMException);
         Node shadowRoot(in Element host) raises (DOMException);
-        Element includerFor(in Node node) raises (DOMException);
         void removeShadowRoot(in Element host) raises (DOMException);
         DOMString shadowPseudoId(in Element element) raises (DOMException);
         Element createShadowContentElement(in Document document) raises(DOMException);
index 31f36f36fdeaf0931fcd2f164670a9d5c9e5b7e6..5a00474f259ec750ba63b3de28c82d10be90e938 100644 (file)
@@ -1,3 +1,16 @@
+2011-07-14  MORITA Hajime  <morrita@google.com>
+
+        Unreviewed, rolling out r90976, r90981, and r90985.
+        http://trac.webkit.org/changeset/90976
+        http://trac.webkit.org/changeset/90981
+        http://trac.webkit.org/changeset/90985
+        https://bugs.webkit.org/show_bug.cgi?id=64251
+
+        build break
+
+        * win/WebKit2.def:
+        * win/WebKit2CFLite.def:
+
 2011-07-13  MORITA Hajime <morrita@google.com>
 
         Unreviewed attempt at a build fix.
index 711d02fe5135a2c7961242fd852dfbf2d103b57f..6181dde06a47d6e055b7624b763a5eeb45b34df8 100644 (file)
@@ -135,9 +135,6 @@ EXPORTS
         ?createThread@WTF@@YAIP6APAXPAX@Z0@Z
 
         ; Re-exports from WebCore for test harnesses
-        ??0NodeRenderingContext@WebCore@@QAE@PAVNode@1@@Z
-        ??1NodeRenderingContext@WebCore@@QAE@XZ
-        ?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
         ??0String@WTF@@QAE@PBD@Z
         ??0String@WTF@@QAE@PB_W@Z
         ?add@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBD@Z
index d5ba4ee42258275fba617cdd0e8636a534d6a448..0a3559e62504ea345769d28ecef9ecddd91f797d 100644 (file)
@@ -128,10 +128,8 @@ EXPORTS
         ?createThread@WTF@@YAIP6APAXPAX@Z0@Z
 
         ; Re-exports from WebCore for test harnesses
-        ??0NodeRenderingContext@WebCore@@QAE@PAVNode@1@@Z
         ??0String@WTF@@QAE@PBD@Z
         ??0String@WTF@@QAE@PB_W@Z
-        ??1NodeRenderingContext@WebCore@@QAE@XZ
         ?add@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBD@Z
         ?addSlowCase@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PAVStringImpl@2@@Z
         ?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z
@@ -150,5 +148,4 @@ EXPORTS
         ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
         ?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
         ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
-        ?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
-        ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
\ No newline at end of file
+        ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
index 04301459c70641ded6c191c3e6c72a75b446d060..bc920a9723d163d5400273a8d9be95cb2e7a4fbc 100644 (file)
@@ -37,15 +37,12 @@ _ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi;
 _ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_;
 _ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;
 _ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii;
-_ZN7WebCore20NodeRenderingContextC1EPNS_4NodeE;
-_ZN7WebCore20NodeRenderingContextD1Ev;
 _ZN7WebCore20ShadowContentElement6createEPNS_8DocumentE;
 _ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
 _ZN7WebCore22externalRepresentationEPNS_7ElementEj;
 _ZN7WebCore6JSNode13visitChildrenERN3JSC11SlotVisitorE;
 _ZN7WebCore6JSNode3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
 _ZN7WebCore6JSNode6s_infoE;
-_ZN7WebCore6toNodeEN3JSC7JSValueE;
 _ZN7WebCore7Element16ensureShadowRootEv;
 _ZN7WebCore7Element16removeShadowRootEv;
 _ZN7WebCore9JSElement3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;