[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at apple.com darin at apple.com
Wed Dec 22 12:27:20 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2ab09d090942fd53f7ebe0bb9326d43f12d9dfa5
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 24 01:39:08 2010 +0000

    WebCore: Changed type of Node::parentNode to ContainerNode so we don't have to cast,
    since parent are all containers.
    
    Reviewed by Geoff Garen.
    
    * css/CSSStyleSelector.h: Changed m_parentNode to ContainerNode*.
    
    * dom/Document.h: Fixed the type of TreeShared in the Node constructor.
    Yes, it's here.
    
    * dom/Node.cpp:
    (WebCore::Node::eventParentNode): Removed now-unneeded typecast dance.
    (WebCore::eventTargetAsSVGElementInstance):Changed type to ContainerNode*.
    
    * dom/Node.h: Made Node inherit from TreeShared<ContainerNode> instead of
    from TreeShared<Node>. Removed bogus comment. Changed return type of parentNode
    and shadowParentNode functions to ContainerNode*. Fixed using to use
    TreeShared<ContainerNode>.
    
    * dom/Position.h: Include ContainerNode.h instead of Node.h.
    
    * html/HTMLConstructionSite.cpp:
    (WebCore::HTMLConstructionSite::findFosterSite): Removed now-unneeded typecast.
    
    * rendering/MediaControlElements.h:
    * rendering/SVGShadowTreeElements.h:
    * rendering/TextControlInnerElements.h:
    Changed return type of shadowParentNode functions to ContainerNode.
    
    * rendering/RenderMeter.cpp:
    (WebCore::RenderMeter::updatePartsState): Cast the node to HTMLElement* before
    passing it to the function that creates the shadow element. We know the node is
    a HTMLMeterElement, but the node function doesn't know that.
    * rendering/RenderProgress.cpp:
    (WebCore::RenderProgress::updatePartsState): Ditto.
    * rendering/RenderSlider.cpp:
    (WebCore::SliderThumbElement::SliderThumbElement): More of the same.
    (WebCore::SliderThumbElement::create): Ditto.
    (WebCore::RenderSlider::updateFromElement): Ditto.
    * rendering/RenderTextControl.cpp:
    (WebCore::RenderTextControl::createSubtreeIfNeeded): Ditto.
    * rendering/RenderTextControlSingleLine.cpp:
    (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded): Ditto.
    * rendering/SVGShadowTreeElements.cpp:
    (WebCore::SVGShadowTreeRootElement::SVGShadowTreeRootElement): Ditto.
    (WebCore::SVGShadowTreeRootElement::shadowParentNode): Ditto.
    * rendering/ShadowElement.cpp:
    (WebCore::ShadowBlockElement::create): Ditto.
    (WebCore::ShadowBlockElement::ShadowBlockElement): Ditto.
    (WebCore::ShadowBlockElement::createForPart): Ditto.
    (WebCore::ShadowInputElement::create): Ditto.
    (WebCore::ShadowInputElement::ShadowInputElement): Ditto.
    * rendering/ShadowElement.h:
    (WebCore::ShadowElement::ShadowElement): Ditto.
    (WebCore::ShadowElement::shadowParent): Ditto.
    (WebCore::ShadowElement::shadowParentNode): Ditto.
    * rendering/TextControlInnerElements.cpp:
    (WebCore::TextControlInnerElement::TextControlInnerElement): Ditto.
    (WebCore::TextControlInnerElement::create): Ditto.
    (WebCore::TextControlInnerTextElement::TextControlInnerTextElement): Ditto.
    (WebCore::TextControlInnerTextElement::create): Ditto.
    (WebCore::SpinButtonElement::SpinButtonElement): Ditto.
    (WebCore::SpinButtonElement::create): Ditto.
    
    * svg/SVGElement.cpp:
    (WebCore::SVGElement::eventParentNode): Removed now-unneeded typecast.
    
    * svg/SVGStyledElement.cpp:
    (WebCore::SVGStyledElement::title): Changed type to ContainerNode*.
    
    WebKit2: * WebProcess/InjectedBundle/API/c/WKBundleNode.cpp:
    (WKBundleNodeGetParent): Update since parent now returns a
    ContainerNode*. The toRef function is a bit too picky to convert
    it without a bit of help.
    
    Reviewed by Geoff Garen.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65852 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 364a414..8a888c4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,75 @@
+2010-08-23  Darin Adler  <darin at apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Changed type of Node::parentNode to ContainerNode so we don't have to cast,
+        since parent are all containers.
+
+        * css/CSSStyleSelector.h: Changed m_parentNode to ContainerNode*.
+
+        * dom/Document.h: Fixed the type of TreeShared in the Node constructor.
+        Yes, it's here.
+
+        * dom/Node.cpp:
+        (WebCore::Node::eventParentNode): Removed now-unneeded typecast dance.
+        (WebCore::eventTargetAsSVGElementInstance):Changed type to ContainerNode*.
+
+        * dom/Node.h: Made Node inherit from TreeShared<ContainerNode> instead of
+        from TreeShared<Node>. Removed bogus comment. Changed return type of parentNode
+        and shadowParentNode functions to ContainerNode*. Fixed using to use
+        TreeShared<ContainerNode>.
+
+        * dom/Position.h: Include ContainerNode.h instead of Node.h.
+
+        * html/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::findFosterSite): Removed now-unneeded typecast.
+
+        * rendering/MediaControlElements.h:
+        * rendering/SVGShadowTreeElements.h:
+        * rendering/TextControlInnerElements.h:
+        Changed return type of shadowParentNode functions to ContainerNode.
+
+        * rendering/RenderMeter.cpp:
+        (WebCore::RenderMeter::updatePartsState): Cast the node to HTMLElement* before
+        passing it to the function that creates the shadow element. We know the node is
+        a HTMLMeterElement, but the node function doesn't know that.
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::updatePartsState): Ditto.
+        * rendering/RenderSlider.cpp:
+        (WebCore::SliderThumbElement::SliderThumbElement): More of the same.
+        (WebCore::SliderThumbElement::create): Ditto.
+        (WebCore::RenderSlider::updateFromElement): Ditto.
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::createSubtreeIfNeeded): Ditto.
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded): Ditto.
+        * rendering/SVGShadowTreeElements.cpp:
+        (WebCore::SVGShadowTreeRootElement::SVGShadowTreeRootElement): Ditto.
+        (WebCore::SVGShadowTreeRootElement::shadowParentNode): Ditto.
+        * rendering/ShadowElement.cpp:
+        (WebCore::ShadowBlockElement::create): Ditto.
+        (WebCore::ShadowBlockElement::ShadowBlockElement): Ditto.
+        (WebCore::ShadowBlockElement::createForPart): Ditto.
+        (WebCore::ShadowInputElement::create): Ditto.
+        (WebCore::ShadowInputElement::ShadowInputElement): Ditto.
+        * rendering/ShadowElement.h:
+        (WebCore::ShadowElement::ShadowElement): Ditto.
+        (WebCore::ShadowElement::shadowParent): Ditto.
+        (WebCore::ShadowElement::shadowParentNode): Ditto.
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerElement::TextControlInnerElement): Ditto.
+        (WebCore::TextControlInnerElement::create): Ditto.
+        (WebCore::TextControlInnerTextElement::TextControlInnerTextElement): Ditto.
+        (WebCore::TextControlInnerTextElement::create): Ditto.
+        (WebCore::SpinButtonElement::SpinButtonElement): Ditto.
+        (WebCore::SpinButtonElement::create): Ditto.
+
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::eventParentNode): Removed now-unneeded typecast.
+
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::title): Changed type to ContainerNode*.
+
 2010-08-23  Martin Robinson  <mrobinson at igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index ad801da..b0d977e 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -50,6 +50,7 @@ class CSSStyleSheet;
 class CSSValue;
 class CSSVariableDependentValue;
 class CSSVariablesRule;
