<!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>[174117] trunk/Source</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/174117">174117</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-09-30 12:59:49 -0700 (Tue, 30 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use is&lt;&gt;() / downcast&lt;&gt;() for Element
https://bugs.webkit.org/show_bug.cgi?id=137241

Reviewed by Andreas Kling.

Use is&lt;&gt;() / downcast&lt;&gt;() for Element instead of isElementNode() /
toElement().

Source/WebCore:

No new tests, no behavior change.

* accessibility/AXObjectCache.cpp:
(WebCore::nodeHasRole):
(WebCore::createFromRenderer):
(WebCore::AXObjectCache::handleLiveRegionCreated):
(WebCore::AXObjectCache::handleMenuItemSelected):
(WebCore::AXObjectCache::rootAXEditableElement):
(WebCore::isNodeAriaVisible):
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::canSetFocusAttribute):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
(WebCore::AccessibilityNodeObject::isEnabled):
(WebCore::AccessibilityNodeObject::isPressed):
(WebCore::AccessibilityNodeObject::isHovered):
(WebCore::AccessibilityNodeObject::anchorElement):
(WebCore::nativeActionElement):
(WebCore::AccessibilityNodeObject::actionElement):
(WebCore::AccessibilityNodeObject::mouseButtonListener):
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::helpText):
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
(WebCore::AccessibilityNodeObject::title):
(WebCore::AccessibilityNodeObject::text):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::hasTagName):
(WebCore::AccessibilityObject::hasAttribute):
(WebCore::AccessibilityObject::element):
(WebCore::AccessibilityObject::classList):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::anchorElement):
(WebCore::AccessibilityRenderObject::helpText):
(WebCore::AccessibilityRenderObject::checkboxOrRadioRect):
(WebCore::AccessibilityRenderObject::titleUIElement):
(WebCore::AccessibilityRenderObject::accessKey):
(WebCore::AccessibilityRenderObject::setElementAttributeValue):
(WebCore::AccessibilityRenderObject::setFocused):
(WebCore::AccessibilityRenderObject::setValue):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
(WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
(WebCore::AccessibilityRenderObject::renderObjectIsObservable):
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
(WebCore::AccessibilityRenderObject::setAccessibleName):
(WebCore::AccessibilityRenderObject::stringRoleForMSAA):
* accessibility/AccessibilitySearchFieldButtons.cpp:
(WebCore::AccessibilitySearchFieldCancelButton::press):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::styledNode):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::locateCousinList):
* dom/ContainerNode.cpp:
(WebCore::destroyRenderTreeIfNeeded):
(WebCore::ContainerNode::notifyChildRemoved):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
(WebCore::assertConnectedSubrameCountIsConsistent):
* dom/Document.cpp:
(WebCore::Document::importNode):
(WebCore::Document::elementFromPoint):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/Element.cpp:
(WebCore::Element::computeInheritedLanguage):
* dom/Element.h:
(WebCore::isElement):
(WebCore::Node::hasAttributes):
(WebCore::Node::attributes):
(WebCore::Node::parentElement):
* dom/ElementTraversal.h:
(WebCore::Traversal&lt;Element&gt;::nextTemplate):
(WebCore::ElementTraversal::previousIncludingPseudo):
(WebCore::ElementTraversal::nextIncludingPseudo):
(WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
(WebCore::ElementTraversal::pseudoAwarePreviousSibling):
* dom/LiveNodeList.cpp:
(WebCore::LiveNodeList::namedItem):
* dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::Node::normalize):
(WebCore::Node::pseudoAwareFirstChild):
(WebCore::Node::pseudoAwareLastChild):
(WebCore::Node::computedStyle):
(WebCore::Node::parentOrShadowHostElement):
(WebCore::Node::rootEditableElement):
(WebCore::Node::isEqualNode):
(WebCore::Node::isDefaultNamespace):
(WebCore::Node::lookupNamespacePrefix):
(WebCore::Node::ancestorElement):
(WebCore::appendAttributeDesc):
(WebCore::Node::showNodePathForThis):
(WebCore::Node::enclosingLinkEventParentOrSelf):
(WebCore::Node::handleLocalEvents):
(WebCore::Node::willRespondToMouseMoveEvents):
(WebCore::Node::willRespondToMouseClickEvents):
* dom/NodeRenderingTraversal.cpp:
(WebCore::NodeRenderingTraversal::nodeCanBeDistributed):
* dom/Position.cpp:
(WebCore::Position::element):
* dom/Range.cpp:
(WebCore::Range::getBorderAndTextQuads):
* dom/ShadowRoot.h:
(WebCore::Node::shadowRoot):
* dom/StaticNodeList.cpp:
(WebCore::StaticNodeList::namedItem):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
* editing/ApplyStyleCommand.cpp:
(WebCore::dummySpanAncestorForNode):
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
(WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
(WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::isRemovableBlock):
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
* editing/Editor.cpp:
(WebCore::Editor::isSpellCheckingEnabledFor):
(WebCore::Editor::applyEditingStyleToBodyElement):
* editing/FormatBlockCommand.cpp:
(WebCore::isElementForFormatBlock):
(WebCore::FormatBlockCommand::elementForFormatBlockCommand):
* editing/FrameSelection.cpp:
(WebCore::removingNodeRemovesPosition):
(WebCore::CaretBase::paintCaret):
(WebCore::FrameSelection::debugRenderer):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentParagraph):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::appendStartMarkup):
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::appendEndTag):
* editing/ModifySelectionListLevel.cpp:
(WebCore::IncreaseSelectionListLevelCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::isMailPasteAsQuotationNode):
(WebCore::haveSameTagName):
(WebCore::handleStyleSpansBeforeInsertion):
(WebCore::ReplaceSelectionCommand::doApply):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::isCheckable):
* editing/SplitTextNodeContainingElementCommand.cpp:
(WebCore::SplitTextNodeContainingElementCommand::doApply):
* editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverterCaches::floatPropertyValueForNode):
(HTMLConverterCaches::colorPropertyValueForNode):
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
(HTMLConverter::_traverseNode):
(WebCore::editingAttributedStringFromRange):
* editing/htmlediting.cpp:
(WebCore::unsplittableElementForPosition):
(WebCore::enclosingBlock):
(WebCore::enclosingElementWithTag):
(WebCore::enclosingTableCell):
(WebCore::enclosingAnchorElement):
(WebCore::areIdenticalElements):
(WebCore::isNonTableCellHTMLBlockElement):
(WebCore::deprecatedEnclosingBlockFlowElement):
(WebCore::rendererForCaretPainting):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::wrapWithNode):
(WebCore::createMarkupInternal):
(WebCore::createFragmentFromText):
* html/HTMLDetailsElement.cpp:
(WebCore::DetailsSummaryElement::fallbackSummary):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::insertAdjacentElement):
(WebCore::contextElementForInsertion):
(WebCore::HTMLElement::directionality):
* html/HTMLFormControlElement.h:
(WebCore::isHTMLFormControlElement):
* html/HTMLMediaElement.h:
(WebCore::isHTMLMediaElement):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateDocNamedItem):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::collectOptionInnerText):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLSummaryElement.cpp:
(WebCore::isClickableControl):
* html/HTMLTextFormControlElement.h:
(WebCore::isHTMLTextFormControlElement):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::attachLater):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLElementStack::htmlElement):
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::element):
* html/shadow/InsertionPoint.h:
(WebCore::parentElementForDistribution):
(WebCore::shadowRootOfParentForDistribution):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::markFutureAndPastNodes):
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::innerPatchNode):
(WebCore::DOMPatchSupport::createDigest):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::elementForId):
(WebCore::InspectorCSSAgent::buildArrayForRegions):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::unbind):
(WebCore::InspectorDOMAgent::assertElement):
(WebCore::InspectorDOMAgent::setAttributesAsText):
(WebCore::InspectorDOMAgent::setNodeName):
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
(WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementInfo):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::inlineStyleSheetText):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
* page/EventHandler.cpp:
(WebCore::findDropZone):
(WebCore::EventHandler::updateDragAndDrop):
(WebCore::EventHandler::updateMouseEventTargetNode):
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::focusNavigationScopeOwnedByShadowHost):
(WebCore::isFocusableShadowHost):
(WebCore::adjustedTabIndex):
(WebCore::FocusController::findFocusableElementAcrossFocusScope):
(WebCore::FocusController::findElementWithExactTabIndex):
(WebCore::nextElementWithGreaterTabIndex):
(WebCore::previousElementWithLowerTabIndex):
(WebCore::FocusController::nextFocusableElement):
(WebCore::FocusController::previousFocusableElement):
(WebCore::FocusController::advanceFocusDirectionallyInContainer):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::title):
(WebCore::HitTestResult::innerTextIfTruncated):
(WebCore::HitTestResult::absoluteImageURL):
(WebCore::HitTestResult::innerElement):
(WebCore::HitTestResult::innerNonSharedElement):
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::isOpen):
* rendering/RenderElement.h:
(WebCore::RenderElement::element):
(WebCore::RenderElement::nonPseudoElement):
(WebCore::RenderElement::generatingElement):
* rendering/RenderGrid.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::isRestartedPlugin):
* rendering/RenderListItem.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::isChildAllowed):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
(WebCore::RenderObject::updateDragState):
(WebCore::RenderObject::getUncachedPseudoStyle):
* rendering/RenderRuby.h:
* rendering/RenderRubyText.h:
* rendering/RenderTableCaption.h:
* rendering/RenderTableCol.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isEnabled):
(WebCore::RenderTheme::isFocused):
(WebCore::RenderTheme::isPressed):
(WebCore::RenderTheme::isSpinUpButtonPartPressed):
(WebCore::RenderTheme::isReadOnlyControl):
(WebCore::RenderTheme::isHovered):
(WebCore::RenderTheme::isSpinUpButtonPartHovered):
* rendering/RenderThemeGtk.cpp:
(WebCore::nodeHasClass):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updatePressedState):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::isAutosizingContainer):
(WebCore::TextAutosizer::containerContainsOneOfTags):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::isChildAllowed):
* style/StyleResolveTree.cpp:
(WebCore::Style::attachChildren):
(WebCore::Style::attachDistributedChildren):
(WebCore::Style::detachDistributedChildren):
(WebCore::Style::detachChildren):
(WebCore::Style::resolveShadowTree):
(WebCore::Style::resolveTree):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
* xml/XPathFunctions.cpp:
(WebCore::XPath::FunLang::evaluate):
* xml/XPathNodeSet.cpp:
(WebCore::XPath::NodeSet::traversalSort):
* xml/XPathStep.cpp:
(WebCore::XPath::nodeMatchesBasicTest):
(WebCore::XPath::Step::nodesInAxis):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):

Source/WebKit/mac:

* WebView/WebRenderLayer.mm:
(+[WebRenderLayer nameForLayer:]):

Source/WebKit/win:

* DOMEventsClasses.cpp:
(DOMMouseEvent::toElement):
* DOMEventsClasses.h:

Source/WebKit2:

* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::WebRenderObject):
* WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
(-[WKDOMElement hasAttribute:]):
(-[WKDOMElement getAttribute:]):
(-[WKDOMElement setAttribute:value:]):
(-[WKDOMElement tagName]):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::elementBounds):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::mediaType):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
(WebKit::WebPage::blurAssistedNode):
(WebKit::WebPage::getPositionInformation):
(WebKit::nextFocusableElement):
(WebKit::WebPage::elementDidFocus):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp">trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySearchFieldButtonscpp">trunk/Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleWrapperAtkcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsgobjectWebKitDOMPrivatecpp">trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeAlgorithmscpp">trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentStyleSheetCollectioncpp">trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomElementTraversalh">trunk/Source/WebCore/dom/ElementTraversal.h</a></li>
<li><a href="#trunkSourceWebCoredomLiveNodeListcpp">trunk/Source/WebCore/dom/LiveNodeList.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="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRooth">trunk/Source/WebCore/dom/ShadowRoot.h</a></li>
<li><a href="#trunkSourceWebCoredomStaticNodeListcpp">trunk/Source/WebCore/dom/StaticNodeList.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="#trunkSourceWebCoreeditingBreakBlockquoteCommandcpp">trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteSelectionCommandcpp">trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFormatBlockCommandcpp">trunk/Source/WebCore/editing/FormatBlockCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingIndentOutdentCommandcpp">trunk/Source/WebCore/editing/IndentOutdentCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp">trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingMarkupAccumulatorcpp">trunk/Source/WebCore/editing/MarkupAccumulator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingMarkupAccumulatorh">trunk/Source/WebCore/editing/MarkupAccumulator.h</a></li>
<li><a href="#trunkSourceWebCoreeditingModifySelectionListLevelcpp">trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingSpellCheckercpp">trunk/Source/WebCore/editing/SpellChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingSplitTextNodeContainingElementCommandcpp">trunk/Source/WebCore/editing/SplitTextNodeContainingElementCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaHTMLConvertermm">trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm</a></li>
<li><a href="#trunkSourceWebCoreeditinghtmleditingcpp">trunk/Source/WebCore/editing/htmlediting.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingmarkupcpp">trunk/Source/WebCore/editing/markup.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDetailsElementcpp">trunk/Source/WebCore/html/HTMLDetailsElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementh">trunk/Source/WebCore/html/HTMLFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOptionElementcpp">trunk/Source/WebCore/html/HTMLOptionElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSourceElementcpp">trunk/Source/WebCore/html/HTMLSourceElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSummaryElementcpp">trunk/Source/WebCore/html/HTMLSummaryElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementh">trunk/Source/WebCore/html/HTMLTextFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLConstructionSitecpp">trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLElementStackcpp">trunk/Source/WebCore/html/parser/HTMLElementStack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLStackItemh">trunk/Source/WebCore/html/parser/HTMLStackItem.h</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowInsertionPointh">trunk/Source/WebCore/html/shadow/InsertionPoint.h</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowMediaControlElementscpp">trunk/Source/WebCore/html/shadow/MediaControlElements.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCuecpp">trunk/Source/WebCore/html/track/VTTCue.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorDOMPatchSupportcpp">trunk/Source/WebCore/inspector/DOMPatchSupport.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorNodeFindercpp">trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheetcpp">trunk/Source/WebCore/inspector/InspectorStyleSheet.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="#trunkSourceWebCorerenderingHitTestResultcpp">trunk/Source/WebCore/rendering/HitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderDeprecatedFlexibleBoxh">trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderDetailsMarkercpp">trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridh">trunk/Source/WebCore/rendering/RenderGrid.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListItemh">trunk/Source/WebCore/rendering/RenderListItem.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderNamedFlowThreadcpp">trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjectcpp">trunk/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyh">trunk/Source/WebCore/rendering/RenderRuby.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyTexth">trunk/Source/WebCore/rendering/RenderRubyText.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableCaptionh">trunk/Source/WebCore/rendering/RenderTableCaption.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableColh">trunk/Source/WebCore/rendering/RenderTableCol.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemecpp">trunk/Source/WebCore/rendering/RenderTheme.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeGtkcpp">trunk/Source/WebCore/rendering/RenderThemeGtk.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutosizercpp">trunk/Source/WebCore/rendering/TextAutosizer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLBlockcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveTreecpp">trunk/Source/WebCore/style/StyleResolveTree.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGUseElementcpp">trunk/Source/WebCore/svg/SVGUseElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvganimationSVGSMILElementcpp">trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXPathFunctionscpp">trunk/Source/WebCore/xml/XPathFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXPathNodeSetcpp">trunk/Source/WebCore/xml/XPathNodeSet.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXPathStepcpp">trunk/Source/WebCore/xml/XPathStep.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp">trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebRenderLayermm">trunk/Source/WebKit/mac/WebView/WebRenderLayer.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinDOMEventsClassescpp">trunk/Source/WebKit/win/DOMEventsClasses.cpp</a></li>
<li><a href="#trunkSourceWebKitwinDOMEventsClassesh">trunk/Source/WebKit/win/DOMEventsClasses.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebRenderObjectcpp">trunk/Source/WebKit2/Shared/WebRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKDOMElementmm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMElement.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleDOMInjectedBundleNodeHandlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundleHitTestResultcpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/ChangeLog        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1,3 +1,344 @@
</span><ins>+2014-09-30  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element
+        https://bugs.webkit.org/show_bug.cgi?id=137241
+
+        Reviewed by Andreas Kling.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element instead of isElementNode() /
+        toElement().
+
+        No new tests, no behavior change.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::nodeHasRole):
+        (WebCore::createFromRenderer):
+        (WebCore::AXObjectCache::handleLiveRegionCreated):
+        (WebCore::AXObjectCache::handleMenuItemSelected):
+        (WebCore::AXObjectCache::rootAXEditableElement):
+        (WebCore::isNodeAriaVisible):
+        * accessibility/AccessibilityMenuList.cpp:
+        (WebCore::AccessibilityMenuList::canSetFocusAttribute):
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
+        (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
+        (WebCore::AccessibilityNodeObject::isEnabled):
+        (WebCore::AccessibilityNodeObject::isPressed):
+        (WebCore::AccessibilityNodeObject::isHovered):
+        (WebCore::AccessibilityNodeObject::anchorElement):
+        (WebCore::nativeActionElement):
+        (WebCore::AccessibilityNodeObject::actionElement):
+        (WebCore::AccessibilityNodeObject::mouseButtonListener):
+        (WebCore::AccessibilityNodeObject::titleElementText):
+        (WebCore::AccessibilityNodeObject::helpText):
+        (WebCore::AccessibilityNodeObject::hierarchicalLevel):
+        (WebCore::AccessibilityNodeObject::title):
+        (WebCore::AccessibilityNodeObject::text):
+        (WebCore::accessibleNameForNode):
+        (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::press):
+        (WebCore::AccessibilityObject::hasTagName):
+        (WebCore::AccessibilityObject::hasAttribute):
+        (WebCore::AccessibilityObject::element):
+        (WebCore::AccessibilityObject::classList):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::anchorElement):
+        (WebCore::AccessibilityRenderObject::helpText):
+        (WebCore::AccessibilityRenderObject::checkboxOrRadioRect):
+        (WebCore::AccessibilityRenderObject::titleUIElement):
+        (WebCore::AccessibilityRenderObject::accessKey):
+        (WebCore::AccessibilityRenderObject::setElementAttributeValue):
+        (WebCore::AccessibilityRenderObject::setFocused):
+        (WebCore::AccessibilityRenderObject::setValue):
+        (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
+        (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
+        (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
+        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
+        (WebCore::AccessibilityRenderObject::setAccessibleName):
+        (WebCore::AccessibilityRenderObject::stringRoleForMSAA):
+        * accessibility/AccessibilitySearchFieldButtons.cpp:
+        (WebCore::AccessibilitySearchFieldCancelButton::press):
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes):
+        * bindings/gobject/WebKitDOMPrivate.cpp:
+        (WebKit::wrap):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::isReachableFromDOM):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::styledNode):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::locateCousinList):
+        * dom/ContainerNode.cpp:
+        (WebCore::destroyRenderTreeIfNeeded):
+        (WebCore::ContainerNode::notifyChildRemoved):
+        * dom/ContainerNodeAlgorithms.cpp:
+        (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
+        (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
+        (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
+        (WebCore::assertConnectedSubrameCountIsConsistent):
+        * dom/Document.cpp:
+        (WebCore::Document::importNode):
+        (WebCore::Document::elementFromPoint):
+        * dom/DocumentStyleSheetCollection.cpp:
+        (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
+        * dom/Element.cpp:
+        (WebCore::Element::computeInheritedLanguage):
+        * dom/Element.h:
+        (WebCore::isElement):
+        (WebCore::Node::hasAttributes):
+        (WebCore::Node::attributes):
+        (WebCore::Node::parentElement):
+        * dom/ElementTraversal.h:
+        (WebCore::Traversal&lt;Element&gt;::nextTemplate):
+        (WebCore::ElementTraversal::previousIncludingPseudo):
+        (WebCore::ElementTraversal::nextIncludingPseudo):
+        (WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
+        (WebCore::ElementTraversal::pseudoAwarePreviousSibling):
+        * dom/LiveNodeList.cpp:
+        (WebCore::LiveNodeList::namedItem):
+        * dom/Node.cpp:
+        (WebCore::Node::dumpStatistics):
+        (WebCore::Node::normalize):
+        (WebCore::Node::pseudoAwareFirstChild):
+        (WebCore::Node::pseudoAwareLastChild):
+        (WebCore::Node::computedStyle):
+        (WebCore::Node::parentOrShadowHostElement):
+        (WebCore::Node::rootEditableElement):
+        (WebCore::Node::isEqualNode):
+        (WebCore::Node::isDefaultNamespace):
+        (WebCore::Node::lookupNamespacePrefix):
+        (WebCore::Node::ancestorElement):
+        (WebCore::appendAttributeDesc):
+        (WebCore::Node::showNodePathForThis):
+        (WebCore::Node::enclosingLinkEventParentOrSelf):
+        (WebCore::Node::handleLocalEvents):
+        (WebCore::Node::willRespondToMouseMoveEvents):
+        (WebCore::Node::willRespondToMouseClickEvents):
+        * dom/NodeRenderingTraversal.cpp:
+        (WebCore::NodeRenderingTraversal::nodeCanBeDistributed):
+        * dom/Position.cpp:
+        (WebCore::Position::element):
+        * dom/Range.cpp:
+        (WebCore::Range::getBorderAndTextQuads):
+        * dom/ShadowRoot.h:
+        (WebCore::Node::shadowRoot):
+        * dom/StaticNodeList.cpp:
+        (WebCore::StaticNodeList::namedItem):
+        * dom/TreeScopeAdopter.cpp:
+        (WebCore::TreeScopeAdopter::moveTreeToNewScope):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::dummySpanAncestorForNode):
+        (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
+        (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
+        (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
+        (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
+        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
+        * editing/BreakBlockquoteCommand.cpp:
+        (WebCore::BreakBlockquoteCommand::doApply):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::isRemovableBlock):
+        (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
+        (WebCore::CompositeEditCommand::moveParagraphs):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
+        * editing/Editor.cpp:
+        (WebCore::Editor::isSpellCheckingEnabledFor):
+        (WebCore::Editor::applyEditingStyleToBodyElement):
+        * editing/FormatBlockCommand.cpp:
+        (WebCore::isElementForFormatBlock):
+        (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
+        * editing/FrameSelection.cpp:
+        (WebCore::removingNodeRemovesPosition):
+        (WebCore::CaretBase::paintCaret):
+        (WebCore::FrameSelection::debugRenderer):
+        * editing/IndentOutdentCommand.cpp:
+        (WebCore::IndentOutdentCommand::outdentParagraph):
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::doApply):
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
+        (WebCore::MarkupAccumulator::appendStartMarkup):
+        * editing/MarkupAccumulator.h:
+        (WebCore::MarkupAccumulator::appendEndTag):
+        * editing/ModifySelectionListLevel.cpp:
+        (WebCore::IncreaseSelectionListLevelCommand::doApply):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::isMailPasteAsQuotationNode):
+        (WebCore::haveSameTagName):
+        (WebCore::handleStyleSpansBeforeInsertion):
+        (WebCore::ReplaceSelectionCommand::doApply):
+        * editing/SpellChecker.cpp:
+        (WebCore::SpellChecker::isCheckable):
+        * editing/SplitTextNodeContainingElementCommand.cpp:
+        (WebCore::SplitTextNodeContainingElementCommand::doApply):
+        * editing/TextIterator.cpp:
+        (WebCore::isRendererReplacedElement):
+        * editing/cocoa/HTMLConverter.mm:
+        (HTMLConverterCaches::propertyValueForNode):
+        (HTMLConverterCaches::floatPropertyValueForNode):
+        (HTMLConverterCaches::colorPropertyValueForNode):
+        (HTMLConverter::aggregatedAttributesForAncestors):
+        (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
+        (HTMLConverter::_traverseNode):
+        (WebCore::editingAttributedStringFromRange):
+        * editing/htmlediting.cpp:
+        (WebCore::unsplittableElementForPosition):
+        (WebCore::enclosingBlock):
+        (WebCore::enclosingElementWithTag):
+        (WebCore::enclosingTableCell):
+        (WebCore::enclosingAnchorElement):
+        (WebCore::areIdenticalElements):
+        (WebCore::isNonTableCellHTMLBlockElement):
+        (WebCore::deprecatedEnclosingBlockFlowElement):
+        (WebCore::rendererForCaretPainting):
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::wrapWithNode):
+        (WebCore::createMarkupInternal):
+        (WebCore::createFragmentFromText):
+        * html/HTMLDetailsElement.cpp:
+        (WebCore::DetailsSummaryElement::fallbackSummary):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::insertAdjacentElement):
+        (WebCore::contextElementForInsertion):
+        (WebCore::HTMLElement::directionality):
+        * html/HTMLFormControlElement.h:
+        (WebCore::isHTMLFormControlElement):
+        * html/HTMLMediaElement.h:
+        (WebCore::isHTMLMediaElement):
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::updateDocNamedItem):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::collectOptionInnerText):
+        * html/HTMLSourceElement.cpp:
+        (WebCore::HTMLSourceElement::removedFrom):
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::isClickableControl):
+        * html/HTMLTextFormControlElement.h:
+        (WebCore::isHTMLTextFormControlElement):
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::attachLater):
+        * html/parser/HTMLElementStack.cpp:
+        (WebCore::HTMLElementStack::htmlElement):
+        * html/parser/HTMLStackItem.h:
+        (WebCore::HTMLStackItem::element):
+        * html/shadow/InsertionPoint.h:
+        (WebCore::parentElementForDistribution):
+        (WebCore::shadowRootOfParentForDistribution):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::markFutureAndPastNodes):
+        * inspector/DOMPatchSupport.cpp:
+        (WebCore::DOMPatchSupport::innerPatchNode):
+        (WebCore::DOMPatchSupport::createDigest):
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::elementForId):
+        (WebCore::InspectorCSSAgent::buildArrayForRegions):
+        (WebCore::InspectorCSSAgent::resetPseudoStates):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::unbind):
+        (WebCore::InspectorDOMAgent::assertElement):
+        (WebCore::InspectorDOMAgent::setAttributesAsText):
+        (WebCore::InspectorDOMAgent::setNodeName):
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+        (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
+        * inspector/InspectorNodeFinder.cpp:
+        (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::buildObjectForElementInfo):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyleSheet::inlineStyleSheetText):
+        * page/DragController.cpp:
+        (WebCore::elementUnderMouse):
+        * page/EventHandler.cpp:
+        (WebCore::findDropZone):
+        (WebCore::EventHandler::updateDragAndDrop):
+        (WebCore::EventHandler::updateMouseEventTargetNode):
+        * page/FocusController.cpp:
+        (WebCore::FocusNavigationScope::focusNavigationScopeOwnedByShadowHost):
+        (WebCore::isFocusableShadowHost):
+        (WebCore::adjustedTabIndex):
+        (WebCore::FocusController::findFocusableElementAcrossFocusScope):
+        (WebCore::FocusController::findElementWithExactTabIndex):
+        (WebCore::nextElementWithGreaterTabIndex):
+        (WebCore::previousElementWithLowerTabIndex):
+        (WebCore::FocusController::nextFocusableElement):
+        (WebCore::FocusController::previousFocusableElement):
+        (WebCore::FocusController::advanceFocusDirectionallyInContainer):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::serializeFrame):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::title):
+        (WebCore::HitTestResult::innerTextIfTruncated):
+        (WebCore::HitTestResult::absoluteImageURL):
+        (WebCore::HitTestResult::innerElement):
+        (WebCore::HitTestResult::innerNonSharedElement):
+        * rendering/RenderDeprecatedFlexibleBox.h:
+        * rendering/RenderDetailsMarker.cpp:
+        (WebCore::RenderDetailsMarker::isOpen):
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::element):
+        (WebCore::RenderElement::nonPseudoElement):
+        (WebCore::RenderElement::generatingElement):
+        * rendering/RenderGrid.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::isRestartedPlugin):
+        * rendering/RenderListItem.h:
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::isChildAllowed):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::addPDFURLRect):
+        (WebCore::RenderObject::updateDragState):
+        (WebCore::RenderObject::getUncachedPseudoStyle):
+        * rendering/RenderRuby.h:
+        * rendering/RenderRubyText.h:
+        * rendering/RenderTableCaption.h:
+        * rendering/RenderTableCol.h:
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::isEnabled):
+        (WebCore::RenderTheme::isFocused):
+        (WebCore::RenderTheme::isPressed):
+        (WebCore::RenderTheme::isSpinUpButtonPartPressed):
+        (WebCore::RenderTheme::isReadOnlyControl):
+        (WebCore::RenderTheme::isHovered):
+        (WebCore::RenderTheme::isSpinUpButtonPartHovered):
+        * rendering/RenderThemeGtk.cpp:
+        (WebCore::nodeHasClass):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::updatePressedState):
+        (WebCore::RenderThemeMac::paintSliderThumb):
+        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::RenderTreeAsText::writeRenderObject):
+        * rendering/TextAutosizer.cpp:
+        (WebCore::TextAutosizer::isAutosizingContainer):
+        (WebCore::TextAutosizer::containerContainsOneOfTags):
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::isChildAllowed):
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::attachChildren):
+        (WebCore::Style::attachDistributedChildren):
+        (WebCore::Style::detachDistributedChildren):
+        (WebCore::Style::detachChildren):
+        (WebCore::Style::resolveShadowTree):
+        (WebCore::Style::resolveTree):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::buildPendingResource):
+        * xml/XPathFunctions.cpp:
+        (WebCore::XPath::FunLang::evaluate):
+        * xml/XPathNodeSet.cpp:
+        (WebCore::XPath::NodeSet::traversalSort):
+        * xml/XPathStep.cpp:
+        (WebCore::XPath::nodeMatchesBasicTest):
+        (WebCore::XPath::Step::nodesInAxis):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::XMLDocumentParser):
+        (WebCore::XMLDocumentParser::endElementNs):
+
</ins><span class="cx"> 2014-09-30  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Replay: use static Strings instead of AtomicStrings for replay input type tags
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -253,10 +253,10 @@
</span><span class="cx"> // FIXME: This should take a const char*, but one caller passes nullAtom.
</span><span class="cx"> bool nodeHasRole(Node* node, const String&amp; role)
</span><span class="cx"> {
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    auto&amp; roleValue = toElement(node)-&gt;fastGetAttribute(roleAttr);
</del><ins>+    auto&amp; roleValue = downcast&lt;Element&gt;(*node).fastGetAttribute(roleAttr);
</ins><span class="cx">     if (role.isNull())
</span><span class="cx">         return roleValue.isEmpty();
</span><span class="cx">     if (roleValue.isEmpty())
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx">         return AccessibilitySVGRoot::create(renderer);
</span><span class="cx">     
</span><span class="cx">     // Search field buttons
</span><del>-    if (node &amp;&amp; node-&gt;isElementNode() &amp;&amp; toElement(node)-&gt;isSearchFieldCancelButtonElement())
</del><ins>+    if (node &amp;&amp; is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(*node).isSearchFieldCancelButtonElement())
</ins><span class="cx">         return AccessibilitySearchFieldCancelButton::create(renderer);
</span><span class="cx">     
</span><span class="cx">     if (renderer-&gt;isBoxModelObject()) {
</span><span class="lines">@@ -653,10 +653,10 @@
</span><span class="cx">     
</span><span class="cx"> void AXObjectCache::handleLiveRegionCreated(Node* node)
</span><span class="cx"> {
</span><del>-    if (!node || !node-&gt;renderer() || !node-&gt;isElementNode())
</del><ins>+    if (!node || !node-&gt;renderer() || !is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    Element* element = toElement(node);
</del><ins>+    Element* element = downcast&lt;Element&gt;(node);
</ins><span class="cx">     String liveRegionStatus = element-&gt;fastGetAttribute(aria_liveAttr);
</span><span class="cx">     if (liveRegionStatus.isEmpty()) {
</span><span class="cx">         const AtomicString&amp; ariaRole = element-&gt;fastGetAttribute(roleAttr);
</span><span class="lines">@@ -820,7 +820,7 @@
</span><span class="cx">     if (!nodeHasRole(node, &quot;menuitem&quot;) &amp;&amp; !nodeHasRole(node, &quot;menuitemradio&quot;) &amp;&amp; !nodeHasRole(node, &quot;menuitemcheckbox&quot;))
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    if (!toElement(node)-&gt;focused() &amp;&amp; !equalIgnoringCase(toElement(node)-&gt;fastGetAttribute(aria_selectedAttr), &quot;true&quot;))
</del><ins>+    if (!downcast&lt;Element&gt;(*node).focused() &amp;&amp; !equalIgnoringCase(downcast&lt;Element&gt;(*node).fastGetAttribute(aria_selectedAttr), &quot;true&quot;))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     postNotification(getOrCreate(node), &amp;document(), AXMenuListItemSelected);
</span><span class="lines">@@ -1030,7 +1030,7 @@
</span><span class="cx"> const Element* AXObjectCache::rootAXEditableElement(const Node* node)
</span><span class="cx"> {
</span><span class="cx">     const Element* result = node-&gt;rootEditableElement();
</span><del>-    const Element* element = node-&gt;isElementNode() ? toElement(node) : node-&gt;parentElement();
</del><ins>+    const Element* element = is&lt;Element&gt;(node) ? downcast&lt;Element&gt;(node) : node-&gt;parentElement();
</ins><span class="cx"> 
</span><span class="cx">     for (; element; element = element-&gt;parentElement()) {
</span><span class="cx">         if (nodeIsTextControl(element))
</span><span class="lines">@@ -1073,8 +1073,8 @@
</span><span class="cx">     // To determine if a node is ARIA visible, we need to check the parent hierarchy to see if anyone specifies
</span><span class="cx">     // aria-hidden explicitly.
</span><span class="cx">     for (Node* testNode = node; testNode; testNode = testNode-&gt;parentNode()) {
</span><del>-        if (testNode-&gt;isElementNode()) {
-            const AtomicString&amp; ariaHiddenValue = toElement(testNode)-&gt;fastGetAttribute(aria_hiddenAttr);
</del><ins>+        if (is&lt;Element&gt;(testNode)) {
+            const AtomicString&amp; ariaHiddenValue = downcast&lt;Element&gt;(*testNode).fastGetAttribute(aria_hiddenAttr);
</ins><span class="cx">             if (equalIgnoringCase(ariaHiddenValue, &quot;false&quot;))
</span><span class="cx">                 return true;
</span><span class="cx">             if (equalIgnoringCase(ariaHiddenValue, &quot;true&quot;))
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     if (!node())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return !toElement(node())-&gt;isDisabledFormControl();
</del><ins>+    return !downcast&lt;Element&gt;(*node()).isDisabledFormControl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityMenuList::didUpdateActiveOption(int optionIndex)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;FrameSelection.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;HTMLAreaElement.h&quot;
</span><ins>+#include &quot;HTMLCanvasElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLFieldSetElement.h&quot;
</span><span class="cx"> #include &quot;HTMLFormElement.h&quot;
</span><span class="cx"> #include &quot;HTMLFrameElementBase.h&quot;
</span><span class="lines">@@ -324,7 +325,7 @@
</span><span class="cx">         return ParagraphRole;
</span><span class="cx">     if (is&lt;HTMLLabelElement&gt;(node()))
</span><span class="cx">         return LabelRole;
</span><del>-    if (node()-&gt;isElementNode() &amp;&amp; toElement(node())-&gt;isFocusable())
</del><ins>+    if (is&lt;Element&gt;(node()) &amp;&amp; downcast&lt;Element&gt;(*node()).isFocusable())
</ins><span class="cx">         return GroupRole;
</span><span class="cx">     
</span><span class="cx">     return UnknownRole;
</span><span class="lines">@@ -441,9 +442,9 @@
</span><span class="cx"> bool AccessibilityNodeObject::canvasHasFallbackContent() const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (!node || !node-&gt;hasTagName(canvasTag))
</del><ins>+    if (!node || !is&lt;HTMLCanvasElement&gt;(node))
</ins><span class="cx">         return false;
</span><del>-    Element&amp; canvasElement = toElement(*node);
</del><ins>+    HTMLCanvasElement&amp; canvasElement = downcast&lt;HTMLCanvasElement&gt;(*node);
</ins><span class="cx">     // If it has any children that are elements, we'll assume it might be fallback
</span><span class="cx">     // content. If it has no children or its only children are not elements
</span><span class="cx">     // (e.g. just text nodes), it doesn't have fallback content.
</span><span class="lines">@@ -642,10 +643,10 @@
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    return !toElement(node)-&gt;isDisabledFormControl();
</del><ins>+    return !downcast&lt;Element&gt;(*node).isDisabledFormControl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::isIndeterminate() const
</span><span class="lines">@@ -677,9 +678,9 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><del>-    return toElement(node)-&gt;active();
</del><ins>+    return downcast&lt;Element&gt;(*node).active();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::isChecked() const
</span><span class="lines">@@ -719,7 +720,7 @@
</span><span class="cx">     if (!node)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return node-&gt;isElementNode() &amp;&amp; toElement(node)-&gt;hovered();
</del><ins>+    return is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(*node).hovered();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::isMultiSelectable() const
</span><span class="lines">@@ -965,7 +966,7 @@
</span><span class="cx">     // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElement
</span><span class="cx">     for ( ; node; node = node-&gt;parentNode()) {
</span><span class="cx">         if (is&lt;HTMLAnchorElement&gt;(node) || (node-&gt;renderer() &amp;&amp; cache-&gt;getOrCreate(node-&gt;renderer())-&gt;isAnchor()))
</span><del>-            return toElement(node);
</del><ins>+            return downcast&lt;Element&gt;(node);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -994,7 +995,7 @@
</span><span class="cx">     
</span><span class="cx">     for (Node* child = start-&gt;firstChild(); child; child = child-&gt;nextSibling()) {
</span><span class="cx">         if (isNodeActionElement(child))
</span><del>-            return toElement(child);
</del><ins>+            return downcast&lt;Element&gt;(child);
</ins><span class="cx"> 
</span><span class="cx">         if (Element* subChild = nativeActionElement(child))
</span><span class="cx">             return subChild;
</span><span class="lines">@@ -1009,10 +1010,10 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (isNodeActionElement(node))
</span><del>-        return toElement(node);
</del><ins>+        return downcast&lt;Element&gt;(node);
</ins><span class="cx">     
</span><span class="cx">     if (AccessibilityObject::isARIAInput(ariaRoleAttribute()))
</span><del>-        return toElement(node);
</del><ins>+        return downcast&lt;Element&gt;(node);
</ins><span class="cx"> 
</span><span class="cx">     switch (roleValue()) {
</span><span class="cx">     case ButtonRole:
</span><span class="lines">@@ -1026,7 +1027,7 @@
</span><span class="cx">         // Check if the author is hiding the real control element inside the ARIA element.
</span><span class="cx">         if (Element* nativeElement = nativeActionElement(node))
</span><span class="cx">             return nativeElement;
</span><del>-        return toElement(node);
</del><ins>+        return downcast&lt;Element&gt;(node);
</ins><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -1045,7 +1046,7 @@
</span><span class="cx"> 
</span><span class="cx">     // check if our parent is a mouse button listener
</span><span class="cx">     // FIXME: Do the continuation search like anchorElement does
</span><del>-    for (auto&amp; element : elementLineage(node-&gt;isElementNode() ? toElement(node) : node-&gt;parentElement())) {
</del><ins>+    for (auto&amp; element : elementLineage(is&lt;Element&gt;(node) ? downcast&lt;Element&gt;(node) : node-&gt;parentElement())) {
</ins><span class="cx">         // If we've reached the body and this is not a control element, do not expose press action for this element unless filter is IncludeBodyElement.
</span><span class="cx">         // It can cause false positives, where every piece of text is labeled as accepting press actions.
</span><span class="cx">         if (element.hasTagName(bodyTag) &amp;&amp; isStaticText() &amp;&amp; filter == ExcludeBodyElement)
</span><span class="lines">@@ -1253,8 +1254,7 @@
</span><span class="cx">     
</span><span class="cx">     bool isInputTag = is&lt;HTMLInputElement&gt;(node);
</span><span class="cx">     if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) {
</span><del>-        HTMLLabelElement* label = labelForElement(toElement(node));
-        if (label) {
</del><ins>+        if (HTMLLabelElement* label = labelForElement(downcast&lt;Element&gt;(node))) {
</ins><span class="cx">             AccessibilityObject* labelObject = axObjectCache()-&gt;getOrCreate(label);
</span><span class="cx">             String innerText = label-&gt;innerText();
</span><span class="cx">             // Only use the &lt;label&gt; text if there's no ARIA override.
</span><span class="lines">@@ -1532,21 +1532,22 @@
</span><span class="cx">         return describedBy;
</span><span class="cx">     
</span><span class="cx">     String description = accessibilityDescription();
</span><del>-    for (Node* curr = node; curr; curr = curr-&gt;parentNode()) {
-        if (curr-&gt;isHTMLElement()) {
-            const AtomicString&amp; summary = toElement(curr)-&gt;getAttribute(summaryAttr);
</del><ins>+    for (Node* ancestor = node; ancestor; ancestor = ancestor-&gt;parentNode()) {
+        if (is&lt;HTMLElement&gt;(ancestor)) {
+            HTMLElement&amp; element = downcast&lt;HTMLElement&gt;(*ancestor);
+            const AtomicString&amp; summary = element.getAttribute(summaryAttr);
</ins><span class="cx">             if (!summary.isEmpty())
</span><span class="cx">                 return summary;
</span><span class="cx">             
</span><span class="cx">             // The title attribute should be used as help text unless it is already being used as descriptive text.
</span><del>-            const AtomicString&amp; title = toElement(curr)-&gt;getAttribute(titleAttr);
</del><ins>+            const AtomicString&amp; title = element.getAttribute(titleAttr);
</ins><span class="cx">             if (!title.isEmpty() &amp;&amp; description != title)
</span><span class="cx">                 return title;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // Only take help text from an ancestor element if its a group or an unknown role. If help was 
</span><span class="cx">         // added to those kinds of elements, it is likely it was meant for a child element.
</span><del>-        AccessibilityObject* axObj = axObjectCache()-&gt;getOrCreate(curr);
</del><ins>+        AccessibilityObject* axObj = axObjectCache()-&gt;getOrCreate(ancestor);
</ins><span class="cx">         if (axObj) {
</span><span class="cx">             AccessibilityRole role = axObj-&gt;roleValue();
</span><span class="cx">             if (role != GroupRole &amp;&amp; role != UnknownRole)
</span><span class="lines">@@ -1560,10 +1561,10 @@
</span><span class="cx"> unsigned AccessibilityNodeObject::hierarchicalLevel() const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return 0;
</span><del>-    Element* element = toElement(node);
-    const AtomicString&amp; ariaLevel = element-&gt;fastGetAttribute(aria_levelAttr);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
+    const AtomicString&amp; ariaLevel = element.fastGetAttribute(aria_levelAttr);
</ins><span class="cx">     if (!ariaLevel.isEmpty())
</span><span class="cx">         return ariaLevel.toInt();
</span><span class="cx">     
</span><span class="lines">@@ -1705,7 +1706,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) {
</span><del>-        HTMLLabelElement* label = labelForElement(toElement(node));
</del><ins>+        HTMLLabelElement* label = labelForElement(downcast&lt;Element&gt;(node));
</ins><span class="cx">         // Use the label text as the title if 1) the title element is NOT an exposed element and 2) there's no ARIA override.
</span><span class="cx">         if (label &amp;&amp; !exposesTitleUIElement() &amp;&amp; !ariaAccessibilityDescription().length())
</span><span class="cx">             return label-&gt;innerText();
</span><span class="lines">@@ -1771,7 +1772,7 @@
</span><span class="cx">     if (!node-&gt;isElementNode())
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    return toElement(node)-&gt;innerText();
</del><ins>+    return downcast&lt;Element&gt;(node)-&gt;innerText();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String AccessibilityNodeObject::stringValue() const
</span><span class="lines">@@ -1843,15 +1844,15 @@
</span><span class="cx"> static String accessibleNameForNode(Node* node)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(node);
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return String();
</span><span class="cx">     
</span><del>-    Element* element = toElement(node);
-    const AtomicString&amp; ariaLabel = element-&gt;fastGetAttribute(aria_labelAttr);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
+    const AtomicString&amp; ariaLabel = element.fastGetAttribute(aria_labelAttr);
</ins><span class="cx">     if (!ariaLabel.isEmpty())
</span><span class="cx">         return ariaLabel;
</span><span class="cx">     
</span><del>-    const AtomicString&amp; alt = element-&gt;fastGetAttribute(altAttr);
</del><ins>+    const AtomicString&amp; alt = element.fastGetAttribute(altAttr);
</ins><span class="cx">     if (!alt.isEmpty())
</span><span class="cx">         return alt;
</span><span class="cx"> 
</span><span class="lines">@@ -1872,12 +1873,12 @@
</span><span class="cx">         if (axObject-&gt;accessibleNameDerivesFromContent())
</span><span class="cx">             text = axObject-&gt;textUnderElement(AccessibilityTextUnderElementMode(AccessibilityTextUnderElementMode::TextUnderElementModeIncludeNameFromContentsChildren, true));
</span><span class="cx">     } else
</span><del>-        text = element-&gt;innerText();
</del><ins>+        text = element.innerText();
</ins><span class="cx"> 
</span><span class="cx">     if (!text.isEmpty())
</span><span class="cx">         return text;
</span><span class="cx">     
</span><del>-    const AtomicString&amp; title = element-&gt;fastGetAttribute(titleAttr);
</del><ins>+    const AtomicString&amp; title = element.fastGetAttribute(titleAttr);
</ins><span class="cx">     if (!title.isEmpty())
</span><span class="cx">         return title;
</span><span class="cx">     
</span><span class="lines">@@ -1943,15 +1944,15 @@
</span><span class="cx">     if (!node)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    Element* element = toElement(node);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx"> 
</span><del>-    if (element-&gt;isDisabledFormControl())
</del><ins>+    if (element.isDisabledFormControl())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return element-&gt;supportsFocus();
</del><ins>+    return element.supportsFocus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessibilityRole AccessibilityNodeObject::determineAriaRoleAttribute() const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -851,8 +851,8 @@
</span><span class="cx">         document-&gt;renderView()-&gt;hitTest(request, hitTestResult);
</span><span class="cx">         if (hitTestResult.innerNode()) {
</span><span class="cx">             Node* innerNode = hitTestResult.innerNode()-&gt;deprecatedShadowAncestorNode();
</span><del>-            if (innerNode-&gt;isElementNode())
-                hitTestElement = toElement(innerNode);
</del><ins>+            if (is&lt;Element&gt;(innerNode))
+                hitTestElement = downcast&lt;Element&gt;(innerNode);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -1759,20 +1759,19 @@
</span><span class="cx"> bool AccessibilityObject::hasTagName(const QualifiedName&amp; tagName) const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    return node &amp;&amp; node-&gt;isElementNode() &amp;&amp; toElement(*node).hasTagName(tagName);
</del><ins>+    return node &amp;&amp; is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(*node).hasTagName(tagName);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool AccessibilityObject::hasAttribute(const QualifiedName&amp; attribute) const
</span><span class="cx"> {
</span><del>-    Node* elementNode = node();
-    if (!elementNode)
</del><ins>+    Node* node = this-&gt;node();
+    if (!node)
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    if (!elementNode-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    Element* element = toElement(elementNode);
-    return element-&gt;fastHasAttribute(attribute);
</del><ins>+    return downcast&lt;Element&gt;(*node).fastHasAttribute(attribute);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> const AtomicString&amp; AccessibilityObject::getAttribute(const QualifiedName&amp; attribute) const
</span><span class="lines">@@ -1967,8 +1966,8 @@
</span><span class="cx"> Element* AccessibilityObject::element() const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (node &amp;&amp; node-&gt;isElementNode())
-        return toElement(node);
</del><ins>+    if (node &amp;&amp; is&lt;Element&gt;(node))
+        return downcast&lt;Element&gt;(node);
</ins><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2115,10 +2114,10 @@
</span><span class="cx"> void AccessibilityObject::classList(Vector&lt;String&gt;&amp; classList) const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    Element* element = toElement(node);
</del><ins>+    Element* element = downcast&lt;Element&gt;(node);
</ins><span class="cx">     DOMTokenList&amp; list = element-&gt;classList();
</span><span class="cx">     unsigned length = list.length();
</span><span class="cx">     for (unsigned k = 0; k &lt; length; k++)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -586,7 +586,7 @@
</span><span class="cx">     Node* node = currRenderer-&gt;node();
</span><span class="cx">     for ( ; node; node = node-&gt;parentNode()) {
</span><span class="cx">         if (is&lt;HTMLAnchorElement&gt;(node) || (node-&gt;renderer() &amp;&amp; cache-&gt;getOrCreate(node-&gt;renderer())-&gt;isAnchor()))
</span><del>-            return toElement(node);
</del><ins>+            return downcast&lt;Element&gt;(node);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -606,21 +606,22 @@
</span><span class="cx">         return describedBy;
</span><span class="cx">     
</span><span class="cx">     String description = accessibilityDescription();
</span><del>-    for (RenderObject* curr = m_renderer; curr; curr = curr-&gt;parent()) {
-        if (curr-&gt;node() &amp;&amp; curr-&gt;node()-&gt;isHTMLElement()) {
-            const AtomicString&amp; summary = toElement(curr-&gt;node())-&gt;getAttribute(summaryAttr);
</del><ins>+    for (RenderObject* ancestor = m_renderer; ancestor; ancestor = ancestor-&gt;parent()) {
+        if (ancestor-&gt;node() &amp;&amp; is&lt;HTMLElement&gt;(ancestor-&gt;node())) {
+            HTMLElement&amp; element = downcast&lt;HTMLElement&gt;(*ancestor-&gt;node());
+            const AtomicString&amp; summary = element.getAttribute(summaryAttr);
</ins><span class="cx">             if (!summary.isEmpty())
</span><span class="cx">                 return summary;
</span><span class="cx">             
</span><span class="cx">             // The title attribute should be used as help text unless it is already being used as descriptive text.
</span><del>-            const AtomicString&amp; title = toElement(curr-&gt;node())-&gt;getAttribute(titleAttr);
</del><ins>+            const AtomicString&amp; title = element.getAttribute(titleAttr);
</ins><span class="cx">             if (!title.isEmpty() &amp;&amp; description != title)
</span><span class="cx">                 return title;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // Only take help text from an ancestor element if its a group or an unknown role. If help was 
</span><span class="cx">         // added to those kinds of elements, it is likely it was meant for a child element.
</span><del>-        AccessibilityObject* axObj = axObjectCache()-&gt;getOrCreate(curr);
</del><ins>+        AccessibilityObject* axObj = axObjectCache()-&gt;getOrCreate(ancestor);
</ins><span class="cx">         if (axObj) {
</span><span class="cx">             AccessibilityRole role = axObj-&gt;roleValue();
</span><span class="cx">             if (role != GroupRole &amp;&amp; role != UnknownRole)
</span><span class="lines">@@ -845,7 +846,7 @@
</span><span class="cx">     if (!m_renderer)
</span><span class="cx">         return LayoutRect();
</span><span class="cx">     
</span><del>-    HTMLLabelElement* label = labelForElement(toElement(m_renderer-&gt;node()));
</del><ins>+    HTMLLabelElement* label = labelForElement(downcast&lt;Element&gt;(m_renderer-&gt;node()));
</ins><span class="cx">     if (!label || !label-&gt;renderer())
</span><span class="cx">         return boundingBoxRect();
</span><span class="cx">     
</span><span class="lines">@@ -1105,9 +1106,9 @@
</span><span class="cx">         return axObjectCache()-&gt;getOrCreate(toRenderFieldset(m_renderer)-&gt;findLegend(RenderFieldset::IncludeFloatingOrOutOfFlow));
</span><span class="cx">     
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return nullptr;
</span><del>-    HTMLLabelElement* label = labelForElement(toElement(node));
</del><ins>+    HTMLLabelElement* label = labelForElement(downcast&lt;Element&gt;(node));
</ins><span class="cx">     if (label &amp;&amp; label-&gt;renderer())
</span><span class="cx">         return axObjectCache()-&gt;getOrCreate(label);
</span><span class="cx"> 
</span><span class="lines">@@ -1466,9 +1467,9 @@
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><span class="cx">     if (!node)
</span><span class="cx">         return nullAtom;
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return nullAtom;
</span><del>-    return toElement(node)-&gt;getAttribute(accesskeyAttr);
</del><ins>+    return downcast&lt;Element&gt;(*node).getAttribute(accesskeyAttr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VisibleSelection AccessibilityRenderObject::selection() const
</span><span class="lines">@@ -1542,11 +1543,10 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    Element* element = toElement(node);
-    element-&gt;setAttribute(attributeName, (value) ? &quot;true&quot; : &quot;false&quot;);        
</del><ins>+    downcast&lt;Element&gt;(*node).setAttribute(attributeName, (value) ? &quot;true&quot; : &quot;false&quot;);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool AccessibilityRenderObject::elementAttributeValue(const QualifiedName&amp; attributeName) const
</span><span class="lines">@@ -1646,7 +1646,7 @@
</span><span class="cx">     Document* document = this-&gt;document();
</span><span class="cx">     Node* node = this-&gt;node();
</span><span class="cx"> 
</span><del>-    if (!on || !node || !node-&gt;isElementNode()) {
</del><ins>+    if (!on || !node || !is&lt;Element&gt;(node)) {
</ins><span class="cx">         document-&gt;setFocusedElement(nullptr);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1657,7 +1657,7 @@
</span><span class="cx">     if (document-&gt;focusedElement() == node)
</span><span class="cx">         document-&gt;setFocusedElement(nullptr);
</span><span class="cx"> 
</span><del>-    toElement(node)-&gt;focus();
</del><ins>+    downcast&lt;Element&gt;(*node).focus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityRenderObject::setSelectedRows(AccessibilityChildrenVector&amp; selectedRows)
</span><span class="lines">@@ -1678,9 +1678,9 @@
</span><span class="cx">     
</span><span class="cx"> void AccessibilityRenderObject::setValue(const String&amp; string)
</span><span class="cx"> {
</span><del>-    if (!m_renderer || !m_renderer-&gt;node() || !m_renderer-&gt;node()-&gt;isElementNode())
</del><ins>+    if (!m_renderer || !m_renderer-&gt;node() || !is&lt;Element&gt;(m_renderer-&gt;node()))
</ins><span class="cx">         return;
</span><del>-    Element&amp; element = toElement(*m_renderer-&gt;node());
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*m_renderer-&gt;node());
</ins><span class="cx"> 
</span><span class="cx">     if (!m_renderer-&gt;isBoxModelObject())
</span><span class="cx">         return;
</span><span class="lines">@@ -2343,7 +2343,7 @@
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityRenderObject::handleActiveDescendantChanged()
</span><span class="cx"> {
</span><del>-    Element* element = toElement(renderer()-&gt;node());
</del><ins>+    Element* element = downcast&lt;Element&gt;(renderer()-&gt;node());
</ins><span class="cx">     if (!element)
</span><span class="cx">         return;
</span><span class="cx">     if (!renderer()-&gt;frame().selection().isFocusedAndActive() || renderer()-&gt;document().focusedElement() != element)
</span><span class="lines">@@ -2381,9 +2381,8 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><del>-    if (node &amp;&amp; node-&gt;isHTMLElement()) {
-        HTMLLabelElement* label = labelForElement(toElement(node));
-        if (label)
</del><ins>+    if (node &amp;&amp; is&lt;HTMLElement&gt;(node)) {
+        if (HTMLLabelElement* label = labelForElement(downcast&lt;HTMLElement&gt;(node)))
</ins><span class="cx">             return axObjectCache()-&gt;getOrCreate(label);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2405,7 +2404,7 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     // Textboxes should send out notifications.
</span><del>-    if (nodeHasRole(node, &quot;textbox&quot;) || (node-&gt;isElementNode() &amp;&amp; contentEditableAttributeIsEnabled(toElement(node))))
</del><ins>+    if (nodeHasRole(node, &quot;textbox&quot;) || (is&lt;Element&gt;(node) &amp;&amp; contentEditableAttributeIsEnabled(downcast&lt;Element&gt;(node))))
</ins><span class="cx">         return true;
</span><span class="cx">     
</span><span class="cx">     return false;
</span><span class="lines">@@ -2695,13 +2694,13 @@
</span><span class="cx">         if (!parent-&gt;isAccessibilityRenderObject())
</span><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        Node* elementNode = toAccessibilityRenderObject(parent)-&gt;node();
-        if (!elementNode || !elementNode-&gt;isElementNode())
</del><ins>+        Node* node = toAccessibilityRenderObject(parent)-&gt;node();
+        if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><span class="cx">         // If native tag of the parent element matches an acceptable name, then return
</span><span class="cx">         // based on its presentational status.
</span><del>-        if (possibleParentTagNames-&gt;contains(toElement(elementNode)-&gt;tagQName()))
</del><ins>+        if (possibleParentTagNames-&gt;contains(downcast&lt;Element&gt;(node)-&gt;tagQName()))
</ins><span class="cx">             return parent-&gt;roleValue() == PresentationalRole;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -3244,15 +3243,15 @@
</span><span class="cx">     if (!m_renderer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Node* domNode = nullptr;
</del><ins>+    Node* node = nullptr;
</ins><span class="cx">     // For web areas, set the aria-label on the HTML element.
</span><span class="cx">     if (isWebArea())
</span><del>-        domNode = m_renderer-&gt;document().documentElement();
</del><ins>+        node = m_renderer-&gt;document().documentElement();
</ins><span class="cx">     else
</span><del>-        domNode = m_renderer-&gt;node();
</del><ins>+        node = m_renderer-&gt;node();
</ins><span class="cx"> 
</span><del>-    if (domNode &amp;&amp; domNode-&gt;isElementNode())
-        toElement(domNode)-&gt;setAttribute(aria_labelAttr, name);
</del><ins>+    if (node &amp;&amp; is&lt;Element&gt;(node))
+        downcast&lt;Element&gt;(*node).setAttribute(aria_labelAttr, name);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> static bool isLinkable(const AccessibilityRenderObject&amp; object)
</span><span class="lines">@@ -3372,14 +3371,14 @@
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    Element* element = toElement(node);
-    if (!shouldReturnTagNameAsRoleForMSAA(*element))
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
+    if (!shouldReturnTagNameAsRoleForMSAA(element))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    return element-&gt;tagName();
</del><ins>+    return element.tagName();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String AccessibilityRenderObject::positionalDescriptionForMSAA() const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySearchFieldButtonscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -58,13 +58,13 @@
</span><span class="cx"> bool AccessibilitySearchFieldCancelButton::press()
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (!node || !node-&gt;isElementNode())
</del><ins>+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    Element* element = toElement(node);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">     // The default event handler on SearchFieldCancelButtonElement requires hover.
</span><del>-    element-&gt;setHovered(true);
-    element-&gt;accessKeyAction(true);
</del><ins>+    element.setHovered(true);
+    element.accessKeyAction(true);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleWrapperAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -506,8 +506,8 @@
</span><span class="cx">     // cannot be done from the UIProcess. Assistive technologies have no need
</span><span class="cx">     // for this information.
</span><span class="cx">     Node* node = coreObject-&gt;node();
</span><del>-    if (node &amp;&amp; node-&gt;isElementNode()) {
-        String id = toElement(node)-&gt;getIdAttribute().string();
</del><ins>+    if (node &amp;&amp; is&lt;Element&gt;(node)) {
+        String id = downcast&lt;Element&gt;(*node).getIdAttribute().string();
</ins><span class="cx">         if (!id.isEmpty())
</span><span class="cx">             attributeSet = addToAtkAttributeSet(attributeSet, &quot;html-id&quot;, id.utf8().data());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgobjectWebKitDOMPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     case Node::ELEMENT_NODE:
</span><span class="cx">         if (is&lt;HTMLElement&gt;(node))
</span><span class="cx">             return WEBKIT_DOM_NODE(wrap(downcast&lt;HTMLElement&gt;(node)));
</span><del>-        return WEBKIT_DOM_NODE(wrapElement(toElement(node)));
</del><ins>+        return WEBKIT_DOM_NODE(wrapElement(downcast&lt;Element&gt;(node)));
</ins><span class="cx">     case Node::ATTRIBUTE_NODE:
</span><span class="cx">         return WEBKIT_DOM_NODE(wrapAttr(static_cast&lt;Attr*&gt;(node)));
</span><span class="cx">     case Node::TEXT_NODE:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -97,8 +97,8 @@
</span><span class="cx"> static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     if (!node-&gt;inDocument()) {
</span><del>-        if (node-&gt;isElementNode()) {
-            auto&amp; element = toElement(*node);
</del><ins>+        if (is&lt;Element&gt;(node)) {
+            auto&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx"> 
</span><span class="cx">             // If a wrapper is the last reference to an image element
</span><span class="cx">             // that is loading but not in the document, the wrapper is observable
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1629,15 +1629,15 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_node)
</span><span class="cx">         return nullptr;
</span><del>-    if (!m_node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(*m_node))
</ins><span class="cx">         return m_node.get();
</span><del>-    Element* element = toElement(m_node.get());
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*m_node);
</ins><span class="cx">     PseudoElement* pseudoElement;
</span><del>-    if (m_pseudoElementSpecifier == BEFORE &amp;&amp; (pseudoElement = element-&gt;beforePseudoElement()))
</del><ins>+    if (m_pseudoElementSpecifier == BEFORE &amp;&amp; (pseudoElement = element.beforePseudoElement()))
</ins><span class="cx">         return pseudoElement;
</span><del>-    if (m_pseudoElementSpecifier == AFTER &amp;&amp; (pseudoElement = element-&gt;afterPseudoElement()))
</del><ins>+    if (m_pseudoElementSpecifier == AFTER &amp;&amp; (pseudoElement = element.afterPseudoElement()))
</ins><span class="cx">         return pseudoElement;
</span><del>-    return element;
</del><ins>+    return &amp;element;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;CSSValue&gt; CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -467,7 +467,7 @@
</span><span class="cx">         while (currentNode) {
</span><span class="cx">             ++subcount;
</span><span class="cx">             if (currentNode-&gt;renderStyle() == parentStyle &amp;&amp; currentNode-&gt;lastChild()
</span><del>-                &amp;&amp; currentNode-&gt;isElementNode() &amp;&amp; !parentElementPreventsSharing(toElement(currentNode))
</del><ins>+                &amp;&amp; is&lt;Element&gt;(currentNode) &amp;&amp; !parentElementPreventsSharing(downcast&lt;Element&gt;(currentNode))
</ins><span class="cx">                 ) {
</span><span class="cx">                 // Adjust for unused reserved tries.
</span><span class="cx">                 visitedNodeCount -= cStyleSearchThreshold - subcount;
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -100,8 +100,8 @@
</span><span class="cx">     // FIXME: Get rid of the named flow test.
</span><span class="cx">     if (!child.renderer() &amp;&amp; !child.isNamedFlowContentNode())
</span><span class="cx">         return;
</span><del>-    if (child.isElementNode())
-        Style::detachRenderTree(toElement(child));
</del><ins>+    if (is&lt;Element&gt;(child))
+        Style::detachRenderTree(downcast&lt;Element&gt;(child));
</ins><span class="cx">     else if (is&lt;Text&gt;(child))
</span><span class="cx">         Style::detachTextRenderer(downcast&lt;Text&gt;(child));
</span><span class="cx"> }
</span><span class="lines">@@ -347,9 +347,9 @@
</span><span class="cx"> void ContainerNode::notifyChildRemoved(Node&amp; child, Node* previousSibling, Node* nextSibling, ChildChangeSource source)
</span><span class="cx"> {
</span><span class="cx">     ChildChange change;
</span><del>-    change.type = child.isElementNode() ? ElementRemoved : child.isTextNode() ? TextRemoved : NonContentsChildChanged;
-    change.previousSiblingElement = (!previousSibling || previousSibling-&gt;isElementNode()) ? toElement(previousSibling) : ElementTraversal::previousSibling(previousSibling);
-    change.nextSiblingElement = (!nextSibling || nextSibling-&gt;isElementNode()) ? toElement(nextSibling) : ElementTraversal::nextSibling(nextSibling);
</del><ins>+    change.type = is&lt;Element&gt;(child) ? ElementRemoved : is&lt;Text&gt;(child) ? TextRemoved : NonContentsChildChanged;
+    change.previousSiblingElement = (!previousSibling || is&lt;Element&gt;(previousSibling)) ? downcast&lt;Element&gt;(previousSibling) : ElementTraversal::previousSibling(previousSibling);
+    change.nextSiblingElement = (!nextSibling || is&lt;Element&gt;(nextSibling)) ? downcast&lt;Element&gt;(nextSibling) : ElementTraversal::nextSibling(nextSibling);
</ins><span class="cx">     change.source = source;
</span><span class="cx"> 
</span><span class="cx">     childrenChanged(change);
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeAlgorithmscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -40,10 +40,10 @@
</span><span class="cx">             notifyNodeInsertedIntoDocument(*child);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!node.isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (RefPtr&lt;ShadowRoot&gt; root = toElement(node).shadowRoot()) {
</del><ins>+    if (RefPtr&lt;ShadowRoot&gt; root = downcast&lt;Element&gt;(node).shadowRoot()) {
</ins><span class="cx">         if (node.inDocument() &amp;&amp; root-&gt;hostElement() == &amp;node)
</span><span class="cx">             notifyNodeInsertedIntoDocument(*root);
</span><span class="cx">     }
</span><span class="lines">@@ -71,13 +71,13 @@
</span><span class="cx">             notifyNodeRemovedFromDocument(*child.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!node.isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (node.document().cssTarget() == &amp;node)
</span><span class="cx">         node.document().setCSSTarget(0);
</span><span class="cx"> 
</span><del>-    if (RefPtr&lt;ShadowRoot&gt; root = toElement(node).shadowRoot()) {
</del><ins>+    if (RefPtr&lt;ShadowRoot&gt; root = downcast&lt;Element&gt;(node).shadowRoot()) {
</ins><span class="cx">         if (!node.inDocument() &amp;&amp; root-&gt;hostElement() == &amp;node)
</span><span class="cx">             notifyNodeRemovedFromDocument(*root.get());
</span><span class="cx">     }
</span><span class="lines">@@ -90,10 +90,10 @@
</span><span class="cx">             notifyNodeRemovedFromTree(*toContainerNode(child));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!node.isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (RefPtr&lt;ShadowRoot&gt; root = toElement(node).shadowRoot())
</del><ins>+    if (RefPtr&lt;ShadowRoot&gt; root = downcast&lt;Element&gt;(node).shadowRoot())
</ins><span class="cx">         notifyNodeRemovedFromTree(*root.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -102,11 +102,11 @@
</span><span class="cx"> {
</span><span class="cx">     unsigned count = 0;
</span><span class="cx"> 
</span><del>-    if (node.isElementNode()) {
</del><ins>+    if (is&lt;Element&gt;(node)) {
</ins><span class="cx">         if (is&lt;HTMLFrameOwnerElement&gt;(node) &amp;&amp; downcast&lt;HTMLFrameOwnerElement&gt;(node).contentFrame())
</span><span class="cx">             ++count;
</span><span class="cx"> 
</span><del>-        if (ShadowRoot* root = toElement(node).shadowRoot())
</del><ins>+        if (ShadowRoot* root = downcast&lt;Element&gt;(node).shadowRoot())
</ins><span class="cx">             count += assertConnectedSubrameCountIsConsistent(*root);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -941,7 +941,7 @@
</span><span class="cx">     case COMMENT_NODE:
</span><span class="cx">         return createComment(importedNode-&gt;nodeValue());
</span><span class="cx">     case ELEMENT_NODE: {
</span><del>-        Element&amp; oldElement = toElement(*importedNode);
</del><ins>+        Element&amp; oldElement = downcast&lt;Element&gt;(*importedNode);
</ins><span class="cx">         // FIXME: The following check might be unnecessary. Is it possible that
</span><span class="cx">         // oldElement has mismatched prefix/namespace?
</span><span class="cx">         if (!hasValidNamespaceForElements(oldElement.tagQName())) {
</span><span class="lines">@@ -1414,13 +1414,13 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     Node* node = nodeFromPoint(clientPoint);
</span><del>-    while (node &amp;&amp; !node-&gt;isElementNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Element&gt;(node))
</ins><span class="cx">         node = node-&gt;parentNode();
</span><span class="cx"> 
</span><span class="cx">     if (node)
</span><span class="cx">         node = ancestorInThisScope(node);
</span><span class="cx"> 
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Range&gt; Document::caretRangeFromPoint(int x, int y)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentStyleSheetCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">             }
</span><span class="cx"> #endif
</span><span class="cx">         } else if (is&lt;HTMLLinkElement&gt;(*node) || is&lt;HTMLStyleElement&gt;(*node) || is&lt;SVGStyleElement&gt;(*node)) {
</span><del>-            Element&amp; element = toElement(*node);
</del><ins>+            Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">             AtomicString title = element.fastGetAttribute(titleAttr);
</span><span class="cx">             bool enabledViaScript = false;
</span><span class="cx">             if (is&lt;HTMLLinkElement&gt;(element)) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -2195,8 +2195,8 @@
</span><span class="cx">     // The language property is inherited, so we iterate over the parents to find the first language.
</span><span class="cx">     const Node* currentNode = this;
</span><span class="cx">     while ((currentNode = currentNode-&gt;parentNode())) {
</span><del>-        if (currentNode-&gt;isElementNode()) {
-            if (const ElementData* elementData = toElement(*currentNode).elementData()) {
</del><ins>+        if (is&lt;Element&gt;(currentNode)) {
+            if (const ElementData* elementData = downcast&lt;Element&gt;(*currentNode).elementData()) {
</ins><span class="cx">                 if (const Attribute* attribute = elementData-&gt;findLanguageAttribute())
</span><span class="cx">                     return attribute-&gt;value();
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/Element.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -666,29 +666,24 @@
</span><span class="cx">     RefPtr&lt;ElementData&gt; m_elementData;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline bool isElement(const Node&amp; node) { return node.isElementNode(); }
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(Element)
+    static bool isElement(const Node&amp; node) { return node.isElementNode(); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx"> 
</span><del>-NODE_TYPE_CASTS(Element)
-
-template &lt;&gt;
-struct NodeTypeCastTraits&lt;const Element, const Node&gt; {
-    static bool isType(const Node&amp; node) { return node.isElementNode(); }
-};
-
</del><span class="cx"> inline bool Node::hasAttributes() const
</span><span class="cx"> {
</span><del>-    return isElementNode() &amp;&amp; toElement(this)-&gt;hasAttributes();
</del><ins>+    return is&lt;Element&gt;(*this) &amp;&amp; downcast&lt;Element&gt;(*this).hasAttributes();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline NamedNodeMap* Node::attributes() const
</span><span class="cx"> {
</span><del>-    return isElementNode() ? &amp;toElement(this)-&gt;attributes() : nullptr;
</del><ins>+    return is&lt;Element&gt;(*this) ? &amp;downcast&lt;Element&gt;(*this).attributes() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Element* Node::parentElement() const
</span><span class="cx"> {
</span><span class="cx">     ContainerNode* parent = parentNode();
</span><del>-    return parent &amp;&amp; parent-&gt;isElementNode() ? toElement(parent) : nullptr;
</del><ins>+    return parent &amp;&amp; is&lt;Element&gt;(parent) ? downcast&lt;Element&gt;(parent) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline bool Element::fastHasAttribute(const QualifiedName&amp; name) const
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementTraversalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ElementTraversal.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ElementTraversal.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/ElementTraversal.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -95,9 +95,9 @@
</span><span class="cx"> inline Element* Traversal&lt;Element&gt;::nextTemplate(CurrentType* current)
</span><span class="cx"> {
</span><span class="cx">     Node* node = NodeTraversal::next(current);
</span><del>-    while (node &amp;&amp; !node-&gt;isElementNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Element&gt;(node))
</ins><span class="cx">         node = NodeTraversal::nextSkippingChildren(node);
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;&gt;
</span><span class="lines">@@ -105,9 +105,9 @@
</span><span class="cx"> inline Element* Traversal&lt;Element&gt;::nextTemplate(CurrentType* current, const Node* stayWithin)
</span><span class="cx"> {
</span><span class="cx">     Node* node = NodeTraversal::next(current, stayWithin);
</span><del>-    while (node &amp;&amp; !node-&gt;isElementNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Element&gt;(node))
</ins><span class="cx">         node = NodeTraversal::nextSkippingChildren(node, stayWithin);
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Generic versions.
</span><span class="lines">@@ -258,33 +258,33 @@
</span><span class="cx"> inline Element* ElementTraversal::previousIncludingPseudo(const Node* current, const Node* stayWithin)
</span><span class="cx"> {
</span><span class="cx">     Node* node = NodeTraversal::previousIncludingPseudo(current, stayWithin);
</span><del>-    while (node &amp;&amp; !node-&gt;isElementNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Element&gt;(node))
</ins><span class="cx">         node = NodeTraversal::previousIncludingPseudo(node, stayWithin);
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Element* ElementTraversal::nextIncludingPseudo(const Node* current, const Node* stayWithin)
</span><span class="cx"> {
</span><span class="cx">     Node* node = NodeTraversal::nextIncludingPseudo(current, stayWithin);
</span><del>-    while (node &amp;&amp; !node-&gt;isElementNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Element&gt;(node))
</ins><span class="cx">         node = NodeTraversal::nextIncludingPseudo(node, stayWithin);
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Element* ElementTraversal::nextIncludingPseudoSkippingChildren(const Node* current, const Node* stayWithin)
</span><span class="cx"> {
</span><span class="cx">     Node* node = NodeTraversal::nextIncludingPseudoSkippingChildren(current, stayWithin);
</span><del>-    while (node &amp;&amp; !node-&gt;isElementNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Element&gt;(node))
</ins><span class="cx">         node = NodeTraversal::nextIncludingPseudoSkippingChildren(node, stayWithin);
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Element* ElementTraversal::pseudoAwarePreviousSibling(const Node* current)
</span><span class="cx"> {
</span><span class="cx">     Node* node = current-&gt;pseudoAwarePreviousSibling();
</span><del>-    while (node &amp;&amp; !node-&gt;isElementNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Element&gt;(node))
</ins><span class="cx">         node = node-&gt;pseudoAwarePreviousSibling();
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomLiveNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/LiveNodeList.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/LiveNodeList.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/LiveNodeList.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -68,11 +68,11 @@
</span><span class="cx">     unsigned length = this-&gt;length();
</span><span class="cx">     for (unsigned i = 0; i &lt; length; i++) {
</span><span class="cx">         Node* node = item(i);
</span><del>-        if (!node-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><del>-        Element* element = toElement(node);
</del><ins>+        Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">         // FIXME: This should probably be using getIdAttribute instead of idForStyleResolution.
</span><del>-        if (element-&gt;hasID() &amp;&amp; element-&gt;idForStyleResolution() == elementId)
</del><ins>+        if (element.hasID() &amp;&amp; element.idForStyleResolution() == elementId)
</ins><span class="cx">             return node;
</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 (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -137,9 +137,9 @@
</span><span class="cx"> 
</span><span class="cx">         if (node-&gt;hasRareData()) {
</span><span class="cx">             ++nodesWithRareData;
</span><del>-            if (node-&gt;isElementNode()) {
</del><ins>+            if (is&lt;Element&gt;(node)) {
</ins><span class="cx">                 ++elementsWithRareData;
</span><del>-                if (toElement(node)-&gt;hasNamedNodeMap())
</del><ins>+                if (downcast&lt;Element&gt;(*node).hasNamedNodeMap())
</ins><span class="cx">                     ++elementsWithNamedNodeMap;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -149,12 +149,12 @@
</span><span class="cx">                 ++elementNodes;
</span><span class="cx"> 
</span><span class="cx">                 // Tag stats
</span><del>-                Element* element = toElement(node);
-                HashMap&lt;String, size_t&gt;::AddResult result = perTagCount.add(element-&gt;tagName(), 1);
</del><ins>+                Element&amp; element = downcast&lt;Element&gt;(*node);
+                HashMap&lt;String, size_t&gt;::AddResult result = perTagCount.add(element.tagName(), 1);
</ins><span class="cx">                 if (!result.isNewEntry)
</span><span class="cx">                     result.iterator-&gt;value++;
</span><span class="cx"> 
</span><del>-                if (ElementData* elementData = element-&gt;elementData()) {
</del><ins>+                if (ElementData* elementData = element.elementData()) {
</ins><span class="cx">                     unsigned length = elementData-&gt;length();
</span><span class="cx">                     attributes += length;
</span><span class="cx">                     ++elementsWithAttributeStorage;
</span><span class="lines">@@ -479,7 +479,7 @@
</span><span class="cx">     while (node) {
</span><span class="cx">         NodeType type = node-&gt;nodeType();
</span><span class="cx">         if (type == ELEMENT_NODE)
</span><del>-            toElement(node.get())-&gt;normalizeAttributes();
</del><ins>+            downcast&lt;Element&gt;(*node).normalizeAttributes();
</ins><span class="cx"> 
</span><span class="cx">         if (node == this)
</span><span class="cx">             break;
</span><span class="lines">@@ -896,14 +896,14 @@
</span><span class="cx"> 
</span><span class="cx"> Node* Node::pseudoAwareFirstChild() const
</span><span class="cx"> {
</span><del>-    if (isElementNode()) {
-        const Element* currentElement = toElement(this);
-        Node* first = currentElement-&gt;beforePseudoElement();
</del><ins>+    if (is&lt;Element&gt;(*this)) {
+        const Element&amp; currentElement = downcast&lt;Element&gt;(*this);
+        Node* first = currentElement.beforePseudoElement();
</ins><span class="cx">         if (first)
</span><span class="cx">             return first;
</span><del>-        first = currentElement-&gt;firstChild();
</del><ins>+        first = currentElement.firstChild();
</ins><span class="cx">         if (!first)
</span><del>-            first = currentElement-&gt;afterPseudoElement();
</del><ins>+            first = currentElement.afterPseudoElement();
</ins><span class="cx">         return first;
</span><span class="cx">     }
</span><span class="cx">     return firstChild();
</span><span class="lines">@@ -911,14 +911,14 @@
</span><span class="cx"> 
</span><span class="cx"> Node* Node::pseudoAwareLastChild() const
</span><span class="cx"> {
</span><del>-    if (isElementNode()) {
-        const Element* currentElement = toElement(this);
-        Node* last = currentElement-&gt;afterPseudoElement();
</del><ins>+    if (is&lt;Element&gt;(*this)) {
+        const Element&amp; currentElement = downcast&lt;Element&gt;(*this);
+        Node* last = currentElement.afterPseudoElement();
</ins><span class="cx">         if (last)
</span><span class="cx">             return last;
</span><del>-        last = currentElement-&gt;lastChild();
</del><ins>+        last = currentElement.lastChild();
</ins><span class="cx">         if (!last)
</span><del>-            last = currentElement-&gt;beforePseudoElement();
</del><ins>+            last = currentElement.beforePseudoElement();
</ins><span class="cx">         return last;
</span><span class="cx">     }
</span><span class="cx">     return lastChild();
</span><span class="lines">@@ -927,8 +927,8 @@
</span><span class="cx"> RenderStyle* Node::computedStyle(PseudoId pseudoElementSpecifier)
</span><span class="cx"> {
</span><span class="cx">     for (Node* node = this; node; node = node-&gt;parentOrShadowHostNode()) {
</span><del>-        if (node-&gt;isElementNode())
-            return toElement(node)-&gt;computedStyle(pseudoElementSpecifier);
</del><ins>+        if (is&lt;Element&gt;(node))
+            return downcast&lt;Element&gt;(*node).computedStyle(pseudoElementSpecifier);
</ins><span class="cx">     }
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -1007,10 +1007,10 @@
</span><span class="cx">     if (is&lt;ShadowRoot&gt;(parent))
</span><span class="cx">         return downcast&lt;ShadowRoot&gt;(parent)-&gt;hostElement();
</span><span class="cx"> 
</span><del>-    if (!parent-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(parent))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return toElement(parent);
</del><ins>+    return downcast&lt;Element&gt;(parent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Node* Node::insertionParentForBinding() const
</span><span class="lines">@@ -1055,11 +1055,11 @@
</span><span class="cx"> 
</span><span class="cx"> Element* Node::rootEditableElement() const
</span><span class="cx"> {
</span><del>-    Element* result = 0;
-    for (Node* n = const_cast&lt;Node*&gt;(this); n &amp;&amp; n-&gt;hasEditableStyle(); n = n-&gt;parentNode()) {
-        if (n-&gt;isElementNode())
-            result = toElement(n);
-        if (n-&gt;hasTagName(bodyTag))
</del><ins>+    Element* result = nullptr;
+    for (Node* node = const_cast&lt;Node*&gt;(this); node &amp;&amp; node-&gt;hasEditableStyle(); node = node-&gt;parentNode()) {
+        if (is&lt;Element&gt;(node))
+            result = downcast&lt;Element&gt;(node);
+        if (is&lt;HTMLBodyElement&gt;(node))
</ins><span class="cx">             break;
</span><span class="cx">     }
</span><span class="cx">     return result;
</span><span class="lines">@@ -1102,7 +1102,7 @@
</span><span class="cx">     if (nodeValue() != other-&gt;nodeValue())
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    if (isElementNode() &amp;&amp; !toElement(this)-&gt;hasEquivalentAttributes(toElement(other)))
</del><ins>+    if (is&lt;Element&gt;(*this) &amp;&amp; !downcast&lt;Element&gt;(*this).hasEquivalentAttributes(downcast&lt;Element&gt;(other)))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     Node* child = firstChild();
</span><span class="lines">@@ -1144,13 +1144,13 @@
</span><span class="cx"> 
</span><span class="cx">     switch (nodeType()) {
</span><span class="cx">         case ELEMENT_NODE: {
</span><del>-            const Element* elem = toElement(this);
</del><ins>+            const Element&amp; element = downcast&lt;Element&gt;(*this);
</ins><span class="cx">             
</span><del>-            if (elem-&gt;prefix().isNull())
-                return elem-&gt;namespaceURI() == namespaceURI;
</del><ins>+            if (element.prefix().isNull())
+                return element.namespaceURI() == namespaceURI;
</ins><span class="cx"> 
</span><del>-            if (elem-&gt;hasAttributes()) {
-                for (const Attribute&amp; attribute : elem-&gt;attributesIterator()) {
</del><ins>+            if (element.hasAttributes()) {
+                for (const Attribute&amp; attribute : element.attributesIterator()) {
</ins><span class="cx">                     if (attribute.localName() == xmlnsAtom)
</span><span class="cx">                         return attribute.value() == namespaceURI;
</span><span class="cx">                 }
</span><span class="lines">@@ -1284,10 +1284,10 @@
</span><span class="cx">     if (originalElement-&gt;lookupNamespaceURI(prefix()) == _namespaceURI)
</span><span class="cx">         return prefix();
</span><span class="cx">     
</span><del>-    ASSERT(isElementNode());
-    const Element* thisElement = toElement(this);
-    if (thisElement-&gt;hasAttributes()) {
-        for (const Attribute&amp; attribute : thisElement-&gt;attributesIterator()) {
</del><ins>+    ASSERT(is&lt;Element&gt;(*this));
+    const Element&amp; thisElement = downcast&lt;Element&gt;(*this);
+    if (thisElement.hasAttributes()) {
+        for (const Attribute&amp; attribute : thisElement.attributesIterator()) {
</ins><span class="cx">             if (attribute.prefix() == xmlnsAtom &amp;&amp; attribute.value() == _namespaceURI
</span><span class="cx">                 &amp;&amp; originalElement-&gt;lookupNamespaceURI(attribute.localName()) == _namespaceURI)
</span><span class="cx">                 return attribute.localName();
</span><span class="lines">@@ -1383,11 +1383,11 @@
</span><span class="cx"> Element* Node::ancestorElement() const
</span><span class="cx"> {
</span><span class="cx">     // In theory, there can be EntityReference nodes between elements, but this is currently not supported.
</span><del>-    for (ContainerNode* n = parentNode(); n; n = n-&gt;parentNode()) {
-        if (n-&gt;isElementNode())
-            return toElement(n);
</del><ins>+    for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor-&gt;parentNode()) {
+        if (is&lt;Element&gt;(ancestor))
+            return downcast&lt;Element&gt;(ancestor);
</ins><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Node::offsetInCharacters() const
</span><span class="lines">@@ -1529,10 +1529,10 @@
</span><span class="cx"> 
</span><span class="cx"> static void appendAttributeDesc(const Node* node, StringBuilder&amp; stringBuilder, const QualifiedName&amp; name, const char* attrDesc)
</span><span class="cx"> {
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    String attr = toElement(node)-&gt;getAttribute(name);
</del><ins>+    const AtomicString&amp; attr = downcast&lt;Element&gt;(*node).getAttribute(name);
</ins><span class="cx">     if (attr.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1584,8 +1584,8 @@
</span><span class="cx">         case ELEMENT_NODE: {
</span><span class="cx">             fprintf(stderr, &quot;/%s&quot;, node-&gt;nodeName().utf8().data());
</span><span class="cx"> 
</span><del>-            const Element* element = toElement(node);
-            const AtomicString&amp; idattr = element-&gt;getIdAttribute();
</del><ins>+            const Element&amp; element = downcast&lt;Element&gt;(*node);
+            const AtomicString&amp; idattr = element.getIdAttribute();
</ins><span class="cx">             bool hasIdAttr = !idattr.isNull() &amp;&amp; !idattr.isEmpty();
</span><span class="cx">             if (node-&gt;previousSibling() || node-&gt;nextSibling()) {
</span><span class="cx">                 int count = 0;
</span><span class="lines">@@ -1724,10 +1724,10 @@
</span><span class="cx">         // So we don't let images be the enclosing link element, even though isLink sometimes returns
</span><span class="cx">         // true for them.
</span><span class="cx">         if (node-&gt;isLink() &amp;&amp; !is&lt;HTMLImageElement&gt;(node))
</span><del>-            return toElement(node);
</del><ins>+            return downcast&lt;Element&gt;(node);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EventTargetInterface Node::eventTargetInterface() const
</span><span class="lines">@@ -2018,7 +2018,7 @@
</span><span class="cx">     if (!hasEventTargetData())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (isElementNode() &amp;&amp; toElement(*this).isDisabledFormControl() &amp;&amp; event.isMouseEvent())
</del><ins>+    if (is&lt;Element&gt;(*this) &amp;&amp; downcast&lt;Element&gt;(*this).isDisabledFormControl() &amp;&amp; event.isMouseEvent())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     fireEventListeners(&amp;event);
</span><span class="lines">@@ -2164,9 +2164,9 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Why is the iOS code path different from the non-iOS code path?
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-    if (!isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(*this))
</ins><span class="cx">         return false;
</span><del>-    if (toElement(this)-&gt;isDisabledFormControl())
</del><ins>+    if (downcast&lt;Element&gt;(*this).isDisabledFormControl())
</ins><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx">     return hasEventListeners(eventNames().mousemoveEvent) || hasEventListeners(eventNames().mouseoverEvent) || hasEventListeners(eventNames().mouseoutEvent);
</span><span class="lines">@@ -2178,9 +2178,9 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     return isContentEditable() || hasEventListeners(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent) || hasEventListeners(eventNames().clickEvent);
</span><span class="cx"> #else
</span><del>-    if (!isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(*this))
</ins><span class="cx">         return false;
</span><del>-    if (toElement(this)-&gt;isDisabledFormControl())
</del><ins>+    if (downcast&lt;Element&gt;(*this).isDisabledFormControl())
</ins><span class="cx">         return false;
</span><span class="cx">     return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListeners(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent) || hasEventListeners(eventNames().clickEvent) || hasEventListeners(eventNames().DOMActivateEvent);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeRenderingTraversalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     if (parent-&gt;isShadowRoot())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (parent-&gt;isElementNode() &amp;&amp; toElement(parent)-&gt;shadowRoot())
</del><ins>+    if (is&lt;Element&gt;(parent) &amp;&amp; downcast&lt;Element&gt;(*parent).shadowRoot())
</ins><span class="cx">         return true;
</span><span class="cx">     
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/Position.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -290,10 +290,10 @@
</span><span class="cx"> // FIXME: This method is confusing (does it return anchorNode() or containerNode()?) and should be renamed or removed
</span><span class="cx"> Element* Position::element() const
</span><span class="cx"> {
</span><del>-    Node* n = anchorNode();
-    while (n &amp;&amp; !n-&gt;isElementNode())
-        n = n-&gt;parentNode();
-    return toElement(n);
</del><ins>+    Node* node = anchorNode();
+    while (node &amp;&amp; !is&lt;Element&gt;(node))
+        node = node-&gt;parentNode();
+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Position Position::previous(PositionMoveType moveType) const
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/Range.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -2224,8 +2224,8 @@
</span><span class="cx">         selectedElementsSet.remove(parent);
</span><span class="cx"> 
</span><span class="cx">     for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
</span><del>-        if (node-&gt;isElementNode() &amp;&amp; selectedElementsSet.contains(node) &amp;&amp; !selectedElementsSet.contains(node-&gt;parentNode())) {
-            if (RenderBoxModelObject* renderBoxModelObject = toElement(node)-&gt;renderBoxModelObject()) {
</del><ins>+        if (is&lt;Element&gt;(node) &amp;&amp; selectedElementsSet.contains(node) &amp;&amp; !selectedElementsSet.contains(node-&gt;parentNode())) {
+            if (RenderBoxModelObject* renderBoxModelObject = downcast&lt;Element&gt;(*node).renderBoxModelObject()) {
</ins><span class="cx">                 Vector&lt;FloatQuad&gt; elementQuads;
</span><span class="cx">                 renderBoxModelObject-&gt;absoluteQuads(elementQuads);
</span><span class="cx">                 ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, renderBoxModelObject-&gt;style());
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/ShadowRoot.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -101,9 +101,9 @@
</span><span class="cx"> 
</span><span class="cx"> inline ShadowRoot* Node::shadowRoot() const
</span><span class="cx"> {
</span><del>-    if (!isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(*this))
</ins><span class="cx">         return nullptr;
</span><del>-    return toElement(this)-&gt;shadowRoot();
</del><ins>+    return downcast&lt;Element&gt;(*this).shadowRoot();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline ContainerNode* Node::parentOrShadowHostNode() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomStaticNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StaticNodeList.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StaticNodeList.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/StaticNodeList.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (unsigned i = 0, length = m_nodes.size(); i &lt; length; ++i) {
</span><span class="cx">         Node&amp; node = const_cast&lt;Node&amp;&gt;(m_nodes[i].get());
</span><del>-        if (node.isElementNode() &amp;&amp; toElement(node).getIdAttribute() == elementId)
</del><ins>+        if (is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(node).getIdAttribute() == elementId)
</ins><span class="cx">             return &amp;node;
</span><span class="cx">     }
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopeAdoptercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScopeAdopter.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScopeAdopter.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/dom/TreeScopeAdopter.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -60,11 +60,11 @@
</span><span class="cx">                 rareData-&gt;nodeLists()-&gt;adoptTreeScope();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!node-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         if (node-&gt;hasSyntheticAttrChildNodes()) {
</span><del>-            const Vector&lt;RefPtr&lt;Attr&gt;&gt;&amp; attrs = toElement(node)-&gt;attrNodeList();
</del><ins>+            const Vector&lt;RefPtr&lt;Attr&gt;&gt;&amp; attrs = downcast&lt;Element&gt;(*node).attrNodeList();
</ins><span class="cx">             for (unsigned i = 0; i &lt; attrs.size(); ++i)
</span><span class="cx">                 moveTreeToNewScope(attrs[i].get());
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -420,10 +420,10 @@
</span><span class="cx"> 
</span><span class="cx"> static ContainerNode* dummySpanAncestorForNode(const Node* node)
</span><span class="cx"> {
</span><del>-    while (node &amp;&amp; (!node-&gt;isElementNode() || !isStyleSpanOrSpanWithOnlyStyleAttribute(toElement(node))))
</del><ins>+    while (node &amp;&amp; (!is&lt;Element&gt;(node) || !isStyleSpanOrSpanWithOnlyStyleAttribute(downcast&lt;Element&gt;(node))))
</ins><span class="cx">         node = node-&gt;parentNode();
</span><span class="cx">     
</span><del>-    return node ? node-&gt;parentNode() : 0;
</del><ins>+    return node ? node-&gt;parentNode() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ApplyStyleCommand::cleanupUnstyledAppleStyleSpans(ContainerNode* dummySpanAncestor)
</span><span class="lines">@@ -486,7 +486,7 @@
</span><span class="cx">     // Split every ancestor through highest ancestor with embedding.
</span><span class="cx">     RefPtr&lt;Node&gt; currentNode = node;
</span><span class="cx">     while (currentNode) {
</span><del>-        RefPtr&lt;Element&gt; parent = toElement(currentNode-&gt;parentNode());
</del><ins>+        RefPtr&lt;Element&gt; parent = downcast&lt;Element&gt;(currentNode-&gt;parentNode());
</ins><span class="cx">         if (before ? currentNode-&gt;previousSibling() : currentNode-&gt;nextSibling())
</span><span class="cx">             splitElement(parent, before ? currentNode : currentNode-&gt;nextSibling());
</span><span class="cx">         if (parent == highestAncestorWithUnicodeBidi)
</span><span class="lines">@@ -1040,7 +1040,7 @@
</span><span class="cx">         getChildNodes(*current.get(), currentChildren);
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;StyledElement&gt; styledElement;
</span><del>-        if (is&lt;StyledElement&gt;(*current) &amp;&amp; isStyledInlineElementToRemove(toElement(current.get()))) {
</del><ins>+        if (is&lt;StyledElement&gt;(*current) &amp;&amp; isStyledInlineElementToRemove(downcast&lt;Element&gt;(current.get()))) {
</ins><span class="cx">             styledElement = downcast&lt;StyledElement&gt;(current.get());
</span><span class="cx">             elementsToPushDown.append(*styledElement);
</span><span class="cx">         }
</span><span class="lines">@@ -1286,8 +1286,8 @@
</span><span class="cx">     Node* previousSibling = startNode-&gt;previousSibling();
</span><span class="cx"> 
</span><span class="cx">     if (previousSibling &amp;&amp; areIdenticalElements(startNode, previousSibling)) {
</span><del>-        Element* previousElement = toElement(previousSibling);
-        Element* element = toElement(startNode);
</del><ins>+        Element* previousElement = downcast&lt;Element&gt;(previousSibling);
+        Element* element = downcast&lt;Element&gt;(startNode);
</ins><span class="cx">         Node* startChild = element-&gt;firstChild();
</span><span class="cx">         ASSERT(startChild);
</span><span class="cx">         mergeIdenticalElements(previousElement, element);
</span><span class="lines">@@ -1319,8 +1319,8 @@
</span><span class="cx"> 
</span><span class="cx">     Node* nextSibling = endNode-&gt;nextSibling();
</span><span class="cx">     if (nextSibling &amp;&amp; areIdenticalElements(endNode, nextSibling)) {
</span><del>-        Element* nextElement = toElement(nextSibling);
-        Element* element = toElement(endNode);
</del><ins>+        Element* nextElement = downcast&lt;Element&gt;(nextSibling);
+        Element* element = downcast&lt;Element&gt;(endNode);
</ins><span class="cx">         Node* nextChild = nextElement-&gt;firstChild();
</span><span class="cx"> 
</span><span class="cx">         mergeIdenticalElements(element, nextElement);
</span><span class="lines">@@ -1359,15 +1359,15 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Node&gt; nextSibling = element-&gt;nextSibling();
</span><span class="cx">     RefPtr&lt;Node&gt; previousSibling = element-&gt;previousSibling();
</span><del>-    if (nextSibling &amp;&amp; nextSibling-&gt;isElementNode() &amp;&amp; nextSibling-&gt;hasEditableStyle()
-        &amp;&amp; areIdenticalElements(element.get(), toElement(nextSibling.get())))
-        mergeIdenticalElements(element.get(), toElement(nextSibling.get()));
</del><ins>+    if (nextSibling &amp;&amp; is&lt;Element&gt;(*nextSibling) &amp;&amp; nextSibling-&gt;hasEditableStyle()
+        &amp;&amp; areIdenticalElements(element.get(), downcast&lt;Element&gt;(nextSibling.get())))
+        mergeIdenticalElements(element.get(), downcast&lt;Element&gt;(nextSibling.get()));
</ins><span class="cx"> 
</span><del>-    if (previousSibling &amp;&amp; previousSibling-&gt;isElementNode() &amp;&amp; previousSibling-&gt;hasEditableStyle()) {
</del><ins>+    if (previousSibling &amp;&amp; is&lt;Element&gt;(*previousSibling) &amp;&amp; previousSibling-&gt;hasEditableStyle()) {
</ins><span class="cx">         Node* mergedElement = previousSibling-&gt;nextSibling();
</span><del>-        if (mergedElement-&gt;isElementNode() &amp;&amp; mergedElement-&gt;hasEditableStyle()
-            &amp;&amp; areIdenticalElements(toElement(previousSibling.get()), toElement(mergedElement)))
-            mergeIdenticalElements(toElement(previousSibling.get()), toElement(mergedElement));
</del><ins>+        if (is&lt;Element&gt;(mergedElement) &amp;&amp; mergedElement-&gt;hasEditableStyle()
+            &amp;&amp; areIdenticalElements(downcast&lt;Element&gt;(previousSibling.get()), downcast&lt;Element&gt;(mergedElement)))
+            mergeIdenticalElements(downcast&lt;Element&gt;(previousSibling.get()), downcast&lt;Element&gt;(mergedElement));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We should probably call updateStartEnd if the start or end was in the node
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingBreakBlockquoteCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">         ancestors.append(node);
</span><span class="cx">     
</span><span class="cx">     // Insert a clone of the top blockquote after the break.
</span><del>-    RefPtr&lt;Element&gt; clonedBlockquote = toElement(topBlockquote)-&gt;cloneElementWithoutChildren();
</del><ins>+    RefPtr&lt;Element&gt; clonedBlockquote = downcast&lt;Element&gt;(*topBlockquote).cloneElementWithoutChildren();
</ins><span class="cx">     insertNodeAfter(clonedBlockquote.get(), breakNode.get());
</span><span class="cx">     
</span><span class="cx">     // Clone startNode's ancestors into the cloned blockquote.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -39,7 +39,9 @@
</span><span class="cx"> #include &quot;ElementTraversal.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><ins>+#include &quot;HTMLDivElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><ins>+#include &quot;HTMLLIElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><span class="cx"> #include &quot;InsertIntoTextNodeCommand.h&quot;
</span><span class="lines">@@ -322,14 +324,14 @@
</span><span class="cx"> 
</span><span class="cx"> bool CompositeEditCommand::isRemovableBlock(const Node* node)
</span><span class="cx"> {
</span><del>-    if (!node-&gt;hasTagName(divTag))
</del><ins>+    if (!is&lt;HTMLDivElement&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     Node* parentNode = node-&gt;parentNode();
</span><span class="cx">     if (parentNode &amp;&amp; parentNode-&gt;firstChild() != parentNode-&gt;lastChild())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!toElement(node)-&gt;hasAttributes())
</del><ins>+    if (!downcast&lt;HTMLDivElement&gt;(*node).hasAttributes())
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="lines">@@ -1069,7 +1071,7 @@
</span><span class="cx">         for (size_t i = ancestors.size(); i != 0; --i) {
</span><span class="cx">             Node* item = ancestors[i - 1].get();
</span><span class="cx">             RefPtr&lt;Node&gt; child = item-&gt;cloneNode(isRenderedTable(item));
</span><del>-            appendNode(child, toElement(lastNode.get()));
</del><ins>+            appendNode(child, downcast&lt;Element&gt;(lastNode.get()));
</ins><span class="cx">             lastNode = child.release();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1347,13 +1349,13 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Element&gt; newBlock = 0;
</span><span class="cx">     if (ContainerNode* blockEnclosingList = listNode-&gt;parentNode()) {
</span><del>-        if (blockEnclosingList-&gt;hasTagName(liTag)) { // listNode is inside another list item
</del><ins>+        if (is&lt;HTMLLIElement&gt;(blockEnclosingList)) { // listNode is inside another list item
</ins><span class="cx">             if (visiblePositionAfterNode(blockEnclosingList) == visiblePositionAfterNode(listNode.get())) {
</span><span class="cx">                 // If listNode appears at the end of the outer list item, then move listNode outside of this list item
</span><span class="cx">                 // e.g. &lt;ul&gt;&lt;li&gt;hello &lt;ul&gt;&lt;li&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;/ul&gt; should become &lt;ul&gt;&lt;li&gt;hello&lt;/li&gt; &lt;ul&gt;&lt;li&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/ul&gt; after this section
</span><span class="cx">                 // If listNode does NOT appear at the end, then we should consider it as a regular paragraph.
</span><span class="cx">                 // e.g. &lt;ul&gt;&lt;li&gt; &lt;ul&gt;&lt;li&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt; hello&lt;/li&gt;&lt;/ul&gt; should become &lt;ul&gt;&lt;li&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt; hello&lt;/li&gt;&lt;/ul&gt; at the end
</span><del>-                splitElement(toElement(blockEnclosingList), listNode);
</del><ins>+                splitElement(downcast&lt;HTMLLIElement&gt;(blockEnclosingList), listNode);
</ins><span class="cx">                 removeNodePreservingChildren(listNode-&gt;parentNode());
</span><span class="cx">                 newBlock = createListItemElement(document());
</span><span class="cx">             }
</span><span class="lines">@@ -1369,7 +1371,7 @@
</span><span class="cx">     if (isListItem(nextListNode.get()) || isListElement(nextListNode.get())) {
</span><span class="cx">         // If emptyListItem follows another list item or nested list, split the list node.
</span><span class="cx">         if (isListItem(previousListNode.get()) || isListElement(previousListNode.get()))
</span><del>-            splitElement(toElement(listNode.get()), emptyListItem);
</del><ins>+            splitElement(downcast&lt;Element&gt;(listNode.get()), emptyListItem);
</ins><span class="cx"> 
</span><span class="cx">         // If emptyListItem is followed by other list item or nested list, then insert newBlock before the list node.
</span><span class="cx">         // Because we have splitted the element, emptyListItem is the first element in the list node.
</span><span class="lines">@@ -1522,13 +1524,13 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Node&gt; endNode = end;
</span><span class="cx">     for (node = start; node &amp;&amp; node-&gt;parentNode() != endNode; node = node-&gt;parentNode()) {
</span><del>-        if (!node-&gt;parentNode()-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node-&gt;parentNode()))
</ins><span class="cx">             break;
</span><span class="cx">         // Do not split a node when doing so introduces an empty node.
</span><span class="cx">         VisiblePosition positionInParent = firstPositionInNode(node-&gt;parentNode());
</span><span class="cx">         VisiblePosition positionInNode = firstPositionInOrBeforeNode(node.get());
</span><span class="cx">         if (positionInParent != positionInNode)
</span><del>-            splitElement(toElement(node-&gt;parentNode()), node);
</del><ins>+            splitElement(downcast&lt;Element&gt;(node-&gt;parentNode()), node);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return node.release();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -34,7 +34,9 @@
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;htmlediting.h&quot;
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><ins>+#include &quot;HTMLLinkElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><ins>+#include &quot;HTMLStyleElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLTableElement.h&quot;
</span><span class="cx"> #include &quot;NodeTraversal.h&quot;
</span><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="lines">@@ -434,7 +436,7 @@
</span><span class="cx">     RefPtr&lt;Node&gt; node = range-&gt;firstNode();
</span><span class="cx">     while (node &amp;&amp; node != range-&gt;pastLastNode()) {
</span><span class="cx">         RefPtr&lt;Node&gt; nextNode = NodeTraversal::next(node.get());
</span><del>-        if ((node-&gt;hasTagName(styleTag) &amp;&amp; !(toElement(node.get())-&gt;hasAttribute(scopedAttr))) || node-&gt;hasTagName(linkTag)) {
</del><ins>+        if ((is&lt;HTMLStyleElement&gt;(*node) &amp;&amp; !downcast&lt;HTMLStyleElement&gt;(*node).hasAttribute(scopedAttr)) || is&lt;HTMLLinkElement&gt;(*node)) {
</ins><span class="cx">             nextNode = NodeTraversal::nextSkippingChildren(node.get());
</span><span class="cx">             RefPtr&lt;ContainerNode&gt; rootEditableElement = node-&gt;rootEditableElement();
</span><span class="cx">             if (rootEditableElement) {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -2378,7 +2378,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!node)
</span><span class="cx">         return false;
</span><del>-    const Element* focusedElement = node-&gt;isElementNode() ? toElement(node) : node-&gt;parentElement();
</del><ins>+    const Element* focusedElement = is&lt;Element&gt;(node) ? downcast&lt;Element&gt;(node) : node-&gt;parentElement();
</ins><span class="cx">     if (!focusedElement)
</span><span class="cx">         return false;
</span><span class="cx">     return focusedElement-&gt;isSpellCheckingEnabled();
</span><span class="lines">@@ -3100,7 +3100,7 @@
</span><span class="cx">     RefPtr&lt;NodeList&gt; list = document().getElementsByTagName(&quot;body&quot;);
</span><span class="cx">     unsigned len = list-&gt;length();
</span><span class="cx">     for (unsigned i = 0; i &lt; len; i++)
</span><del>-        applyEditingStyleToElement(toElement(list-&gt;item(i)));
</del><ins>+        applyEditingStyleToElement(downcast&lt;Element&gt;(list-&gt;item(i)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Editor::applyEditingStyleToElement(Element* element) const
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFormatBlockCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FormatBlockCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FormatBlockCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/FormatBlockCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> static bool isElementForFormatBlock(const QualifiedName&amp; tagName);
</span><span class="cx"> static inline bool isElementForFormatBlock(Node* node)
</span><span class="cx"> {
</span><del>-    return node-&gt;isElementNode() &amp;&amp; isElementForFormatBlock(toElement(node)-&gt;tagQName());
</del><ins>+    return is&lt;Element&gt;(node) &amp;&amp; isElementForFormatBlock(downcast&lt;Element&gt;(*node).tagQName());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FormatBlockCommand::FormatBlockCommand(Document&amp; document, const QualifiedName&amp; tagName)
</span><span class="lines">@@ -100,20 +100,20 @@
</span><span class="cx"> Element* FormatBlockCommand::elementForFormatBlockCommand(Range* range)
</span><span class="cx"> {
</span><span class="cx">     if (!range)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     Node* commonAncestor = range-&gt;commonAncestorContainer(IGNORE_EXCEPTION);
</span><span class="cx">     while (commonAncestor &amp;&amp; !isElementForFormatBlock(commonAncestor))
</span><span class="cx">         commonAncestor = commonAncestor-&gt;parentNode();
</span><span class="cx"> 
</span><span class="cx">     if (!commonAncestor)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     Element* rootEditableElement = range-&gt;startContainer()-&gt;rootEditableElement();
</span><span class="cx">     if (!rootEditableElement || commonAncestor-&gt;contains(rootEditableElement))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    return commonAncestor-&gt;isElementNode() ? toElement(commonAncestor) : 0;
</del><ins>+    return commonAncestor-&gt;isElementNode() ? downcast&lt;Element&gt;(commonAncestor) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool isElementForFormatBlock(const QualifiedName&amp; tagName)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -398,10 +398,10 @@
</span><span class="cx">     if (position.anchorNode() == node)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    Element* element = toElement(node);
</del><ins>+    Element* element = downcast&lt;Element&gt;(node);
</ins><span class="cx">     return element-&gt;containsIncludingShadowDOM(position.anchorNode());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1491,7 +1491,7 @@
</span><span class="cx"> 
</span><span class="cx">     Color caretColor = Color::black;
</span><span class="cx">     ColorSpace colorSpace = ColorSpaceDeviceRGB;
</span><del>-    Element* element = node-&gt;isElementNode() ? toElement(node) : node-&gt;parentElement();
</del><ins>+    Element* element = is&lt;Element&gt;(node) ? downcast&lt;Element&gt;(node) : node-&gt;parentElement();
</ins><span class="cx">     Element* rootEditableElement = node-&gt;rootEditableElement();
</span><span class="cx"> 
</span><span class="cx">     if (element &amp;&amp; element-&gt;renderer()) {
</span><span class="lines">@@ -1520,13 +1520,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameSelection::debugRenderer(RenderObject* r, bool selected) const
</del><ins>+void FrameSelection::debugRenderer(RenderObject* renderer, bool selected) const
</ins><span class="cx"> {
</span><del>-    if (r-&gt;node()-&gt;isElementNode()) {
-        Element* element = toElement(r-&gt;node());
</del><ins>+    if (is&lt;Element&gt;(renderer-&gt;node())) {
+        Element* element = downcast&lt;Element&gt;(renderer-&gt;node());
</ins><span class="cx">         fprintf(stderr, &quot;%s%s\n&quot;, selected ? &quot;==&gt; &quot; : &quot;    &quot;, element-&gt;localName().string().utf8().data());
</span><del>-    } else if (r-&gt;isText()) {
-        RenderText* textRenderer = toRenderText(r);
</del><ins>+    } else if (renderer-&gt;isText()) {
+        RenderText* textRenderer = toRenderText(renderer);
</ins><span class="cx">         if (!textRenderer-&gt;textLength() || !textRenderer-&gt;firstTextBox()) {
</span><span class="cx">             fprintf(stderr, &quot;%s#text (empty)\n&quot;, selected ? &quot;==&gt; &quot; : &quot;    &quot;);
</span><span class="cx">             return;
</span><span class="lines">@@ -1537,9 +1537,9 @@
</span><span class="cx">         int textLength = text.length();
</span><span class="cx">         if (selected) {
</span><span class="cx">             int offset = 0;
</span><del>-            if (r-&gt;node() == m_selection.start().containerNode())
</del><ins>+            if (renderer-&gt;node() == m_selection.start().containerNode())
</ins><span class="cx">                 offset = m_selection.start().computeOffsetInContainerNode();
</span><del>-            else if (r-&gt;node() == m_selection.end().containerNode())
</del><ins>+            else if (renderer-&gt;node() == m_selection.end().containerNode())
</ins><span class="cx">                 offset = m_selection.end().computeOffsetInContainerNode();
</span><span class="cx"> 
</span><span class="cx">             int pos;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingIndentOutdentCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/IndentOutdentCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/IndentOutdentCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/IndentOutdentCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx">                 if (splitPointParent-&gt;hasTagName(blockquoteTag)
</span><span class="cx">                     &amp;&amp; !splitPoint-&gt;hasTagName(blockquoteTag)
</span><span class="cx">                     &amp;&amp; splitPointParent-&gt;parentNode()-&gt;hasEditableStyle()) // We can't outdent if there is no place to go!
</span><del>-                    splitElement(toElement(splitPointParent), splitPoint);
</del><ins>+                    splitElement(downcast&lt;Element&gt;(splitPointParent), splitPoint);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx">     else {
</span><span class="cx">         // We split the blockquote at where we start outdenting.
</span><span class="cx">         Node* highestInlineNode = highestEnclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), isInline, CannotCrossEditingBoundary, enclosingBlockFlow);
</span><del>-        splitElement(toElement(enclosingNode), (highestInlineNode) ? highestInlineNode : visibleStartOfParagraph.deepEquivalent().deprecatedNode());
</del><ins>+        splitElement(downcast&lt;Element&gt;(enclosingNode), highestInlineNode ? highestInlineNode : visibleStartOfParagraph.deepEquivalent().deprecatedNode());
</ins><span class="cx">     }
</span><span class="cx">     RefPtr&lt;Node&gt; placeholder = createBreakElement(document());
</span><span class="cx">     insertNodeBefore(placeholder, splitBlockquoteNode);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx">             // into an unquoted area. We then don't want the newline within the blockquote or else it will also be quoted.
</span><span class="cx">             if (m_pasteBlockqutoeIntoUnquotedArea) {
</span><span class="cx">                 if (Node* highestBlockquote = highestEnclosingNodeOfType(canonicalPos, &amp;isMailBlockquote))
</span><del>-                    startBlock = toElement(highestBlockquote);
</del><ins>+                    startBlock = downcast&lt;Element&gt;(highestBlockquote);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             // Most of the time we want to stay at the nesting level of the startBlock (e.g., when nesting within lists).  However,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingMarkupAccumulatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/MarkupAccumulator.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -139,9 +139,9 @@
</span><span class="cx">     if (&amp;targetNode == nodeToSkip)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (tagNamesToSkip &amp;&amp; targetNode.isElementNode()) {
</del><ins>+    if (tagNamesToSkip &amp;&amp; is&lt;Element&gt;(targetNode)) {
</ins><span class="cx">         for (auto&amp; name : *tagNamesToSkip) {
</span><del>-            if (toElement(targetNode).hasTagName(name))
</del><ins>+            if (downcast&lt;Element&gt;(targetNode).hasTagName(name))
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -570,7 +570,7 @@
</span><span class="cx">         appendProcessingInstruction(result, downcast&lt;ProcessingInstruction&gt;(node).target(), downcast&lt;ProcessingInstruction&gt;(node).data());
</span><span class="cx">         break;
</span><span class="cx">     case Node::ELEMENT_NODE:
</span><del>-        appendElement(result, toElement(node), namespaces);
</del><ins>+        appendElement(result, downcast&lt;Element&gt;(node), namespaces);
</ins><span class="cx">         break;
</span><span class="cx">     case Node::CDATA_SECTION_NODE:
</span><span class="cx">         appendCDATASection(result, downcast&lt;CDATASection&gt;(node).data());
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingMarkupAccumulatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/MarkupAccumulator.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/MarkupAccumulator.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/MarkupAccumulator.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx">     void appendString(const String&amp;);
</span><span class="cx">     void appendEndTag(const Node&amp; node)
</span><span class="cx">     {
</span><del>-        if (node.isElementNode())
-            appendEndTag(toElement(node));
</del><ins>+        if (is&lt;Element&gt;(node))
+            appendEndTag(downcast&lt;Element&gt;(node));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     virtual void appendEndTag(const Element&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingModifySelectionListLevelcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">     Node* previousItem = startListChild-&gt;renderer()-&gt;previousSibling()-&gt;node();
</span><span class="cx">     if (isListElement(previousItem)) {
</span><span class="cx">         // move nodes up into preceding list
</span><del>-        appendSiblingNodeRange(startListChild, endListChild, toElement(previousItem));
</del><ins>+        appendSiblingNodeRange(startListChild, endListChild, downcast&lt;Element&gt;(previousItem));
</ins><span class="cx">         m_listElement = previousItem;
</span><span class="cx">     } else {
</span><span class="cx">         // create a sublist for the preceding element and move nodes there
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -430,7 +430,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool isMailPasteAsQuotationNode(const Node* node)
</span><span class="cx"> {
</span><del>-    return node &amp;&amp; node-&gt;hasTagName(blockquoteTag) &amp;&amp; node-&gt;isElementNode() &amp;&amp; toElement(node)-&gt;getAttribute(classAttr) == ApplePasteAsQuotation;
</del><ins>+    return node &amp;&amp; node-&gt;hasTagName(blockquoteTag) &amp;&amp; downcast&lt;Element&gt;(node)-&gt;getAttribute(classAttr) == ApplePasteAsQuotation;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool isHeaderElement(const Node* a)
</span><span class="lines">@@ -448,7 +448,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool haveSameTagName(Node* a, Node* b)
</span><span class="cx"> {
</span><del>-    return a &amp;&amp; b &amp;&amp; a-&gt;isElementNode() &amp;&amp; b-&gt;isElementNode() &amp;&amp; toElement(a)-&gt;tagName() == toElement(b)-&gt;tagName();
</del><ins>+    return a &amp;&amp; b &amp;&amp; is&lt;Element&gt;(a) &amp;&amp; is&lt;Element&gt;(b) &amp;&amp; downcast&lt;Element&gt;(*a).tagName() == downcast&lt;Element&gt;(*b).tagName();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ReplaceSelectionCommand::shouldMerge(const VisiblePosition&amp; source, const VisiblePosition&amp; destination)
</span><span class="lines">@@ -755,7 +755,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This string comparison is a naive way of comparing two styles.
</span><span class="cx">     // We should be taking the diff and check that the diff is empty.
</span><del>-    if (styleText != toElement(wrappingStyleSpan)-&gt;getAttribute(styleAttr))
</del><ins>+    if (styleText != downcast&lt;Element&gt;(*wrappingStyleSpan).getAttribute(styleAttr))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     fragment.removeNodePreservingChildren(wrappingStyleSpan);
</span><span class="lines">@@ -1234,7 +1234,7 @@
</span><span class="cx">         mergeEndIfNeeded();
</span><span class="cx"> 
</span><span class="cx">     if (Node* mailBlockquote = enclosingNodeOfType(positionAtStartOfInsertedContent().deepEquivalent(), isMailPasteAsQuotationNode))
</span><del>-        removeNodeAttribute(toElement(mailBlockquote), classAttr);
</del><ins>+        removeNodeAttribute(downcast&lt;Element&gt;(mailBlockquote), classAttr);
</ins><span class="cx"> 
</span><span class="cx">     if (shouldPerformSmartReplace())
</span><span class="cx">         addSpacesForSmartReplace();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingSpellCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/SpellChecker.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/SpellChecker.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/SpellChecker.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">     if (!range || !range-&gt;firstNode() || !range-&gt;firstNode()-&gt;renderer())
</span><span class="cx">         return false;
</span><span class="cx">     const Node* node = range-&gt;startContainer();
</span><del>-    if (node &amp;&amp; node-&gt;isElementNode() &amp;&amp; !toElement(node)-&gt;isSpellCheckingEnabled())
</del><ins>+    if (node &amp;&amp; is&lt;Element&gt;(node) &amp;&amp; !downcast&lt;Element&gt;(*node).isSpellCheckingEnabled())
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingSplitTextNodeContainingElementCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/SplitTextNodeContainingElementCommand.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/SplitTextNodeContainingElementCommand.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/SplitTextNodeContainingElementCommand.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -57,9 +57,9 @@
</span><span class="cx">     if (!parentRenderer || !parentRenderer-&gt;isInline()) {
</span><span class="cx">         wrapContentsInDummySpan(parent);
</span><span class="cx">         Node* firstChild = parent-&gt;firstChild();
</span><del>-        if (!firstChild || !firstChild-&gt;isElementNode())
</del><ins>+        if (!firstChild || !is&lt;Element&gt;(firstChild))
</ins><span class="cx">             return;
</span><del>-        parent = toElement(firstChild);
</del><ins>+        parent = downcast&lt;Element&gt;(firstChild);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     splitElement(parent, m_text);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -255,8 +255,8 @@
</span><span class="cx">     if (renderer-&gt;isImage() || renderer-&gt;isWidget() || renderer-&gt;isMedia())
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (renderer-&gt;node() &amp;&amp; renderer-&gt;node()-&gt;isElementNode()) {
-        Element&amp; element = toElement(*renderer-&gt;node());
</del><ins>+    if (renderer-&gt;node() &amp;&amp; is&lt;Element&gt;(renderer-&gt;node())) {
+        Element&amp; element = downcast&lt;Element&gt;(*renderer-&gt;node());
</ins><span class="cx">         if (is&lt;HTMLFormControlElement&gt;(element) || is&lt;HTMLLegendElement&gt;(element) || is&lt;HTMLMeterElement&gt;(element) || is&lt;HTMLProgressElement&gt;(element))
</span><span class="cx">             return true;
</span><span class="cx">         if (equalIgnoringCase(element.fastGetAttribute(roleAttr), &quot;img&quot;))
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #import &quot;FrameLoader.h&quot;
</span><span class="cx"> #import &quot;HTMLElement.h&quot;
</span><span class="cx"> #import &quot;HTMLFrameElementBase.h&quot;
</span><ins>+#import &quot;HTMLImageElement.h&quot;
</ins><span class="cx"> #import &quot;HTMLInputElement.h&quot;
</span><span class="cx"> #import &quot;HTMLMetaElement.h&quot;
</span><span class="cx"> #import &quot;HTMLNames.h&quot;
</span><span class="lines">@@ -738,14 +739,14 @@
</span><span class="cx"> 
</span><span class="cx"> String HTMLConverterCaches::propertyValueForNode(Node&amp; node, CSSPropertyID propertyId)
</span><span class="cx"> {
</span><del>-    if (!node.isElementNode()) {
</del><ins>+    if (!is&lt;Element&gt;(node)) {
</ins><span class="cx">         if (Node* parent = node.parentNode())
</span><span class="cx">             return propertyValueForNode(*parent, propertyId);
</span><span class="cx">         return String();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool inherit = false;
</span><del>-    Element&amp; element = toElement(node);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(node);
</ins><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</span><span class="cx">         String result;
</span><span class="cx">         if (stringFromCSSValue(*value, result))
</span><span class="lines">@@ -883,13 +884,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool HTMLConverterCaches::floatPropertyValueForNode(Node&amp; node, CSSPropertyID propertyId, float&amp; result)
</span><span class="cx"> {
</span><del>-    if (!node.isElementNode()) {
</del><ins>+    if (!is&lt;Element&gt;(node)) {
</ins><span class="cx">         if (ContainerNode* parent = node.parentNode())
</span><span class="cx">             return floatPropertyValueForNode(*parent, propertyId, result);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Element&amp; element = toElement(node);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(node);
</ins><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</span><span class="cx">         if (value-&gt;isPrimitiveValue() &amp;&amp; floatValueFromPrimitiveValue(toCSSPrimitiveValue(*value), result))
</span><span class="cx">             return true;
</span><span class="lines">@@ -1052,13 +1053,13 @@
</span><span class="cx"> 
</span><span class="cx"> Color HTMLConverterCaches::colorPropertyValueForNode(Node&amp; node, CSSPropertyID propertyId)
</span><span class="cx"> {
</span><del>-    if (!node.isElementNode()) {
</del><ins>+    if (!is&lt;Element&gt;(node)) {
</ins><span class="cx">         if (Node* parent = node.parentNode())
</span><span class="cx">             return colorPropertyValueForNode(*parent, propertyId);
</span><span class="cx">         return Color();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Element&amp; element = toElement(node);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(node);
</ins><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</span><span class="cx">         if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(*value).isRGBColor())
</span><span class="cx">             return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</span><span class="lines">@@ -1356,11 +1357,11 @@
</span><span class="cx"> NSDictionary* HTMLConverter::aggregatedAttributesForAncestors(CharacterData&amp; node)
</span><span class="cx"> {
</span><span class="cx">     Node* ancestor = node.parentNode();
</span><del>-    while (ancestor &amp;&amp; !ancestor-&gt;isElementNode())
</del><ins>+    while (ancestor &amp;&amp; !is&lt;Element&gt;(ancestor))
</ins><span class="cx">         ancestor = ancestor-&gt;parentNode();
</span><span class="cx">     if (!ancestor)
</span><span class="cx">         return nullptr;
</span><del>-    return aggregatedAttributesForElementAndItsAncestors(*toElement(ancestor));
</del><ins>+    return aggregatedAttributesForElementAndItsAncestors(downcast&lt;Element&gt;(*ancestor));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NSDictionary* HTMLConverter::aggregatedAttributesForElementAndItsAncestors(Element&amp; element)
</span><span class="lines">@@ -1373,7 +1374,7 @@
</span><span class="cx">     ASSERT(attributesForCurrentElement);
</span><span class="cx"> 
</span><span class="cx">     Node* ancestor = element.parentNode();
</span><del>-    while (ancestor &amp;&amp; !ancestor-&gt;isElementNode())
</del><ins>+    while (ancestor &amp;&amp; !is&lt;Element&gt;(ancestor))
</ins><span class="cx">         ancestor = ancestor-&gt;parentNode();
</span><span class="cx"> 
</span><span class="cx">     if (!ancestor) {
</span><span class="lines">@@ -1381,7 +1382,7 @@
</span><span class="cx">         return attributesForCurrentElement;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;NSMutableDictionary&gt; attributesForAncestors = adoptNS([aggregatedAttributesForElementAndItsAncestors(*toElement(ancestor)) mutableCopy]);
</del><ins>+    RetainPtr&lt;NSMutableDictionary&gt; attributesForAncestors = adoptNS([aggregatedAttributesForElementAndItsAncestors(downcast&lt;Element&gt;(*ancestor)) mutableCopy]);
</ins><span class="cx">     [attributesForAncestors addEntriesFromDictionary:attributesForCurrentElement];
</span><span class="cx">     m_aggregatedAttributesForElements.set(&amp;element, attributesForAncestors);
</span><span class="cx"> 
</span><span class="lines">@@ -2394,8 +2395,8 @@
</span><span class="cx">                 break;
</span><span class="cx">             child = child-&gt;nextSibling();
</span><span class="cx">         }
</span><del>-    } else if (node.isElementNode()) {
-        Element&amp; element = toElement(node);
</del><ins>+    } else if (is&lt;Element&gt;(node)) {
+        Element&amp; element = downcast&lt;Element&gt;(node);
</ins><span class="cx">         if (_enterElement(element, embedded)) {
</span><span class="cx">             NSUInteger startIndex = [_attrStr length];
</span><span class="cx">             if (_processElement(element, depth)) {
</span><span class="lines">@@ -2570,8 +2571,8 @@
</span><span class="cx">         
</span><span class="cx">         if (startContainer == endContainer &amp;&amp; (startOffset == endOffset - 1)) {
</span><span class="cx">             Node* node = startContainer-&gt;traverseToChildAt(startOffset);
</span><del>-            if (node &amp;&amp; node-&gt;hasTagName(imgTag)) {
-                NSFileWrapper* fileWrapper = fileWrapperForElement(toElement(node));
</del><ins>+            if (node &amp;&amp; is&lt;HTMLImageElement&gt;(node)) {
+                NSFileWrapper* fileWrapper = fileWrapperForElement(downcast&lt;HTMLImageElement&gt;(node));
</ins><span class="cx">                 NSTextAttachment* attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper];
</span><span class="cx">                 [string appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];
</span><span class="cx">                 [attachment release];
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinghtmleditingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/htmlediting.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/htmlediting.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/htmlediting.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Since enclosingNodeOfType won't search beyond the highest root editable node,
</span><span class="cx">     // this code works even if the closest table cell was outside of the root editable node.
</span><del>-    Element* enclosingCell = toElement(enclosingNodeOfType(p, &amp;isTableCell));
</del><ins>+    Element* enclosingCell = downcast&lt;Element&gt;(enclosingNodeOfType(p, &amp;isTableCell));
</ins><span class="cx">     if (enclosingCell)
</span><span class="cx">         return enclosingCell;
</span><span class="cx"> 
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx"> Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
</span><span class="cx"> {
</span><span class="cx">     Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule);
</span><del>-    return enclosingNode &amp;&amp; enclosingNode-&gt;isElementNode() ? toElement(enclosingNode) : 0;
</del><ins>+    return enclosingNode &amp;&amp; is&lt;Element&gt;(enclosingNode) ? downcast&lt;Element&gt;(enclosingNode) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextDirection directionOfEnclosingBlock(const Position&amp; position)
</span><span class="lines">@@ -550,10 +550,10 @@
</span><span class="cx">     for (Node* node = position.deprecatedNode(); node; node = node-&gt;parentNode()) {
</span><span class="cx">         if (root &amp;&amp; !node-&gt;hasEditableStyle())
</span><span class="cx">             continue;
</span><del>-        if (!node-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><del>-        if (toElement(*node).hasTagName(tagName))
-            return toElement(node);
</del><ins>+        if (downcast&lt;Element&gt;(*node).hasTagName(tagName))
+            return downcast&lt;Element&gt;(node);
</ins><span class="cx">         if (node == root)
</span><span class="cx">             return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -629,7 +629,7 @@
</span><span class="cx"> 
</span><span class="cx"> Node* enclosingTableCell(const Position&amp; p)
</span><span class="cx"> {
</span><del>-    return toElement(enclosingNodeOfType(p, isTableCell));
</del><ins>+    return downcast&lt;Element&gt;(enclosingNodeOfType(p, isTableCell));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Element* enclosingAnchorElement(const Position&amp; p)
</span><span class="lines">@@ -638,8 +638,8 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     for (Node* node = p.deprecatedNode(); node; node = node-&gt;parentNode()) {
</span><del>-        if (node-&gt;isElementNode() &amp;&amp; node-&gt;isLink())
-            return toElement(node);
</del><ins>+        if (is&lt;Element&gt;(node) &amp;&amp; node-&gt;isLink())
+            return downcast&lt;Element&gt;(node);
</ins><span class="cx">     }
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -1184,11 +1184,11 @@
</span><span class="cx"> 
</span><span class="cx"> bool areIdenticalElements(const Node* first, const Node* second)
</span><span class="cx"> {
</span><del>-    if (!first-&gt;isElementNode() || !second-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(first) || !is&lt;Element&gt;(second))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    const Element* firstElement = toElement(first);
-    const Element* secondElement = toElement(second);
</del><ins>+    const Element* firstElement = downcast&lt;Element&gt;(first);
+    const Element* secondElement = downcast&lt;Element&gt;(second);
</ins><span class="cx">     if (!firstElement-&gt;hasTagName(secondElement-&gt;tagQName()))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -1197,21 +1197,17 @@
</span><span class="cx"> 
</span><span class="cx"> bool isNonTableCellHTMLBlockElement(const Node* node)
</span><span class="cx"> {
</span><del>-    if (!node-&gt;isElementNode())
-        return false;
-
-    const Element* element = toElement(node);
-    return element-&gt;hasTagName(listingTag)
-        || element-&gt;hasTagName(olTag)
-        || element-&gt;hasTagName(preTag)
-        || is&lt;HTMLTableElement&gt;(element)
-        || element-&gt;hasTagName(ulTag)
-        || element-&gt;hasTagName(xmpTag)
-        || element-&gt;hasTagName(h1Tag)
-        || element-&gt;hasTagName(h2Tag)
-        || element-&gt;hasTagName(h3Tag)
-        || element-&gt;hasTagName(h4Tag)
-        || element-&gt;hasTagName(h5Tag);
</del><ins>+    return node-&gt;hasTagName(listingTag)
+        || node-&gt;hasTagName(olTag)
+        || node-&gt;hasTagName(preTag)
+        || is&lt;HTMLTableElement&gt;(node)
+        || node-&gt;hasTagName(ulTag)
+        || node-&gt;hasTagName(xmpTag)
+        || node-&gt;hasTagName(h1Tag)
+        || node-&gt;hasTagName(h2Tag)
+        || node-&gt;hasTagName(h3Tag)
+        || node-&gt;hasTagName(h4Tag)
+        || node-&gt;hasTagName(h5Tag);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Position adjustedSelectionStartForStyleComputation(const VisibleSelection&amp; selection)
</span><span class="lines">@@ -1251,14 +1247,14 @@
</span><span class="cx"> Element* deprecatedEnclosingBlockFlowElement(Node* node)
</span><span class="cx"> {
</span><span class="cx">     if (!node)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (isBlockFlowElement(node))
</span><del>-        return toElement(node);
</del><ins>+        return downcast&lt;Element&gt;(node);
</ins><span class="cx">     while ((node = node-&gt;parentNode())) {
</span><del>-        if (isBlockFlowElement(node) || node-&gt;hasTagName(bodyTag))
-            return toElement(node);
</del><ins>+        if (isBlockFlowElement(node) || is&lt;HTMLBodyElement&gt;(node))
+            return downcast&lt;Element&gt;(node);
</ins><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool caretRendersInsideNode(Node* node)
</span><span class="lines">@@ -1269,11 +1265,11 @@
</span><span class="cx"> RenderObject* rendererForCaretPainting(Node* node)
</span><span class="cx"> {
</span><span class="cx">     if (!node)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     RenderObject* renderer = node-&gt;renderer();
</span><span class="cx">     if (!renderer)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     // If caretNode is a block and caret is inside it, then caret should be painted by that block.
</span><span class="cx">     bool paintedByBlock = renderer-&gt;isRenderBlockFlow() &amp;&amp; caretRendersInsideNode(node);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmarkupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/markup.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/markup.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/editing/markup.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -181,10 +181,10 @@
</span><span class="cx"> void StyledMarkupAccumulator::wrapWithNode(Node&amp; node, bool convertBlocksToInlines, RangeFullySelectsNode rangeFullySelectsNode)
</span><span class="cx"> {
</span><span class="cx">     StringBuilder markup;
</span><del>-    if (node.isElementNode())
-        appendElement(markup, toElement(node), convertBlocksToInlines &amp;&amp; isBlock(&amp;node), rangeFullySelectsNode);
</del><ins>+    if (is&lt;Element&gt;(node))
+        appendElement(markup, downcast&lt;Element&gt;(node), convertBlocksToInlines &amp;&amp; isBlock(&amp;node), rangeFullySelectsNode);
</ins><span class="cx">     else
</span><del>-        appendStartMarkup(markup, node, 0);
</del><ins>+        appendStartMarkup(markup, node, nullptr);
</ins><span class="cx">     m_reversedPrecedingMarkup.append(markup.toString());
</span><span class="cx">     appendEndTag(node);
</span><span class="cx">     if (m_nodes)
</span><span class="lines">@@ -571,7 +571,7 @@
</span><span class="cx">     document.updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><span class="cx">     auto* body = enclosingElementWithTag(firstPositionInNode(commonAncestor), bodyTag);
</span><del>-    Node* fullySelectedRoot = 0;
</del><ins>+    Element* fullySelectedRoot = nullptr;
</ins><span class="cx">     // FIXME: Do this for all fully selected blocks, not just the body.
</span><span class="cx">     if (body &amp;&amp; VisiblePosition(firstPositionInNode(body)) == VisiblePosition(range.startPosition())
</span><span class="cx">         &amp;&amp; VisiblePosition(lastPositionInNode(body)) == VisiblePosition(range.endPosition()))
</span><span class="lines">@@ -608,8 +608,8 @@
</span><span class="cx">                 // Bring the background attribute over, but not as an attribute because a background attribute on a div
</span><span class="cx">                 // appears to have no effect.
</span><span class="cx">                 if ((!fullySelectedRootStyle || !fullySelectedRootStyle-&gt;style() || !fullySelectedRootStyle-&gt;style()-&gt;getPropertyCSSValue(CSSPropertyBackgroundImage))
</span><del>-                    &amp;&amp; toElement(fullySelectedRoot)-&gt;hasAttribute(backgroundAttr))
-                    fullySelectedRootStyle-&gt;style()-&gt;setProperty(CSSPropertyBackgroundImage, &quot;url('&quot; + toElement(fullySelectedRoot)-&gt;getAttribute(backgroundAttr) + &quot;')&quot;);
</del><ins>+                    &amp;&amp; fullySelectedRoot-&gt;hasAttribute(backgroundAttr))
+                    fullySelectedRootStyle-&gt;style()-&gt;setProperty(CSSPropertyBackgroundImage, &quot;url('&quot; + fullySelectedRoot-&gt;getAttribute(backgroundAttr) + &quot;')&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 if (fullySelectedRootStyle-&gt;style()) {
</span><span class="cx">                     // Reset the CSS properties to avoid an assertion error in addStyleMarkup().
</span><span class="lines">@@ -804,7 +804,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Break string into paragraphs. Extra line breaks turn into empty paragraphs.
</span><span class="cx">     Node* blockNode = enclosingBlock(context.firstNode());
</span><del>-    Element* block = toElement(blockNode);
</del><ins>+    Element* block = downcast&lt;Element&gt;(blockNode);
</ins><span class="cx">     bool useClonesOfEnclosingBlock = blockNode
</span><span class="cx">         &amp;&amp; blockNode-&gt;isElementNode()
</span><span class="cx">         &amp;&amp; !block-&gt;hasTagName(bodyTag)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDetailsElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDetailsElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDetailsElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLDetailsElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">     Element* fallbackSummary()
</span><span class="cx">     {
</span><span class="cx">         ASSERT(firstChild() &amp;&amp; firstChild()-&gt;hasTagName(summaryTag));
</span><del>-        return toElement(firstChild());
</del><ins>+        return downcast&lt;Element&gt;(firstChild());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -642,8 +642,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Node* returnValue = insertAdjacent(where, newChild, ec);
</span><del>-    ASSERT_WITH_SECURITY_IMPLICATION(!returnValue || returnValue-&gt;isElementNode());
-    return toElement(returnValue); 
</del><ins>+    ASSERT_WITH_SECURITY_IMPLICATION(!returnValue || is&lt;Element&gt;(returnValue));
+    return downcast&lt;Element&gt;(returnValue); 
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Step 3 of http://www.whatwg.org/specs/web-apps/current-work/multipage/apis-in-html-documents.html#insertadjacenthtml()
</span><span class="lines">@@ -651,12 +651,12 @@
</span><span class="cx"> {
</span><span class="cx">     if (equalIgnoringCase(where, &quot;beforeBegin&quot;) || equalIgnoringCase(where, &quot;afterEnd&quot;)) {
</span><span class="cx">         ContainerNode* parent = element-&gt;parentNode();
</span><del>-        if (parent &amp;&amp; !parent-&gt;isElementNode()) {
</del><ins>+        if (parent &amp;&amp; !is&lt;Element&gt;(parent)) {
</ins><span class="cx">             ec = NO_MODIFICATION_ALLOWED_ERR;
</span><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><del>-        ASSERT_WITH_SECURITY_IMPLICATION(!parent || parent-&gt;isElementNode());
-        return toElement(parent);
</del><ins>+        ASSERT_WITH_SECURITY_IMPLICATION(!parent || is&lt;Element&gt;(parent));
+        return downcast&lt;Element&gt;(parent);
</ins><span class="cx">     }
</span><span class="cx">     if (equalIgnoringCase(where, &quot;afterBegin&quot;) || equalIgnoringCase(where, &quot;beforeEnd&quot;))
</span><span class="cx">         return element;
</span><span class="lines">@@ -934,14 +934,14 @@
</span><span class="cx">     while (node) {
</span><span class="cx">         // Skip bdi, script, style and text form controls.
</span><span class="cx">         if (equalIgnoringCase(node-&gt;nodeName(), &quot;bdi&quot;) || node-&gt;hasTagName(scriptTag) || node-&gt;hasTagName(styleTag) 
</span><del>-            || (node-&gt;isElementNode() &amp;&amp; toElement(node)-&gt;isTextFormControl())) {
</del><ins>+            || (is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(*node).isTextFormControl())) {
</ins><span class="cx">             node = NodeTraversal::nextSkippingChildren(node, this);
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Skip elements with valid dir attribute
</span><del>-        if (node-&gt;isElementNode()) {
-            AtomicString dirAttributeValue = toElement(node)-&gt;fastGetAttribute(dirAttr);
</del><ins>+        if (is&lt;Element&gt;(node)) {
+            AtomicString dirAttributeValue = downcast&lt;Element&gt;(*node).fastGetAttribute(dirAttr);
</ins><span class="cx">             if (isLTROrRTLIgnoringCase(dirAttributeValue) || equalIgnoringCase(dirAttributeValue, &quot;auto&quot;)) {
</span><span class="cx">                 node = NodeTraversal::nextSkippingChildren(node, this);
</span><span class="cx">                 continue;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(HTMLFormControlElement)
</span><span class="cx">     static bool isHTMLFormControlElement(const Element&amp; element) { return element.isFormControlElement(); }
</span><del>-    static bool isHTMLFormControlElement(const Node&amp; node) { return node.isElementNode() &amp;&amp; toElement(node).isFormControlElement(); }
</del><ins>+    static bool isHTMLFormControlElement(const Node&amp; node) { return is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(node).isFormControlElement(); }
</ins><span class="cx">     static bool isHTMLFormControlElement(const FormAssociatedElement&amp; element) { return element.isFormControlElement(); }
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -911,7 +911,7 @@
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(HTMLMediaElement)
</span><span class="cx">     static bool isHTMLMediaElement(const Element&amp; element) { return element.isMediaElement(); }
</span><del>-    static bool isHTMLMediaElement(const Node&amp; node) { return node.isElementNode() &amp;&amp; isHTMLMediaElement(toElement(node)); }
</del><ins>+    static bool isHTMLMediaElement(const Node&amp; node) { return is&lt;Element&gt;(node) &amp;&amp; isHTMLMediaElement(downcast&lt;Element&gt;(node)); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -423,10 +423,10 @@
</span><span class="cx">     bool isNamedItem = true;
</span><span class="cx">     Node* child = firstChild();
</span><span class="cx">     while (child &amp;&amp; isNamedItem) {
</span><del>-        if (child-&gt;isElementNode()) {
-            Element* element = toElement(child);
</del><ins>+        if (is&lt;Element&gt;(child)) {
+            Element&amp; element = downcast&lt;Element&gt;(*child);
</ins><span class="cx">             // FIXME: Use of isRecognizedTagName is almost certainly wrong here.
</span><del>-            if (isRecognizedTagName(element-&gt;tagQName()) &amp;&amp; !element-&gt;hasTagName(paramTag))
</del><ins>+            if (isRecognizedTagName(element.tagQName()) &amp;&amp; !element.hasTagName(paramTag))
</ins><span class="cx">                 isNamedItem = false;
</span><span class="cx">         } else if (is&lt;Text&gt;(child)) {
</span><span class="cx">             if (!downcast&lt;Text&gt;(*child).containsOnlyWhitespace())
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOptionElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOptionElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -338,10 +338,10 @@
</span><span class="cx"> {
</span><span class="cx">     StringBuilder text;
</span><span class="cx">     for (Node* node = firstChild(); node; ) {
</span><del>-        if (node-&gt;isTextNode())
</del><ins>+        if (is&lt;Text&gt;(node))
</ins><span class="cx">             text.append(node-&gt;nodeValue());
</span><span class="cx">         // Text nodes inside script elements are not part of the option text.
</span><del>-        if (node-&gt;isElementNode() &amp;&amp; toScriptElementIfPossible(toElement(node)))
</del><ins>+        if (is&lt;Element&gt;(node) &amp;&amp; toScriptElementIfPossible(downcast&lt;Element&gt;(node)))
</ins><span class="cx">             node = NodeTraversal::nextSkippingChildren(node, this);
</span><span class="cx">         else
</span><span class="cx">             node = NodeTraversal::next(node, this);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSourceElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSourceElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSourceElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLSourceElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -63,8 +63,8 @@
</span><span class="cx"> void HTMLSourceElement::removedFrom(ContainerNode&amp; removalRoot)
</span><span class="cx"> {
</span><span class="cx">     Element* parent = parentElement();
</span><del>-    if (!parent &amp;&amp; removalRoot.isElementNode())
-        parent = &amp;toElement(removalRoot);
</del><ins>+    if (!parent &amp;&amp; is&lt;Element&gt;(removalRoot))
+        parent = &amp;downcast&lt;Element&gt;(removalRoot);
</ins><span class="cx">     if (parent &amp;&amp; is&lt;HTMLMediaElement&gt;(parent))
</span><span class="cx">         downcast&lt;HTMLMediaElement&gt;(*parent).sourceWasRemoved(this);
</span><span class="cx">     HTMLElement::removedFrom(removalRoot);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSummaryElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSummaryElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSummaryElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLSummaryElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -102,12 +102,12 @@
</span><span class="cx"> 
</span><span class="cx"> static bool isClickableControl(Node* node)
</span><span class="cx"> {
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><del>-    Element* element = toElement(node);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">     if (is&lt;HTMLFormControlElement&gt;(element))
</span><span class="cx">         return true;
</span><del>-    Element* host = element-&gt;shadowHost();
</del><ins>+    Element* host = element.shadowHost();
</ins><span class="cx">     return host &amp;&amp; is&lt;HTMLFormControlElement&gt;(host);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(HTMLTextFormControlElement)
</span><span class="cx">     static bool isHTMLTextFormControlElement(const Element&amp; element) { return element.isTextFormControl(); }
</span><del>-    static bool isHTMLTextFormControlElement(const Node&amp; node) { return node.isElementNode() &amp;&amp; isHTMLTextFormControlElement(toElement(node)); }
</del><ins>+    static bool isHTMLTextFormControlElement(const Node&amp; node) { return is&lt;Element&gt;(node) &amp;&amp; isHTMLTextFormControlElement(downcast&lt;Element&gt;(node)); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx"> 
</span><span class="cx"> HTMLTextFormControlElement* enclosingTextFormControl(const Position&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLConstructionSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLConstructionSite::attachLater(ContainerNode* parent, PassRefPtr&lt;Node&gt; prpChild, bool selfClosing)
</span><span class="cx"> {
</span><del>-    ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !prpChild.get()-&gt;isElementNode() || !toScriptElementIfPossible(toElement(prpChild.get())));
</del><ins>+    ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is&lt;Element&gt;(prpChild.get()) || !toScriptElementIfPossible(downcast&lt;Element&gt;(prpChild.get())));
</ins><span class="cx">     ASSERT(pluginContentIsAllowed(m_parserContentPolicy) || !prpChild-&gt;isPluginElement());
</span><span class="cx"> 
</span><span class="cx">     HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLElementStackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLElementStack.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLElementStack.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/parser/HTMLElementStack.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -541,7 +541,7 @@
</span><span class="cx"> Element* HTMLElementStack::htmlElement() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_rootNode);
</span><del>-    return toElement(m_rootNode);
</del><ins>+    return downcast&lt;Element&gt;(m_rootNode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Element* HTMLElementStack::headElement() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLStackItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLStackItem.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLStackItem.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/parser/HTMLStackItem.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">         return adoptRef(new HTMLStackItem(node, token, namespaceURI));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Element* element() const { return toElement(m_node.get()); }
</del><ins>+    Element* element() const { return downcast&lt;Element&gt;(m_node.get()); }
</ins><span class="cx">     ContainerNode* node() const { return m_node.get(); }
</span><span class="cx"> 
</span><span class="cx">     bool isDocumentFragmentNode() const { return m_isDocumentFragmentNode; }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowInsertionPointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/InsertionPoint.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/InsertionPoint.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/shadow/InsertionPoint.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -100,11 +100,11 @@
</span><span class="cx"> inline Element* parentElementForDistribution(const Node* node)
</span><span class="cx"> {
</span><span class="cx">     if (Node* parent = parentNodeForDistribution(node)) {
</span><del>-        if (parent-&gt;isElementNode())
-            return toElement(parent);
</del><ins>+        if (is&lt;Element&gt;(parent))
+            return downcast&lt;Element&gt;(parent);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline ShadowRoot* shadowRootOfParentForDistribution(const Node* node)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">     if (Element* parent = parentElementForDistribution(node))
</span><span class="cx">         return parent-&gt;shadowRoot();
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InsertionPoint* findInsertionPointOf(const Node*);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowMediaControlElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -689,7 +689,7 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     if (event-&gt;type() == eventNames().clickEvent) {
</span><span class="cx">         Node* target = event-&gt;target()-&gt;toNode();
</span><del>-        if (!target || !target-&gt;isElementNode())
</del><ins>+        if (!target || !is&lt;Element&gt;(target))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         // When we created the elements in the track list, we gave them a custom
</span><span class="lines">@@ -698,7 +698,7 @@
</span><span class="cx">         // tell the HTMLMediaElement to enable that track.
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;TextTrack&gt; textTrack;
</span><del>-        MenuItemToTrackMap::iterator iter = m_menuToTrackMap.find(toElement(target));
</del><ins>+        MenuItemToTrackMap::iterator iter = m_menuToTrackMap.find(downcast&lt;Element&gt;(target));
</ins><span class="cx">         if (iter != m_menuToTrackMap.end())
</span><span class="cx">             textTrack = iter-&gt;value;
</span><span class="cx">         m_menuToTrackMap.clear();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -770,7 +770,7 @@
</span><span class="cx">             downcast&lt;WebVTTElement&gt;(*child).setIsPastNode(isPastNode);
</span><span class="cx">             // Make an elemenet id match a cue id for style matching purposes.
</span><span class="cx">             if (!id().isEmpty())
</span><del>-                toElement(child)-&gt;setIdAttribute(id());
</del><ins>+                downcast&lt;WebVTTElement&gt;(*child).setIdAttribute(id());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorDOMPatchSupportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/DOMPatchSupport.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/DOMPatchSupport.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/inspector/DOMPatchSupport.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -181,8 +181,8 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     // Patch attributes
</span><del>-    Element* oldElement = toElement(oldNode);
-    Element* newElement = toElement(newNode);
</del><ins>+    Element* oldElement = downcast&lt;Element&gt;(oldNode);
+    Element* newElement = downcast&lt;Element&gt;(newNode);
</ins><span class="cx">     if (oldDigest-&gt;m_attrsSHA1 != newDigest-&gt;m_attrsSHA1) {
</span><span class="cx">         // FIXME: Create a function in Element for removing all properties. Take in account whether did/willModifyAttribute are important.
</span><span class="cx">         if (oldElement-&gt;hasAttributesWithoutUpdate()) {
</span><span class="lines">@@ -426,7 +426,7 @@
</span><span class="cx">             child = child-&gt;nextSibling();
</span><span class="cx">             digest-&gt;m_children.append(WTF::move(childInfo));
</span><span class="cx">         }
</span><del>-        Element* element = toElement(node);
</del><ins>+        Element* element = downcast&lt;Element&gt;(node);
</ins><span class="cx"> 
</span><span class="cx">         if (element-&gt;hasAttributesWithoutUpdate()) {
</span><span class="cx">             SHA1 attrsSHA1;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -896,11 +896,11 @@
</span><span class="cx">         *errorString = &quot;No node with given id found&quot;;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-    if (!node-&gt;isElementNode()) {
</del><ins>+    if (!is&lt;Element&gt;(node)) {
</ins><span class="cx">         *errorString = &quot;Not an element node&quot;;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int InspectorCSSAgent::documentNodeWithRequestedFlowsId(Document* document)
</span><span class="lines">@@ -1108,7 +1108,7 @@
</span><span class="cx">     for (unsigned i = 0; i &lt; regionList-&gt;length(); ++i) {
</span><span class="cx">         Inspector::Protocol::CSS::Region::RegionOverset regionOverset;
</span><span class="cx"> 
</span><del>-        switch (toElement(regionList-&gt;item(i))-&gt;regionOversetState()) {
</del><ins>+        switch (downcast&lt;Element&gt;(regionList-&gt;item(i))-&gt;regionOversetState()) {
</ins><span class="cx">         case RegionFit:
</span><span class="cx">             regionOverset = Inspector::Protocol::CSS::Region::RegionOverset::Fit;
</span><span class="cx">             break;
</span><span class="lines">@@ -1201,7 +1201,7 @@
</span><span class="cx"> {
</span><span class="cx">     HashSet&lt;Document*&gt; documentsToChange;
</span><span class="cx">     for (NodeIdToForcedPseudoState::iterator it = m_nodeIdToForcedPseudoState.begin(), end = m_nodeIdToForcedPseudoState.end(); it != end; ++it) {
</span><del>-        if (Element* element = toElement(m_domAgent-&gt;nodeForId(it-&gt;key)))
</del><ins>+        if (Element* element = downcast&lt;Element&gt;(m_domAgent-&gt;nodeForId(it-&gt;key)))
</ins><span class="cx">             documentsToChange.add(&amp;element-&gt;document());
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -339,8 +339,8 @@
</span><span class="cx">             unbind(contentDocument, nodesMap);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (node-&gt;isElementNode()) {
-        if (ShadowRoot* root = toElement(node)-&gt;shadowRoot())
</del><ins>+    if (is&lt;Element&gt;(node)) {
+        if (ShadowRoot* root = downcast&lt;Element&gt;(*node).shadowRoot())
</ins><span class="cx">             unbind(root, nodesMap);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -387,11 +387,11 @@
</span><span class="cx">     Node* node = assertNode(errorString, nodeId);
</span><span class="cx">     if (!node)
</span><span class="cx">         return nullptr;
</span><del>-    if (!node-&gt;isElementNode()) {
</del><ins>+    if (!is&lt;Element&gt;(node)) {
</ins><span class="cx">         *errorString = &quot;Node is not an Element&quot;;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-    return toElement(node);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Node* InspectorDOMAgent::assertEditableNode(ErrorString* errorString, int nodeId)
</span><span class="lines">@@ -671,7 +671,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Element* childElement = toElement(child);
</del><ins>+    Element* childElement = downcast&lt;Element&gt;(child);
</ins><span class="cx">     if (!childElement-&gt;hasAttributes() &amp;&amp; name) {
</span><span class="cx">         m_domEditor-&gt;removeAttribute(element, *name, errorString);
</span><span class="cx">         return;
</span><span class="lines">@@ -718,7 +718,7 @@
</span><span class="cx">     *newId = 0;
</span><span class="cx"> 
</span><span class="cx">     Node* oldNode = nodeForId(nodeId);
</span><del>-    if (!oldNode || !oldNode-&gt;isElementNode())
</del><ins>+    if (!oldNode || !is&lt;Element&gt;(oldNode))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="lines">@@ -727,7 +727,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Copy over the original node's attributes.
</span><del>-    newElem-&gt;cloneAttributesFromElement(*toElement(oldNode));
</del><ins>+    newElem-&gt;cloneAttributesFromElement(*downcast&lt;Element&gt;(oldNode));
</ins><span class="cx"> 
</span><span class="cx">     // Copy over the original node's children.
</span><span class="cx">     Node* child;
</span><span class="lines">@@ -1269,11 +1269,11 @@
</span><span class="cx">             value-&gt;setChildren(children.release());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (node-&gt;isElementNode()) {
-        Element* element = toElement(node);
-        value-&gt;setAttributes(buildArrayForElementAttributes(element));
-        if (is&lt;HTMLFrameOwnerElement&gt;(node)) {
-            HTMLFrameOwnerElement&amp; frameOwner = downcast&lt;HTMLFrameOwnerElement&gt;(*node);
</del><ins>+    if (is&lt;Element&gt;(node)) {
+        Element&amp; element = downcast&lt;Element&gt;(*node);
+        value-&gt;setAttributes(buildArrayForElementAttributes(&amp;element));
+        if (is&lt;HTMLFrameOwnerElement&gt;(element)) {
+            HTMLFrameOwnerElement&amp; frameOwner = downcast&lt;HTMLFrameOwnerElement&gt;(element);
</ins><span class="cx">             Frame* frame = frameOwner.contentFrame();
</span><span class="cx">             if (frame)
</span><span class="cx">                 value-&gt;setFrameId(m_pageAgent-&gt;frameId(frame));
</span><span class="lines">@@ -1282,7 +1282,7 @@
</span><span class="cx">                 value-&gt;setContentDocument(buildObjectForNode(document, 0, nodesMap));
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (ShadowRoot* root = element-&gt;shadowRoot()) {
</del><ins>+        if (ShadowRoot* root = element.shadowRoot()) {
</ins><span class="cx">             RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::DOM::Node&gt;&gt; shadowRoots = Inspector::Protocol::Array&lt;Inspector::Protocol::DOM::Node&gt;::create();
</span><span class="cx">             shadowRoots-&gt;addItem(buildObjectForNode(root, 0, nodesMap));
</span><span class="cx">             value-&gt;setShadowRoots(shadowRoots);
</span><span class="lines">@@ -1290,7 +1290,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TEMPLATE_ELEMENT)
</span><span class="cx">         if (is&lt;HTMLTemplateElement&gt;(element))
</span><del>-            value-&gt;setTemplateContent(buildObjectForNode(downcast&lt;HTMLTemplateElement&gt;(*element).content(), 0, nodesMap));
</del><ins>+            value-&gt;setTemplateContent(buildObjectForNode(downcast&lt;HTMLTemplateElement&gt;(element).content(), 0, nodesMap));
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     } else if (is&lt;Document&gt;(node)) {
</span><span class="lines">@@ -1522,8 +1522,8 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             
</span><del>-            if (node-&gt;isElementNode()) {
-                supportsFocused = toElement(node)-&gt;isFocusable();
</del><ins>+            if (is&lt;Element&gt;(node)) {
+                supportsFocused = downcast&lt;Element&gt;(*node).isFocusable();
</ins><span class="cx">                 if (supportsFocused)
</span><span class="cx">                     focused = axObject-&gt;isFocused();
</span><span class="cx">             }
</span><span class="lines">@@ -1884,7 +1884,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_revalidateStyleAttrTask)
</span><span class="cx">         m_revalidateStyleAttrTask = std::make_unique&lt;RevalidateStyleAttributeTask&gt;(this);
</span><del>-    m_revalidateStyleAttrTask-&gt;scheduleFor(toElement(node));
</del><ins>+    m_revalidateStyleAttrTask-&gt;scheduleFor(downcast&lt;Element&gt;(node));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDOMAgent::didPushShadowRoot(Element* host, ShadowRoot* root)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorNodeFindercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case Node::ELEMENT_NODE: {
</span><del>-            if (matchesElement(*toElement(node)))
</del><ins>+            if (matchesElement(downcast&lt;Element&gt;(*node)))
</ins><span class="cx">                 m_results.add(node);
</span><span class="cx"> 
</span><span class="cx">             // Search inside frame elements.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -676,19 +676,19 @@
</span><span class="cx"> 
</span><span class="cx"> static PassRefPtr&lt;InspectorObject&gt; buildObjectForElementInfo(Node* node)
</span><span class="cx"> {
</span><del>-    if (!node-&gt;isElementNode() || !node-&gt;document().frame())
</del><ins>+    if (!is&lt;Element&gt;(node) || !node-&gt;document().frame())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;InspectorObject&gt; elementInfo = InspectorObject::create();
</span><span class="cx"> 
</span><del>-    Element* element = toElement(node);
-    bool isXHTML = element-&gt;document().isXHTMLDocument();
-    elementInfo-&gt;setString(&quot;tagName&quot;, isXHTML ? element-&gt;nodeName() : element-&gt;nodeName().lower());
-    elementInfo-&gt;setString(&quot;idValue&quot;, element-&gt;getIdAttribute());
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
+    bool isXHTML = element.document().isXHTMLDocument();
+    elementInfo-&gt;setString(&quot;tagName&quot;, isXHTML ? element.nodeName() : element.nodeName().lower());
+    elementInfo-&gt;setString(&quot;idValue&quot;, element.getIdAttribute());
</ins><span class="cx">     HashSet&lt;AtomicString&gt; usedClassNames;
</span><del>-    if (element-&gt;hasClass() &amp;&amp; is&lt;StyledElement&gt;(element)) {
</del><ins>+    if (element.hasClass() &amp;&amp; is&lt;StyledElement&gt;(element)) {
</ins><span class="cx">         StringBuilder classNames;
</span><del>-        const SpaceSplitString&amp; classNamesString = downcast&lt;StyledElement&gt;(*element).classNames();
</del><ins>+        const SpaceSplitString&amp; classNamesString = downcast&lt;StyledElement&gt;(element).classNames();
</ins><span class="cx">         size_t classNameCount = classNamesString.size();
</span><span class="cx">         for (size_t i = 0; i &lt; classNameCount; ++i) {
</span><span class="cx">             const AtomicString&amp; className = classNamesString[i];
</span><span class="lines">@@ -701,7 +701,7 @@
</span><span class="cx">         elementInfo-&gt;setString(&quot;className&quot;, classNames.toString());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RenderElement* renderer = element-&gt;renderer();
</del><ins>+    RenderElement* renderer = element.renderer();
</ins><span class="cx">     Frame* containingFrame = node-&gt;document().frame();
</span><span class="cx">     FrameView* containingView = containingFrame-&gt;view();
</span><span class="cx">     IntRect boundingBox = snappedIntRect(containingView-&gt;contentsToRootView(renderer-&gt;absoluteBoundingBoxRect()));
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1388,13 +1388,13 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     Node* ownerNode = m_pageStyleSheet-&gt;ownerNode();
</span><del>-    if (!ownerNode || !ownerNode-&gt;isElementNode())
</del><ins>+    if (!ownerNode || !is&lt;Element&gt;(ownerNode))
</ins><span class="cx">         return false;
</span><del>-    Element* ownerElement = toElement(ownerNode);
</del><ins>+    Element&amp; ownerElement = downcast&lt;Element&gt;(*ownerNode);
</ins><span class="cx"> 
</span><span class="cx">     if (!is&lt;HTMLStyleElement&gt;(ownerElement) &amp;&amp; !is&lt;SVGStyleElement&gt;(ownerElement))
</span><span class="cx">         return false;
</span><del>-    *result = ownerElement-&gt;textContent();
</del><ins>+    *result = ownerElement.textContent();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/page/DragController.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -289,13 +289,13 @@
</span><span class="cx">     HitTestResult result(point);
</span><span class="cx">     documentUnderMouse-&gt;renderView()-&gt;hitTest(HitTestRequest(), result);
</span><span class="cx"> 
</span><del>-    Node* n = result.innerNode();
-    while (n &amp;&amp; !n-&gt;isElementNode())
-        n = n-&gt;parentNode();
-    if (n)
-        n = n-&gt;deprecatedShadowAncestorNode();
</del><ins>+    Node* node = result.innerNode();
+    while (node &amp;&amp; !is&lt;Element&gt;(node))
+        node = node-&gt;parentNode();
+    if (node)
+        node = node-&gt;deprecatedShadowAncestorNode();
</ins><span class="cx"> 
</span><del>-    return toElement(n);
</del><ins>+    return downcast&lt;Element&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool DragController::tryDocumentDrag(DragData&amp; dragData, DragDestinationAction actionMask, DragOperation&amp; dragOperation)
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -2186,7 +2186,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool findDropZone(Node* target, DataTransfer* dataTransfer)
</span><span class="cx"> {
</span><del>-    Element* element = target-&gt;isElementNode() ? toElement(target) : target-&gt;parentElement();
</del><ins>+    Element* element = is&lt;Element&gt;(target) ? downcast&lt;Element&gt;(target) : target-&gt;parentElement();
</ins><span class="cx">     for (; element; element = element-&gt;parentElement()) {
</span><span class="cx">         bool matched = false;
</span><span class="cx">         String dropZoneStr = element-&gt;fastGetAttribute(webkitdropzoneAttr);
</span><span class="lines">@@ -2233,10 +2233,10 @@
</span><span class="cx">     RefPtr&lt;Element&gt; newTarget;
</span><span class="cx">     if (Node* targetNode = mouseEvent.targetNode()) {
</span><span class="cx">         // Drag events should never go to non-element nodes (following IE, and proper mouseover/out dispatch)
</span><del>-        if (!targetNode-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(targetNode))
</ins><span class="cx">             newTarget = targetNode-&gt;parentOrShadowHostElement();
</span><span class="cx">         else
</span><del>-            newTarget = toElement(targetNode);
</del><ins>+            newTarget = downcast&lt;Element&gt;(targetNode);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_autoscrollController-&gt;updateDragAndDrop(newTarget.get(), event.position(), event.timestamp());
</span><span class="lines">@@ -2394,10 +2394,10 @@
</span><span class="cx">         targetElement = m_capturingMouseEventsElement.get();
</span><span class="cx">     else if (targetNode) {
</span><span class="cx">         // If the target node is a non-element, dispatch on the parent. &lt;rdar://problem/4196646&gt;
</span><del>-        if (!targetNode-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(targetNode))
</ins><span class="cx">             targetElement = targetNode-&gt;parentOrShadowHostElement();
</span><span class="cx">         else
</span><del>-            targetElement = toElement(targetNode);
</del><ins>+            targetElement = downcast&lt;Element&gt;(targetNode);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_elementUnderMouse = targetElement;
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/page/FocusController.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -103,8 +103,8 @@
</span><span class="cx"> FocusNavigationScope FocusNavigationScope::focusNavigationScopeOwnedByShadowHost(Node* node)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(node);
</span><del>-    ASSERT(toElement(node)-&gt;shadowRoot());
-    return FocusNavigationScope(toElement(node)-&gt;shadowRoot());
</del><ins>+    ASSERT(downcast&lt;Element&gt;(*node).shadowRoot());
+    return FocusNavigationScope(downcast&lt;Element&gt;(*node).shadowRoot());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FocusNavigationScope FocusNavigationScope::focusNavigationScopeOwnedByIFrame(HTMLFrameOwnerElement* frame)
</span><span class="lines">@@ -145,14 +145,14 @@
</span><span class="cx"> 
</span><span class="cx"> static inline bool isFocusableShadowHost(Node&amp; node, KeyboardEvent&amp; event)
</span><span class="cx"> {
</span><del>-    return node.isElementNode() &amp;&amp; toElement(node).isKeyboardFocusable(&amp;event) &amp;&amp; toElement(node).shadowRoot() &amp;&amp; !hasCustomFocusLogic(toElement(node));
</del><ins>+    return is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(node).isKeyboardFocusable(&amp;event) &amp;&amp; downcast&lt;Element&gt;(node).shadowRoot() &amp;&amp; !hasCustomFocusLogic(downcast&lt;Element&gt;(node));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline int adjustedTabIndex(Node&amp; node, KeyboardEvent&amp; event)
</span><span class="cx"> {
</span><del>-    if (!node.isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return 0;
</span><del>-    return isNonFocusableShadowHost(toElement(node), event) ? 0 : toElement(node).tabIndex();
</del><ins>+    return isNonFocusableShadowHost(downcast&lt;Element&gt;(node), event) ? 0 : downcast&lt;Element&gt;(node).tabIndex();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool shouldVisit(Element&amp; element, KeyboardEvent&amp; event)
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx"> 
</span><span class="cx"> Element* FocusController::findFocusableElementAcrossFocusScope(FocusDirection direction, FocusNavigationScope scope, Node* currentNode, KeyboardEvent* event)
</span><span class="cx"> {
</span><del>-    ASSERT(!currentNode || !currentNode-&gt;isElementNode() || !isNonFocusableShadowHost(*toElement(currentNode), *event));
</del><ins>+    ASSERT(!currentNode || !is&lt;Element&gt;(currentNode) || !isNonFocusableShadowHost(*downcast&lt;Element&gt;(currentNode), *event));
</ins><span class="cx">     Element* found;
</span><span class="cx">     if (currentNode &amp;&amp; direction == FocusDirectionForward &amp;&amp; isFocusableShadowHost(*currentNode, *event)) {
</span><span class="cx">         Element* foundInInnerFocusScope = findFocusableElementRecursively(direction, FocusNavigationScope::focusNavigationScopeOwnedByShadowHost(currentNode), 0, event);
</span><span class="lines">@@ -410,9 +410,9 @@
</span><span class="cx">     // Search is inclusive of start
</span><span class="cx">     using namespace NodeRenderingTraversal;
</span><span class="cx">     for (Node* node = start; node; node = direction == FocusDirectionForward ? nextInScope(node) : previousInScope(node)) {
</span><del>-        if (!node-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><del>-        Element&amp; element = toElement(*node);
</del><ins>+        Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">         if (shouldVisit(element, *event) &amp;&amp; adjustedTabIndex(element, *event) == tabIndex)
</span><span class="cx">             return &amp;element;
</span><span class="cx">     }
</span><span class="lines">@@ -425,9 +425,9 @@
</span><span class="cx">     int winningTabIndex = std::numeric_limits&lt;short&gt;::max() + 1;
</span><span class="cx">     Element* winner = nullptr;
</span><span class="cx">     for (Node* node = start; node; node = NodeRenderingTraversal::nextInScope(node)) {
</span><del>-        if (!node-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><del>-        Element&amp; element = toElement(*node);
</del><ins>+        Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">         if (shouldVisit(element, event) &amp;&amp; element.tabIndex() &gt; tabIndex &amp;&amp; element.tabIndex() &lt; winningTabIndex) {
</span><span class="cx">             winner = &amp;element;
</span><span class="cx">             winningTabIndex = element.tabIndex();
</span><span class="lines">@@ -443,9 +443,9 @@
</span><span class="cx">     int winningTabIndex = 0;
</span><span class="cx">     Element* winner = nullptr;
</span><span class="cx">     for (Node* node = start; node; node = NodeRenderingTraversal::previousInScope(node)) {
</span><del>-        if (!node-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><del>-        Element&amp; element = toElement(*node);
</del><ins>+        Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">         int currentTabIndex = adjustedTabIndex(element, event);
</span><span class="cx">         if ((shouldVisit(element, event) || isNonFocusableShadowHost(element, event)) &amp;&amp; currentTabIndex &lt; tabIndex &amp;&amp; currentTabIndex &gt; winningTabIndex) {
</span><span class="cx">             winner = &amp;element;
</span><span class="lines">@@ -464,9 +464,9 @@
</span><span class="cx">         // If a node is excluded from the normal tabbing cycle, the next focusable node is determined by tree order
</span><span class="cx">         if (tabIndex &lt; 0) {
</span><span class="cx">             for (Node* node = nextInScope(start); node; node = nextInScope(node)) {
</span><del>-                if (!node-&gt;isElementNode())
</del><ins>+                if (!is&lt;Element&gt;(node))
</ins><span class="cx">                     continue;
</span><del>-                Element&amp; element = toElement(*node);
</del><ins>+                Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">                 if (shouldVisit(element, *event) &amp;&amp; adjustedTabIndex(element, *event) &gt;= 0)
</span><span class="cx">                     return &amp;element;
</span><span class="cx">             }
</span><span class="lines">@@ -516,9 +516,9 @@
</span><span class="cx">     // However, if a node is excluded from the normal tabbing cycle, the previous focusable node is determined by tree order
</span><span class="cx">     if (startingTabIndex &lt; 0) {
</span><span class="cx">         for (Node* node = startingNode; node; node = previousInScope(node)) {
</span><del>-            if (!node-&gt;isElementNode())
</del><ins>+            if (!is&lt;Element&gt;(node))
</ins><span class="cx">                 continue;
</span><del>-            Element&amp; element = toElement(*node);
</del><ins>+            Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">             if (shouldVisit(element, *event) &amp;&amp; adjustedTabIndex(element, *event) &gt;= 0)
</span><span class="cx">                 return &amp;element;
</span><span class="cx">         }
</span><span class="lines">@@ -860,7 +860,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // We found a new focus node, navigate to it.
</span><del>-    Element* element = toElement(focusCandidate.focusableNode);
</del><ins>+    Element* element = downcast&lt;Element&gt;(focusCandidate.focusableNode);
</ins><span class="cx">     ASSERT(element);
</span><span class="cx"> 
</span><span class="cx">     element-&gt;focus(false, direction);
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageSerializercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageSerializer.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageSerializer.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/page/PageSerializer.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -222,10 +222,10 @@
</span><span class="cx"> 
</span><span class="cx">     for (Vector&lt;Node*&gt;::iterator iter = nodes.begin(); iter != nodes.end(); ++iter) {
</span><span class="cx">         Node* node = *iter;
</span><del>-        if (!node-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        Element&amp; element = toElement(*node);
</del><ins>+        Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx">         // We have to process in-line style as it might contain some resources (typically background images).
</span><span class="cx">         if (is&lt;StyledElement&gt;(element))
</span><span class="cx">             retrieveResourcesForProperties(downcast&lt;StyledElement&gt;(element).inlineStyle(), document);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/HitTestResult.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/HitTestResult.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -223,10 +223,11 @@
</span><span class="cx">     // Find the title in the nearest enclosing DOM node.
</span><span class="cx">     // For &lt;area&gt; tags in image maps, walk the tree for the &lt;area&gt;, not the &lt;img&gt; using it.
</span><span class="cx">     for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = titleNode-&gt;parentNode()) {
</span><del>-        if (titleNode-&gt;isElementNode()) {
-            String title = toElement(titleNode)-&gt;title();
</del><ins>+        if (is&lt;Element&gt;(titleNode)) {
+            Element&amp; titleElement = downcast&lt;Element&gt;(*titleNode);
+            String title = titleElement.title();
</ins><span class="cx">             if (!title.isEmpty()) {
</span><del>-                if (auto renderer = titleNode-&gt;renderer())
</del><ins>+                if (auto renderer = titleElement.renderer())
</ins><span class="cx">                     dir = renderer-&gt;style().direction();
</span><span class="cx">                 return title;
</span><span class="cx">             }
</span><span class="lines">@@ -238,17 +239,17 @@
</span><span class="cx"> String HitTestResult::innerTextIfTruncated(TextDirection&amp; dir) const
</span><span class="cx"> {
</span><span class="cx">     for (Node* truncatedNode = m_innerNode.get(); truncatedNode; truncatedNode = truncatedNode-&gt;parentNode()) {
</span><del>-        if (!truncatedNode-&gt;isElementNode())
</del><ins>+        if (!is&lt;Element&gt;(truncatedNode))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (auto renderer = toElement(truncatedNode)-&gt;renderer()) {
</del><ins>+        if (auto renderer = downcast&lt;Element&gt;(*truncatedNode).renderer()) {
</ins><span class="cx">             if (renderer-&gt;isRenderBlockFlow()) {
</span><span class="cx">                 RenderBlockFlow* block = toRenderBlockFlow(renderer);
</span><span class="cx">                 if (block-&gt;style().textOverflow()) {
</span><span class="cx">                     for (RootInlineBox* line = block-&gt;firstRootBox(); line; line = line-&gt;nextRootBox()) {
</span><span class="cx">                         if (line-&gt;hasEllipsisBox()) {
</span><span class="cx">                             dir = block-&gt;style().direction();
</span><del>-                            return toElement(truncatedNode)-&gt;innerText();
</del><ins>+                            return downcast&lt;Element&gt;(*truncatedNode).innerText();
</ins><span class="cx">                         }
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="lines">@@ -322,7 +323,7 @@
</span><span class="cx">         || is&lt;HTMLInputElement&gt;(*m_innerNonSharedNode)
</span><span class="cx">         || is&lt;HTMLObjectElement&gt;(*m_innerNonSharedNode)
</span><span class="cx">         || is&lt;SVGImageElement&gt;(*m_innerNonSharedNode)) {
</span><del>-        urlString = toElement(*m_innerNonSharedNode).imageSourceURL();
</del><ins>+        urlString = downcast&lt;Element&gt;(*m_innerNonSharedNode).imageSourceURL();
</ins><span class="cx">     } else
</span><span class="cx">         return URL();
</span><span class="cx"> 
</span><span class="lines">@@ -674,9 +675,9 @@
</span><span class="cx"> {
</span><span class="cx">     Node* node = m_innerNode.get();
</span><span class="cx">     if (!node)
</span><del>-        return 0;
-    if (node-&gt;isElementNode())
-        return toElement(node);
</del><ins>+        return nullptr;
+    if (is&lt;Element&gt;(node))
+        return downcast&lt;Element&gt;(node);
</ins><span class="cx">     return node-&gt;parentElement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -684,9 +685,9 @@
</span><span class="cx"> {
</span><span class="cx">     Node* node = m_innerNonSharedNode.get();
</span><span class="cx">     if (!node)
</span><del>-        return 0;
-    if (node-&gt;isElementNode())
-        return toElement(node);
</del><ins>+        return nullptr;
+    if (is&lt;Element&gt;(node))
+        return downcast&lt;Element&gt;(node);
</ins><span class="cx">     return node-&gt;parentElement();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderDeprecatedFlexibleBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">     RenderDeprecatedFlexibleBox(Element&amp;, PassRef&lt;RenderStyle&gt;);
</span><span class="cx">     virtual ~RenderDeprecatedFlexibleBox();
</span><span class="cx"> 
</span><del>-    Element&amp; element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+    Element&amp; element() const { return downcast&lt;Element&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     virtual const char* renderName() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderDetailsMarkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><ins>+#include &quot;HTMLDetailsElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><span class="lines">@@ -143,8 +144,8 @@
</span><span class="cx">     for (RenderObject* renderer = parent(); renderer; renderer = renderer-&gt;parent()) {
</span><span class="cx">         if (!renderer-&gt;node())
</span><span class="cx">             continue;
</span><del>-        if (renderer-&gt;node()-&gt;hasTagName(detailsTag))
-            return !toElement(renderer-&gt;node())-&gt;getAttribute(openAttr).isNull();
</del><ins>+        if (is&lt;HTMLDetailsElement&gt;(renderer-&gt;node()))
+            return !downcast&lt;HTMLDetailsElement&gt;(*renderer-&gt;node()).getAttribute(openAttr).isNull();
</ins><span class="cx">         if (is&lt;HTMLInputElement&gt;(renderer-&gt;node()))
</span><span class="cx">             return true;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -48,8 +48,8 @@
</span><span class="cx">     void setAnimatableStyle(PassRef&lt;RenderStyle&gt;);
</span><span class="cx"> 
</span><span class="cx">     // This is null for anonymous renderers.
</span><del>-    Element* element() const { return toElement(RenderObject::node()); }
-    Element* nonPseudoElement() const { return toElement(RenderObject::nonPseudoNode()); }
</del><ins>+    Element* element() const { return downcast&lt;Element&gt;(RenderObject::node()); }
+    Element* nonPseudoElement() const { return downcast&lt;Element&gt;(RenderObject::nonPseudoNode()); }
</ins><span class="cx">     Element* generatingElement() const;
</span><span class="cx"> 
</span><span class="cx">     RenderObject* firstChild() const { return m_firstChild; }
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (parent() &amp;&amp; isRenderNamedFlowFragment())
</span><span class="cx">         return parent()-&gt;generatingElement();
</span><del>-    return toElement(RenderObject::generatingNode());
</del><ins>+    return downcast&lt;Element&gt;(RenderObject::generatingNode());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline bool RenderObject::isRenderLayerModelObject() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderGrid.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     RenderGrid(Element&amp;, PassRef&lt;RenderStyle&gt;);
</span><span class="cx">     virtual ~RenderGrid();
</span><span class="cx"> 
</span><del>-    Element&amp; element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+    Element&amp; element() const { return downcast&lt;Element&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1680,7 +1680,7 @@
</span><span class="cx">     if (!renderer-&gt;isEmbeddedObject())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    Element* element = toElement(renderer-&gt;node());
</del><ins>+    Element* element = downcast&lt;Element&gt;(renderer-&gt;node());
</ins><span class="cx">     if (!element || !is&lt;HTMLPlugInElement&gt;(element))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListItem.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListItem.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderListItem.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> class RenderListItem final : public RenderBlockFlow {
</span><span class="cx"> public:
</span><span class="cx">     RenderListItem(Element&amp;, PassRef&lt;RenderStyle&gt;);
</span><del>-    Element&amp; element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+    Element&amp; element() const { return downcast&lt;Element&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     int value() const { if (!m_isValueUpToDate) updateValueNow(); return m_value; }
</span><span class="cx">     void updateValue();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderNamedFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -545,13 +545,13 @@
</span><span class="cx">     if (!child.node())
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    ASSERT(child.node()-&gt;isElementNode());
</del><ins>+    ASSERT(is&lt;Element&gt;(child.node()));
</ins><span class="cx"> 
</span><span class="cx">     Node* originalParent = NodeRenderingTraversal::parent(child.node());
</span><del>-    if (!originalParent || !originalParent-&gt;isElementNode() || !originalParent-&gt;renderer())
</del><ins>+    if (!originalParent || !is&lt;Element&gt;(originalParent) || !originalParent-&gt;renderer())
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    return toElement(originalParent)-&gt;renderer()-&gt;isChildAllowed(child, style);
</del><ins>+    return downcast&lt;Element&gt;(*originalParent).renderer()-&gt;isChildAllowed(child, style);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded()
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1033,13 +1033,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (urlRect.isEmpty())
</span><span class="cx">         return;
</span><del>-    Node* n = node();
-    if (!n || !n-&gt;isLink() || !n-&gt;isElementNode())
</del><ins>+    Node* node = this-&gt;node();
+    if (!node || !node-&gt;isLink() || !is&lt;Element&gt;(node))
</ins><span class="cx">         return;
</span><del>-    const AtomicString&amp; href = toElement(n)-&gt;getAttribute(hrefAttr);
</del><ins>+    const AtomicString&amp; href = downcast&lt;Element&gt;(*node).getAttribute(hrefAttr);
</ins><span class="cx">     if (href.isNull())
</span><span class="cx">         return;
</span><del>-    paintInfo.context-&gt;setURLForRect(n-&gt;document().completeURL(href), snappedIntRect(urlRect));
</del><ins>+    paintInfo.context-&gt;setURLForRect(node-&gt;document().completeURL(href), snappedIntRect(urlRect));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderObject::paintOutline(PaintInfo&amp; paintInfo, const LayoutRect&amp; paintRect)
</span><span class="lines">@@ -2141,7 +2141,7 @@
</span><span class="cx"> {
</span><span class="cx">     bool valueChanged = (dragOn != isDragging());
</span><span class="cx">     setIsDragging(dragOn);
</span><del>-    if (valueChanged &amp;&amp; node() &amp;&amp; (style().affectedByDrag() || (node()-&gt;isElementNode() &amp;&amp; toElement(node())-&gt;childrenAffectedByDrag())))
</del><ins>+    if (valueChanged &amp;&amp; node() &amp;&amp; (style().affectedByDrag() || (is&lt;Element&gt;(node()) &amp;&amp; downcast&lt;Element&gt;(*node()).childrenAffectedByDrag())))
</ins><span class="cx">         node()-&gt;setNeedsStyleRecalc();
</span><span class="cx">     for (RenderObject* curr = firstChildSlow(); curr; curr = curr-&gt;nextSibling())
</span><span class="cx">         curr-&gt;updateDragState(dragOn);
</span><span class="lines">@@ -2225,7 +2225,7 @@
</span><span class="cx"> PassRefPtr&lt;RenderStyle&gt; RenderObject::getUncachedPseudoStyle(const PseudoStyleRequest&amp; pseudoStyleRequest, RenderStyle* parentStyle, RenderStyle* ownStyle) const
</span><span class="cx"> {
</span><span class="cx">     if (pseudoStyleRequest.pseudoId &lt; FIRST_INTERNAL_PSEUDOID &amp;&amp; !ownStyle &amp;&amp; !style().hasPseudoStyle(pseudoStyleRequest.pseudoId))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     
</span><span class="cx">     if (!parentStyle) {
</span><span class="cx">         ASSERT(!ownStyle);
</span><span class="lines">@@ -2233,20 +2233,20 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This &quot;find nearest element parent&quot; should be a helper function.
</span><del>-    Node* n = node();
-    while (n &amp;&amp; !n-&gt;isElementNode())
-        n = n-&gt;parentNode();
-    if (!n)
-        return 0;
-    Element* element = toElement(n);
</del><ins>+    Node* node = this-&gt;node();
+    while (node &amp;&amp; !is&lt;Element&gt;(node))
+        node = node-&gt;parentNode();
+    if (!node)
+        return nullptr;
+    Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx"> 
</span><span class="cx">     if (pseudoStyleRequest.pseudoId == FIRST_LINE_INHERITED) {
</span><del>-        RefPtr&lt;RenderStyle&gt; result = document().ensureStyleResolver().styleForElement(element, parentStyle, DisallowStyleSharing);
</del><ins>+        RefPtr&lt;RenderStyle&gt; result = document().ensureStyleResolver().styleForElement(&amp;element, parentStyle, DisallowStyleSharing);
</ins><span class="cx">         result-&gt;setStyleType(FIRST_LINE_INHERITED);
</span><span class="cx">         return result.release();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return document().ensureStyleResolver().pseudoStyleForElement(element, pseudoStyleRequest, parentStyle);
</del><ins>+    return document().ensureStyleResolver().pseudoStyleForElement(&amp;element, pseudoStyleRequest, parentStyle);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Color decorationColor(RenderStyle* style)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRuby.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRuby.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderRuby.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     RenderRubyAsBlock(Element&amp;, PassRef&lt;RenderStyle&gt;);
</span><span class="cx">     virtual ~RenderRubyAsBlock();
</span><span class="cx"> 
</span><del>-    Element&amp; element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+    Element&amp; element() const { return downcast&lt;Element&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
</span><span class="cx">     virtual RenderObject* removeChild(RenderObject&amp; child) override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyText.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyText.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderRubyText.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     RenderRubyText(Element&amp;, PassRef&lt;RenderStyle&gt;);
</span><span class="cx">     virtual ~RenderRubyText();
</span><span class="cx"> 
</span><del>-    Element&amp; element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+    Element&amp; element() const { return downcast&lt;Element&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     virtual bool isChildAllowed(const RenderObject&amp;, const RenderStyle&amp;) const override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableCaptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCaption.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCaption.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderTableCaption.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">     RenderTableCaption(Element&amp;, PassRef&lt;RenderStyle&gt;);
</span><span class="cx">     virtual ~RenderTableCaption();
</span><span class="cx"> 
</span><del>-    Element&amp; element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+    Element&amp; element() const { return downcast&lt;Element&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     virtual LayoutUnit containingBlockLogicalWidthForContent() const override;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableColh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCol.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCol.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderTableCol.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> class RenderTableCol final : public RenderBox {
</span><span class="cx"> public:
</span><span class="cx">     RenderTableCol(Element&amp;, PassRef&lt;RenderStyle&gt;);
</span><del>-    Element&amp; element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+    Element&amp; element() const { return downcast&lt;Element&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     void clearPreferredLogicalWidthsDirtyBits();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTheme.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -802,67 +802,67 @@
</span><span class="cx">     return inputElement-&gt;shouldAppearIndeterminate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTheme::isEnabled(const RenderObject&amp; o) const
</del><ins>+bool RenderTheme::isEnabled(const RenderObject&amp; renderer) const
</ins><span class="cx"> {
</span><del>-    Node* node = o.node();
-    if (!node || !node-&gt;isElementNode())
</del><ins>+    Node* node = renderer.node();
+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return true;
</span><del>-    return !toElement(node)-&gt;isDisabledFormControl();
</del><ins>+    return !downcast&lt;Element&gt;(*node).isDisabledFormControl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTheme::isFocused(const RenderObject&amp; o) const
</del><ins>+bool RenderTheme::isFocused(const RenderObject&amp; renderer) const
</ins><span class="cx"> {
</span><del>-    Node* node = o.node();
-    if (!node || !node-&gt;isElementNode())
</del><ins>+    Node* node = renderer.node();
+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    Element* focusDelegate = toElement(node)-&gt;focusDelegate();
</del><ins>+    Element* focusDelegate = downcast&lt;Element&gt;(*node).focusDelegate();
</ins><span class="cx">     Document&amp; document = focusDelegate-&gt;document();
</span><span class="cx">     Frame* frame = document.frame();
</span><span class="cx">     return focusDelegate == document.focusedElement() &amp;&amp; frame &amp;&amp; frame-&gt;selection().isFocusedAndActive();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTheme::isPressed(const RenderObject&amp; o) const
</del><ins>+bool RenderTheme::isPressed(const RenderObject&amp; renderer) const
</ins><span class="cx"> {
</span><del>-    if (!o.node() || !o.node()-&gt;isElementNode())
</del><ins>+    if (!renderer.node() || !is&lt;Element&gt;(renderer.node()))
</ins><span class="cx">         return false;
</span><del>-    return toElement(o.node())-&gt;active();
</del><ins>+    return downcast&lt;Element&gt;(*renderer.node()).active();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject&amp; o) const
</del><ins>+bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject&amp; renderer) const
</ins><span class="cx"> {
</span><del>-    Node* node = o.node();
-    if (!node || !node-&gt;isElementNode())
</del><ins>+    Node* node = renderer.node();
+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><del>-    Element* element = toElement(node);
-    if (!element-&gt;active() || !element-&gt;isSpinButtonElement())
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
+    if (!element.active() || !element.isSpinButtonElement())
</ins><span class="cx">         return false;
</span><del>-    return static_cast&lt;SpinButtonElement*&gt;(element)-&gt;upDownState() == SpinButtonElement::Up;
</del><ins>+    return static_cast&lt;SpinButtonElement&amp;&gt;(element).upDownState() == SpinButtonElement::Up;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTheme::isReadOnlyControl(const RenderObject&amp; o) const
</del><ins>+bool RenderTheme::isReadOnlyControl(const RenderObject&amp; renderer) const
</ins><span class="cx"> {
</span><del>-    Node* node = o.node();
</del><ins>+    Node* node = renderer.node();
</ins><span class="cx">     if (!node || !is&lt;HTMLFormControlElement&gt;(node))
</span><span class="cx">         return false;
</span><del>-    return !toElement(*node).matchesReadWritePseudoClass();
</del><ins>+    return !downcast&lt;Element&gt;(*node).matchesReadWritePseudoClass();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTheme::isHovered(const RenderObject&amp; o) const
</del><ins>+bool RenderTheme::isHovered(const RenderObject&amp; renderer) const
</ins><span class="cx"> {
</span><del>-    Node* node = o.node();
-    if (!node || !node-&gt;isElementNode())
</del><ins>+    Node* node = renderer.node();
+    if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><del>-    if (!toElement(node)-&gt;isSpinButtonElement())
-        return toElement(node)-&gt;hovered();
</del><ins>+    if (!downcast&lt;Element&gt;(*node).isSpinButtonElement())
+        return downcast&lt;Element&gt;(*node).hovered();
</ins><span class="cx">     SpinButtonElement* element = static_cast&lt;SpinButtonElement*&gt;(node);
</span><span class="cx">     return element-&gt;hovered() &amp;&amp; element-&gt;upDownState() != SpinButtonElement::Indeterminate;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject&amp; o) const
</del><ins>+bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject&amp; renderer) const
</ins><span class="cx"> {
</span><del>-    Node* node = o.node();
-    if (!node || !node-&gt;isElementNode() || !toElement(node)-&gt;isSpinButtonElement())
</del><ins>+    Node* node = renderer.node();
+    if (!node || !is&lt;Element&gt;(node) || !downcast&lt;Element&gt;(*node).isSpinButtonElement())
</ins><span class="cx">         return false;
</span><span class="cx">     SpinButtonElement* element = static_cast&lt;SpinButtonElement*&gt;(node);
</span><span class="cx">     return element-&gt;upDownState() == SpinButtonElement::Up;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -316,15 +316,15 @@
</span><span class="cx"> 
</span><span class="cx"> static bool nodeHasClass(Node* node, const char* className)
</span><span class="cx"> {
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    Element* element = toElement(node);
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx"> 
</span><del>-    if (!element-&gt;hasClass())
</del><ins>+    if (!element.hasClass())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return element-&gt;classNames().contains(className);
</del><ins>+    return element.classNames().contains(className);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderThemeGtk::RenderThemeGtk()
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -729,7 +729,7 @@
</span><span class="cx"> void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject&amp; o)
</span><span class="cx"> {
</span><span class="cx">     bool oldPressed = [cell isHighlighted];
</span><del>-    bool pressed = o.node() &amp;&amp; o.node()-&gt;isElementNode() &amp;&amp; toElement(o.node())-&gt;active();
</del><ins>+    bool pressed = o.node() &amp;&amp; is&lt;Element&gt;(o.node()) &amp;&amp; downcast&lt;Element&gt;(*o.node()).active();
</ins><span class="cx">     if (pressed != oldPressed)
</span><span class="cx">         [cell setHighlighted:pressed];
</span><span class="cx"> }
</span><span class="lines">@@ -1531,7 +1531,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Update the various states we respond to.
</span><span class="cx">     updateEnabledState(sliderThumbCell, o);
</span><del>-        Element* focusDelegate = (o.node() &amp;&amp; o.node()-&gt;isElementNode()) ? toElement(o.node())-&gt;focusDelegate() : 0;
</del><ins>+        Element* focusDelegate = (o.node() &amp;&amp; is&lt;Element&gt;(o.node())) ? downcast&lt;Element&gt;(o.node())-&gt;focusDelegate() : nullptr;
</ins><span class="cx">     if (focusDelegate)
</span><span class="cx">         updateFocusedState(sliderThumbCell, *focusDelegate-&gt;renderer());
</span><span class="cx"> 
</span><span class="lines">@@ -1673,7 +1673,7 @@
</span><span class="cx"> {
</span><span class="cx">     Element* input = o.node()-&gt;shadowHost();
</span><span class="cx">     if (!input)
</span><del>-        input = toElement(o.node());
</del><ins>+        input = downcast&lt;Element&gt;(o.node());
</ins><span class="cx"> 
</span><span class="cx">     if (!input-&gt;renderer()-&gt;isBox())
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -393,7 +393,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (behavior &amp; RenderAsTextShowIDAndClass) {
</span><del>-        if (Element* element = o.node() &amp;&amp; o.node()-&gt;isElementNode() ? toElement(o.node()) : 0) {
</del><ins>+        if (Element* element = o.node() &amp;&amp; is&lt;Element&gt;(o.node()) ? downcast&lt;Element&gt;(o.node()) : nullptr) {
</ins><span class="cx">             if (element-&gt;hasID())
</span><span class="cx">                 ts &lt;&lt; &quot; id=\&quot;&quot; + element-&gt;getIdAttribute() + &quot;\&quot;&quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutosizercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutosizer.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutosizer.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/TextAutosizer.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -276,8 +276,8 @@
</span><span class="cx">     if (renderer-&gt;isListItem())
</span><span class="cx">         return renderer-&gt;isFloating() || renderer-&gt;isOutOfFlowPositioned();
</span><span class="cx">     // Avoid creating containers for text within text controls, buttons, or &lt;select&gt; buttons.
</span><del>-    Node* parentNode = renderer-&gt;parent() ? renderer-&gt;parent()-&gt;generatingNode() : 0;
-    if (parentNode &amp;&amp; parentNode-&gt;isElementNode() &amp;&amp; formInputTags().contains(toElement(parentNode)-&gt;tagQName()))
</del><ins>+    Node* parentNode = renderer-&gt;parent() ? renderer-&gt;parent()-&gt;generatingNode() : nullptr;
+    if (parentNode &amp;&amp; is&lt;Element&gt;(parentNode) &amp;&amp; formInputTags().contains(downcast&lt;Element&gt;(*parentNode).tagQName()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -388,8 +388,8 @@
</span><span class="cx">     const RenderObject* renderer = container;
</span><span class="cx">     while (renderer) {
</span><span class="cx">         const Node* rendererNode = renderer-&gt;node();
</span><del>-        if (rendererNode &amp;&amp; rendererNode-&gt;isElementNode()) {
-            if (tags.contains(toElement(rendererNode)-&gt;tagQName()))
</del><ins>+        if (rendererNode &amp;&amp; is&lt;Element&gt;(rendererNode)) {
+            if (tags.contains(downcast&lt;Element&gt;(*rendererNode).tagQName()))
</ins><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">         renderer = nextInPreOrderSkippingDescendantsOfContainers(renderer, container);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool RenderMathMLBlock::isChildAllowed(const RenderObject&amp; child, const RenderStyle&amp;) const
</span><span class="cx"> {
</span><del>-    return child.node() &amp;&amp; isElement(*child.node());
</del><ins>+    return child.node() &amp;&amp; is&lt;Element&gt;(*child.node());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr&lt;RenderMathMLBlock&gt; RenderMathMLBlock::createAnonymousMathMLBlock()
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveTree.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -482,8 +482,8 @@
</span><span class="cx">             attachTextRenderer(downcast&lt;Text&gt;(*child), renderTreePosition);
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (child-&gt;isElementNode())
-            attachRenderTree(*toElement(child), inheritedStyle, renderTreePosition, nullptr);
</del><ins>+        if (is&lt;Element&gt;(child))
+            attachRenderTree(downcast&lt;Element&gt;(*child), inheritedStyle, renderTreePosition, nullptr);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -501,8 +501,8 @@
</span><span class="cx">             attachTextRenderer(downcast&lt;Text&gt;(*current), renderTreePosition);
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (current-&gt;isElementNode()) {
-            Element&amp; currentElement = toElement(*current);
</del><ins>+        if (is&lt;Element&gt;(current)) {
+            Element&amp; currentElement = downcast&lt;Element&gt;(*current);
</ins><span class="cx">             if (currentElement.renderer())
</span><span class="cx">                 detachRenderTree(currentElement);
</span><span class="cx">             attachRenderTree(currentElement, inheritedStyle, renderTreePosition, nullptr);
</span><span class="lines">@@ -655,8 +655,8 @@
</span><span class="cx">             detachTextRenderer(downcast&lt;Text&gt;(*current));
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (current-&gt;isElementNode())
-            detachRenderTree(*toElement(current));
</del><ins>+        if (is&lt;Element&gt;(current))
+            detachRenderTree(downcast&lt;Element&gt;(*current));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -670,8 +670,8 @@
</span><span class="cx">             Style::detachTextRenderer(downcast&lt;Text&gt;(*child));
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (child-&gt;isElementNode())
-            detachRenderTree(*toElement(child), detachType);
</del><ins>+        if (is&lt;Element&gt;(child))
+            detachRenderTree(downcast&lt;Element&gt;(*child), detachType);
</ins><span class="cx">     }
</span><span class="cx">     current.clearChildNeedsStyleRecalc();
</span><span class="cx"> }
</span><span class="lines">@@ -819,8 +819,8 @@
</span><span class="cx">             resolveTextNode(downcast&lt;Text&gt;(*child), renderTreePosition);
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (child-&gt;isElementNode())
-            resolveTree(*toElement(child), host.renderer()-&gt;style(), renderTreePosition, change);
</del><ins>+        if (is&lt;Element&gt;(child))
+            resolveTree(downcast&lt;Element&gt;(*child), host.renderer()-&gt;style(), renderTreePosition, change);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     shadowRoot.clearNeedsStyleRecalc();
</span><span class="lines">@@ -943,19 +943,19 @@
</span><span class="cx">                 resolveTextNode(downcast&lt;Text&gt;(*child), childRenderTreePosition);
</span><span class="cx">                 continue;
</span><span class="cx">             }
</span><del>-            if (!child-&gt;isElementNode())
</del><ins>+            if (!is&lt;Element&gt;(child))
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            Element* childElement = toElement(child);
</del><ins>+            Element&amp; childElement = downcast&lt;Element&gt;(*child);
</ins><span class="cx">             if (elementNeedingStyleRecalcAffectsNextSiblingElementStyle) {
</span><del>-                if (childElement-&gt;styleIsAffectedByPreviousSibling())
-                    childElement-&gt;setNeedsStyleRecalc();
-                elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement-&gt;affectsNextSiblingElementStyle();
-            } else if (childElement-&gt;styleChangeType() &gt;= FullStyleChange)
-                elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement-&gt;affectsNextSiblingElementStyle();
-            if (change &gt;= Inherit || childElement-&gt;childNeedsStyleRecalc() || childElement-&gt;needsStyleRecalc()) {
</del><ins>+                if (childElement.styleIsAffectedByPreviousSibling())
+                    childElement.setNeedsStyleRecalc();
+                elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement.affectsNextSiblingElementStyle();
+            } else if (childElement.styleChangeType() &gt;= FullStyleChange)
+                elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement.affectsNextSiblingElementStyle();
+            if (change &gt;= Inherit || childElement.childNeedsStyleRecalc() || childElement.needsStyleRecalc()) {
</ins><span class="cx">                 parentPusher.push();
</span><del>-                resolveTree(*childElement, renderer-&gt;style(), childRenderTreePosition, change);
</del><ins>+                resolveTree(childElement, renderer-&gt;style(), childRenderTreePosition, change);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGUseElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGUseElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -760,9 +760,9 @@
</span><span class="cx">         expandUseElementsInShadowTree(child.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SVGUseElement::expandSymbolElementsInShadowTree(Node* element)
</del><ins>+void SVGUseElement::expandSymbolElementsInShadowTree(Node* node)
</ins><span class="cx"> {
</span><del>-    if (element-&gt;hasTagName(SVGNames::symbolTag)) {
</del><ins>+    if (is&lt;SVGSymbolElement&gt;(node)) {
</ins><span class="cx">         // Spec: The referenced 'symbol' and its contents are deep-cloned into the generated tree,
</span><span class="cx">         // with the exception that the 'symbol' is replaced by an 'svg'. This generated 'svg' will
</span><span class="cx">         // always have explicit values for attributes width and height. If attributes width and/or
</span><span class="lines">@@ -772,10 +772,10 @@
</span><span class="cx">         RefPtr&lt;SVGSVGElement&gt; svgElement = SVGSVGElement::create(SVGNames::svgTag, *referencedDocument());
</span><span class="cx"> 
</span><span class="cx">         // Transfer all data (attributes, etc.) from &lt;symbol&gt; to the new &lt;svg&gt; element.
</span><del>-        svgElement-&gt;cloneDataFromElement(*toElement(element));
</del><ins>+        svgElement-&gt;cloneDataFromElement(downcast&lt;SVGSymbolElement&gt;(*node));
</ins><span class="cx"> 
</span><span class="cx">         // Only clone symbol children, and add them to the new &lt;svg&gt; element
</span><del>-        for (Node* child = element-&gt;firstChild(); child; child = child-&gt;nextSibling()) {
</del><ins>+        for (Node* child = node-&gt;firstChild(); child; child = child-&gt;nextSibling()) {
</ins><span class="cx">             RefPtr&lt;Node&gt; newChild = child-&gt;cloneNode(true);
</span><span class="cx">             svgElement-&gt;appendChild(newChild.release());
</span><span class="cx">         }
</span><span class="lines">@@ -788,19 +788,19 @@
</span><span class="cx">         if (subtreeContainsDisallowedElement(*svgElement))
</span><span class="cx">             removeDisallowedElementsFromSubtree(*svgElement);
</span><span class="cx"> 
</span><del>-        RefPtr&lt;Node&gt; replacingElement(svgElement.get());
</del><ins>+        RefPtr&lt;SVGSVGElement&gt; replacingElement(svgElement.get());
</ins><span class="cx"> 
</span><span class="cx">         // Replace &lt;symbol&gt; with &lt;svg&gt;.
</span><del>-        element-&gt;parentNode()-&gt;replaceChild(svgElement.release(), element);
</del><ins>+        node-&gt;parentNode()-&gt;replaceChild(svgElement.release(), node);
</ins><span class="cx"> 
</span><span class="cx">         // Expand the siblings because the *element* is replaced and we will
</span><span class="cx">         // lose the sibling chain when we are back from recursion.
</span><del>-        element = replacingElement.get();
-        for (RefPtr&lt;Node&gt; sibling = element-&gt;nextSibling(); sibling; sibling = sibling-&gt;nextSibling())
</del><ins>+        node = replacingElement.get();
+        for (RefPtr&lt;Node&gt; sibling = node-&gt;nextSibling(); sibling; sibling = sibling-&gt;nextSibling())
</ins><span class="cx">             expandSymbolElementsInShadowTree(sibling.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (RefPtr&lt;Node&gt; child = element-&gt;firstChild(); child; child = child-&gt;nextSibling())
</del><ins>+    for (RefPtr&lt;Node&gt; child = node-&gt;firstChild(); child; child = child-&gt;nextSibling())
</ins><span class="cx">         expandSymbolElementsInShadowTree(child.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvganimationSVGSMILElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!inDocument()) {
</span><span class="cx">         // Reset the target element if we are no longer in the document.
</span><del>-        setTargetElement(0);
</del><ins>+        setTargetElement(nullptr);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">     String href = getAttribute(XLinkNames::hrefAttr);
</span><span class="cx">     Element* target;
</span><span class="cx">     if (href.isEmpty())
</span><del>-        target = parentNode() &amp;&amp; parentNode()-&gt;isElementNode() ? toElement(parentNode()) : nullptr;
</del><ins>+        target = parentNode() &amp;&amp; is&lt;Element&gt;(parentNode()) ? downcast&lt;Element&gt;(parentNode()) : nullptr;
</ins><span class="cx">     else
</span><span class="cx">         target = SVGURIReference::targetElementFromIRIString(href, document(), &amp;id);
</span><span class="cx">     SVGElement* svgTarget = target &amp;&amp; is&lt;SVGElement&gt;(target) ? downcast&lt;SVGElement&gt;(target) : nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXPathFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XPathFunctions.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XPathFunctions.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/xml/XPathFunctions.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -580,13 +580,13 @@
</span><span class="cx"> {
</span><span class="cx">     String lang = argument(0).evaluate().toString();
</span><span class="cx"> 
</span><del>-    const Attribute* languageAttribute = 0;
</del><ins>+    const Attribute* languageAttribute = nullptr;
</ins><span class="cx">     Node* node = evaluationContext().node.get();
</span><span class="cx">     while (node) {
</span><del>-        if (node-&gt;isElementNode()) {
-            Element* element = toElement(node);
-            if (element-&gt;hasAttributes())
-                languageAttribute = element-&gt;findAttributeByName(XMLNames::langAttr);
</del><ins>+        if (is&lt;Element&gt;(node)) {
+            Element&amp; element = downcast&lt;Element&gt;(*node);
+            if (element.hasAttributes())
+                languageAttribute = element.findAttributeByName(XMLNames::langAttr);
</ins><span class="cx">         }
</span><span class="cx">         if (languageAttribute)
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXPathNodeSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XPathNodeSet.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XPathNodeSet.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/xml/XPathNodeSet.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -207,19 +207,19 @@
</span><span class="cx">     Vector&lt;RefPtr&lt;Node&gt;&gt; sortedNodes;
</span><span class="cx">     sortedNodes.reserveInitialCapacity(nodeCount);
</span><span class="cx"> 
</span><del>-    for (Node* n = findRootNode(m_nodes.first().get()); n; n = NodeTraversal::next(n)) {
-        if (nodes.contains(n))
-            sortedNodes.append(n);
</del><ins>+    for (Node* node = findRootNode(m_nodes.first().get()); node; node = NodeTraversal::next(node)) {
+        if (nodes.contains(node))
+            sortedNodes.append(node);
</ins><span class="cx"> 
</span><del>-        if (!containsAttributeNodes || !n-&gt;isElementNode())
</del><ins>+        if (!containsAttributeNodes || !is&lt;Element&gt;(node))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        Element* element = toElement(n);
-        if (!element-&gt;hasAttributes())
</del><ins>+        Element&amp; element = downcast&lt;Element&gt;(*node);
+        if (!element.hasAttributes())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        for (const Attribute&amp; attribute : element-&gt;attributesIterator()) {
-            RefPtr&lt;Attr&gt; attr = element-&gt;attrIfExists(attribute.name());
</del><ins>+        for (const Attribute&amp; attribute : element.attributesIterator()) {
+            RefPtr&lt;Attr&gt; attr = element.attrIfExists(attribute.name());
</ins><span class="cx">             if (attr &amp;&amp; nodes.contains(attr.get()))
</span><span class="cx">                 sortedNodes.append(attr);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXPathStepcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XPathStep.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XPathStep.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/xml/XPathStep.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Attr.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><ins>+#include &quot;HTMLDocument.h&quot;
</ins><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><span class="cx"> #include &quot;NodeTraversal.h&quot;
</span><span class="cx"> #include &quot;XMLNSNames.h&quot;
</span><span class="lines">@@ -201,21 +202,21 @@
</span><span class="cx"> 
</span><span class="cx">             // For other axes, the principal node type is element.
</span><span class="cx">             ASSERT(primaryNodeType(axis) == Node::ELEMENT_NODE);
</span><del>-            if (!node.isElementNode())
</del><ins>+            if (!is&lt;Element&gt;(node))
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">             if (name == starAtom)
</span><span class="cx">                 return namespaceURI.isEmpty() || namespaceURI == node.namespaceURI();
</span><span class="cx"> 
</span><del>-            if (node.document().isHTMLDocument()) {
</del><ins>+            if (is&lt;HTMLDocument&gt;(node.document())) {
</ins><span class="cx">                 if (is&lt;HTMLElement&gt;(node)) {
</span><span class="cx">                     // Paths without namespaces should match HTML elements in HTML documents despite those having an XHTML namespace. Names are compared case-insensitively.
</span><span class="cx">                     return equalIgnoringCase(downcast&lt;HTMLElement&gt;(node).localName(), name) &amp;&amp; (namespaceURI.isNull() || namespaceURI == node.namespaceURI());
</span><span class="cx">                 }
</span><span class="cx">                 // An expression without any prefix shouldn't match no-namespace nodes (because HTML5 says so).
</span><del>-                return toElement(node).hasLocalName(name) &amp;&amp; namespaceURI == node.namespaceURI() &amp;&amp; !namespaceURI.isNull();
</del><ins>+                return downcast&lt;Element&gt;(node).hasLocalName(name) &amp;&amp; namespaceURI == node.namespaceURI() &amp;&amp; !namespaceURI.isNull();
</ins><span class="cx">             }
</span><del>-            return toElement(node).hasLocalName(name) &amp;&amp; namespaceURI == node.namespaceURI();
</del><ins>+            return downcast&lt;Element&gt;(node).hasLocalName(name) &amp;&amp; namespaceURI == node.namespaceURI();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -343,10 +344,10 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         case AttributeAxis: {
</span><del>-            if (!context.isElementNode())
</del><ins>+            if (!is&lt;Element&gt;(context))
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-            Element&amp; contextElement = toElement(context);
</del><ins>+            Element&amp; contextElement = downcast&lt;Element&gt;(context);
</ins><span class="cx"> 
</span><span class="cx">             // Avoid lazily creating attribute nodes for attributes that we do not need anyway.
</span><span class="cx">             if (m_nodeTest.m_kind == NodeTest::NameTest &amp;&amp; m_nodeTest.m_data != starAtom) {
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -621,10 +621,10 @@
</span><span class="cx">     while (parentElement) {
</span><span class="cx">         elemStack.append(parentElement);
</span><span class="cx"> 
</span><del>-        ContainerNode* n = parentElement-&gt;parentNode();
-        if (!n || !n-&gt;isElementNode())
</del><ins>+        ContainerNode* node = parentElement-&gt;parentNode();
+        if (!node || !is&lt;Element&gt;(node))
</ins><span class="cx">             break;
</span><del>-        parentElement = toElement(n);
</del><ins>+        parentElement = downcast&lt;Element&gt;(node);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (elemStack.isEmpty())
</span><span class="lines">@@ -881,34 +881,34 @@
</span><span class="cx"> 
</span><span class="cx">     exitText();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;ContainerNode&gt; n = m_currentNode;
-    n-&gt;finishParsingChildren();
</del><ins>+    RefPtr&lt;ContainerNode&gt; node = m_currentNode;
+    node-&gt;finishParsingChildren();
</ins><span class="cx"> 
</span><span class="cx">     // Once we reach the depth again where entity expansion started, stop executing the work-around.
</span><span class="cx">     if (hackAroundLibXMLEntityParsingBug() &amp;&amp; context()-&gt;depth &lt;= depthTriggeringEntityExpansion())
</span><span class="cx">         setDepthTriggeringEntityExpansion(-1);
</span><span class="cx"> 
</span><del>-    if (!scriptingContentIsAllowed(parserContentPolicy()) &amp;&amp; n-&gt;isElementNode() &amp;&amp; toScriptElementIfPossible(toElement(n.get()))) {
</del><ins>+    if (!scriptingContentIsAllowed(parserContentPolicy()) &amp;&amp; is&lt;Element&gt;(*node) &amp;&amp; toScriptElementIfPossible(downcast&lt;Element&gt;(node.get()))) {
</ins><span class="cx">         popCurrentNode();
</span><del>-        n-&gt;remove(IGNORE_EXCEPTION);
</del><ins>+        node-&gt;remove(IGNORE_EXCEPTION);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!n-&gt;isElementNode() || !m_view) {
</del><ins>+    if (!node-&gt;isElementNode() || !m_view) {
</ins><span class="cx">         popCurrentNode();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Element* element = toElement(n.get());
</del><ins>+    Element&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx"> 
</span><span class="cx">     // The element's parent may have already been removed from document.
</span><span class="cx">     // Parsing continues in this case, but scripts aren't executed.
</span><del>-    if (!element-&gt;inDocument()) {
</del><ins>+    if (!element.inDocument()) {
</ins><span class="cx">         popCurrentNode();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ScriptElement* scriptElement = toScriptElementIfPossible(element);
</del><ins>+    ScriptElement* scriptElement = toScriptElementIfPossible(&amp;element);
</ins><span class="cx">     if (!scriptElement) {
</span><span class="cx">         popCurrentNode();
</span><span class="cx">         return;
</span><span class="lines">@@ -926,14 +926,14 @@
</span><span class="cx">             scriptElement-&gt;executeScript(ScriptSourceCode(scriptElement-&gt;scriptContent(), document()-&gt;url(), m_scriptStartPosition));
</span><span class="cx">         else if (scriptElement-&gt;willBeParserExecuted()) {
</span><span class="cx">             m_pendingScript = scriptElement-&gt;cachedScript();
</span><del>-            m_scriptElement = element;
</del><ins>+            m_scriptElement = &amp;element;
</ins><span class="cx">             m_pendingScript-&gt;addClient(this);
</span><span class="cx"> 
</span><span class="cx">             // m_pendingScript will be 0 if script was already loaded and addClient() executed it.
</span><span class="cx">             if (m_pendingScript)
</span><span class="cx">                 pauseParsing();
</span><span class="cx">         } else
</span><del>-            m_scriptElement = 0;
</del><ins>+            m_scriptElement = nullptr;
</ins><span class="cx"> 
</span><span class="cx">         // JavaScript may have detached the parser
</span><span class="cx">         if (isDetached())
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-09-30  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element
+        https://bugs.webkit.org/show_bug.cgi?id=137241
+
+        Reviewed by Andreas Kling.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element instead of isElementNode() /
+        toElement().
+
+        * WebView/WebRenderLayer.mm:
+        (+[WebRenderLayer nameForLayer:]):
+
</ins><span class="cx"> 2014-09-28  Gyuyoung Kim  &lt;gyuyoung.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move ColorInputType class to std::unique_ptr
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebRenderLayermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebRenderLayer.mm (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebRenderLayer.mm        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit/mac/WebView/WebRenderLayer.mm        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     const RenderObject&amp; renderer = layer-&gt;renderer();
</span><span class="cx">     NSString *name = [NSString stringWithUTF8String:renderer.renderName()];
</span><span class="cx"> 
</span><del>-    if (Element* element = renderer.node() &amp;&amp; renderer.node()-&gt;isElementNode() ? toElement(renderer.node()) : 0) {
</del><ins>+    if (Element* element = renderer.node() &amp;&amp; is&lt;Element&gt;(renderer.node()) ? downcast&lt;Element&gt;(renderer.node()) : nullptr) {
</ins><span class="cx">         name = [name stringByAppendingFormat:@&quot; %@&quot;, (NSString *)element-&gt;tagName()];
</span><span class="cx">         if (element-&gt;hasID())
</span><span class="cx">             name = [name stringByAppendingFormat:@&quot; id=\&quot;%@\&quot;&quot;, (NSString *)element-&gt;getIdAttribute()];
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit/win/ChangeLog        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-09-30  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element
+        https://bugs.webkit.org/show_bug.cgi?id=137241
+
+        Reviewed by Andreas Kling.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element instead of isElementNode() /
+        toElement().
+
+        * DOMEventsClasses.cpp:
+        (DOMMouseEvent::toElement):
+        * DOMEventsClasses.h:
+
</ins><span class="cx"> 2014-09-29  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make is&lt;&gt;() / downcast&lt;&gt;() work for HTMLDocument and its subclasses
</span></span></pre></div>
<a id="trunkSourceWebKitwinDOMEventsClassescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/DOMEventsClasses.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/DOMEventsClasses.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit/win/DOMEventsClasses.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -550,7 +550,7 @@
</span><span class="cx">     return E_NOTIMPL;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HRESULT STDMETHODCALLTYPE DOMMouseEvent::toElement( 
</del><ins>+HRESULT STDMETHODCALLTYPE DOMMouseEvent::toElement(
</ins><span class="cx">     /* [retval][out] */ IDOMNode** /*result*/)
</span><span class="cx"> {
</span><span class="cx">     return E_NOTIMPL;
</span></span></pre></div>
<a id="trunkSourceWebKitwinDOMEventsClassesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/DOMEventsClasses.h (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/DOMEventsClasses.h        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit/win/DOMEventsClasses.h        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -613,7 +613,7 @@
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE fromElement( 
</span><span class="cx">         /* [retval][out] */ IDOMNode** result);
</span><span class="cx">     
</span><del>-    virtual HRESULT STDMETHODCALLTYPE toElement( 
</del><ins>+    virtual HRESULT STDMETHODCALLTYPE toElement(
</ins><span class="cx">         /* [retval][out] */ IDOMNode** result);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit2/ChangeLog        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2014-09-30  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element
+        https://bugs.webkit.org/show_bug.cgi?id=137241
+
+        Reviewed by Andreas Kling.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Element instead of isElementNode() /
+        toElement().
+
+        * Shared/WebRenderObject.cpp:
+        (WebKit::WebRenderObject::WebRenderObject):
+        * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
+        (-[WKDOMElement hasAttribute:]):
+        (-[WKDOMElement getAttribute:]):
+        (-[WKDOMElement setAttribute:value:]):
+        (-[WKDOMElement tagName]):
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+        (WebKit::InjectedBundleNodeHandle::elementBounds):
+        * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
+        (WebKit::InjectedBundleHitTestResult::mediaType):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
+        (WebKit::WebPage::blurAssistedNode):
+        (WebKit::WebPage::getPositionInformation):
+        (WebKit::nextFocusableElement):
+        (WebKit::WebPage::elementDidFocus):
+
</ins><span class="cx"> 2014-09-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r173929): [GTK] TestInspector fails after r173929
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebRenderObject.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebRenderObject.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit2/Shared/WebRenderObject.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -66,17 +66,17 @@
</span><span class="cx">     m_name = renderer-&gt;renderName();
</span><span class="cx"> 
</span><span class="cx">     if (Node* node = renderer-&gt;node()) {
</span><del>-        if (node-&gt;isElementNode()) {
-            Element* element = toElement(node);
-            m_elementTagName = element-&gt;tagName();
-            m_elementID = element-&gt;getIdAttribute();
</del><ins>+        if (is&lt;Element&gt;(node)) {
+            Element&amp; element = downcast&lt;Element&gt;(*node);
+            m_elementTagName = element.tagName();
+            m_elementID = element.getIdAttribute();
</ins><span class="cx">             
</span><del>-            if (element-&gt;isStyledElement() &amp;&amp; element-&gt;hasClass()) {
</del><ins>+            if (element.isStyledElement() &amp;&amp; element.hasClass()) {
</ins><span class="cx">                 Vector&lt;RefPtr&lt;API::Object&gt;&gt; classNames;
</span><del>-                classNames.reserveInitialCapacity(element-&gt;classNames().size());
</del><ins>+                classNames.reserveInitialCapacity(element.classNames().size());
</ins><span class="cx"> 
</span><del>-                for (size_t i = 0, size = element-&gt;classNames().size(); i &lt; size; ++i)
-                    classNames.append(API::String::create(element-&gt;classNames()[i]));
</del><ins>+                for (size_t i = 0, size = element.classNames().size(); i &lt; size; ++i)
+                    classNames.append(API::String::create(element.classNames()[i]));
</ins><span class="cx"> 
</span><span class="cx">                 m_elementClassNames = API::Array::create(WTF::move(classNames));
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKDOMElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMElement.mm (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMElement.mm        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMElement.mm        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -35,24 +35,24 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)hasAttribute:(NSString *)attribute
</span><span class="cx"> {
</span><del>-    return WebCore::toElement(_impl.get())-&gt;hasAttribute(attribute);
</del><ins>+    return WebCore::downcast&lt;WebCore::Element&gt;(*_impl).hasAttribute(attribute);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSString *)getAttribute:(NSString *)attribute
</span><span class="cx"> {
</span><del>-    return WebCore::toElement(_impl.get())-&gt;getAttribute(attribute);
</del><ins>+    return WebCore::downcast&lt;WebCore::Element&gt;(*_impl).getAttribute(attribute);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setAttribute:(NSString *)name value:(NSString *)value
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Do something about the exception.
</span><span class="cx">     WebCore::ExceptionCode ec;
</span><del>-    WebCore::toElement(_impl.get())-&gt;setAttribute(name, value, ec);
</del><ins>+    WebCore::downcast&lt;WebCore::Element&gt;(*_impl).setAttribute(name, value, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSString *)tagName
</span><span class="cx"> {
</span><del>-    return WebCore::toElement(_impl.get())-&gt;tagName();
</del><ins>+    return WebCore::downcast&lt;WebCore::Element&gt;(*_impl).tagName();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleDOMInjectedBundleNodeHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -118,10 +118,10 @@
</span><span class="cx"> 
</span><span class="cx"> IntRect InjectedBundleNodeHandle::elementBounds() const
</span><span class="cx"> {
</span><del>-    if (!m_node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(*m_node))
</ins><span class="cx">         return IntRect();
</span><span class="cx"> 
</span><del>-    return toElement(m_node.get())-&gt;boundsInRootViewSpace();
</del><ins>+    return downcast&lt;Element&gt;(*m_node).boundsInRootViewSpace();
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> IntRect InjectedBundleNodeHandle::renderRect(bool* isReplaced) const
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundleHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -114,10 +114,10 @@
</span><span class="cx">     return BundleHitTestResultMediaTypeNone;
</span><span class="cx"> #else
</span><span class="cx">     WebCore::Node* node = m_hitTestResult.innerNonSharedNode();
</span><del>-    if (!node-&gt;isElementNode())
</del><ins>+    if (!is&lt;Element&gt;(node))
</ins><span class="cx">         return BundleHitTestResultMediaTypeNone;
</span><span class="cx">     
</span><del>-    if (!toElement(node)-&gt;isMediaElement())
</del><ins>+    if (!downcast&lt;Element&gt;(*node).isMediaElement())
</ins><span class="cx">         return BundleHitTestResultMediaTypeNone;
</span><span class="cx">     
</span><span class="cx">     return m_hitTestResult.mediaIsVideo() ? BundleHitTestResultMediaTypeVideo : BundleHitTestResultMediaTypeAudio;    
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (174116 => 174117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-09-30 19:50:01 UTC (rev 174116)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-09-30 19:59:49 UTC (rev 174117)
</span><span class="lines">@@ -515,8 +515,8 @@
</span><span class="cx">     if (!node)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (isElement(*node))
-        prefetchDNS(toElement(*node).absoluteLinkURL().host());
</del><ins>+    if (is&lt;Element&gt;(*node))
+        prefetchDNS(downcast&lt;Element&gt;(*node).absoluteLinkURL().host());
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><span class="cx">     if (RenderObject *renderer = node-&gt;renderer()) {
</span><span class="lines">@@ -604,8 +604,8 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::blurAssistedNode()
</span><span class="cx"> {
</span><del>-    if (m_assistedNode &amp;&amp; m_assistedNode-&gt;isElementNode())
-        toElement(m_assistedNode.get())-&gt;blur();
</del><ins>+    if (m_assistedNode &amp;&amp; is&lt;Element&gt;(*m_assistedNode))
+        downcast&lt;Element&gt;(*m_assistedNode).blur();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::setAssistedNodeValue(const String&amp; value)
</span><span class="lines">@@ -1888,7 +1888,7 @@
</span><span class="cx">     if (hitNode) {
</span><span class="cx">         info.clickableElementName = hitNode-&gt;nodeName();
</span><span class="cx"> 
</span><del>-        Element* element = hitNode-&gt;isElementNode() ? toElement(hitNode) : 0;
</del><ins>+        Element* element = is&lt;Element&gt;(hitNode) ? downcast&lt;Element&gt;(hitNode) : nullptr;
</ins><span class="cx">         if (element) {
</span><span class="cx">             Element* linkElement = nullptr;
</span><span class="cx">             if (element-&gt;renderer() &amp;&amp; element-&gt;renderer()-&gt;isRenderImage()) {
</span><span class="lines">@@ -2006,7 +2006,7 @@
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;KeyboardEvent&gt; key = KeyboardEvent::create();
</span><span class="cx"> 
</span><del>-    Element* nextElement = toElement(startNode);
</del><ins>+    Element* nextElement = downcast&lt;Element&gt;(startNode);
</ins><span class="cx">     do {
</span><span class="cx">         nextElement = isForward ? page-&gt;focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;nextElement-&gt;document()), nextElement, key.get())
</span><span class="cx">             : page-&gt;focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;nextElement-&gt;document()), nextElement, key.get());
</span><span class="lines">@@ -2163,7 +2163,7 @@
</span><span class="cx">         // a programmatic focus happening while the keyboard is already shown. Once we have a way to
</span><span class="cx">         // know the keyboard state in the Web Process, we should refine the condition.
</span><span class="cx">         if (m_userIsInteracting)
</span><del>-            m_formClient-&gt;willBeginInputSession(this, toElement(node), WebFrame::fromCoreFrame(*node-&gt;document().frame()), userData);
</del><ins>+            m_formClient-&gt;willBeginInputSession(this, downcast&lt;Element&gt;(node), WebFrame::fromCoreFrame(*node-&gt;document().frame()), userData);
</ins><span class="cx"> 
</span><span class="cx">         send(Messages::WebPageProxy::StartAssistingNode(information, m_userIsInteracting, m_hasPendingBlurNotification, InjectedBundleUserMessageEncoder(userData.get())));
</span><span class="cx">         m_hasPendingBlurNotification = false;
</span></span></pre>
</div>
</div>

</body>
</html>