Commit 462c3ea4 authored by morrita@google.com's avatar morrita@google.com
Browse files

2011-01-17 MORITA Hajime <morrita@google.com>

        Unreviewed, rolling out r75995.
        http://trac.webkit.org/changeset/75995
        https://bugs.webkit.org/show_bug.cgi?id=51914

        Causes assertion failures.

        * dom/Element.cpp:
        (WebCore::Element::shadowRoot):
        (WebCore::Element::setShadowRoot):
        (WebCore::Element::removeShadowRoot):
        * dom/ElementRareData.h:
        (WebCore::ElementRareData::ElementRareData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 905dfd3c
2011-01-17 MORITA Hajime <morrita@google.com>
Unreviewed, rolling out r75995.
http://trac.webkit.org/changeset/75995
https://bugs.webkit.org/show_bug.cgi?id=51914
Causes assertion failures.
* dom/Element.cpp:
(WebCore::Element::shadowRoot):
(WebCore::Element::setShadowRoot):
(WebCore::Element::removeShadowRoot):
* dom/ElementRareData.h:
(WebCore::ElementRareData::ElementRareData):
2011-01-17 MORITA Hajime <morrita@google.com>
 
Unreviewed, rolling out r75999.
......
......@@ -1084,7 +1084,7 @@ void Element::recalcStyle(StyleChange change)
Node* Element::shadowRoot()
{
return hasRareData() ? rareData()->m_shadowRoot : 0;
return hasRareData() ? rareData()->m_shadowRoot.get() : 0;
}
void Element::setShadowRoot(PassRefPtr<Node> node)
......@@ -1093,21 +1093,20 @@ void Element::setShadowRoot(PassRefPtr<Node> node)
// about compromising DOM tree integrity (eg. node being a parent of this). However,
// once we implement XBL2, we will have to add integrity checks here.
removeShadowRoot();
if (!node)
RefPtr<Node> newRoot = node;
if (!newRoot)
return;
ElementRareData* data = ensureRareData();
data->m_shadowRoot = node.leakRef();
data->m_shadowRoot->setShadowHost(this);
ensureRareData()->m_shadowRoot = newRoot;
newRoot->setShadowHost(this);
}
void Element::removeShadowRoot()
{
if (ElementRareData* data = rareData()) {
if (!data->m_shadowRoot)
return;
RefPtr<Node> oldRoot = data->m_shadowRoot;
data->m_shadowRoot = 0;
if (!hasRareData())
return;
if (RefPtr<Node> oldRoot = rareData()->m_shadowRoot.release()) {
document()->removeFocusedNodeOfSubtree(oldRoot.get());
oldRoot->setShadowHost(0);
if (oldRoot->inDocument())
......
......@@ -41,7 +41,7 @@ public:
IntSize m_minimumSizeForResizing;
RefPtr<RenderStyle> m_computedStyle;
Node* m_shadowRoot;
RefPtr<Node> m_shadowRoot;
OwnPtr<DatasetDOMStringMap> m_datasetDOMStringMap;
OwnPtr<ClassList> m_classList;
......@@ -54,7 +54,6 @@ inline IntSize defaultMinimumSizeForResizing()
inline ElementRareData::ElementRareData()
: m_minimumSizeForResizing(defaultMinimumSizeForResizing())
, m_shadowRoot(0)
{
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment