Title: [150483] trunk/Source/WebCore
Revision
150483
Author
[email protected]
Date
2013-05-21 15:48:37 -0700 (Tue, 21 May 2013)

Log Message

Remove stub HTMLContentElement
https://bugs.webkit.org/show_bug.cgi?id=116580

Reviewed by Andreas Kling.

Inherit DetailsContentElement and DetailsSummaryElement directly from InsertionPoint instead.

* html/HTMLDetailsElement.cpp:
(WebCore::DetailsContentElement::DetailsContentElement):
(WebCore::DetailsSummaryElement::DetailsSummaryElement):
* html/HTMLSummaryElement.cpp:
(WebCore::SummaryContentElement::SummaryContentElement):
* html/shadow/HTMLContentElement.cpp:
(WebCore::HTMLContentElement::contentTagName):
* html/shadow/HTMLContentElement.h:
(WebCore::isHTMLContentElement):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::setResetStyleInheritance):
* html/shadow/InsertionPoint.h:
        
    Also remove some leftover selector code.

(WebCore::InsertionPoint::insertionPointType):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150482 => 150483)


--- trunk/Source/WebCore/ChangeLog	2013-05-21 22:20:50 UTC (rev 150482)
+++ trunk/Source/WebCore/ChangeLog	2013-05-21 22:48:37 UTC (rev 150483)
@@ -1,3 +1,29 @@
+2013-05-21  Antti Koivisto  <[email protected]>
+
+        Remove stub HTMLContentElement
+        https://bugs.webkit.org/show_bug.cgi?id=116580
+
+        Reviewed by Andreas Kling.
+
+        Inherit DetailsContentElement and DetailsSummaryElement directly from InsertionPoint instead.
+
+        * html/HTMLDetailsElement.cpp:
+        (WebCore::DetailsContentElement::DetailsContentElement):
+        (WebCore::DetailsSummaryElement::DetailsSummaryElement):
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::SummaryContentElement::SummaryContentElement):
+        * html/shadow/HTMLContentElement.cpp:
+        (WebCore::HTMLContentElement::contentTagName):
+        * html/shadow/HTMLContentElement.h:
+        (WebCore::isHTMLContentElement):
+        * html/shadow/InsertionPoint.cpp:
+        (WebCore::InsertionPoint::setResetStyleInheritance):
+        * html/shadow/InsertionPoint.h:
+        
+            Also remove some leftover selector code.
+
+        (WebCore::InsertionPoint::insertionPointType):
+
 2013-05-21  Andreas Kling  <[email protected]>
 
         Robustify repaint of previous caret node when moving FrameSelection.

Modified: trunk/Source/WebCore/html/HTMLDetailsElement.cpp (150482 => 150483)


--- trunk/Source/WebCore/html/HTMLDetailsElement.cpp	2013-05-21 22:20:50 UTC (rev 150482)
+++ trunk/Source/WebCore/html/HTMLDetailsElement.cpp	2013-05-21 22:48:37 UTC (rev 150483)
@@ -42,13 +42,13 @@
     return selector;
 };
 
