summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2012-04-12 13:43:08 +0100
committerSteve Block <steveblock@google.com>2012-04-12 17:42:30 +0100
commitaee2a095ee4baa61c2e8b86cfa8076967a7f34ac (patch)
tree7ed4dfec749cbc7d772b2acf8448e4a2283b0812
parent6fc495ad78b1663298d1395115dc316eeb537036 (diff)
downloadexternal_webkit-aee2a095ee4baa61c2e8b86cfa8076967a7f34ac.zip
external_webkit-aee2a095ee4baa61c2e8b86cfa8076967a7f34ac.tar.gz
external_webkit-aee2a095ee4baa61c2e8b86cfa8076967a7f34ac.tar.bz2
Cherry-pick WebKit change r87227 as a prerequisite for r92139
See http://trac.webkit.org/changeset/87227 Bug: 6329073 Change-Id: I18c371c96547d5a2011847647c8fc398b0adb18d
-rw-r--r--Source/WebCore/dom/Node.cpp10
-rw-r--r--Source/WebCore/dom/Node.h4
-rw-r--r--Source/WebCore/html/shadow/TextControlInnerElements.h5
3 files changed, 9 insertions, 10 deletions
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 24b2301..da4312c 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -1614,7 +1614,7 @@ SVGUseElement* Node::svgShadowHost() const
}
#endif
-Node* Node::shadowAncestorNode()
+Node* Node::shadowAncestorNode() const
{
#if ENABLE(SVG)
// SVG elements living in a shadow tree only occur when <use> created them.
@@ -1622,18 +1622,18 @@ Node* Node::shadowAncestorNode()
// but the actual shadow tree element - as main difference to the HTML forms
// shadow tree concept. (This function _could_ be made virtual - opinions?)
if (isSVGElement())
- return this;
+ return const_cast<Node*>(this);
#endif
Node* root = shadowTreeRootNode();
if (root)
return root->shadowHost();
- return this;
+ return const_cast<Node*>(this);
}
-Node* Node::shadowTreeRootNode()
+Node* Node::shadowTreeRootNode() const
{
- Node* root = this;
+ Node* root = const_cast<Node*>(this);
while (root) {
if (root->isShadowRoot() || root->isSVGShadowRoot())
return root;
diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h
index 08b1921..76355c3 100644
--- a/Source/WebCore/dom/Node.h
+++ b/Source/WebCore/dom/Node.h
@@ -218,8 +218,8 @@ public:
virtual bool isShadowBoundary() const { return false; }
virtual bool canHaveLightChildRendererWithShadow() const { return false; }
- Node* shadowAncestorNode();
- Node* shadowTreeRootNode();
+ Node* shadowAncestorNode() const;
+ Node* shadowTreeRootNode() const;
bool isInShadowTree();
// Node's parent, shadow tree host, or SVG use.
ContainerNode* parentOrHostNode() const;
diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.h b/Source/WebCore/html/shadow/TextControlInnerElements.h
index 2340970..886fbf8 100644
--- a/Source/WebCore/html/shadow/TextControlInnerElements.h
+++ b/Source/WebCore/html/shadow/TextControlInnerElements.h
@@ -101,9 +101,8 @@ private:
virtual void detach();
virtual bool isSpinButtonElement() const { return true; }
- // FIXME: shadowAncestorNode() should be const.
- virtual bool isEnabledFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isEnabledFormControl(); }
- virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isReadOnlyFormControl(); }
+ virtual bool isEnabledFormControl() const { return static_cast<Element*>(shadowAncestorNode())->isEnabledFormControl(); }
+ virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(shadowAncestorNode())->isReadOnlyFormControl(); }
virtual void defaultEventHandler(Event*);
void startRepeatingTimer();
void stopRepeatingTimer();