+class ContainerNode;
 class DataGridColumn;
 class Document;
 class Element;
@@ -298,7 +299,7 @@ public:
         Element* m_element;
         StyledElement* m_styledElement;
         EInsideLink m_elementLinkState;
-        Node* m_parentNode;
+        ContainerNode* m_parentNode;
         CSSValue* m_lineHeightValue;
         bool m_fontDirty;
         bool m_matchAuthorAndUserStyles;
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 65ef13f..984306f 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -1298,7 +1298,7 @@ inline bool Node::isDocumentNode() const
 
 // here because it uses a Document method but we really want to inline it
 inline Node::Node(Document* document, ConstructionType type)
-    : TreeShared<Node>(initialRefCount(type))
+    : TreeShared<ContainerNode>(initialRefCount(type))
     , m_document(document)
     , m_previous(0)
     , m_next(0)
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 0e79972..7b534ce 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -2331,9 +2331,7 @@ void Node::getSubresourceURLs(ListHashSet<KURL>& urls) const
 
 ContainerNode* Node::eventParentNode()
 {
-    Node* parent = parentNode();
-    ASSERT(!parent || parent->isContainerNode());
-    return static_cast<ContainerNode*>(parent);
+    return parentNode();
 }
 
 Node* Node::enclosingLinkEventParentOrSelf()
