Changeset 84511 in webkit


Ignore:
Timestamp:
Apr 21, 2011 9:51:55 AM (13 years ago)
Author:
morrita@google.com
Message:

2011-04-20 MORITA Hajime <morrita@google.com>

Reviewed by Dimitri Glazkov.

Content of <summary> should be forwarded through the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=58914

  • Added test cases for dynamic DOM change.
  • Updated expectations details-open2.html because generated RenderTree slightly changed.
  • fast/html/details-add-summary-child-1.html: Added.
  • fast/html/details-add-summary-child-2.html: Added.
  • fast/html/details-remove-summary-child-1.html: Added.
  • fast/html/details-remove-summary-child-2.html: Added.
  • platform/chromium/test_expectations.txt:
  • platform/mac/fast/html/details-add-summary-child-1-expected.checksum: Added.
  • platform/mac/fast/html/details-add-summary-child-1-expected.png: Added.
  • platform/mac/fast/html/details-add-summary-child-1-expected.txt: Added.
  • platform/mac/fast/html/details-add-summary-child-2-expected.checksum: Added.
  • platform/mac/fast/html/details-add-summary-child-2-expected.png: Added.
  • platform/mac/fast/html/details-add-summary-child-2-expected.txt: Added.
  • platform/mac/fast/html/details-open2-expected.txt:
  • platform/mac/fast/html/details-remove-summary-child-1-expected.checksum: Added.
  • platform/mac/fast/html/details-remove-summary-child-1-expected.png: Added.
  • platform/mac/fast/html/details-remove-summary-child-1-expected.txt: Added.
  • platform/mac/fast/html/details-remove-summary-child-2-expected.checksum: Added.
  • platform/mac/fast/html/details-remove-summary-child-2-expected.png: Added.
  • platform/mac/fast/html/details-remove-summary-child-2-expected.txt: Added.

2011-04-20 MORITA Hajime <morrita@google.com>

Reviewed by Dimitri Glazkov.

Content of <summary> should be forwarded through the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=58914

  • Introduced ShadowContentElement which hosts forwarded children of <summary>
  • Encapsulated Node::parentNodeForRenderingAndStyle() and shouldCreateRendererFor() into NodeVisualParentLookupResult class.
  • The parent lookup is also aware of node forwarding. If the visual parent node has a shadow root, the node is possibly forwarded to ShadowContentElement
  • ShadowContentElement lookup is implemented inside ShadowRoot.

Tests: fast/html/details-add-summary-child-1.html

fast/html/details-add-summary-child-2.html
fast/html/details-remove-summary-child-1.html
fast/html/details-remove-summary-child-2.html

  • GNUmakefile.list.am:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Element.cpp: (WebCore::Element::childrenChanged):
  • dom/Node.cpp: (WebCore::NodeRenderParentDetector::NodeRenderParentDetector): (WebCore::NodeRenderParentDetector::parentNodeForRenderingAndStyle): (WebCore::NodeRenderParentDetector::findVisualParent): (WebCore::NodeRenderParentDetector::shouldCreateRenderer): (WebCore::Node::parentNodeForRenderingAndStyle): (WebCore::Node::createRendererAndStyle):
  • dom/ShadowRoot.cpp: (WebCore::ShadowRoot::contentContainerFor): (WebCore::ShadowRoot::hostChildrenChanged): (WebCore::ShadowRoot::firstContentElement):
  • dom/ShadowRoot.h:
  • html/HTMLSummaryElement.cpp: (WebCore::HTMLSummaryElement::createShadowSubtree):
  • html/HTMLSummaryElement.h:
  • html/shadow/ShadowContentElement.h: Copied from Source/WebCore/dom/ShadowRoot.h. (WebCore::ShadowContentElement::ShadowContentElement): (WebCore::ShadowContentElement::isShadowBoundary): (WebCore::ShadowContentElement::createRenderer): (WebCore::ShadowContentElement::create):
