<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174069] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174069">174069</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-09-29 10:35:28 -0700 (Mon, 29 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use the new is<>() / downcast<>() for ShadowRoot and StyledElement
https://bugs.webkit.org/show_bug.cgi?id=137199
Reviewed by Darin Adler.
Use the new is<>() / downcast<>() for ShadowRoot and StyledElement and
move towards getting rid of the NODE_TYPE_CASTS() macro.
No new tests, no behavior change.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAllRules):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::initElement):
(WebCore::StyleResolver::State::initForStyleResolve):
(WebCore::StyleResolver::locateCousinList):
(WebCore::StyleResolver::findSiblingForStyleSharing):
* dom/Attr.cpp:
(WebCore::Attr::style):
* dom/Element.cpp:
(WebCore::Element::removeAttribute):
* dom/EventDispatcher.cpp:
(WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
(WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
(WebCore::eventTargetRespectingTargetRules):
(WebCore::EventPath::EventPath):
* dom/Node.cpp:
(WebCore::Node::containingShadowRoot):
(WebCore::Node::parentOrShadowHostElement):
(WebCore::Node::showNodePathForThis):
* dom/NodeRenderingTraversal.cpp:
(WebCore::NodeRenderingTraversal::traverseParent):
* dom/ShadowRoot.h:
(WebCore::isShadowRoot):
(WebCore::Node::shadowRoot):
(WebCore::Node::parentOrShadowHostNode):
* dom/StyledElement.h:
(WebCore::StyledElement::presentationAttributeStyle):
(WebCore::isStyledElement):
* dom/Text.cpp:
(WebCore::isSVGShadowText):
* dom/TreeScope.cpp:
(WebCore::TreeScope::focusedElement):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::wrappingStyleForSerialization):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::inlineStylePropertyForElement):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendElement):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementInfo):
* page/DragController.cpp:
(WebCore::asFileInput):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::owner):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
* svg/SVGElement.cpp:
(WebCore::SVGElement::title):
* testing/Internals.cpp:
(WebCore::Internals::shadowRoot):
(WebCore::Internals::shadowRootType):
(WebCore::Internals::includerFor):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssElementRuleCollectorcpp">trunk/Source/WebCore/css/ElementRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomAttrcpp">trunk/Source/WebCore/dom/Attr.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventDispatchercpp">trunk/Source/WebCore/dom/EventDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeRenderingTraversalcpp">trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRooth">trunk/Source/WebCore/dom/ShadowRoot.h</a></li>
<li><a href="#trunkSourceWebCoredomStyledElementh">trunk/Source/WebCore/dom/StyledElement.h</a></li>
<li><a href="#trunkSourceWebCoredomTextcpp">trunk/Source/WebCore/dom/Text.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTreeScopecpp">trunk/Source/WebCore/dom/TreeScope.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTreeScopeAdoptercpp">trunk/Source/WebCore/dom/TreeScopeAdopter.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaHTMLConvertermm">trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmarkupcpp">trunk/Source/WebCore/editing/markup.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFocusControllercpp">trunk/Source/WebCore/page/FocusController.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageSerializercpp">trunk/Source/WebCore/page/PageSerializer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementcpp">trunk/Source/WebCore/svg/SVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/ChangeLog        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -1,5 +1,86 @@
</span><span class="cx"> 2014-09-29 Christophe Dumez <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ Use the new is<>() / downcast<>() for ShadowRoot and StyledElement
+ https://bugs.webkit.org/show_bug.cgi?id=137199
+
+ Reviewed by Darin Adler.
+
+ Use the new is<>() / downcast<>() for ShadowRoot and StyledElement and
+ move towards getting rid of the NODE_TYPE_CASTS() macro.
+
+ No new tests, no behavior change.
+
+ * css/ElementRuleCollector.cpp:
+ (WebCore::ElementRuleCollector::matchAllRules):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::State::initElement):
+ (WebCore::StyleResolver::State::initForStyleResolve):
+ (WebCore::StyleResolver::locateCousinList):
+ (WebCore::StyleResolver::findSiblingForStyleSharing):
+ * dom/Attr.cpp:
+ (WebCore::Attr::style):
+ * dom/Element.cpp:
+ (WebCore::Element::removeAttribute):
+ * dom/EventDispatcher.cpp:
+ (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
+ (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
+ (WebCore::eventTargetRespectingTargetRules):
+ (WebCore::EventPath::EventPath):
+ * dom/Node.cpp:
+ (WebCore::Node::containingShadowRoot):
+ (WebCore::Node::parentOrShadowHostElement):
+ (WebCore::Node::showNodePathForThis):
+ * dom/NodeRenderingTraversal.cpp:
+ (WebCore::NodeRenderingTraversal::traverseParent):
+ * dom/ShadowRoot.h:
+ (WebCore::isShadowRoot):
+ (WebCore::Node::shadowRoot):
+ (WebCore::Node::parentOrShadowHostNode):
+ * dom/StyledElement.h:
+ (WebCore::StyledElement::presentationAttributeStyle):
+ (WebCore::isStyledElement):
+ * dom/Text.cpp:
+ (WebCore::isSVGShadowText):
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::focusedElement):
+ * dom/TreeScopeAdopter.cpp:
+ (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
+ (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
+ * editing/EditingStyle.cpp:
+ (WebCore::EditingStyle::wrappingStyleForSerialization):
+ * editing/Editor.cpp:
+ (WebCore::Editor::applyEditingStyleToElement):
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
+ * editing/cocoa/HTMLConverter.mm:
+ (HTMLConverterCaches::inlineStylePropertyForElement):
+ * editing/markup.cpp:
+ (WebCore::StyledMarkupAccumulator::appendElement):
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
+ * inspector/InspectorOverlay.cpp:
+ (WebCore::buildObjectForElementInfo):
+ * page/DragController.cpp:
+ (WebCore::asFileInput):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleMousePressEvent):
+ * page/FocusController.cpp:
+ (WebCore::FocusNavigationScope::owner):
+ * page/PageSerializer.cpp:
+ (WebCore::PageSerializer::serializeFrame):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::resize):
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::title):
+ * testing/Internals.cpp:
+ (WebCore::Internals::shadowRoot):
+ (WebCore::Internals::shadowRootType):
+ (WebCore::Internals::includerFor):
+
+2014-09-29 Christophe Dumez <cdumez@apple.com>
+
</ins><span class="cx"> Use the new is<>() / downcast<>() for Text Nodes
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=137188
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -388,8 +388,8 @@
</span><span class="cx"> matchUserRules(false);
</span><span class="cx">
</span><span class="cx"> // Now check author rules, beginning first with presentational attributes mapped from HTML.
</span><del>- if (m_element.isStyledElement()) {
- StyledElement& styledElement = toStyledElement(m_element);
</del><ins>+ if (is<StyledElement>(m_element)) {
+ StyledElement& styledElement = downcast<StyledElement>(m_element);
</ins><span class="cx"> addElementStyleProperties(styledElement.presentationAttributeStyle());
</span><span class="cx">
</span><span class="cx"> // Now we check additional mapped declarations.
</span><span class="lines">@@ -409,8 +409,8 @@
</span><span class="cx"> if (matchAuthorAndUserStyles)
</span><span class="cx"> matchAuthorRules(false);
</span><span class="cx">
</span><del>- if (matchAuthorAndUserStyles && m_element.isStyledElement()) {
- StyledElement& styledElement = toStyledElement(m_element);
</del><ins>+ if (matchAuthorAndUserStyles && is<StyledElement>(m_element)) {
+ StyledElement& styledElement = downcast<StyledElement>(m_element);
</ins><span class="cx"> // Now check our inline style attribute.
</span><span class="cx"> if (styledElement.inlineStyle()) {
</span><span class="cx"> // Inline style is immutable as long as there is no CSSOM wrapper.
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -385,11 +385,11 @@
</span><span class="cx"> m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), m_rootElementStyle, m_element ? document().renderView() : nullptr);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void StyleResolver::State::initElement(Element* e)
</del><ins>+inline void StyleResolver::State::initElement(Element* element)
</ins><span class="cx"> {
</span><del>- m_element = e;
- m_styledElement = e && e->isStyledElement() ? toStyledElement(e) : nullptr;
- m_elementLinkState = e ? e->document().visitedLinkState().determineLinkState(*e) : NotInsideLink;
</del><ins>+ m_element = element;
+ m_styledElement = element && is<StyledElement>(element) ? downcast<StyledElement>(element) : nullptr;
+ m_elementLinkState = element ? element->document().visitedLinkState().determineLinkState(*element) : NotInsideLink;
</ins><span class="cx"> updateConversionData();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -409,7 +409,7 @@
</span><span class="cx"> m_regionForStyling = regionForStyling;
</span><span class="cx">
</span><span class="cx"> if (e) {
</span><del>- bool resetStyleInheritance = hasShadowRootParent(*e) && toShadowRoot(e->parentNode())->resetStyleInheritance();
</del><ins>+ bool resetStyleInheritance = hasShadowRootParent(*e) && downcast<ShadowRoot>(*e->parentNode()).resetStyleInheritance();
</ins><span class="cx"> m_parentStyle = resetStyleInheritance ? nullptr : parentStyle;
</span><span class="cx"> } else
</span><span class="cx"> m_parentStyle = parentStyle;
</span><span class="lines">@@ -445,9 +445,9 @@
</span><span class="cx"> {
</span><span class="cx"> if (visitedNodeCount >= cStyleSearchThreshold * cStyleSearchLevelThreshold)
</span><span class="cx"> return nullptr;
</span><del>- if (!parent || !parent->isStyledElement())
</del><ins>+ if (!parent || !is<StyledElement>(parent))
</ins><span class="cx"> return nullptr;
</span><del>- StyledElement* styledParent = toStyledElement(parent);
</del><ins>+ StyledElement* styledParent = downcast<StyledElement>(parent);
</ins><span class="cx"> if (styledParent->inlineStyle())
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (is<SVGElement>(styledParent) && downcast<SVGElement>(*styledParent).animatedSMILStyleProperties())
</span><span class="lines">@@ -664,14 +664,14 @@
</span><span class="cx"> inline StyledElement* StyleResolver::findSiblingForStyleSharing(Node* node, unsigned& count) const
</span><span class="cx"> {
</span><span class="cx"> for (; node; node = node->previousSibling()) {
</span><del>- if (!node->isStyledElement())
</del><ins>+ if (!is<StyledElement>(node))
</ins><span class="cx"> continue;
</span><del>- if (canShareStyleWithElement(toStyledElement(node)))
</del><ins>+ if (canShareStyleWithElement(downcast<StyledElement>(node)))
</ins><span class="cx"> break;
</span><span class="cx"> if (count++ == cStyleSearchThreshold)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><del>- return toStyledElement(node);
</del><ins>+ return downcast<StyledElement>(node);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RenderStyle* StyleResolver::locateSharedStyle()
</span></span></pre></div>
<a id="trunkSourceWebCoredomAttrcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Attr.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Attr.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/Attr.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -188,10 +188,10 @@
</span><span class="cx"> CSSStyleDeclaration* Attr::style()
</span><span class="cx"> {
</span><span class="cx"> // This function only exists to support the Obj-C bindings.
</span><del>- if (!m_element || !m_element->isStyledElement())
</del><ins>+ if (!m_element || !is<StyledElement>(m_element))
</ins><span class="cx"> return nullptr;
</span><span class="cx"> m_style = MutableStyleProperties::create();
</span><del>- toStyledElement(m_element)->collectStyleForPresentationAttribute(qualifiedName(), value(), *m_style);
</del><ins>+ downcast<StyledElement>(*m_element).collectStyleForPresentationAttribute(qualifiedName(), value(), *m_style);
</ins><span class="cx"> return m_style->ensureCSSStyleDeclaration();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -1825,8 +1825,8 @@
</span><span class="cx"> AtomicString localName = shouldIgnoreAttributeCase(*this) ? name.lower() : name;
</span><span class="cx"> unsigned index = elementData()->findAttributeIndexByName(localName, false);
</span><span class="cx"> if (index == ElementData::attributeNotFound) {
</span><del>- if (UNLIKELY(localName == styleAttr) && elementData()->styleAttributeIsDirty() && isStyledElement())
- toStyledElement(this)->removeAllInlineStyleProperties();
</del><ins>+ if (UNLIKELY(localName == styleAttr) && elementData()->styleAttributeIsDirty() && is<StyledElement>(*this))
+ downcast<StyledElement>(*this).removeAllInlineStyleProperties();
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventDispatcher.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventDispatcher.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/EventDispatcher.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -143,8 +143,8 @@
</span><span class="cx"> return m_relatedNodeInCurrentTreeScope;
</span><span class="cx">
</span><span class="cx"> if (m_currentTreeScope) {
</span><del>- ASSERT(m_currentTreeScope->rootNode().isShadowRoot());
- ASSERT(&newTarget == toShadowRoot(m_currentTreeScope->rootNode()).hostElement());
</del><ins>+ ASSERT(is<ShadowRoot>(m_currentTreeScope->rootNode()));
+ ASSERT(&newTarget == downcast<ShadowRoot>(m_currentTreeScope->rootNode()).hostElement());
</ins><span class="cx"> ASSERT(m_currentTreeScope->parentTreeScope() == &newTreeScope);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -184,8 +184,8 @@
</span><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(&previousHost->treeScope() == &targetScope);
</span><span class="cx"> return previousHost;
</span><span class="cx"> }
</span><del>- if (scope->rootNode().isShadowRoot())
- previousHost = toShadowRoot(scope->rootNode()).hostElement();
</del><ins>+ if (is<ShadowRoot>(scope->rootNode()))
+ previousHost = downcast<ShadowRoot>(scope->rootNode()).hostElement();
</ins><span class="cx"> else
</span><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(!scope->parentTreeScope());
</span><span class="cx"> }
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx"> // Spec: The event handling for the non-exposed tree works as if the referenced element had been textually included
</span><span class="cx"> // as a deeply cloned child of the 'use' element, except that events are dispatched to the SVGElementInstance objects
</span><span class="cx"> auto& rootNode = referenceNode.treeScope().rootNode();
</span><del>- Element* shadowHostElement = rootNode.isShadowRoot() ? toShadowRoot(rootNode).hostElement() : nullptr;
</del><ins>+ Element* shadowHostElement = is<ShadowRoot>(rootNode) ? downcast<ShadowRoot>(rootNode).hostElement() : nullptr;
</ins><span class="cx"> // At this time, SVG nodes are not supported in non-<use> shadow trees.
</span><span class="cx"> if (!shadowHostElement || !shadowHostElement->hasTagName(SVGNames::useTag))
</span><span class="cx"> return referenceNode;
</span><span class="lines">@@ -447,12 +447,12 @@
</span><span class="cx"> m_path.append(std::make_unique<EventContext>(node, &currentTarget, target));
</span><span class="cx"> if (!inDocument)
</span><span class="cx"> return;
</span><del>- if (node->isShadowRoot())
</del><ins>+ if (is<ShadowRoot>(node))
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><del>- if (!node || !shouldEventCrossShadowBoundary(event, *toShadowRoot(node), *target))
</del><ins>+ if (!node || !shouldEventCrossShadowBoundary(event, downcast<ShadowRoot>(*node), *target))
</ins><span class="cx"> return;
</span><del>- node = toShadowRoot(node)->hostElement();
</del><ins>+ node = downcast<ShadowRoot>(*node).hostElement();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -974,7 +974,7 @@
</span><span class="cx"> ShadowRoot* Node::containingShadowRoot() const
</span><span class="cx"> {
</span><span class="cx"> ContainerNode& root = treeScope().rootNode();
</span><del>- return root.isShadowRoot() ? toShadowRoot(&root) : nullptr;
</del><ins>+ return is<ShadowRoot>(root) ? downcast<ShadowRoot>(&root) : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node* Node::nonBoundaryShadowTreeRootNode()
</span><span class="lines">@@ -1002,13 +1002,13 @@
</span><span class="cx"> {
</span><span class="cx"> ContainerNode* parent = parentOrShadowHostNode();
</span><span class="cx"> if (!parent)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><del>- if (parent->isShadowRoot())
- return toShadowRoot(parent)->hostElement();
</del><ins>+ if (is<ShadowRoot>(parent))
+ return downcast<ShadowRoot>(parent)->hostElement();
</ins><span class="cx">
</span><span class="cx"> if (!parent->isElementNode())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> return toElement(parent);
</span><span class="cx"> }
</span><span class="lines">@@ -1572,9 +1572,9 @@
</span><span class="cx"> }
</span><span class="cx"> for (unsigned index = chain.size(); index > 0; --index) {
</span><span class="cx"> const Node* node = chain[index - 1];
</span><del>- if (node->isShadowRoot()) {
</del><ins>+ if (is<ShadowRoot>(node)) {
</ins><span class="cx"> int count = 0;
</span><del>- for (const ShadowRoot* shadowRoot = toShadowRoot(node); shadowRoot && shadowRoot != node; shadowRoot = shadowRoot->shadowRoot())
</del><ins>+ for (const ShadowRoot* shadowRoot = downcast<ShadowRoot>(node); shadowRoot && shadowRoot != node; shadowRoot = shadowRoot->shadowRoot())
</ins><span class="cx"> ++count;
</span><span class="cx"> fprintf(stderr, "/#shadow-root[%d]", count);
</span><span class="cx"> continue;
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeRenderingTraversalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> static ContainerNode* traverseParent(const Node* node, ShadowRootCrossing shadowRootCrossing)
</span><span class="cx"> {
</span><span class="cx"> if (shadowRootCrossing == DontCrossShadowRoot && node->isShadowRoot())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (nodeCanBeDistributed(node)) {
</span><span class="cx"> if (InsertionPoint* insertionPoint = findInsertionPointOf(node))
</span><span class="lines">@@ -132,8 +132,8 @@
</span><span class="cx"> if (!parent)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- if (parent->isShadowRoot())
- return shadowRootCrossing == CrossShadowRoot ? toShadowRoot(parent)->hostElement() : parent;
</del><ins>+ if (is<ShadowRoot>(parent))
+ return shadowRootCrossing == CrossShadowRoot ? downcast<ShadowRoot>(parent)->hostElement() : parent;
</ins><span class="cx">
</span><span class="cx"> if (is<InsertionPoint>(parent)) {
</span><span class="cx"> const InsertionPoint& insertionPoint = downcast<InsertionPoint>(*parent);
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.h (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.h        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/ShadowRoot.h        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -95,22 +95,22 @@
</span><span class="cx"> return treeScope().focusedElement();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline bool isShadowRoot(const Node& node) { return node.isShadowRoot(); }
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(ShadowRoot)
+ static bool isShadowRoot(const Node& node) { return node.isShadowRoot(); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx">
</span><del>-NODE_TYPE_CASTS(ShadowRoot)
-
</del><span class="cx"> inline ShadowRoot* Node::shadowRoot() const
</span><span class="cx"> {
</span><span class="cx"> if (!isElementNode())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return toElement(this)->shadowRoot();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline ContainerNode* Node::parentOrShadowHostNode() const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThreadOrGCThread());
</span><del>- if (isShadowRoot())
- return toShadowRoot(this)->hostElement();
</del><ins>+ if (is<ShadowRoot>(this))
+ return downcast<ShadowRoot>(*this).hostElement();
</ins><span class="cx"> return parentNode();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomStyledElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StyledElement.h (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StyledElement.h        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/StyledElement.h        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -100,16 +100,16 @@
</span><span class="cx"> inline const StyleProperties* StyledElement::presentationAttributeStyle()
</span><span class="cx"> {
</span><span class="cx"> if (!elementData())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> if (elementData()->presentationAttributeStyleIsDirty())
</span><span class="cx"> rebuildPresentationAttributeStyle();
</span><span class="cx"> return elementData()->presentationAttributeStyle();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline bool isStyledElement(const Node& node) { return node.isStyledElement(); }
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(StyledElement)
+ static bool isStyledElement(const Node& node) { return node.isStyledElement(); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx">
</span><del>-NODE_TYPE_CASTS(StyledElement)
-
</del><span class="cx"> } //namespace
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/Text.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx"> static bool isSVGShadowText(Text* text)
</span><span class="cx"> {
</span><span class="cx"> Node* parentNode = text->parentNode();
</span><del>- return parentNode->isShadowRoot() && toShadowRoot(parentNode)->hostElement()->hasTagName(SVGNames::trefTag);
</del><ins>+ return is<ShadowRoot>(parentNode) && downcast<ShadowRoot>(*parentNode).hostElement()->hasTagName(SVGNames::trefTag);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool isSVGText(Text* text)
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScope.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScope.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/TreeScope.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> TreeScope* treeScope = &element->treeScope();
</span><span class="cx"> while (treeScope != this && treeScope != &document) {
</span><del>- element = toShadowRoot(treeScope->rootNode()).hostElement();
</del><ins>+ element = downcast<ShadowRoot>(treeScope->rootNode()).hostElement();
</ins><span class="cx"> treeScope = &element->treeScope();
</span><span class="cx"> }
</span><span class="cx"> if (this != treeScope)
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopeAdoptercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScopeAdopter.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScopeAdopter.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/dom/TreeScopeAdopter.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -124,8 +124,8 @@
</span><span class="cx"> if (oldDocument)
</span><span class="cx"> oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
</span><span class="cx">
</span><del>- if (node->isShadowRoot())
- toShadowRoot(node)->setDocumentScope(newDocument);
</del><ins>+ if (is<ShadowRoot>(node))
+ downcast<ShadowRoot>(*node).setDocumentScope(newDocument);
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> didMoveToNewDocumentWasCalled = false;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -502,14 +502,14 @@
</span><span class="cx"> if (!block)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- Node* parent = 0;
- for (Node* n = node->parentNode(); n != block && n != unsplitAncestor; n = parent) {
- parent = n->parentNode();
- if (!n->isStyledElement())
</del><ins>+ Node* parent = nullptr;
+ for (Node* ancestor = node->parentNode(); ancestor != block && ancestor != unsplitAncestor; ancestor = parent) {
+ parent = ancestor->parentNode();
+ if (!is<StyledElement>(ancestor))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- StyledElement* element = toStyledElement(n);
- int unicodeBidi = toIdentifier(ComputedStyleExtractor(element).propertyValue(CSSPropertyUnicodeBidi));
</del><ins>+ StyledElement& element = downcast<StyledElement>(*ancestor);
+ int unicodeBidi = toIdentifier(ComputedStyleExtractor(&element).propertyValue(CSSPropertyUnicodeBidi));
</ins><span class="cx"> if (!unicodeBidi || unicodeBidi == CSSValueNormal)
</span><span class="cx"> continue;
</span><span class="cx">
</span><span class="lines">@@ -517,17 +517,17 @@
</span><span class="cx"> // and all matching style rules in order to determine how to best set the unicode-bidi property to 'normal'.
</span><span class="cx"> // For now, it assumes that if the 'dir' attribute is present, then removing it will suffice, and
</span><span class="cx"> // otherwise it sets the property in the inline style declaration.
</span><del>- if (element->fastHasAttribute(dirAttr)) {
</del><ins>+ if (element.fastHasAttribute(dirAttr)) {
</ins><span class="cx"> // FIXME: If this is a BDO element, we should probably just remove it if it has no
</span><span class="cx"> // other attributes, like we (should) do with B and I elements.
</span><del>- removeNodeAttribute(element, dirAttr);
</del><ins>+ removeNodeAttribute(&element, dirAttr);
</ins><span class="cx"> } else {
</span><del>- RefPtr<MutableStyleProperties> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle());
</del><ins>+ RefPtr<MutableStyleProperties> inlineStyle = copyStyleOrCreateEmpty(element.inlineStyle());
</ins><span class="cx"> inlineStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal);
</span><span class="cx"> inlineStyle->removeProperty(CSSPropertyDirection);
</span><del>- setNodeAttribute(element, styleAttr, inlineStyle->asText());
- if (isSpanWithoutAttributesOrUnstyledStyleSpan(element))
- removeNodePreservingChildren(element);
</del><ins>+ setNodeAttribute(&element, styleAttr, inlineStyle->asText());
+ if (isSpanWithoutAttributesOrUnstyledStyleSpan(&element))
+ removeNodePreservingChildren(&element);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -1040,8 +1040,8 @@
</span><span class="cx"> getChildNodes(*current.get(), currentChildren);
</span><span class="cx">
</span><span class="cx"> RefPtr<StyledElement> styledElement;
</span><del>- if (current->isStyledElement() && isStyledInlineElementToRemove(toElement(current.get()))) {
- styledElement = toStyledElement(current.get());
</del><ins>+ if (is<StyledElement>(*current) && isStyledInlineElementToRemove(toElement(current.get()))) {
+ styledElement = downcast<StyledElement>(current.get());
</ins><span class="cx"> elementsToPushDown.append(*styledElement);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -1036,8 +1036,8 @@
</span><span class="cx">
</span><span class="cx"> // When not annotating for interchange, we only preserve inline style declarations.
</span><span class="cx"> for (Node* node = context; node && !node->isDocumentNode(); node = node->parentNode()) {
</span><del>- if (node->isStyledElement() && !isMailBlockquote(node)) {
- wrappingStyle->mergeInlineAndImplicitStyleOfElement(toStyledElement(node), EditingStyle::DoNotOverrideValues,
</del><ins>+ if (is<StyledElement>(node) && !isMailBlockquote(node)) {
+ wrappingStyle->mergeInlineAndImplicitStyleOfElement(downcast<StyledElement>(node), EditingStyle::DoNotOverrideValues,
</ins><span class="cx"> EditingStyle::EditingPropertiesInEffect);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -3107,12 +3107,12 @@
</span><span class="cx"> {
</span><span class="cx"> if (!element)
</span><span class="cx"> return;
</span><del>- ASSERT(element->isStyledElement());
- if (!element->isStyledElement())
</del><ins>+ ASSERT(is<StyledElement>(element));
+ if (!is<StyledElement>(element))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // Mutate using the CSSOM wrapper so we get the same event behavior as a script.
</span><del>- CSSStyleDeclaration* style = toStyledElement(element)->style();
</del><ins>+ CSSStyleDeclaration* style = downcast<StyledElement>(*element).style();
</ins><span class="cx"> style->setPropertyInternal(CSSPropertyWordWrap, "break-word", false, IGNORE_EXCEPTION);
</span><span class="cx"> style->setPropertyInternal(CSSPropertyWebkitNbspMode, "space", false, IGNORE_EXCEPTION);
</span><span class="cx"> style->setPropertyInternal(CSSPropertyWebkitLineBreak, "after-white-space", false, IGNORE_EXCEPTION);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -480,10 +480,10 @@
</span><span class="cx"> // FIXME: <rdar://problem/5371536> Style rules that match pasted content can change it's appearance
</span><span class="cx">
</span><span class="cx"> next = NodeTraversal::next(node.get());
</span><del>- if (!node->isStyledElement())
</del><ins>+ if (!is<StyledElement>(*node))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- StyledElement* element = toStyledElement(node.get());
</del><ins>+ StyledElement* element = downcast<StyledElement>(node.get());
</ins><span class="cx">
</span><span class="cx"> const StyleProperties* inlineStyle = element->inlineStyle();
</span><span class="cx"> RefPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle);
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx"> if (newInlineStyle->conflictsWithImplicitStyleOfElement(&htmlElement)) {
</span><span class="cx"> // e.g. <b style="font-weight: normal;"> is converted to <span style="font-weight: normal;">
</span><span class="cx"> node = replaceElementWithSpanPreservingChildrenAndAttributes(&htmlElement);
</span><del>- element = toStyledElement(node.get());
</del><ins>+ element = downcast<StyledElement>(node.get());
</ins><span class="cx"> insertedNodes.didReplaceNode(&htmlElement, node.get());
</span><span class="cx"> } else if (newInlineStyle->extractConflictingImplicitStyleOfAttributes(&htmlElement, EditingStyle::PreserveWritingDirection, 0, attributes,
</span><span class="cx"> EditingStyle::DoNotExtractMatchingStyle)) {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -709,9 +709,9 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<CSSValue> HTMLConverterCaches::inlineStylePropertyForElement(Element& element, CSSPropertyID propertyId)
</span><span class="cx"> {
</span><del>- if (propertyId == CSSPropertyInvalid || !element.isStyledElement())
</del><ins>+ if (propertyId == CSSPropertyInvalid || !is<StyledElement>(element))
</ins><span class="cx"> return nullptr;
</span><del>- const StyleProperties* properties = toStyledElement(element).inlineStyle();
</del><ins>+ const StyleProperties* properties = downcast<StyledElement>(element).inlineStyle();
</ins><span class="cx"> if (!properties)
</span><span class="cx"> return nullptr;
</span><span class="cx"> return properties->getPropertyCSSValue(propertyId);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmarkupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/markup.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/markup.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/editing/markup.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -322,8 +322,8 @@
</span><span class="cx"> } else
</span><span class="cx"> newInlineStyle = EditingStyle::create();
</span><span class="cx">
</span><del>- if (element.isStyledElement() && toStyledElement(element).inlineStyle())
- newInlineStyle->overrideWithStyle(toStyledElement(element).inlineStyle());
</del><ins>+ if (is<StyledElement>(element) && downcast<StyledElement>(element).inlineStyle())
+ newInlineStyle->overrideWithStyle(downcast<StyledElement>(element).inlineStyle());
</ins><span class="cx">
</span><span class="cx"> if (shouldAnnotateOrForceInline) {
</span><span class="cx"> if (shouldAnnotate())
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -1086,11 +1086,11 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Inspector::Protocol::CSS::CSSStyle> InspectorCSSAgent::buildObjectForAttributesStyle(Element* element)
</span><span class="cx"> {
</span><del>- if (!element->isStyledElement())
</del><ins>+ if (!is<StyledElement>(element))
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // FIXME: Ugliness below.
</span><del>- StyleProperties* attributeStyle = const_cast<StyleProperties*>(toStyledElement(element)->presentationAttributeStyle());
</del><ins>+ StyleProperties* attributeStyle = const_cast<StyleProperties*>(downcast<StyledElement>(element)->presentationAttributeStyle());
</ins><span class="cx"> if (!attributeStyle)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -686,9 +686,9 @@
</span><span class="cx"> elementInfo->setString("tagName", isXHTML ? element->nodeName() : element->nodeName().lower());
</span><span class="cx"> elementInfo->setString("idValue", element->getIdAttribute());
</span><span class="cx"> HashSet<AtomicString> usedClassNames;
</span><del>- if (element->hasClass() && element->isStyledElement()) {
</del><ins>+ if (element->hasClass() && is<StyledElement>(element)) {
</ins><span class="cx"> StringBuilder classNames;
</span><del>- const SpaceSplitString& classNamesString = toStyledElement(element)->classNames();
</del><ins>+ const SpaceSplitString& classNamesString = downcast<StyledElement>(*element).classNames();
</ins><span class="cx"> size_t classNameCount = classNamesString.size();
</span><span class="cx"> for (size_t i = 0; i < classNameCount; ++i) {
</span><span class="cx"> const AtomicString& className = classNamesString[i];
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/page/DragController.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -273,8 +273,8 @@
</span><span class="cx"> HTMLInputElement* inputElement = node->toInputElement();
</span><span class="cx">
</span><span class="cx"> // If this is a button inside of the a file input, move up to the file input.
</span><del>- if (inputElement && inputElement->isTextButton() && inputElement->treeScope().rootNode().isShadowRoot())
- inputElement = toShadowRoot(inputElement->treeScope().rootNode()).hostElement()->toInputElement();
</del><ins>+ if (inputElement && inputElement->isTextButton() && is<ShadowRoot>(inputElement->treeScope().rootNode()))
+ inputElement = downcast<ShadowRoot>(inputElement->treeScope().rootNode()).hostElement()->toInputElement();
</ins><span class="cx">
</span><span class="cx"> return inputElement && inputElement->isFileUpload() ? inputElement : 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -1760,7 +1760,7 @@
</span><span class="cx"> // If a mouse event handler changes the input element type to one that has a widget associated,
</span><span class="cx"> // we'd like to EventHandler::handleMousePressEvent to pass the event to the widget and thus the
</span><span class="cx"> // event target node can't still be the shadow node.
</span><del>- if (mouseEvent.targetNode()->isShadowRoot() && is<HTMLInputElement>(toShadowRoot(mouseEvent.targetNode())->hostElement()))
</del><ins>+ if (is<ShadowRoot>(mouseEvent.targetNode()) && is<HTMLInputElement>(downcast<ShadowRoot>(*mouseEvent.targetNode()).hostElement()))
</ins><span class="cx"> mouseEvent = m_frame.document()->prepareMouseEvent(HitTestRequest(), documentPoint, platformMouseEvent);
</span><span class="cx">
</span><span class="cx"> FrameView* view = m_frame.view();
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/page/FocusController.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -82,11 +82,11 @@
</span><span class="cx"> Element* FocusNavigationScope::owner() const
</span><span class="cx"> {
</span><span class="cx"> ContainerNode* root = rootNode();
</span><del>- if (root->isShadowRoot())
- return toShadowRoot(root)->hostElement();
</del><ins>+ if (is<ShadowRoot>(root))
+ return downcast<ShadowRoot>(*root).hostElement();
</ins><span class="cx"> if (Frame* frame = root->document().frame())
</span><span class="cx"> return frame->ownerElement();
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FocusNavigationScope FocusNavigationScope::focusNavigationScopeOf(Node* node)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageSerializercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageSerializer.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageSerializer.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/page/PageSerializer.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -225,25 +225,25 @@
</span><span class="cx"> if (!node->isElementNode())
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
</del><ins>+ Element& element = toElement(*node);
</ins><span class="cx"> // We have to process in-line style as it might contain some resources (typically background images).
</span><del>- if (element->isStyledElement())
- retrieveResourcesForProperties(toStyledElement(element)->inlineStyle(), document);
</del><ins>+ if (is<StyledElement>(element))
+ retrieveResourcesForProperties(downcast<StyledElement>(element).inlineStyle(), document);
</ins><span class="cx">
</span><span class="cx"> if (is<HTMLImageElement>(element)) {
</span><del>- HTMLImageElement& imageElement = downcast<HTMLImageElement>(*element);
</del><ins>+ HTMLImageElement& imageElement = downcast<HTMLImageElement>(element);
</ins><span class="cx"> URL url = document->completeURL(imageElement.fastGetAttribute(HTMLNames::srcAttr));
</span><span class="cx"> CachedImage* cachedImage = imageElement.cachedImage();
</span><span class="cx"> addImageToResources(cachedImage, imageElement.renderer(), url);
</span><span class="cx"> } else if (is<HTMLLinkElement>(element)) {
</span><del>- HTMLLinkElement& linkElement = downcast<HTMLLinkElement>(*element);
</del><ins>+ HTMLLinkElement& linkElement = downcast<HTMLLinkElement>(element);
</ins><span class="cx"> if (CSSStyleSheet* sheet = linkElement.sheet()) {
</span><span class="cx"> URL url = document->completeURL(linkElement.getAttribute(HTMLNames::hrefAttr));
</span><span class="cx"> serializeCSSStyleSheet(sheet, url);
</span><span class="cx"> ASSERT(m_resourceURLs.contains(url));
</span><span class="cx"> }
</span><span class="cx"> } else if (is<HTMLStyleElement>(element)) {
</span><del>- if (CSSStyleSheet* sheet = downcast<HTMLStyleElement>(*element).sheet())
</del><ins>+ if (CSSStyleSheet* sheet = downcast<HTMLStyleElement>(element).sheet())
</ins><span class="cx"> serializeCSSStyleSheet(sheet, URL());
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -2569,7 +2569,7 @@
</span><span class="cx">
</span><span class="cx"> LayoutSize difference = (currentSize + newOffset - adjustedOldOffset).expandedTo(minimumSize) - currentSize;
</span><span class="cx">
</span><del>- StyledElement* styledElement = toStyledElement(element);
</del><ins>+ StyledElement* styledElement = downcast<StyledElement>(element);
</ins><span class="cx"> bool isBoxSizingBorder = renderer->style().boxSizing() == BORDER_BOX;
</span><span class="cx">
</span><span class="cx"> EResize resize = renderer->style().resize();
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/svg/SVGElement.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -957,7 +957,7 @@
</span><span class="cx">
</span><span class="cx"> // Walk up the tree, to find out whether we're inside a <use> shadow tree, to find the right title.
</span><span class="cx"> if (isInShadowTree()) {
</span><del>- Element* shadowHostElement = toShadowRoot(treeScope().rootNode()).hostElement();
</del><ins>+ Element* shadowHostElement = downcast<ShadowRoot>(treeScope().rootNode()).hostElement();
</ins><span class="cx"> // At this time, SVG nodes are not allowed in non-<use> shadow trees, so any shadow root we do
</span><span class="cx"> // have should be a use. The assert and following test is here to catch future shadow DOM changes
</span><span class="cx"> // that do enable SVG in a shadow tree.
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (174068 => 174069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2014-09-29 17:20:18 UTC (rev 174068)
+++ trunk/Source/WebCore/testing/Internals.cpp        2014-09-29 17:35:28 UTC (rev 174069)
</span><span class="lines">@@ -574,19 +574,19 @@
</span><span class="cx"> {
</span><span class="cx"> if (!host) {
</span><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> return host->shadowRoot();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String Internals::shadowRootType(const Node* root, ExceptionCode& ec) const
</span><span class="cx"> {
</span><del>- if (!root || !root->isShadowRoot()) {
</del><ins>+ if (!root || !is<ShadowRoot>(root)) {
</ins><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- switch (toShadowRoot(root)->type()) {
</del><ins>+ switch (downcast<ShadowRoot>(*root).type()) {
</ins><span class="cx"> case ShadowRoot::UserAgentShadowRoot:
</span><span class="cx"> return String("UserAgentShadowRoot");
</span><span class="cx"> default:
</span><span class="lines">@@ -598,7 +598,7 @@
</span><span class="cx"> Element* Internals::includerFor(Node*, ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String Internals::shadowPseudoId(Element* element, ExceptionCode& ec)
</span></span></pre>
</div>
</div>
</body>
</html>