-class DetailsContentElement : public HTMLContentElement {
+class DetailsContentElement : public InsertionPoint {
 public:
     static PassRefPtr<DetailsContentElement> create(Document*);
 
 private:
     DetailsContentElement(Document* document)
-        : HTMLContentElement(HTMLNames::webkitShadowContentTag, document)
+        : InsertionPoint(HTMLNames::webkitShadowContentTag, document)
     {
     }
 
@@ -65,7 +65,7 @@
     return adoptRef(new DetailsContentElement(document));
 }
 
-class DetailsSummaryElement : public HTMLContentElement {
+class DetailsSummaryElement : public InsertionPoint {
 public:
     static PassRefPtr<DetailsSummaryElement> create(Document*);
 
@@ -77,7 +77,7 @@
 
 private:
     DetailsSummaryElement(Document* document)
-        : HTMLContentElement(HTMLNames::webkitShadowContentTag, document)
+        : InsertionPoint(HTMLNames::webkitShadowContentTag, document)
     { }
 
     virtual MatchType matchTypeFor(Node* node) const OVERRIDE

Modified: trunk/Source/WebCore/html/HTMLSummaryElement.cpp (150482 => 150483)


--- trunk/Source/WebCore/html/HTMLSummaryElement.cpp	2013-05-21 22:20:50 UTC (rev 150482)
+++ trunk/Source/WebCore/html/HTMLSummaryElement.cpp	2013-05-21 22:48:37 UTC (rev 150483)
@@ -37,13 +37,13 @@
 
 using namespace HTMLNames;
 
-class SummaryContentElement : public HTMLContentElement {
+class SummaryContentElement : public InsertionPoint {
 public:
     static PassRefPtr<SummaryContentElement> create(Document*);
 
 private:
     SummaryContentElement(Document* document)
-        : HTMLContentElement(HTMLNames::webkitShadowContentTag, document)
+        : InsertionPoint(HTMLNames::webkitShadowContentTag, document)
     {
     }
 };

Modified: trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp (150482 => 150483)


--- trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp	2013-05-21 22:20:50 UTC (rev 150482)
+++ trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp	2013-05-21 22:48:37 UTC (rev 150483)
@@ -39,19 +39,15 @@
 
 using HTMLNames::selectAttr;
 
+#if ENABLE(SHADOW_DOM)
+
 const QualifiedName& HTMLContentElement::contentTagName(Document*)
 {
-#if ENABLE(SHADOW_DOM)
     if (!RuntimeEnabledFeatures::shadowDOMEnabled())
         return HTMLNames::webkitShadowContentTag;
     return HTMLNames::contentTag;
-#else
-    return HTMLNames::webkitShadowContentTag;
-#endif
 }
 
-#if ENABLE(SHADOW_DOM)
-
 PassRefPtr<HTMLContentElement> HTMLContentElement::create(Document* document)
 {
     return adoptRef(new HTMLContentElement(contentTagName(document), document));
@@ -202,17 +198,6 @@
     return true;
 }
 
-#else
-
-PassRefPtr<HTMLContentElement> HTMLContentElement::create(Document* document)
-{
-    return adoptRef(new HTMLContentElement(contentTagName(document), document));
-}
-
-HTMLContentElement::HTMLContentElement(const QualifiedName& tagName, Document* document)
-    : InsertionPoint(tagName, document)
-{ }
-
 #endif // if ENABLE(SHADOW_DOM)
 
 }

Modified: trunk/Source/WebCore/html/shadow/HTMLContentElement.h (150482 => 150483)


--- trunk/Source/WebCore/html/shadow/HTMLContentElement.h	2013-05-21 22:20:50 UTC (rev 150482)
+++ trunk/Source/WebCore/html/shadow/HTMLContentElement.h	2013-05-21 22:48:37 UTC (rev 150483)
@@ -52,7 +52,7 @@
 
     virtual MatchType matchTypeFor(Node*) OVERRIDE;
     virtual const CSSSelectorList& selectorList() OVERRIDE;
-    virtual Type insertionPointType() const OVERRIDE { return ContentInsertionPoint; }
+    virtual Type insertionPointType() const OVERRIDE { return HTMLContentElementType; }
     virtual bool canAffectSelector() const OVERRIDE { return true; }
     virtual bool isSelectValid();
 
@@ -81,27 +81,10 @@
     return m_selectorList;
 }
 
-#else
-
-// FIXME: shouldn't inherit from InsertionPoint: https://bugs.webkit.org/show_bug.cgi?id=103339
-class HTMLContentElement : public InsertionPoint {
-public:
-    static const QualifiedName& contentTagName(Document*);
-    static PassRefPtr<HTMLContentElement> create(Document*);
-
-    virtual Type insertionPointType() const OVERRIDE { return ContentInsertionPoint; }
-
-protected:
-    HTMLContentElement(const QualifiedName&, Document*);
-
-};
-
-#endif // if ENABLE(SHADOW_DOM)
-
 inline bool isHTMLContentElement(const Node* node)
 {
     ASSERT(node);
-    return node->isInsertionPoint() && toInsertionPoint(node)->insertionPointType() == InsertionPoint::ContentInsertionPoint;
+    return node->isInsertionPoint() && toInsertionPoint(node)->insertionPointType() == InsertionPoint::HTMLContentElementType;
 }
 
 inline HTMLContentElement* toHTMLContentElement(Node* node)
@@ -110,6 +93,8 @@
     return static_cast<HTMLContentElement*>(node);
 }
 
+#endif // if ENABLE(SHADOW_DOM)
+
 }
 
 #endif

Modified: trunk/Source/WebCore/html/shadow/InsertionPoint.cpp (150482 => 150483)


--- trunk/Source/WebCore/html/shadow/InsertionPoint.cpp	2013-05-21 22:20:50 UTC (rev 150482)
+++ trunk/Source/WebCore/html/shadow/InsertionPoint.cpp	2013-05-21 22:48:37 UTC (rev 150483)
@@ -163,12 +163,6 @@
 {
     setBooleanAttribute(reset_style_inheritanceAttr, value);
 }
-
-const CSSSelectorList& InsertionPoint::emptySelectorList()
-{
-    DEFINE_STATIC_LOCAL(CSSSelectorList, selectorList, (CSSSelectorList()));
-    return selectorList;
-}
     
 Node* InsertionPoint::firstDistributed() const
 {

Modified: trunk/Source/WebCore/html/shadow/InsertionPoint.h (150482 => 150483)


--- trunk/Source/WebCore/html/shadow/InsertionPoint.h	2013-05-21 22:20:50 UTC (rev 150482)
+++ trunk/Source/WebCore/html/shadow/InsertionPoint.h	2013-05-21 22:48:37 UTC (rev 150483)
@@ -31,7 +31,6 @@
 #ifndef InsertionPoint_h
 #define InsertionPoint_h
 
-#include "CSSSelectorList.h"
 #include "ContentDistributor.h"
 #include "ElementShadow.h"
 #include "HTMLElement.h"
@@ -44,7 +43,8 @@
 class InsertionPoint : public HTMLElement {
 public:
     enum Type {
-        ContentInsertionPoint
+        InternalType,
+        HTMLContentElementType
     };
 
     enum MatchType {
@@ -61,8 +61,7 @@
     bool isActive() const;
 
     virtual MatchType matchTypeFor(Node*) const { return AlwaysMatches; }
-    virtual const CSSSelectorList& selectorList() { return emptySelectorList(); }
-    virtual Type insertionPointType() const = 0;
+    virtual Type insertionPointType() const { return InternalType; }
 
     bool resetStyleInheritance() const;
     void setResetStyleInheritance(bool);
@@ -77,8 +76,6 @@
     Node* nextDistributedTo(const Node*) const;
     Node* previousDistributedTo(const Node*) const;
 
-    static const CSSSelectorList& emptySelectorList();
-
 protected:
     InsertionPoint(const QualifiedName&, Document*);
     virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to