Location:
trunk
Files:
16 added
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r84509 r84511  
     12011-04-20  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Content of <summary> should be forwarded through the shadow DOM
     6        https://bugs.webkit.org/show_bug.cgi?id=58914
     7
     8        - Added test cases for dynamic DOM change.
     9        - Updated expectations details-open2.html because generated RenderTree slightly changed.
     10
     11        * fast/html/details-add-summary-child-1.html: Added.
     12        * fast/html/details-add-summary-child-2.html: Added.
     13        * fast/html/details-remove-summary-child-1.html: Added.
     14        * fast/html/details-remove-summary-child-2.html: Added.
     15        * platform/chromium/test_expectations.txt:
     16        * platform/mac/fast/html/details-add-summary-child-1-expected.checksum: Added.
     17        * platform/mac/fast/html/details-add-summary-child-1-expected.png: Added.
     18        * platform/mac/fast/html/details-add-summary-child-1-expected.txt: Added.
     19        * platform/mac/fast/html/details-add-summary-child-2-expected.checksum: Added.
     20        * platform/mac/fast/html/details-add-summary-child-2-expected.png: Added.
     21        * platform/mac/fast/html/details-add-summary-child-2-expected.txt: Added.
     22        * platform/mac/fast/html/details-open2-expected.txt:
     23        * platform/mac/fast/html/details-remove-summary-child-1-expected.checksum: Added.
     24        * platform/mac/fast/html/details-remove-summary-child-1-expected.png: Added.
     25        * platform/mac/fast/html/details-remove-summary-child-1-expected.txt: Added.
     26        * platform/mac/fast/html/details-remove-summary-child-2-expected.checksum: Added.
     27        * platform/mac/fast/html/details-remove-summary-child-2-expected.png: Added.
     28        * platform/mac/fast/html/details-remove-summary-child-2-expected.txt: Added.
     29
    1302011-04-20  Matthew Delaney  <mdelaney@apple.com>
    231
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r84503 r84511  
    35063506BUGCR79770 WIN : fast/html/details-add-summary-8.html = IMAGE
    35073507BUGCR79770 WIN : fast/forms/select-background-none.html = IMAGE
     3508
     3509// Need rebaselining
     3510BUGWK58914 : fast/html/details-add-summary-child-1.html = FAIL
     3511BUGWK58914 : fast/html/details-add-summary-child-2.html = FAIL
     3512BUGWK58914 : fast/html/details-remove-summary-child-1.html = FAIL
     3513BUGWK58914 : fast/html/details-remove-summary-child-2.html = FAIL
     3514BUGWK58914 : fast/html/details-open2.html = FAIL
    35083515
    35093516// Temporarily marked as failing for rebaselining.
  • trunk/LayoutTests/platform/mac/fast/html/details-open2-expected.txt

    r84039 r84511  
    1313          RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    1414          RenderText {#text} at (0,0) size 0x0
     15          RenderText {#text} at (0,0) size 0x0
    1516layer at (13,31) size 119x13
    1617  RenderBlock {DIV} at (3,3) size 119x13
  • trunk/Source/WebCore/ChangeLog

    r84510 r84511  
     12011-04-20  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Content of <summary> should be forwarded through the shadow DOM
     6        https://bugs.webkit.org/show_bug.cgi?id=58914
     7
     8        - Introduced ShadowContentElement which hosts forwarded children of <summary>
     9        - Encapsulated Node::parentNodeForRenderingAndStyle() and shouldCreateRendererFor()
     10          into NodeVisualParentLookupResult class.
     11        - The parent lookup is also aware of node forwarding. If the visual parent node has
     12          a shadow root, the node is possibly forwarded to ShadowContentElement
     13        - ShadowContentElement lookup is implemented inside ShadowRoot.
     14       
     15        Tests: fast/html/details-add-summary-child-1.html
     16               fast/html/details-add-summary-child-2.html
     17               fast/html/details-remove-summary-child-1.html
     18               fast/html/details-remove-summary-child-2.html
     19
     20        * GNUmakefile.list.am:
     21        * WebCore.gypi:
     22        * WebCore.vcproj/WebCore.vcproj:
     23        * WebCore.xcodeproj/project.pbxproj:
     24        * dom/Element.cpp:
     25        (WebCore::Element::childrenChanged):
     26        * dom/Node.cpp:
     27        (WebCore::NodeRenderParentDetector::NodeRenderParentDetector):
     28        (WebCore::NodeRenderParentDetector::parentNodeForRenderingAndStyle):
     29        (WebCore::NodeRenderParentDetector::findVisualParent):
     30        (WebCore::NodeRenderParentDetector::shouldCreateRenderer):
     31        (WebCore::Node::parentNodeForRenderingAndStyle):
     32        (WebCore::Node::createRendererAndStyle):
     33        * dom/ShadowRoot.cpp:
     34        (WebCore::ShadowRoot::contentContainerFor):
     35        (WebCore::ShadowRoot::hostChildrenChanged):
     36        (WebCore::ShadowRoot::firstContentElement):
     37        * dom/ShadowRoot.h:
     38        * html/HTMLSummaryElement.cpp:
     39        (WebCore::HTMLSummaryElement::createShadowSubtree):
     40        * html/HTMLSummaryElement.h:
     41        * html/shadow/ShadowContentElement.h: Copied from Source/WebCore/dom/ShadowRoot.h.
     42        (WebCore::ShadowContentElement::ShadowContentElement):
     43        (WebCore::ShadowContentElement::isShadowBoundary):
     44        (WebCore::ShadowContentElement::createRenderer):
     45        (WebCore::ShadowContentElement::create):
     46
    1472011-04-21  Andrey Kosyakov  <caseq@chromium.org>
    248
  • trunk/Source/WebCore/GNUmakefile.list.am

    r84498 r84511  
    18561856        Source/WebCore/html/shadow/ProgressShadowElement.cpp \
    18571857        Source/WebCore/html/shadow/ProgressShadowElement.h \
     1858        Source/WebCore/html/shadow/ShadowContentElement.h \
    18581859        Source/WebCore/html/shadow/SliderThumbElement.cpp \
    18591860        Source/WebCore/html/shadow/SliderThumbElement.h \
  • trunk/Source/WebCore/WebCore.gypi

    r84498 r84511  
    31903190            'html/shadow/ProgressShadowElement.cpp',
    31913191            'html/shadow/ProgressShadowElement.h',
     3192            'html/shadow/ShadowContentElement.h',
    31923193            'html/shadow/SliderThumbElement.cpp',
    31933194            'html/shadow/SliderThumbElement.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r84498 r84511  
    5677056770                                </File>
    5677156771                                <File
     56772                                        RelativePath="..\html\shadow\ShadowContentElement.h"
     56773                                        >
     56774                                </File>
     56775                                <File
    5677256776                                        RelativePath="..\html\shadow\SliderThumbElement.cpp"
    5677356777                                        >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r84498 r84511  
    32403240                A73F95FE12C97BFE0031AAF9 /* RoundedIntRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73F95FC12C97BFE0031AAF9 /* RoundedIntRect.cpp */; };
    32413241                A73F95FF12C97BFE0031AAF9 /* RoundedIntRect.h in Headers */ = {isa = PBXBuildFile; fileRef = A73F95FD12C97BFE0031AAF9 /* RoundedIntRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
     3242                A7477538135FC56900937899 /* ShadowContentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7477537135FC56900937899 /* ShadowContentElement.h */; };
    32423243                A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A75E497410752ACB00C9B896 /* SerializedScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    32433244                A75E497710752ACB00C9B896 /* SerializedScriptValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */; };
     
    98139814                A73F95FC12C97BFE0031AAF9 /* RoundedIntRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RoundedIntRect.cpp; sourceTree = "<group>"; };
    98149815                A73F95FD12C97BFE0031AAF9 /* RoundedIntRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedIntRect.h; sourceTree = "<group>"; };
     9816                A7477537135FC56900937899 /* ShadowContentElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowContentElement.h; sourceTree = "<group>"; };
    98159817                A75E497410752ACB00C9B896 /* SerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedScriptValue.h; sourceTree = "<group>"; };
    98169818                A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SerializedScriptValue.cpp; sourceTree = "<group>"; };
     
    1355813560                                A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */,
    1355913561                                A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */,
     13562                                A7477537135FC56900937899 /* ShadowContentElement.h */,
    1356013563                                4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */,
    1356113564                                4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */,
     
    2242222425                                498770E91242C535002226BA /* Shader.h in Headers */,
    2242322426                                0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */,
     22427                                A7477538135FC56900937899 /* ShadowContentElement.h in Headers */,
    2242422428                                BC5EB8C40E82031B00B25965 /* ShadowData.h in Headers */,
    2242522429                                A7F338A411C0EFCA00A320A7 /* ShadowElement.h in Headers */,
  • trunk/Source/WebCore/dom/Element.cpp

    r84039 r84511  
    13081308    else
    13091309        checkForSiblingStyleChanges(this, renderStyle(), false, beforeChange, afterChange, childCountDelta);
     1310    if (ShadowRoot* shadow = toShadowRoot(shadowRoot()))
     1311        shadow->hostChildrenChanged();
    13101312}
    13111313
  • trunk/Source/WebCore/dom/Node.cpp

    r84394 r84511  
    14471447}
    14481448
    1449 ContainerNode* Node::parentNodeForRenderingAndStyle() const
    1450 {
    1451     ContainerNode* parent = parentOrHostNode();
    1452     return parent && parent->isShadowBoundary() ? parent->shadowHost() : parent;
    1453 }
    1454 
    1455 static bool shouldCreateRendererFor(Node* node, ContainerNode* parentForRenderingAndStyle)
    1456 {
    1457     RenderObject* parentRenderer = parentForRenderingAndStyle->renderer();
     1449
     1450class NodeRenderParentDetector {
     1451public:
     1452    enum Type {
     1453        NotFound,
     1454        AsLightChild,
     1455        AsShadowChild,
     1456        AsContentChild
     1457    };
     1458
     1459    NodeRenderParentDetector(Node* node)
     1460        : m_type(NotFound)
     1461        , m_node(node)
     1462        , m_visualParentShadowRoot(0)
     1463    {
     1464        m_parentNodeForRenderingAndStyle = findVisualParent();
     1465    }
     1466 
     1467    ContainerNode* parentNodeForRenderingAndStyle() const { return m_parentNodeForRenderingAndStyle; }
     1468    bool shouldCreateRenderer() const;
     1469
     1470private:
     1471    ContainerNode* findVisualParent();
     1472
     1473    Type m_type;
     1474    Node* m_node;
     1475    ContainerNode* m_parentNodeForRenderingAndStyle;
     1476    ShadowRoot* m_visualParentShadowRoot;
     1477};
     1478
     1479ContainerNode* NodeRenderParentDetector::findVisualParent()
     1480{
     1481    ContainerNode* parent = m_node->parentOrHostNode();
     1482    if (!parent)
     1483        return 0;
     1484
     1485    if (parent->isShadowBoundary()) {
     1486        m_type = AsShadowChild;
     1487        return parent->shadowHost();
     1488    }
     1489
     1490    if (parent->isElementNode()) {
     1491        m_visualParentShadowRoot = toShadowRoot(toElement(parent)->shadowRoot());
     1492        if (m_visualParentShadowRoot) {
     1493            if (ContainerNode* contentContainer = m_visualParentShadowRoot->contentContainerFor(m_node)) {
     1494                m_type = AsContentChild;
     1495                return NodeRenderParentDetector(contentContainer).parentNodeForRenderingAndStyle();
     1496            }
     1497
     1498            // FIXME: should be not found once light/shadow is mutual exclusive.
     1499        }
     1500    }
     1501
     1502    m_type = AsLightChild;
     1503    return parent;
     1504}
     1505
     1506bool NodeRenderParentDetector::shouldCreateRenderer() const
     1507{
     1508    ASSERT(m_parentNodeForRenderingAndStyle);
     1509
     1510    RenderObject* parentRenderer = m_parentNodeForRenderingAndStyle->renderer();
    14581511    if (!parentRenderer)
    14591512        return false;
    14601513
    1461     bool atShadowBoundary = node->parentOrHostNode()->isShadowBoundary();
    1462 
    1463     // FIXME: Ignoring canHaveChildren() in a case of isShadowRoot() might be wrong.
    1464     // See https://bugs.webkit.org/show_bug.cgi?id=52423
    1465     if (!parentRenderer->canHaveChildren() && !(node->isShadowRoot() || atShadowBoundary))
     1514    if (m_type == AsLightChild) {
     1515        // FIXME: Ignoring canHaveChildren() in a case of shadow children might be wrong.
     1516        // See https://bugs.webkit.org/show_bug.cgi?id=52423
     1517        if (!parentRenderer->canHaveChildren())
     1518            return false;
     1519   
     1520        if (m_visualParentShadowRoot && !m_parentNodeForRenderingAndStyle->canHaveLightChildRendererWithShadow())
     1521            return false;
     1522    }
     1523
     1524    if (!m_parentNodeForRenderingAndStyle->childShouldCreateRenderer(m_node))
    14661525        return false;
    14671526
    1468     if (shadowRoot(parentForRenderingAndStyle) && !atShadowBoundary
    1469         && !parentForRenderingAndStyle->canHaveLightChildRendererWithShadow())
    1470         return false;
    1471 
    1472     if (!parentForRenderingAndStyle->childShouldCreateRenderer(node))
    1473         return false;
    1474 
    14751527    return true;
     1528}
     1529
     1530
     1531ContainerNode* Node::parentNodeForRenderingAndStyle() const
     1532{
     1533    return NodeRenderParentDetector(const_cast<Node*>(this)).parentNodeForRenderingAndStyle();
    14761534}
    14771535
     
    14811539    ASSERT(document()->shouldCreateRenderers());
    14821540
    1483     ContainerNode* parent = parentNodeForRenderingAndStyle();
    1484     ASSERT(parent);
    1485 
    1486     if (!shouldCreateRendererFor(this, parent))
     1541    NodeRenderParentDetector parentDetector(this);
     1542    if (!parentDetector.shouldCreateRenderer())
    14871543        return 0;
    14881544
     
    14951551        return 0;
    14961552
    1497     if (!parent->renderer()->isChildAllowed(newRenderer, style.get())) {
     1553    if (!parentDetector.parentNodeForRenderingAndStyle()->renderer()->isChildAllowed(newRenderer, style.get())) {
    14981554        newRenderer->destroy();
    14991555        return 0;
  • trunk/Source/WebCore/dom/ShadowRoot.cpp

    r84394 r84511  
    2727#include "config.h"
    2828#include "ShadowRoot.h"
     29#include "Element.h"
    2930
    3031#include "Document.h"
     
    9091}
    9192
     93ContainerNode* ShadowRoot::contentContainerFor(Node*)
     94{
     95    // Current limitation:
     96    // - There is at most one content element for each shadow tree
     97    // - The shadow tree accepts any light node.
     98    return firstContentElement();
    9299}
     100
     101void ShadowRoot::hostChildrenChanged()
     102{
     103    if (!firstContentElement())
     104        return;
     105    Element* host = shadowHost();
     106    if (!host || !host->attached())
     107        return;
     108    host->detach();
     109    host->lazyAttach();
     110}
     111
     112ContainerNode* ShadowRoot::firstContentElement() const
     113{
     114    for (Node* n = firstChild(); n; n = n->traverseNextNode(this)) {
     115        // FIXME: This should be replaced with tag-name checking once <content> is ready.
     116        // See also http://webkit.org/b/56973
     117        if (n->isShadowBoundary())
     118            return toContainerNode(n);
     119    }
     120
     121    return 0;
     122}
     123
     124}
  • trunk/Source/WebCore/dom/ShadowRoot.h

    r84394 r84511  
    4141    virtual void recalcStyle(StyleChange = NoChange);
    4242
     43    ContainerNode* contentContainerFor(Node*);
     44    void hostChildrenChanged();
     45
    4346private:
    4447    ShadowRoot(Document*);
     
    4952    virtual PassRefPtr<Node> cloneNode(bool deep);
    5053    virtual bool childTypeAllowed(NodeType) const;
     54
     55    ContainerNode* firstContentElement() const;
    5156};
    5257
  • trunk/Source/WebCore/html/HTMLSummaryElement.cpp

    r84039 r84511  
    2828#include "PlatformMouseEvent.h"
    2929#include "RenderSummary.h"
     30#include "ShadowContentElement.h"
    3031
    3132namespace WebCore {
     
    5556    ExceptionCode ec = 0;
    5657    ensureShadowRoot()->appendChild(DetailsMarkerControl::create(document()), ec, true);
     58    ensureShadowRoot()->appendChild(ShadowContentElement::create(document()), ec, true);
    5759}
    5860
  • trunk/Source/WebCore/html/HTMLSummaryElement.h

    r84039 r84511  
    3838    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    3939    virtual void defaultEventHandler(Event*);
    40     virtual void createShadowSubtree();
    41     virtual bool canHaveLightChildRendererWithShadow() const { return true; }
    4240
     41    void createShadowSubtree();
    4342    HTMLDetailsElement* detailsElement() const;
    4443};
  • trunk/Source/WebCore/html/shadow/ShadowContentElement.h

    r84510 r84511  
    88 *     * Redistributions of source code must retain the above copyright
    99 * notice, this list of conditions and the following disclaimer.
     10 *     * Redistributions in binary form must reproduce the above
     11 * copyright notice, this list of conditions and the following disclaimer
     12 * in the documentation and/or other materials provided with the
     13 * distribution.
    1014 *     * Neither the name of Google Inc. nor the names of its
    1115 * contributors may be used to endorse or promote products derived from
     
    2529 */
    2630
    27 #ifndef ShadowRoot_h
    28 #define ShadowRoot_h
     31#ifndef ShadowContentElement_h
     32#define ShadowContentElement_h
    2933
    30 #include "TreeScope.h"
     34#include "HTMLDivElement.h"
     35#include "HTMLNames.h"
     36#include <wtf/Forward.h>
    3137
    3238namespace WebCore {
    3339
    34 class Document;
     40// NOTE: Current implementation doesn't support dynamic insertion/deletion of ShadowContentElement.
     41// You should create ShadowContentElement during the host construction.
     42class ShadowContentElement : public HTMLDivElement {
     43public:
     44    ShadowContentElement(Document* document)
     45        : HTMLDivElement(HTMLNames::divTag, document)
     46    {
     47    }
    3548
    36 class ShadowRoot : public TreeScope {
    37 public:
    38     static PassRefPtr<ShadowRoot> create(Document*);
    39 
    40     virtual bool isShadowBoundary() const { return true; }
    41     virtual void recalcStyle(StyleChange = NoChange);
     49    static PassRefPtr<ShadowContentElement> create(Document*);
    4250
    4351private:
    44     ShadowRoot(Document*);
    45     virtual ~ShadowRoot();
    46 
    47     virtual String nodeName() const;
    48     virtual NodeType nodeType() const;
    49     virtual PassRefPtr<Node> cloneNode(bool deep);
    50     virtual bool childTypeAllowed(NodeType) const;
     52    // FIXME: This should be replaced with tag-name checking once <content> is ready.
     53    // See also http://webkit.org/b/56973
     54    virtual bool isShadowBoundary() const { return true; }
     55    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) { return 0; }
    5156};
    5257
    53 inline PassRefPtr<ShadowRoot> ShadowRoot::create(Document* document)
     58inline PassRefPtr<ShadowContentElement> ShadowContentElement::create(Document* document)
    5459{
    55     return adoptRef(new ShadowRoot(document));
     60    return adoptRef(new ShadowContentElement(document));
    5661}
    5762
    58 inline ShadowRoot* toShadowRoot(Node* node)
    59 {
    60     ASSERT(!node || node->isShadowBoundary());
    61     return static_cast<ShadowRoot*>(node);
    6263}
    6364
    64 } // namespace
    65 
    6665#endif
Note: See TracChangeset for help on using the changeset viewer.