@@ -2589,7 +2587,7 @@ static inline SVGElementInstance* eventTargetAsSVGElementInstance(Node* referenc
         if (!n->isShadowNode() || !n->isSVGElement())
             continue;
 
-        Node* shadowTreeParentElement = n->shadowParentNode();
+        ContainerNode* shadowTreeParentElement = n->shadowParentNode();
         ASSERT(shadowTreeParentElement->hasTagName(SVGNames::useTag));
 
         if (SVGElementInstance* instance = static_cast<SVGUseElement*>(shadowTreeParentElement)->instanceForShadowTreeElement(referenceNode))
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index 6280a12..91ce035 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -86,8 +86,7 @@ enum StyleChangeType {
     SyntheticStyleChange = 3 << nodeStyleChangeShift
 };
 
-// this class implements nodes, which can have a parent but no children:
-class Node : public EventTarget, public TreeShared<Node>, public ScriptWrappable {
+class Node : public EventTarget, public TreeShared<ContainerNode>, public ScriptWrappable {
     friend class Document;
 public:
     enum NodeType {
@@ -134,7 +133,7 @@ public:
     virtual String nodeValue() const;
     virtual void setNodeValue(const String&, ExceptionCode&);
     virtual NodeType nodeType() const = 0;
-    Node* parentNode() const { return parent(); }
+    ContainerNode* parentNode() const { return parent(); }
     Element* parentElement() const;
     Node* previousSibling() const { return m_previous; }
     Node* nextSibling() const { return m_next; }
@@ -209,7 +208,7 @@ public:
     virtual bool isCharacterDataNode() const { return false; }
     bool isDocumentNode() const;
     virtual bool isShadowNode() const { return false; }
-    virtual Node* shadowParentNode() { return 0; }
+    virtual ContainerNode* shadowParentNode() { return 0; }
     Node* shadowAncestorNode();
     Node* shadowTreeRootNode();
     bool isInShadowTree();
@@ -591,8 +590,8 @@ public:
      */
     virtual bool disabled() const;
 
-    using TreeShared<Node>::ref;
-    using TreeShared<Node>::deref;
+    using TreeShared<ContainerNode>::ref;
+    using TreeShared<ContainerNode>::deref;
 
     virtual EventTargetData* eventTargetData();
     virtual EventTargetData* ensureEventTargetData();
diff --git a/WebCore/dom/Position.h b/WebCore/dom/Position.h
index 9f2ee24..552d675 100644
--- a/WebCore/dom/Position.h
+++ b/WebCore/dom/Position.h
@@ -26,9 +26,9 @@
 #ifndef Position_h
 #define Position_h
 
+#include "ContainerNode.h"
 #include "TextAffinity.h"
 #include "TextDirection.h"
-#include "Node.h" // for position creation functions
 #include <wtf/Assertions.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp
index 5898691..0aaf087 100644
--- a/WebCore/html/HTMLConstructionSite.cpp
+++ b/WebCore/html/HTMLConstructionSite.cpp
@@ -433,7 +433,7 @@ void HTMLConstructionSite::findFosterSite(AttachmentSite& site)
     HTMLElementStack::ElementRecord* lastTableElementRecord = m_openElements.topmost(tableTag.localName());
     if (lastTableElementRecord) {
         Element* lastTableElement = lastTableElementRecord->element();
-        if (ContainerNode* parent = static_cast<ContainerNode*>(lastTableElement->parent())) {
+        if (ContainerNode* parent = lastTableElement->parent()) {
             site.parent = parent;
             site.nextChild = lastTableElement;
             return;
diff --git a/WebCore/rendering/MediaControlElements.h b/WebCore/rendering/MediaControlElements.h
index ceb0255..1dcf6be 100644
--- a/WebCore/rendering/MediaControlElements.h
+++ b/WebCore/rendering/MediaControlElements.h
@@ -81,7 +81,7 @@ private:
     MediaControlShadowRootElement(HTMLMediaElement*);
     
     virtual bool isShadowNode() const { return true; }
-    virtual Node* shadowParentNode() { return m_mediaElement; }
+    virtual ContainerNode* shadowParentNode() { return m_mediaElement; }
 
     HTMLMediaElement* m_mediaElement;    
 };
diff --git a/WebCore/rendering/RenderMeter.cpp b/WebCore/rendering/RenderMeter.cpp
index cfa7cba..1a99976 100644
--- a/WebCore/rendering/RenderMeter.cpp
+++ b/WebCore/rendering/RenderMeter.cpp
@@ -162,9 +162,9 @@ void RenderMeter::updatePartsState()
 {
     if (shouldHaveParts() && !m_barPart) {
         ASSERT(!m_valuePart);
-        m_barPart = ShadowBlockElement::createForPart(this->node(), barPseudoId());
+        m_barPart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), barPseudoId());
         addChild(m_barPart->renderer());
-        m_valuePart = ShadowBlockElement::createForPart(this->node(), valuePseudoId());
+        m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), valuePseudoId());
         addChild(m_valuePart->renderer());
     } else if (!shouldHaveParts() && m_barPart) {
         ASSERT(m_valuePart);
diff --git a/WebCore/rendering/RenderProgress.cpp b/WebCore/rendering/RenderProgress.cpp
index 6072e1e..d6e2dc7 100644
--- a/WebCore/rendering/RenderProgress.cpp
+++ b/WebCore/rendering/RenderProgress.cpp
@@ -109,7 +109,7 @@ void RenderProgress::updatePartsState()
 {
     if (shouldHaveParts() && !m_valuePart) {
         style()->setAppearance(NoControlPart);
-        m_valuePart = ShadowBlockElement::createForPart(this->node(), PROGRESS_BAR_VALUE);
+        m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), PROGRESS_BAR_VALUE);
         addChild(m_valuePart->renderer());
     } else if (!shouldHaveParts() && m_valuePart) {
         m_valuePart->detach();
diff --git a/WebCore/rendering/RenderSlider.cpp b/WebCore/rendering/RenderSlider.cpp
index db14e85..ad45856 100644
--- a/WebCore/rendering/RenderSlider.cpp
+++ b/WebCore/rendering/RenderSlider.cpp
@@ -54,7 +54,7 @@ static double sliderPosition(HTMLInputElement* element)
 
 class SliderThumbElement : public ShadowBlockElement {
 public:
-    static PassRefPtr<SliderThumbElement> create(Node* shadowParent);
+    static PassRefPtr<SliderThumbElement> create(HTMLElement* shadowParent);
 
     bool inDragMode() const { return m_inDragMode; }
 
@@ -62,19 +62,19 @@ public:
     virtual void detach();
 
 private:        
-    SliderThumbElement(Node* shadowParent);
+    SliderThumbElement(HTMLElement* shadowParent);
 
     FloatPoint m_offsetToThumb;
     bool m_inDragMode;
 };
 
-inline SliderThumbElement::SliderThumbElement(Node* shadowParent)
+inline SliderThumbElement::SliderThumbElement(HTMLElement* shadowParent)
     : ShadowBlockElement(shadowParent)
     , m_inDragMode(false)
 {
 }
 
-inline PassRefPtr<SliderThumbElement> SliderThumbElement::create(Node* shadowParent)
+inline PassRefPtr<SliderThumbElement> SliderThumbElement::create(HTMLElement* shadowParent)
 {
     return adoptRef(new SliderThumbElement(shadowParent));
 }
@@ -305,7 +305,7 @@ void RenderSlider::updateFromElement()
 {
     // Layout will take care of the thumb's size and position.
     if (!m_thumb) {
-        m_thumb = SliderThumbElement::create(node());
+        m_thumb = SliderThumbElement::create(static_cast<HTMLElement*>(node()));
         RefPtr<RenderStyle> thumbStyle = createThumbStyle(style());
         m_thumb->setRenderer(m_thumb->createRenderer(renderArena(), thumbStyle.get()));
         m_thumb->renderer()->setStyle(thumbStyle.release());
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index 5f8c788..9098bab 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -145,7 +145,7 @@ void RenderTextControl::createSubtreeIfNeeded(TextControlInnerElement* innerBloc
         // For non-search fields, there is no intermediate innerBlock as the shadow node.
         // m_innerText will be the shadow node in that case.        
         RenderStyle* parentStyle = innerBlock ? innerBlock->renderer()->style() : style();
-        m_innerText = TextControlInnerTextElement::create(document(), innerBlock ? 0 : node());
+        m_innerText = TextControlInnerTextElement::create(document(), innerBlock ? 0 : static_cast<HTMLElement*>(node()));
         m_innerText->attachInnerElement(innerBlock ? innerBlock : node(), createInnerTextStyle(parentStyle), renderArena());
     }
 }
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index 9fcacb6..afecccb 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -612,11 +612,11 @@ void RenderTextControlSingleLine::createSubtreeIfNeeded()
 #endif
         bool hasSpinButton = inputElement()->hasSpinButton();
         if (hasSpinButton && !m_innerSpinButton) {
-            m_innerSpinButton = SpinButtonElement::create(node());
+            m_innerSpinButton = SpinButtonElement::create(static_cast<HTMLElement*>(node()));
             m_innerSpinButton->attachInnerElement(node(), createInnerSpinButtonStyle(), renderArena());
         }
         if (hasSpinButton && !m_outerSpinButton) {
-            m_outerSpinButton = SpinButtonElement::create(node());
+            m_outerSpinButton = SpinButtonElement::create(static_cast<HTMLElement*>(node()));
             m_outerSpinButton->attachInnerElement(node(), createOuterSpinButtonStyle(), renderArena());
         }
         return;
@@ -624,7 +624,7 @@ void RenderTextControlSingleLine::createSubtreeIfNeeded()
 
     if (!m_innerBlock) {
         // Create the inner block element
-        m_innerBlock = TextControlInnerElement::create(node());
+        m_innerBlock = TextControlInnerElement::create(static_cast<HTMLElement*>(node()));
         m_innerBlock->attachInnerElement(node(), createInnerBlockStyle(style()), renderArena());
     }
 #if ENABLE(INPUT_SPEECH)
@@ -635,7 +635,7 @@ void RenderTextControlSingleLine::createSubtreeIfNeeded()
     }
 #endif
     if (inputElement()->hasSpinButton() && !m_outerSpinButton) {
-        m_outerSpinButton = SpinButtonElement::create(node());
+        m_outerSpinButton = SpinButtonElement::create(static_cast<HTMLElement*>(node()));
         m_outerSpinButton->attachInnerElement(node(), createOuterSpinButtonStyle(), renderArena());
     }
 
diff --git a/WebCore/rendering/SVGShadowTreeElements.cpp b/WebCore/rendering/SVGShadowTreeElements.cpp
index f26f87e..311874c 100644
--- a/WebCore/rendering/SVGShadowTreeElements.cpp
+++ b/WebCore/rendering/SVGShadowTreeElements.cpp
@@ -45,7 +45,7 @@ FloatSize SVGShadowTreeContainerElement::containerTranslation() const
 }
 
 // SVGShadowTreeRootElement
-SVGShadowTreeRootElement::SVGShadowTreeRootElement(Document* document, Node* shadowParent)
+SVGShadowTreeRootElement::SVGShadowTreeRootElement(Document* document, Element* shadowParent)
     : SVGShadowTreeContainerElement(document)
     , m_shadowParent(shadowParent)
 {
diff --git a/WebCore/rendering/SVGShadowTreeElements.h b/WebCore/rendering/SVGShadowTreeElements.h
index ed42e89..7611b8a 100644
--- a/WebCore/rendering/SVGShadowTreeElements.h
+++ b/WebCore/rendering/SVGShadowTreeElements.h
@@ -49,16 +49,16 @@ private:
 
 class SVGShadowTreeRootElement : public SVGShadowTreeContainerElement {
 public:
-    SVGShadowTreeRootElement(Document*, Node* shadowParent);
+    SVGShadowTreeRootElement(Document*, Element* shadowParent);
     virtual ~SVGShadowTreeRootElement();
 
     virtual bool isShadowNode() const { return m_shadowParent; }
-    virtual Node* shadowParentNode() { return m_shadowParent; }
+    virtual ContainerNode* shadowParentNode() { return m_shadowParent; }
 
     void attachElement(PassRefPtr<RenderStyle>, RenderArena*);
 
 private:
-    Node* m_shadowParent;
+    ContainerNode* m_shadowParent;
 };
 
 }
diff --git a/WebCore/rendering/ShadowElement.cpp b/WebCore/rendering/ShadowElement.cpp
index 55a4b5c..c52ce17 100644
--- a/WebCore/rendering/ShadowElement.cpp
+++ b/WebCore/rendering/ShadowElement.cpp
@@ -29,12 +29,12 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-PassRefPtr<ShadowBlockElement> ShadowBlockElement::create(Node* shadowParent)
+PassRefPtr<ShadowBlockElement> ShadowBlockElement::create(HTMLElement* shadowParent)
 {
     return adoptRef(new ShadowBlockElement(shadowParent));
 }
 
-ShadowBlockElement::ShadowBlockElement(Node* shadowParent)
+ShadowBlockElement::ShadowBlockElement(HTMLElement* shadowParent)
     : ShadowElement<HTMLDivElement>(divTag, shadowParent)
 {
 }
@@ -66,7 +66,7 @@ void ShadowBlockElement::updateStyleForPart(PseudoId pseudoId)
         renderer()->setStyle(createStyleForPart(renderer()->parent(), pseudoId));
 }
 
-PassRefPtr<ShadowBlockElement> ShadowBlockElement::createForPart(Node* shadowParent, PseudoId pseudoId)
+PassRefPtr<ShadowBlockElement> ShadowBlockElement::createForPart(HTMLElement* shadowParent, PseudoId pseudoId)
 {
     RenderObject* parentRenderer = shadowParent->renderer();
     RefPtr<RenderStyle> styleForPart = createStyleForPart(parentRenderer, pseudoId);
@@ -103,12 +103,12 @@ bool ShadowBlockElement::partShouldHaveStyle(const RenderObject* parentRenderer,
     return !(pseudoStyle && pseudoStyle->hasAppearance());
 }
 
-PassRefPtr<ShadowInputElement> ShadowInputElement::create(Node* shadowParent)
+PassRefPtr<ShadowInputElement> ShadowInputElement::create(HTMLElement* shadowParent)
 {
     return adoptRef(new ShadowInputElement(shadowParent));
 }
 
-ShadowInputElement::ShadowInputElement(Node* shadowParent)
+ShadowInputElement::ShadowInputElement(HTMLElement* shadowParent)
     : ShadowElement<HTMLInputElement>(inputTag, shadowParent)
 {
 }
diff --git a/WebCore/rendering/ShadowElement.h b/WebCore/rendering/ShadowElement.h
index b8aacfd..04db62b 100644
--- a/WebCore/rendering/ShadowElement.h
+++ b/WebCore/rendering/ShadowElement.h
@@ -37,31 +37,31 @@ namespace WebCore {
 template<class BaseElement>
 class ShadowElement : public BaseElement {
 protected:
-    ShadowElement(const QualifiedName& name, Node* shadowParent)
+    ShadowElement(const QualifiedName& name, HTMLElement* shadowParent)
         : BaseElement(name, shadowParent->document())
         , m_shadowParent(shadowParent)
     {
     }
 
-    Node* shadowParent() const { return m_shadowParent; }
+    HTMLElement* shadowParent() const { return m_shadowParent; }
 
 private:
     virtual bool isShadowNode() const { return true; }
-    virtual Node* shadowParentNode() { return m_shadowParent; }
+    virtual ContainerNode* shadowParentNode() { return m_shadowParent; }
 
-    Node* m_shadowParent;
+    HTMLElement* m_shadowParent;
 };
 
 class ShadowBlockElement : public ShadowElement<HTMLDivElement> {
 public:
-    static PassRefPtr<ShadowBlockElement> create(Node*);
-    static PassRefPtr<ShadowBlockElement> createForPart(Node*, PseudoId);
+    static PassRefPtr<ShadowBlockElement> create(HTMLElement*);
+    static PassRefPtr<ShadowBlockElement> createForPart(HTMLElement*, PseudoId);
     static bool partShouldHaveStyle(const RenderObject* parentRenderer, PseudoId pseudoId);
     void layoutAsPart(const IntRect& partRect);
     void updateStyleForPart(PseudoId);
 
 protected:
-    ShadowBlockElement(Node*);
+    ShadowBlockElement(HTMLElement*);
 
 private:
     static PassRefPtr<RenderStyle> createStyleForPart(RenderObject*, PseudoId);
@@ -69,9 +69,9 @@ private:
 
 class ShadowInputElement : public ShadowElement<HTMLInputElement> {
 public:
-    static PassRefPtr<ShadowInputElement> create(Node*);
+    static PassRefPtr<ShadowInputElement> create(HTMLElement*);
 protected:
-    ShadowInputElement(Node*);
+    ShadowInputElement(HTMLElement*);
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 9852aa6..5ce353b 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -84,13 +84,13 @@ VisiblePosition RenderTextControlInnerBlock::positionForPoint(const IntPoint& po
 
 // ----------------------------
 
-TextControlInnerElement::TextControlInnerElement(Document* document, Node* shadowParent)
+TextControlInnerElement::TextControlInnerElement(Document* document, HTMLElement* shadowParent)
     : HTMLDivElement(divTag, document)
     , m_shadowParent(shadowParent)
 {
 }
 
-PassRefPtr<TextControlInnerElement> TextControlInnerElement::create(Node* shadowParent)
+PassRefPtr<TextControlInnerElement> TextControlInnerElement::create(HTMLElement* shadowParent)
 {
     return adoptRef(new TextControlInnerElement(shadowParent->document(), shadowParent));
 }
@@ -122,12 +122,12 @@ void TextControlInnerElement::attachInnerElement(Node* parent, PassRefPtr<Render
 
 // ----------------------------
 
-inline TextControlInnerTextElement::TextControlInnerTextElement(Document* document, Node* shadowParent)
+inline TextControlInnerTextElement::TextControlInnerTextElement(Document* document, HTMLElement* shadowParent)
     : TextControlInnerElement(document, shadowParent)
 {
 }
 
-PassRefPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document* document, Node* shadowParent)
+PassRefPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document* document, HTMLElement* shadowParent)
 {
     return adoptRef(new TextControlInnerTextElement(document, shadowParent));
 }
@@ -251,14 +251,14 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* event)
 
 // ----------------------------
 
-inline SpinButtonElement::SpinButtonElement(Node* shadowParent)
+inline SpinButtonElement::SpinButtonElement(HTMLElement* shadowParent)
     : TextControlInnerElement(shadowParent->document(), shadowParent)
     , m_capturing(false)
     , m_upDownState(Indeterminate)
 {
 }
 
-PassRefPtr<SpinButtonElement> SpinButtonElement::create(Node* shadowParent)
+PassRefPtr<SpinButtonElement> SpinButtonElement::create(HTMLElement* shadowParent)
 {
     return adoptRef(new SpinButtonElement(shadowParent));
 }
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index 3fbc9c8..72927f2 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -37,30 +37,30 @@ class SpeechInput;
 
 class TextControlInnerElement : public HTMLDivElement {
 public:
-    static PassRefPtr<TextControlInnerElement> create(Node* shadowParent);
+    static PassRefPtr<TextControlInnerElement> create(HTMLElement* shadowParent);
 
     void attachInnerElement(Node*, PassRefPtr<RenderStyle>, RenderArena*);
 
 protected:
-    TextControlInnerElement(Document*, Node* shadowParent = 0);
+    TextControlInnerElement(Document*, HTMLElement* shadowParent = 0);
 
 private:
     virtual bool isMouseFocusable() const { return false; } 
     virtual bool isShadowNode() const { return m_shadowParent; }
-    virtual Node* shadowParentNode() { return m_shadowParent; }
-    void setShadowParentNode(Node* node) { m_shadowParent = node; }
+    virtual ContainerNode* shadowParentNode() { return m_shadowParent; }
+    void setShadowParentNode(HTMLElement* shadowParent) { m_shadowParent = shadowParent; }
 
-    Node* m_shadowParent;
+    HTMLElement* m_shadowParent;
 };
 
 class TextControlInnerTextElement : public TextControlInnerElement {
 public:
-    static PassRefPtr<TextControlInnerTextElement> create(Document*, Node* shadowParent);
+    static PassRefPtr<TextControlInnerTextElement> create(Document*, HTMLElement* shadowParent);
 
     virtual void defaultEventHandler(Event*);
 
 private:
-    TextControlInnerTextElement(Document*, Node* shadowParent);
+    TextControlInnerTextElement(Document*, HTMLElement* shadowParent);
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);  
 };
 
@@ -96,11 +96,11 @@ public:
         Up,
     };
 
-    static PassRefPtr<SpinButtonElement> create(Node*);
+    static PassRefPtr<SpinButtonElement> create(HTMLElement*);
     UpDownState upDownState() const { return m_upDownState; }
 
 private:
-    SpinButtonElement(Node*);
+    SpinButtonElement(HTMLElement*);
 
     virtual bool isSpinButtonElement() const { return true; }
     // FIXME: shadowAncestorNode() should be const.
diff --git a/WebCore/svg/SVGElement.cpp b/WebCore/svg/SVGElement.cpp
index 9651f15..37e4930 100644
--- a/WebCore/svg/SVGElement.cpp
+++ b/WebCore/svg/SVGElement.cpp
@@ -334,10 +334,8 @@ void SVGElement::updateAnimatedSVGAttribute(const QualifiedName& name) const
 
 ContainerNode* SVGElement::eventParentNode()
 {
-    if (Node* shadowParent = shadowParentNode()) {
-        ASSERT(shadowParent->isContainerNode());
-        return static_cast<ContainerNode*>(shadowParent);
-    }
+    if (ContainerNode* shadowParent = shadowParentNode())
+        return shadowParent;
     return StyledElement::eventParentNode();
 }
 
diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp
index 4b073a0..6f04382 100644
--- a/WebCore/svg/SVGStyledElement.cpp
+++ b/WebCore/svg/SVGStyledElement.cpp
@@ -80,7 +80,7 @@ String SVGStyledElement::title() const
         }
         
         // Get the <use> element.
-        Node* shadowParent = parent->shadowParentNode();
+        ContainerNode* shadowParent = parent->shadowParentNode();
         if (shadowParent && shadowParent->isSVGElement() && shadowParent->hasTagName(SVGNames::useTag)) {
             SVGUseElement* useElement = static_cast<SVGUseElement*>(shadowParent);
             // If the <use> title is not empty we found the title to use.
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 1e29563..26a7ae8 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-23  Darin Adler  <darin at apple.com>
+
+        Reviewed by Geoff Garen.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleNode.cpp:
+        (WKBundleNodeGetParent): Update since parent now returns a
+        ContainerNode*. The toRef function is a bit too picky to convert
+        it without a bit of help.
+
 2010-08-23  Sheriff Bot  <webkit.review.bot at gmail.com>
 
         Unreviewed, rolling out r65703.
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNode.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNode.cpp
index 3c68549..9e271e2 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNode.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNode.cpp
@@ -28,7 +28,7 @@
 #include "WKAPICast.h"
 #include "WKBundleAPICast.h"
 #include "WKBundleNode.h"
-#include <WebCore/Node.h>
+#include <WebCore/ContainerNode.h>
 
 using namespace WebCore;
 using namespace WebKit;
@@ -40,5 +40,6 @@ WKStringRef WKBundleNodeCopyNodeName(WKBundleNodeRef node)
 
 WKBundleNodeRef WKBundleNodeGetParent(WKBundleNodeRef node)
 {
-    return toRef(toWK(node)->parent());
+    Node* parent = toWK(node)->parent();
+    return toRef(parent);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list