Diff
Modified: trunk/Source/WebCore/ChangeLog (117035 => 117036)
--- trunk/Source/WebCore/ChangeLog 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/ChangeLog 2012-05-15 07:11:59 UTC (rev 117036)
@@ -1,3 +1,37 @@
+2012-05-14 Shinya Kawanaka <shin...@chromium.org>
+
+ Node::shadowTreeRootNode() should return ShadowRoot instead of Node.
+ https://bugs.webkit.org/show_bug.cgi?id=86428
+
+ Reviewed by Hajime Morita.
+
+ Since Node::shadowTreeRootNode() returns only ShadowRoot or 0 now, its return type should be ShadowRoot.
+ This patch changes the return type and adds include directive to build.
+
+ No new tests, no change in behavior.
+
+ * dom/Node.cpp:
+ (WebCore::Node::shadowAncestorNode):
+ (WebCore::Node::shadowTreeRootNode):
+ * dom/Node.h:
+ (WebCore):
+ (Node):
+ * dom/NodeRenderingContext.cpp:
+ (WebCore::NodeRenderingContext::NodeRenderingContext):
+ * dom/Range.cpp:
+ (WebCore::Range::shadowTreeRootNode):
+ * dom/Range.h:
+ (Range):
+ * editing/Editor.cpp:
+ * editing/TextIterator.cpp:
+ * editing/htmlediting.cpp:
+ * html/shadow/ContentSelectorQuery.cpp:
+ * html/shadow/HTMLContentElement.cpp:
+ (WebCore::HTMLContentElement::parseAttribute):
+ * html/shadow/InsertionPoint.cpp:
+ (WebCore::InsertionPoint::detach):
+ * page/EventHandler.cpp:
+
2012-05-14 Luke Macpherson <macpher...@chromium.org>
Make StyleResolver::applyMatchedProperties and ::applyProperties use enum template parameter instead of bool.
Modified: trunk/Source/WebCore/dom/Node.cpp (117035 => 117036)
--- trunk/Source/WebCore/dom/Node.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/dom/Node.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -1500,18 +1500,18 @@
return const_cast<Node*>(this);
#endif
- Node* root = shadowTreeRootNode();
- if (root)
- return root->shadowHost();
+ if (ShadowRoot* root = shadowTreeRootNode())
+ return root->host();
+
return const_cast<Node*>(this);
}
-Node* Node::shadowTreeRootNode() const
+ShadowRoot* Node::shadowTreeRootNode() const
{
Node* root = const_cast<Node*>(this);
while (root) {
if (root->isShadowRoot())
- return root;
+ return toShadowRoot(root);
root = root->parentNodeGuaranteedHostFree();
}
return 0;
Modified: trunk/Source/WebCore/dom/Node.h (117035 => 117036)
--- trunk/Source/WebCore/dom/Node.h 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/dom/Node.h 2012-05-15 07:11:59 UTC (rev 117036)
@@ -82,6 +82,7 @@
class RenderBoxModelObject;
class RenderObject;
class RenderStyle;
+class ShadowRoot;
class TagNodeList;
class TreeScope;
@@ -221,7 +222,7 @@
Node* shadowAncestorNode() const;
// Returns 0, a ShadowRoot, or a legacy shadow root.
- Node* shadowTreeRootNode() const;
+ ShadowRoot* shadowTreeRootNode() const;
// Returns 0, a child of ShadowRoot, or a legacy shadow root.
Node* nonBoundaryShadowTreeRootNode();
bool isInShadowTree() const;
Modified: trunk/Source/WebCore/dom/NodeRenderingContext.cpp (117035 => 117036)
--- trunk/Source/WebCore/dom/NodeRenderingContext.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/dom/NodeRenderingContext.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -78,7 +78,7 @@
if (m_visualParentShadow) {
if ((m_insertionPoint = m_visualParentShadow->insertionPointFor(m_node))) {
- if (toShadowRoot(m_insertionPoint->shadowTreeRootNode())->isUsedForRendering()) {
+ if (m_insertionPoint->shadowTreeRootNode()->isUsedForRendering()) {
m_phase = AttachingDistributed;
m_parentNodeForRenderingAndStyle = NodeRenderingContext(m_insertionPoint).parentNodeForRenderingAndStyle();
return;
@@ -91,7 +91,7 @@
}
if (isShadowBoundary(parent)) {
- if (!toShadowRoot(parent->shadowTreeRootNode())->isUsedForRendering()) {
+ if (!parent->shadowTreeRootNode()->isUsedForRendering()) {
m_phase = AttachingNotDistributed;
m_parentNodeForRenderingAndStyle = parent;
return;
Modified: trunk/Source/WebCore/dom/Range.cpp (117035 => 117036)
--- trunk/Source/WebCore/dom/Range.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/dom/Range.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -1651,7 +1651,7 @@
return m_start.container()->traverseNextSibling();
}
-Node* Range::shadowTreeRootNode() const
+ShadowRoot* Range::shadowTreeRootNode() const
{
return startContainer() ? startContainer()->shadowTreeRootNode() : 0;
}
Modified: trunk/Source/WebCore/dom/Range.h (117035 => 117036)
--- trunk/Source/WebCore/dom/Range.h 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/dom/Range.h 2012-05-15 07:11:59 UTC (rev 117036)
@@ -111,7 +111,7 @@
Node* firstNode() const;
Node* pastLastNode() const;
- Node* shadowTreeRootNode() const;
+ ShadowRoot* shadowTreeRootNode() const;
IntRect boundingBox();
Modified: trunk/Source/WebCore/editing/Editor.cpp (117035 => 117036)
--- trunk/Source/WebCore/editing/Editor.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/editing/Editor.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -74,6 +74,7 @@
#include "RenderedPosition.h"
#include "ReplaceSelectionCommand.h"
#include "Settings.h"
+#include "ShadowRoot.h"
#include "SimplifyMarkupCommand.h"
#include "Sound.h"
#include "SpellChecker.h"
Modified: trunk/Source/WebCore/editing/TextIterator.cpp (117035 => 117036)
--- trunk/Source/WebCore/editing/TextIterator.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/editing/TextIterator.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -39,6 +39,7 @@
#include "RenderTableRow.h"
#include "RenderTextControl.h"
#include "RenderTextFragment.h"
+#include "ShadowRoot.h"
#include "TextBoundaries.h"
#include "TextBreakIterator.h"
#include "VisiblePosition.h"
Modified: trunk/Source/WebCore/editing/htmlediting.cpp (117035 => 117036)
--- trunk/Source/WebCore/editing/htmlediting.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/editing/htmlediting.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -45,10 +45,11 @@
#include "PositionIterator.h"
#include "RenderObject.h"
#include "Range.h"
-#include "VisibleSelection.h"
+#include "ShadowRoot.h"
#include "Text.h"
#include "TextIterator.h"
#include "VisiblePosition.h"
+#include "VisibleSelection.h"
#include "visible_units.h"
#include <wtf/Assertions.h>
#include <wtf/StdLibExtras.h>
Modified: trunk/Source/WebCore/html/shadow/ContentSelectorQuery.cpp (117035 => 117036)
--- trunk/Source/WebCore/html/shadow/ContentSelectorQuery.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/html/shadow/ContentSelectorQuery.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -30,6 +30,7 @@
#include "CSSParser.h"
#include "CSSSelectorList.h"
#include "InsertionPoint.h"
+#include "ShadowRoot.h"
namespace WebCore {
Modified: trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp (117035 => 117036)
--- trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -89,7 +89,7 @@
void HTMLContentElement::parseAttribute(Attribute* attr)
{
if (attr->name() == selectAttr) {
- if (ShadowRoot* root = toShadowRoot(shadowTreeRootNode()))
+ if (ShadowRoot* root = shadowTreeRootNode())
root->owner()->setNeedsRedistributing();
} else
InsertionPoint::parseAttribute(attr);
Modified: trunk/Source/WebCore/html/shadow/InsertionPoint.cpp (117035 => 117036)
--- trunk/Source/WebCore/html/shadow/InsertionPoint.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/html/shadow/InsertionPoint.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -64,7 +64,7 @@
void InsertionPoint::detach()
{
- ShadowRoot* root = toShadowRoot(shadowTreeRootNode());
+ ShadowRoot* root = shadowTreeRootNode();
if (root && isActive()) {
ElementShadow* shadow = root->owner();
Modified: trunk/Source/WebCore/page/EventHandler.cpp (117035 => 117036)
--- trunk/Source/WebCore/page/EventHandler.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -72,6 +72,7 @@
#include "ScrollAnimator.h"
#include "Scrollbar.h"
#include "Settings.h"
+#include "ShadowRoot.h"
#include "SpatialNavigation.h"
#include "StaticHashSetNodeList.h"
#include "StyleCachedImage.h"
Modified: trunk/Source/WebKit/chromium/ChangeLog (117035 => 117036)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-05-15 07:11:59 UTC (rev 117036)
@@ -1,3 +1,14 @@
+2012-05-14 Shinya Kawanaka <shin...@chromium.org>
+
+ Node::shadowTreeRootNode() should return ShadowRoot instead of Node.
+ https://bugs.webkit.org/show_bug.cgi?id=86428
+
+ Reviewed by Hajime Morita.
+
+ Adds include directive to build.
+
+ * src/WebFrameImpl.cpp:
+
2012-05-14 Gavin Peters <gav...@chromium.org>
Add Prerenderer, PrerenderHandle and a chromium interface for Prerendering.
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (117035 => 117036)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2012-05-15 07:04:00 UTC (rev 117035)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2012-05-15 07:11:59 UTC (rev 117036)
@@ -130,6 +130,7 @@
#include "ScrollbarTheme.h"
#include "SecurityPolicy.h"
#include "Settings.h"
+#include "ShadowRoot.h"
#include "SkiaUtils.h"
#include "SpellChecker.h"
#include "SubstituteData.h"