<!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<>() / downcast<>() for Element
https://bugs.webkit.org/show_bug.cgi?id=137241
Reviewed by Andreas Kling.
Use is<>() / downcast<>() 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<Element>::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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for Element
+ https://bugs.webkit.org/show_bug.cgi?id=137241
+
+ Reviewed by Andreas Kling.
+
+ Use is<>() / downcast<>() 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<Element>::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 <burg@cs.washington.edu>
</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& role)
</span><span class="cx"> {
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- auto& roleValue = toElement(node)->fastGetAttribute(roleAttr);
</del><ins>+ auto& roleValue = downcast<Element>(*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 && node->isElementNode() && toElement(node)->isSearchFieldCancelButtonElement())
</del><ins>+ if (node && is<Element>(node) && downcast<Element>(*node).isSearchFieldCancelButtonElement())
</ins><span class="cx"> return AccessibilitySearchFieldCancelButton::create(renderer);
</span><span class="cx">
</span><span class="cx"> if (renderer->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->renderer() || !node->isElementNode())
</del><ins>+ if (!node || !node->renderer() || !is<Element>(node))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
</del><ins>+ Element* element = downcast<Element>(node);
</ins><span class="cx"> String liveRegionStatus = element->fastGetAttribute(aria_liveAttr);
</span><span class="cx"> if (liveRegionStatus.isEmpty()) {
</span><span class="cx"> const AtomicString& ariaRole = element->fastGetAttribute(roleAttr);
</span><span class="lines">@@ -820,7 +820,7 @@
</span><span class="cx"> if (!nodeHasRole(node, "menuitem") && !nodeHasRole(node, "menuitemradio") && !nodeHasRole(node, "menuitemcheckbox"))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (!toElement(node)->focused() && !equalIgnoringCase(toElement(node)->fastGetAttribute(aria_selectedAttr), "true"))
</del><ins>+ if (!downcast<Element>(*node).focused() && !equalIgnoringCase(downcast<Element>(*node).fastGetAttribute(aria_selectedAttr), "true"))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> postNotification(getOrCreate(node), &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->rootEditableElement();
</span><del>- const Element* element = node->isElementNode() ? toElement(node) : node->parentElement();
</del><ins>+ const Element* element = is<Element>(node) ? downcast<Element>(node) : node->parentElement();
</ins><span class="cx">
</span><span class="cx"> for (; element; element = element->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->parentNode()) {
</span><del>- if (testNode->isElementNode()) {
- const AtomicString& ariaHiddenValue = toElement(testNode)->fastGetAttribute(aria_hiddenAttr);
</del><ins>+ if (is<Element>(testNode)) {
+ const AtomicString& ariaHiddenValue = downcast<Element>(*testNode).fastGetAttribute(aria_hiddenAttr);
</ins><span class="cx"> if (equalIgnoringCase(ariaHiddenValue, "false"))
</span><span class="cx"> return true;
</span><span class="cx"> if (equalIgnoringCase(ariaHiddenValue, "true"))
</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())->isDisabledFormControl();
</del><ins>+ return !downcast<Element>(*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 "FrameSelection.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "HTMLAreaElement.h"
</span><ins>+#include "HTMLCanvasElement.h"
</ins><span class="cx"> #include "HTMLFieldSetElement.h"
</span><span class="cx"> #include "HTMLFormElement.h"
</span><span class="cx"> #include "HTMLFrameElementBase.h"
</span><span class="lines">@@ -324,7 +325,7 @@
</span><span class="cx"> return ParagraphRole;
</span><span class="cx"> if (is<HTMLLabelElement>(node()))
</span><span class="cx"> return LabelRole;
</span><del>- if (node()->isElementNode() && toElement(node())->isFocusable())
</del><ins>+ if (is<Element>(node()) && downcast<Element>(*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->node();
</span><del>- if (!node || !node->hasTagName(canvasTag))
</del><ins>+ if (!node || !is<HTMLCanvasElement>(node))
</ins><span class="cx"> return false;
</span><del>- Element& canvasElement = toElement(*node);
</del><ins>+ HTMLCanvasElement& canvasElement = downcast<HTMLCanvasElement>(*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->node();
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><del>- return !toElement(node)->isDisabledFormControl();
</del><ins>+ return !downcast<Element>(*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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return false;
</span><del>- return toElement(node)->active();
</del><ins>+ return downcast<Element>(*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->isElementNode() && toElement(node)->hovered();
</del><ins>+ return is<Element>(node) && downcast<Element>(*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->parentNode()) {
</span><span class="cx"> if (is<HTMLAnchorElement>(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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->firstChild(); child; child = child->nextSibling()) {
</span><span class="cx"> if (isNodeActionElement(child))
</span><del>- return toElement(child);
</del><ins>+ return downcast<Element>(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<Element>(node);
</ins><span class="cx">
</span><span class="cx"> if (AccessibilityObject::isARIAInput(ariaRoleAttribute()))
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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<Element>(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& element : elementLineage(node->isElementNode() ? toElement(node) : node->parentElement())) {
</del><ins>+ for (auto& element : elementLineage(is<Element>(node) ? downcast<Element>(node) : node->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) && isStaticText() && filter == ExcludeBodyElement)
</span><span class="lines">@@ -1253,8 +1254,7 @@
</span><span class="cx">
</span><span class="cx"> bool isInputTag = is<HTMLInputElement>(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<Element>(node))) {
</ins><span class="cx"> AccessibilityObject* labelObject = axObjectCache()->getOrCreate(label);
</span><span class="cx"> String innerText = label->innerText();
</span><span class="cx"> // Only use the <label> 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->parentNode()) {
- if (curr->isHTMLElement()) {
- const AtomicString& summary = toElement(curr)->getAttribute(summaryAttr);
</del><ins>+ for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
+ if (is<HTMLElement>(ancestor)) {
+ HTMLElement& element = downcast<HTMLElement>(*ancestor);
+ const AtomicString& 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& title = toElement(curr)->getAttribute(titleAttr);
</del><ins>+ const AtomicString& title = element.getAttribute(titleAttr);
</ins><span class="cx"> if (!title.isEmpty() && 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()->getOrCreate(curr);
</del><ins>+ AccessibilityObject* axObj = axObjectCache()->getOrCreate(ancestor);
</ins><span class="cx"> if (axObj) {
</span><span class="cx"> AccessibilityRole role = axObj->roleValue();
</span><span class="cx"> if (role != GroupRole && 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->node();
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return 0;
</span><del>- Element* element = toElement(node);
- const AtomicString& ariaLevel = element->fastGetAttribute(aria_levelAttr);
</del><ins>+ Element& element = downcast<Element>(*node);
+ const AtomicString& 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<Element>(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 && !exposesTitleUIElement() && !ariaAccessibilityDescription().length())
</span><span class="cx"> return label->innerText();
</span><span class="lines">@@ -1771,7 +1772,7 @@
</span><span class="cx"> if (!node->isElementNode())
</span><span class="cx"> return String();
</span><span class="cx">
</span><del>- return toElement(node)->innerText();
</del><ins>+ return downcast<Element>(node)->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->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return String();
</span><span class="cx">
</span><del>- Element* element = toElement(node);
- const AtomicString& ariaLabel = element->fastGetAttribute(aria_labelAttr);
</del><ins>+ Element& element = downcast<Element>(*node);
+ const AtomicString& 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& alt = element->fastGetAttribute(altAttr);
</del><ins>+ const AtomicString& 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->accessibleNameDerivesFromContent())
</span><span class="cx"> text = axObject->textUnderElement(AccessibilityTextUnderElementMode(AccessibilityTextUnderElementMode::TextUnderElementModeIncludeNameFromContentsChildren, true));
</span><span class="cx"> } else
</span><del>- text = element->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& title = element->fastGetAttribute(titleAttr);
</del><ins>+ const AtomicString& 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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx">
</span><del>- if (element->isDisabledFormControl())
</del><ins>+ if (element.isDisabledFormControl())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- return element->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->renderView()->hitTest(request, hitTestResult);
</span><span class="cx"> if (hitTestResult.innerNode()) {
</span><span class="cx"> Node* innerNode = hitTestResult.innerNode()->deprecatedShadowAncestorNode();
</span><del>- if (innerNode->isElementNode())
- hitTestElement = toElement(innerNode);
</del><ins>+ if (is<Element>(innerNode))
+ hitTestElement = downcast<Element>(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& tagName) const
</span><span class="cx"> {
</span><span class="cx"> Node* node = this->node();
</span><del>- return node && node->isElementNode() && toElement(*node).hasTagName(tagName);
</del><ins>+ return node && is<Element>(node) && downcast<Element>(*node).hasTagName(tagName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool AccessibilityObject::hasAttribute(const QualifiedName& attribute) const
</span><span class="cx"> {
</span><del>- Node* elementNode = node();
- if (!elementNode)
</del><ins>+ Node* node = this->node();
+ if (!node)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (!elementNode->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Element* element = toElement(elementNode);
- return element->fastHasAttribute(attribute);
</del><ins>+ return downcast<Element>(*node).fastHasAttribute(attribute);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const AtomicString& AccessibilityObject::getAttribute(const QualifiedName& 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->node();
</span><del>- if (node && node->isElementNode())
- return toElement(node);
</del><ins>+ if (node && is<Element>(node))
+ return downcast<Element>(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<String>& classList) const
</span><span class="cx"> {
</span><span class="cx"> Node* node = this->node();
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
</del><ins>+ Element* element = downcast<Element>(node);
</ins><span class="cx"> DOMTokenList& list = element->classList();
</span><span class="cx"> unsigned length = list.length();
</span><span class="cx"> for (unsigned k = 0; k < 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->node();
</span><span class="cx"> for ( ; node; node = node->parentNode()) {
</span><span class="cx"> if (is<HTMLAnchorElement>(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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->parent()) {
- if (curr->node() && curr->node()->isHTMLElement()) {
- const AtomicString& summary = toElement(curr->node())->getAttribute(summaryAttr);
</del><ins>+ for (RenderObject* ancestor = m_renderer; ancestor; ancestor = ancestor->parent()) {
+ if (ancestor->node() && is<HTMLElement>(ancestor->node())) {
+ HTMLElement& element = downcast<HTMLElement>(*ancestor->node());
+ const AtomicString& 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& title = toElement(curr->node())->getAttribute(titleAttr);
</del><ins>+ const AtomicString& title = element.getAttribute(titleAttr);
</ins><span class="cx"> if (!title.isEmpty() && 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()->getOrCreate(curr);
</del><ins>+ AccessibilityObject* axObj = axObjectCache()->getOrCreate(ancestor);
</ins><span class="cx"> if (axObj) {
</span><span class="cx"> AccessibilityRole role = axObj->roleValue();
</span><span class="cx"> if (role != GroupRole && 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->node()));
</del><ins>+ HTMLLabelElement* label = labelForElement(downcast<Element>(m_renderer->node()));
</ins><span class="cx"> if (!label || !label->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()->getOrCreate(toRenderFieldset(m_renderer)->findLegend(RenderFieldset::IncludeFloatingOrOutOfFlow));
</span><span class="cx">
</span><span class="cx"> Node* node = m_renderer->node();
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return nullptr;
</span><del>- HTMLLabelElement* label = labelForElement(toElement(node));
</del><ins>+ HTMLLabelElement* label = labelForElement(downcast<Element>(node));
</ins><span class="cx"> if (label && label->renderer())
</span><span class="cx"> return axObjectCache()->getOrCreate(label);
</span><span class="cx">
</span><span class="lines">@@ -1466,9 +1467,9 @@
</span><span class="cx"> Node* node = m_renderer->node();
</span><span class="cx"> if (!node)
</span><span class="cx"> return nullAtom;
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return nullAtom;
</span><del>- return toElement(node)->getAttribute(accesskeyAttr);
</del><ins>+ return downcast<Element>(*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->node();
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
- element->setAttribute(attributeName, (value) ? "true" : "false");
</del><ins>+ downcast<Element>(*node).setAttribute(attributeName, (value) ? "true" : "false");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool AccessibilityRenderObject::elementAttributeValue(const QualifiedName& attributeName) const
</span><span class="lines">@@ -1646,7 +1646,7 @@
</span><span class="cx"> Document* document = this->document();
</span><span class="cx"> Node* node = this->node();
</span><span class="cx">
</span><del>- if (!on || !node || !node->isElementNode()) {
</del><ins>+ if (!on || !node || !is<Element>(node)) {
</ins><span class="cx"> document->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->focusedElement() == node)
</span><span class="cx"> document->setFocusedElement(nullptr);
</span><span class="cx">
</span><del>- toElement(node)->focus();
</del><ins>+ downcast<Element>(*node).focus();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AccessibilityRenderObject::setSelectedRows(AccessibilityChildrenVector& selectedRows)
</span><span class="lines">@@ -1678,9 +1678,9 @@
</span><span class="cx">
</span><span class="cx"> void AccessibilityRenderObject::setValue(const String& string)
</span><span class="cx"> {
</span><del>- if (!m_renderer || !m_renderer->node() || !m_renderer->node()->isElementNode())
</del><ins>+ if (!m_renderer || !m_renderer->node() || !is<Element>(m_renderer->node()))
</ins><span class="cx"> return;
</span><del>- Element& element = toElement(*m_renderer->node());
</del><ins>+ Element& element = downcast<Element>(*m_renderer->node());
</ins><span class="cx">
</span><span class="cx"> if (!m_renderer->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()->node());
</del><ins>+ Element* element = downcast<Element>(renderer()->node());
</ins><span class="cx"> if (!element)
</span><span class="cx"> return;
</span><span class="cx"> if (!renderer()->frame().selection().isFocusedAndActive() || renderer()->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->node();
</span><del>- if (node && node->isHTMLElement()) {
- HTMLLabelElement* label = labelForElement(toElement(node));
- if (label)
</del><ins>+ if (node && is<HTMLElement>(node)) {
+ if (HTMLLabelElement* label = labelForElement(downcast<HTMLElement>(node)))
</ins><span class="cx"> return axObjectCache()->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, "textbox") || (node->isElementNode() && contentEditableAttributeIsEnabled(toElement(node))))
</del><ins>+ if (nodeHasRole(node, "textbox") || (is<Element>(node) && contentEditableAttributeIsEnabled(downcast<Element>(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->isAccessibilityRenderObject())
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- Node* elementNode = toAccessibilityRenderObject(parent)->node();
- if (!elementNode || !elementNode->isElementNode())
</del><ins>+ Node* node = toAccessibilityRenderObject(parent)->node();
+ if (!node || !is<Element>(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->contains(toElement(elementNode)->tagQName()))
</del><ins>+ if (possibleParentTagNames->contains(downcast<Element>(node)->tagQName()))
</ins><span class="cx"> return parent->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->document().documentElement();
</del><ins>+ node = m_renderer->document().documentElement();
</ins><span class="cx"> else
</span><del>- domNode = m_renderer->node();
</del><ins>+ node = m_renderer->node();
</ins><span class="cx">
</span><del>- if (domNode && domNode->isElementNode())
- toElement(domNode)->setAttribute(aria_labelAttr, name);
</del><ins>+ if (node && is<Element>(node))
+ downcast<Element>(*node).setAttribute(aria_labelAttr, name);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool isLinkable(const AccessibilityRenderObject& 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->node();
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return String();
</span><span class="cx">
</span><del>- Element* element = toElement(node);
- if (!shouldReturnTagNameAsRoleForMSAA(*element))
</del><ins>+ Element& element = downcast<Element>(*node);
+ if (!shouldReturnTagNameAsRoleForMSAA(element))
</ins><span class="cx"> return String();
</span><span class="cx">
</span><del>- return element->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->node();
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!node || !is<Element>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> // The default event handler on SearchFieldCancelButtonElement requires hover.
</span><del>- element->setHovered(true);
- element->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->node();
</span><del>- if (node && node->isElementNode()) {
- String id = toElement(node)->getIdAttribute().string();
</del><ins>+ if (node && is<Element>(node)) {
+ String id = downcast<Element>(*node).getIdAttribute().string();
</ins><span class="cx"> if (!id.isEmpty())
</span><span class="cx"> attributeSet = addToAtkAttributeSet(attributeSet, "html-id", 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<HTMLElement>(node))
</span><span class="cx"> return WEBKIT_DOM_NODE(wrap(downcast<HTMLElement>(node)));
</span><del>- return WEBKIT_DOM_NODE(wrapElement(toElement(node)));
</del><ins>+ return WEBKIT_DOM_NODE(wrapElement(downcast<Element>(node)));
</ins><span class="cx"> case Node::ATTRIBUTE_NODE:
</span><span class="cx"> return WEBKIT_DOM_NODE(wrapAttr(static_cast<Attr*>(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& visitor)
</span><span class="cx"> {
</span><span class="cx"> if (!node->inDocument()) {
</span><del>- if (node->isElementNode()) {
- auto& element = toElement(*node);
</del><ins>+ if (is<Element>(node)) {
+ auto& element = downcast<Element>(*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->isElementNode())
</del><ins>+ if (!is<Element>(*m_node))
</ins><span class="cx"> return m_node.get();
</span><del>- Element* element = toElement(m_node.get());
</del><ins>+ Element& element = downcast<Element>(*m_node);
</ins><span class="cx"> PseudoElement* pseudoElement;
</span><del>- if (m_pseudoElementSpecifier == BEFORE && (pseudoElement = element->beforePseudoElement()))
</del><ins>+ if (m_pseudoElementSpecifier == BEFORE && (pseudoElement = element.beforePseudoElement()))
</ins><span class="cx"> return pseudoElement;
</span><del>- if (m_pseudoElementSpecifier == AFTER && (pseudoElement = element->afterPseudoElement()))
</del><ins>+ if (m_pseudoElementSpecifier == AFTER && (pseudoElement = element.afterPseudoElement()))
</ins><span class="cx"> return pseudoElement;
</span><del>- return element;
</del><ins>+ return &element;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<CSSValue> 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->renderStyle() == parentStyle && currentNode->lastChild()
</span><del>- && currentNode->isElementNode() && !parentElementPreventsSharing(toElement(currentNode))
</del><ins>+ && is<Element>(currentNode) && !parentElementPreventsSharing(downcast<Element>(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() && !child.isNamedFlowContentNode())
</span><span class="cx"> return;
</span><del>- if (child.isElementNode())
- Style::detachRenderTree(toElement(child));
</del><ins>+ if (is<Element>(child))
+ Style::detachRenderTree(downcast<Element>(child));
</ins><span class="cx"> else if (is<Text>(child))
</span><span class="cx"> Style::detachTextRenderer(downcast<Text>(child));
</span><span class="cx"> }
</span><span class="lines">@@ -347,9 +347,9 @@
</span><span class="cx"> void ContainerNode::notifyChildRemoved(Node& 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->isElementNode()) ? toElement(previousSibling) : ElementTraversal::previousSibling(previousSibling);
- change.nextSiblingElement = (!nextSibling || nextSibling->isElementNode()) ? toElement(nextSibling) : ElementTraversal::nextSibling(nextSibling);
</del><ins>+ change.type = is<Element>(child) ? ElementRemoved : is<Text>(child) ? TextRemoved : NonContentsChildChanged;
+ change.previousSiblingElement = (!previousSibling || is<Element>(previousSibling)) ? downcast<Element>(previousSibling) : ElementTraversal::previousSibling(previousSibling);
+ change.nextSiblingElement = (!nextSibling || is<Element>(nextSibling)) ? downcast<Element>(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<Element>(node))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- if (RefPtr<ShadowRoot> root = toElement(node).shadowRoot()) {
</del><ins>+ if (RefPtr<ShadowRoot> root = downcast<Element>(node).shadowRoot()) {
</ins><span class="cx"> if (node.inDocument() && root->hostElement() == &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<Element>(node))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (node.document().cssTarget() == &node)
</span><span class="cx"> node.document().setCSSTarget(0);
</span><span class="cx">
</span><del>- if (RefPtr<ShadowRoot> root = toElement(node).shadowRoot()) {
</del><ins>+ if (RefPtr<ShadowRoot> root = downcast<Element>(node).shadowRoot()) {
</ins><span class="cx"> if (!node.inDocument() && root->hostElement() == &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<Element>(node))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- if (RefPtr<ShadowRoot> root = toElement(node).shadowRoot())
</del><ins>+ if (RefPtr<ShadowRoot> root = downcast<Element>(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<Element>(node)) {
</ins><span class="cx"> if (is<HTMLFrameOwnerElement>(node) && downcast<HTMLFrameOwnerElement>(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<Element>(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->nodeValue());
</span><span class="cx"> case ELEMENT_NODE: {
</span><del>- Element& oldElement = toElement(*importedNode);
</del><ins>+ Element& oldElement = downcast<Element>(*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 && !node->isElementNode())
</del><ins>+ while (node && !is<Element>(node))
</ins><span class="cx"> node = node->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<Element>(node);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Range> 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<HTMLLinkElement>(*node) || is<HTMLStyleElement>(*node) || is<SVGStyleElement>(*node)) {
</span><del>- Element& element = toElement(*node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> AtomicString title = element.fastGetAttribute(titleAttr);
</span><span class="cx"> bool enabledViaScript = false;
</span><span class="cx"> if (is<HTMLLinkElement>(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->parentNode())) {
</span><del>- if (currentNode->isElementNode()) {
- if (const ElementData* elementData = toElement(*currentNode).elementData()) {
</del><ins>+ if (is<Element>(currentNode)) {
+ if (const ElementData* elementData = downcast<Element>(*currentNode).elementData()) {
</ins><span class="cx"> if (const Attribute* attribute = elementData->findLanguageAttribute())
</span><span class="cx"> return attribute->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<ElementData> m_elementData;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline bool isElement(const Node& node) { return node.isElementNode(); }
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(Element)
+ static bool isElement(const Node& node) { return node.isElementNode(); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx">
</span><del>-NODE_TYPE_CASTS(Element)
-
-template <>
-struct NodeTypeCastTraits<const Element, const Node> {
- static bool isType(const Node& node) { return node.isElementNode(); }
-};
-
</del><span class="cx"> inline bool Node::hasAttributes() const
</span><span class="cx"> {
</span><del>- return isElementNode() && toElement(this)->hasAttributes();
</del><ins>+ return is<Element>(*this) && downcast<Element>(*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() ? &toElement(this)->attributes() : nullptr;
</del><ins>+ return is<Element>(*this) ? &downcast<Element>(*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 && parent->isElementNode() ? toElement(parent) : nullptr;
</del><ins>+ return parent && is<Element>(parent) ? downcast<Element>(parent) : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool Element::fastHasAttribute(const QualifiedName& 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<Element>::nextTemplate(CurrentType* current)
</span><span class="cx"> {
</span><span class="cx"> Node* node = NodeTraversal::next(current);
</span><del>- while (node && !node->isElementNode())
</del><ins>+ while (node && !is<Element>(node))
</ins><span class="cx"> node = NodeTraversal::nextSkippingChildren(node);
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(node);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <>
</span><span class="lines">@@ -105,9 +105,9 @@
</span><span class="cx"> inline Element* Traversal<Element>::nextTemplate(CurrentType* current, const Node* stayWithin)
</span><span class="cx"> {
</span><span class="cx"> Node* node = NodeTraversal::next(current, stayWithin);
</span><del>- while (node && !node->isElementNode())
</del><ins>+ while (node && !is<Element>(node))
</ins><span class="cx"> node = NodeTraversal::nextSkippingChildren(node, stayWithin);
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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 && !node->isElementNode())
</del><ins>+ while (node && !is<Element>(node))
</ins><span class="cx"> node = NodeTraversal::previousIncludingPseudo(node, stayWithin);
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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 && !node->isElementNode())
</del><ins>+ while (node && !is<Element>(node))
</ins><span class="cx"> node = NodeTraversal::nextIncludingPseudo(node, stayWithin);
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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 && !node->isElementNode())
</del><ins>+ while (node && !is<Element>(node))
</ins><span class="cx"> node = NodeTraversal::nextIncludingPseudoSkippingChildren(node, stayWithin);
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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->pseudoAwarePreviousSibling();
</span><del>- while (node && !node->isElementNode())
</del><ins>+ while (node && !is<Element>(node))
</ins><span class="cx"> node = node->pseudoAwarePreviousSibling();
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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->length();
</span><span class="cx"> for (unsigned i = 0; i < length; i++) {
</span><span class="cx"> Node* node = item(i);
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><del>- Element* element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> // FIXME: This should probably be using getIdAttribute instead of idForStyleResolution.
</span><del>- if (element->hasID() && element->idForStyleResolution() == elementId)
</del><ins>+ if (element.hasID() && 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->hasRareData()) {
</span><span class="cx"> ++nodesWithRareData;
</span><del>- if (node->isElementNode()) {
</del><ins>+ if (is<Element>(node)) {
</ins><span class="cx"> ++elementsWithRareData;
</span><del>- if (toElement(node)->hasNamedNodeMap())
</del><ins>+ if (downcast<Element>(*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<String, size_t>::AddResult result = perTagCount.add(element->tagName(), 1);
</del><ins>+ Element& element = downcast<Element>(*node);
+ HashMap<String, size_t>::AddResult result = perTagCount.add(element.tagName(), 1);
</ins><span class="cx"> if (!result.isNewEntry)
</span><span class="cx"> result.iterator->value++;
</span><span class="cx">
</span><del>- if (ElementData* elementData = element->elementData()) {
</del><ins>+ if (ElementData* elementData = element.elementData()) {
</ins><span class="cx"> unsigned length = elementData->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->nodeType();
</span><span class="cx"> if (type == ELEMENT_NODE)
</span><del>- toElement(node.get())->normalizeAttributes();
</del><ins>+ downcast<Element>(*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->beforePseudoElement();
</del><ins>+ if (is<Element>(*this)) {
+ const Element& currentElement = downcast<Element>(*this);
+ Node* first = currentElement.beforePseudoElement();
</ins><span class="cx"> if (first)
</span><span class="cx"> return first;
</span><del>- first = currentElement->firstChild();
</del><ins>+ first = currentElement.firstChild();
</ins><span class="cx"> if (!first)
</span><del>- first = currentElement->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->afterPseudoElement();
</del><ins>+ if (is<Element>(*this)) {
+ const Element& currentElement = downcast<Element>(*this);
+ Node* last = currentElement.afterPseudoElement();
</ins><span class="cx"> if (last)
</span><span class="cx"> return last;
</span><del>- last = currentElement->lastChild();
</del><ins>+ last = currentElement.lastChild();
</ins><span class="cx"> if (!last)
</span><del>- last = currentElement->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->parentOrShadowHostNode()) {
</span><del>- if (node->isElementNode())
- return toElement(node)->computedStyle(pseudoElementSpecifier);
</del><ins>+ if (is<Element>(node))
+ return downcast<Element>(*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<ShadowRoot>(parent))
</span><span class="cx"> return downcast<ShadowRoot>(parent)->hostElement();
</span><span class="cx">
</span><del>- if (!parent->isElementNode())
</del><ins>+ if (!is<Element>(parent))
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- return toElement(parent);
</del><ins>+ return downcast<Element>(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<Node*>(this); n && n->hasEditableStyle(); n = n->parentNode()) {
- if (n->isElementNode())
- result = toElement(n);
- if (n->hasTagName(bodyTag))
</del><ins>+ Element* result = nullptr;
+ for (Node* node = const_cast<Node*>(this); node && node->hasEditableStyle(); node = node->parentNode()) {
+ if (is<Element>(node))
+ result = downcast<Element>(node);
+ if (is<HTMLBodyElement>(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->nodeValue())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (isElementNode() && !toElement(this)->hasEquivalentAttributes(toElement(other)))
</del><ins>+ if (is<Element>(*this) && !downcast<Element>(*this).hasEquivalentAttributes(downcast<Element>(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& element = downcast<Element>(*this);
</ins><span class="cx">
</span><del>- if (elem->prefix().isNull())
- return elem->namespaceURI() == namespaceURI;
</del><ins>+ if (element.prefix().isNull())
+ return element.namespaceURI() == namespaceURI;
</ins><span class="cx">
</span><del>- if (elem->hasAttributes()) {
- for (const Attribute& attribute : elem->attributesIterator()) {
</del><ins>+ if (element.hasAttributes()) {
+ for (const Attribute& 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->lookupNamespaceURI(prefix()) == _namespaceURI)
</span><span class="cx"> return prefix();
</span><span class="cx">
</span><del>- ASSERT(isElementNode());
- const Element* thisElement = toElement(this);
- if (thisElement->hasAttributes()) {
- for (const Attribute& attribute : thisElement->attributesIterator()) {
</del><ins>+ ASSERT(is<Element>(*this));
+ const Element& thisElement = downcast<Element>(*this);
+ if (thisElement.hasAttributes()) {
+ for (const Attribute& attribute : thisElement.attributesIterator()) {
</ins><span class="cx"> if (attribute.prefix() == xmlnsAtom && attribute.value() == _namespaceURI
</span><span class="cx"> && originalElement->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->parentNode()) {
- if (n->isElementNode())
- return toElement(n);
</del><ins>+ for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
+ if (is<Element>(ancestor))
+ return downcast<Element>(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& stringBuilder, const QualifiedName& name, const char* attrDesc)
</span><span class="cx"> {
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- String attr = toElement(node)->getAttribute(name);
</del><ins>+ const AtomicString& attr = downcast<Element>(*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, "/%s", node->nodeName().utf8().data());
</span><span class="cx">
</span><del>- const Element* element = toElement(node);
- const AtomicString& idattr = element->getIdAttribute();
</del><ins>+ const Element& element = downcast<Element>(*node);
+ const AtomicString& idattr = element.getIdAttribute();
</ins><span class="cx"> bool hasIdAttr = !idattr.isNull() && !idattr.isEmpty();
</span><span class="cx"> if (node->previousSibling() || node->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->isLink() && !is<HTMLImageElement>(node))
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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() && toElement(*this).isDisabledFormControl() && event.isMouseEvent())
</del><ins>+ if (is<Element>(*this) && downcast<Element>(*this).isDisabledFormControl() && event.isMouseEvent())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> fireEventListeners(&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<Element>(*this))
</ins><span class="cx"> return false;
</span><del>- if (toElement(this)->isDisabledFormControl())
</del><ins>+ if (downcast<Element>(*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<Element>(*this))
</ins><span class="cx"> return false;
</span><del>- if (toElement(this)->isDisabledFormControl())
</del><ins>+ if (downcast<Element>(*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->isShadowRoot())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (parent->isElementNode() && toElement(parent)->shadowRoot())
</del><ins>+ if (is<Element>(parent) && downcast<Element>(*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 && !n->isElementNode())
- n = n->parentNode();
- return toElement(n);
</del><ins>+ Node* node = anchorNode();
+ while (node && !is<Element>(node))
+ node = node->parentNode();
+ return downcast<Element>(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->isElementNode() && selectedElementsSet.contains(node) && !selectedElementsSet.contains(node->parentNode())) {
- if (RenderBoxModelObject* renderBoxModelObject = toElement(node)->renderBoxModelObject()) {
</del><ins>+ if (is<Element>(node) && selectedElementsSet.contains(node) && !selectedElementsSet.contains(node->parentNode())) {
+ if (RenderBoxModelObject* renderBoxModelObject = downcast<Element>(*node).renderBoxModelObject()) {
</ins><span class="cx"> Vector<FloatQuad> elementQuads;
</span><span class="cx"> renderBoxModelObject->absoluteQuads(elementQuads);
</span><span class="cx"> ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, renderBoxModelObject->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<Element>(*this))
</ins><span class="cx"> return nullptr;
</span><del>- return toElement(this)->shadowRoot();
</del><ins>+ return downcast<Element>(*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 < length; ++i) {
</span><span class="cx"> Node& node = const_cast<Node&>(m_nodes[i].get());
</span><del>- if (node.isElementNode() && toElement(node).getIdAttribute() == elementId)
</del><ins>+ if (is<Element>(node) && downcast<Element>(node).getIdAttribute() == elementId)
</ins><span class="cx"> return &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->nodeLists()->adoptTreeScope();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> if (node->hasSyntheticAttrChildNodes()) {
</span><del>- const Vector<RefPtr<Attr>>& attrs = toElement(node)->attrNodeList();
</del><ins>+ const Vector<RefPtr<Attr>>& attrs = downcast<Element>(*node).attrNodeList();
</ins><span class="cx"> for (unsigned i = 0; i < 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 && (!node->isElementNode() || !isStyleSpanOrSpanWithOnlyStyleAttribute(toElement(node))))
</del><ins>+ while (node && (!is<Element>(node) || !isStyleSpanOrSpanWithOnlyStyleAttribute(downcast<Element>(node))))
</ins><span class="cx"> node = node->parentNode();
</span><span class="cx">
</span><del>- return node ? node->parentNode() : 0;
</del><ins>+ return node ? node->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<Node> currentNode = node;
</span><span class="cx"> while (currentNode) {
</span><del>- RefPtr<Element> parent = toElement(currentNode->parentNode());
</del><ins>+ RefPtr<Element> parent = downcast<Element>(currentNode->parentNode());
</ins><span class="cx"> if (before ? currentNode->previousSibling() : currentNode->nextSibling())
</span><span class="cx"> splitElement(parent, before ? currentNode : currentNode->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<StyledElement> styledElement;
</span><del>- if (is<StyledElement>(*current) && isStyledInlineElementToRemove(toElement(current.get()))) {
</del><ins>+ if (is<StyledElement>(*current) && isStyledInlineElementToRemove(downcast<Element>(current.get()))) {
</ins><span class="cx"> styledElement = downcast<StyledElement>(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->previousSibling();
</span><span class="cx">
</span><span class="cx"> if (previousSibling && areIdenticalElements(startNode, previousSibling)) {
</span><del>- Element* previousElement = toElement(previousSibling);
- Element* element = toElement(startNode);
</del><ins>+ Element* previousElement = downcast<Element>(previousSibling);
+ Element* element = downcast<Element>(startNode);
</ins><span class="cx"> Node* startChild = element->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->nextSibling();
</span><span class="cx"> if (nextSibling && areIdenticalElements(endNode, nextSibling)) {
</span><del>- Element* nextElement = toElement(nextSibling);
- Element* element = toElement(endNode);
</del><ins>+ Element* nextElement = downcast<Element>(nextSibling);
+ Element* element = downcast<Element>(endNode);
</ins><span class="cx"> Node* nextChild = nextElement->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<Node> nextSibling = element->nextSibling();
</span><span class="cx"> RefPtr<Node> previousSibling = element->previousSibling();
</span><del>- if (nextSibling && nextSibling->isElementNode() && nextSibling->hasEditableStyle()
- && areIdenticalElements(element.get(), toElement(nextSibling.get())))
- mergeIdenticalElements(element.get(), toElement(nextSibling.get()));
</del><ins>+ if (nextSibling && is<Element>(*nextSibling) && nextSibling->hasEditableStyle()
+ && areIdenticalElements(element.get(), downcast<Element>(nextSibling.get())))
+ mergeIdenticalElements(element.get(), downcast<Element>(nextSibling.get()));
</ins><span class="cx">
</span><del>- if (previousSibling && previousSibling->isElementNode() && previousSibling->hasEditableStyle()) {
</del><ins>+ if (previousSibling && is<Element>(*previousSibling) && previousSibling->hasEditableStyle()) {
</ins><span class="cx"> Node* mergedElement = previousSibling->nextSibling();
</span><del>- if (mergedElement->isElementNode() && mergedElement->hasEditableStyle()
- && areIdenticalElements(toElement(previousSibling.get()), toElement(mergedElement)))
- mergeIdenticalElements(toElement(previousSibling.get()), toElement(mergedElement));
</del><ins>+ if (is<Element>(mergedElement) && mergedElement->hasEditableStyle()
+ && areIdenticalElements(downcast<Element>(previousSibling.get()), downcast<Element>(mergedElement)))
+ mergeIdenticalElements(downcast<Element>(previousSibling.get()), downcast<Element>(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<Element> clonedBlockquote = toElement(topBlockquote)->cloneElementWithoutChildren();
</del><ins>+ RefPtr<Element> clonedBlockquote = downcast<Element>(*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 "ElementTraversal.h"
</span><span class="cx"> #include "ExceptionCodePlaceholder.h"
</span><span class="cx"> #include "Frame.h"
</span><ins>+#include "HTMLDivElement.h"
</ins><span class="cx"> #include "HTMLElement.h"
</span><ins>+#include "HTMLLIElement.h"
</ins><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "InlineTextBox.h"
</span><span class="cx"> #include "InsertIntoTextNodeCommand.h"
</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->hasTagName(divTag))
</del><ins>+ if (!is<HTMLDivElement>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> Node* parentNode = node->parentNode();
</span><span class="cx"> if (parentNode && parentNode->firstChild() != parentNode->lastChild())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (!toElement(node)->hasAttributes())
</del><ins>+ if (!downcast<HTMLDivElement>(*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<Node> child = item->cloneNode(isRenderedTable(item));
</span><del>- appendNode(child, toElement(lastNode.get()));
</del><ins>+ appendNode(child, downcast<Element>(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<Element> newBlock = 0;
</span><span class="cx"> if (ContainerNode* blockEnclosingList = listNode->parentNode()) {
</span><del>- if (blockEnclosingList->hasTagName(liTag)) { // listNode is inside another list item
</del><ins>+ if (is<HTMLLIElement>(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. <ul><li>hello <ul><li><br></li></ul> </li></ul> should become <ul><li>hello</li> <ul><li><br></li></ul> </ul> 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. <ul><li> <ul><li><br></li></ul> hello</li></ul> should become <ul><li> <div><br></div> hello</li></ul> at the end
</span><del>- splitElement(toElement(blockEnclosingList), listNode);
</del><ins>+ splitElement(downcast<HTMLLIElement>(blockEnclosingList), listNode);
</ins><span class="cx"> removeNodePreservingChildren(listNode->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<Element>(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<Node> endNode = end;
</span><span class="cx"> for (node = start; node && node->parentNode() != endNode; node = node->parentNode()) {
</span><del>- if (!node->parentNode()->isElementNode())
</del><ins>+ if (!is<Element>(node->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->parentNode());
</span><span class="cx"> VisiblePosition positionInNode = firstPositionInOrBeforeNode(node.get());
</span><span class="cx"> if (positionInParent != positionInNode)
</span><del>- splitElement(toElement(node->parentNode()), node);
</del><ins>+ splitElement(downcast<Element>(node->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 "Frame.h"
</span><span class="cx"> #include "htmlediting.h"
</span><span class="cx"> #include "HTMLInputElement.h"
</span><ins>+#include "HTMLLinkElement.h"
</ins><span class="cx"> #include "HTMLNames.h"
</span><ins>+#include "HTMLStyleElement.h"
</ins><span class="cx"> #include "HTMLTableElement.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><span class="cx"> #include "RenderTableCell.h"
</span><span class="lines">@@ -434,7 +436,7 @@
</span><span class="cx"> RefPtr<Node> node = range->firstNode();
</span><span class="cx"> while (node && node != range->pastLastNode()) {
</span><span class="cx"> RefPtr<Node> nextNode = NodeTraversal::next(node.get());
</span><del>- if ((node->hasTagName(styleTag) && !(toElement(node.get())->hasAttribute(scopedAttr))) || node->hasTagName(linkTag)) {
</del><ins>+ if ((is<HTMLStyleElement>(*node) && !downcast<HTMLStyleElement>(*node).hasAttribute(scopedAttr)) || is<HTMLLinkElement>(*node)) {
</ins><span class="cx"> nextNode = NodeTraversal::nextSkippingChildren(node.get());
</span><span class="cx"> RefPtr<ContainerNode> rootEditableElement = node->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->isElementNode() ? toElement(node) : node->parentElement();
</del><ins>+ const Element* focusedElement = is<Element>(node) ? downcast<Element>(node) : node->parentElement();
</ins><span class="cx"> if (!focusedElement)
</span><span class="cx"> return false;
</span><span class="cx"> return focusedElement->isSpellCheckingEnabled();
</span><span class="lines">@@ -3100,7 +3100,7 @@
</span><span class="cx"> RefPtr<NodeList> list = document().getElementsByTagName("body");
</span><span class="cx"> unsigned len = list->length();
</span><span class="cx"> for (unsigned i = 0; i < len; i++)
</span><del>- applyEditingStyleToElement(toElement(list->item(i)));
</del><ins>+ applyEditingStyleToElement(downcast<Element>(list->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& tagName);
</span><span class="cx"> static inline bool isElementForFormatBlock(Node* node)
</span><span class="cx"> {
</span><del>- return node->isElementNode() && isElementForFormatBlock(toElement(node)->tagQName());
</del><ins>+ return is<Element>(node) && isElementForFormatBlock(downcast<Element>(*node).tagQName());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FormatBlockCommand::FormatBlockCommand(Document& document, const QualifiedName& 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->commonAncestorContainer(IGNORE_EXCEPTION);
</span><span class="cx"> while (commonAncestor && !isElementForFormatBlock(commonAncestor))
</span><span class="cx"> commonAncestor = commonAncestor->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->startContainer()->rootEditableElement();
</span><span class="cx"> if (!rootEditableElement || commonAncestor->contains(rootEditableElement))
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><del>- return commonAncestor->isElementNode() ? toElement(commonAncestor) : 0;
</del><ins>+ return commonAncestor->isElementNode() ? downcast<Element>(commonAncestor) : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool isElementForFormatBlock(const QualifiedName& 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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
</del><ins>+ Element* element = downcast<Element>(node);
</ins><span class="cx"> return element->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->isElementNode() ? toElement(node) : node->parentElement();
</del><ins>+ Element* element = is<Element>(node) ? downcast<Element>(node) : node->parentElement();
</ins><span class="cx"> Element* rootEditableElement = node->rootEditableElement();
</span><span class="cx">
</span><span class="cx"> if (element && element->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->node()->isElementNode()) {
- Element* element = toElement(r->node());
</del><ins>+ if (is<Element>(renderer->node())) {
+ Element* element = downcast<Element>(renderer->node());
</ins><span class="cx"> fprintf(stderr, "%s%s\n", selected ? "==> " : " ", element->localName().string().utf8().data());
</span><del>- } else if (r->isText()) {
- RenderText* textRenderer = toRenderText(r);
</del><ins>+ } else if (renderer->isText()) {
+ RenderText* textRenderer = toRenderText(renderer);
</ins><span class="cx"> if (!textRenderer->textLength() || !textRenderer->firstTextBox()) {
</span><span class="cx"> fprintf(stderr, "%s#text (empty)\n", selected ? "==> " : " ");
</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->node() == m_selection.start().containerNode())
</del><ins>+ if (renderer->node() == m_selection.start().containerNode())
</ins><span class="cx"> offset = m_selection.start().computeOffsetInContainerNode();
</span><del>- else if (r->node() == m_selection.end().containerNode())
</del><ins>+ else if (renderer->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->hasTagName(blockquoteTag)
</span><span class="cx"> && !splitPoint->hasTagName(blockquoteTag)
</span><span class="cx"> && splitPointParent->parentNode()->hasEditableStyle()) // We can't outdent if there is no place to go!
</span><del>- splitElement(toElement(splitPointParent), splitPoint);
</del><ins>+ splitElement(downcast<Element>(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<Element>(enclosingNode), highestInlineNode ? highestInlineNode : visibleStartOfParagraph.deepEquivalent().deprecatedNode());
</ins><span class="cx"> }
</span><span class="cx"> RefPtr<Node> 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, &isMailBlockquote))
</span><del>- startBlock = toElement(highestBlockquote);
</del><ins>+ startBlock = downcast<Element>(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 (&targetNode == nodeToSkip)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (tagNamesToSkip && targetNode.isElementNode()) {
</del><ins>+ if (tagNamesToSkip && is<Element>(targetNode)) {
</ins><span class="cx"> for (auto& name : *tagNamesToSkip) {
</span><del>- if (toElement(targetNode).hasTagName(name))
</del><ins>+ if (downcast<Element>(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<ProcessingInstruction>(node).target(), downcast<ProcessingInstruction>(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<Element>(node), namespaces);
</ins><span class="cx"> break;
</span><span class="cx"> case Node::CDATA_SECTION_NODE:
</span><span class="cx"> appendCDATASection(result, downcast<CDATASection>(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&);
</span><span class="cx"> void appendEndTag(const Node& node)
</span><span class="cx"> {
</span><del>- if (node.isElementNode())
- appendEndTag(toElement(node));
</del><ins>+ if (is<Element>(node))
+ appendEndTag(downcast<Element>(node));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual void appendEndTag(const Element&);
</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->renderer()->previousSibling()->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<Element>(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 && node->hasTagName(blockquoteTag) && node->isElementNode() && toElement(node)->getAttribute(classAttr) == ApplePasteAsQuotation;
</del><ins>+ return node && node->hasTagName(blockquoteTag) && downcast<Element>(node)->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 && b && a->isElementNode() && b->isElementNode() && toElement(a)->tagName() == toElement(b)->tagName();
</del><ins>+ return a && b && is<Element>(a) && is<Element>(b) && downcast<Element>(*a).tagName() == downcast<Element>(*b).tagName();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool ReplaceSelectionCommand::shouldMerge(const VisiblePosition& source, const VisiblePosition& 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)->getAttribute(styleAttr))
</del><ins>+ if (styleText != downcast<Element>(*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<Element>(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->firstNode() || !range->firstNode()->renderer())
</span><span class="cx"> return false;
</span><span class="cx"> const Node* node = range->startContainer();
</span><del>- if (node && node->isElementNode() && !toElement(node)->isSpellCheckingEnabled())
</del><ins>+ if (node && is<Element>(node) && !downcast<Element>(*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->isInline()) {
</span><span class="cx"> wrapContentsInDummySpan(parent);
</span><span class="cx"> Node* firstChild = parent->firstChild();
</span><del>- if (!firstChild || !firstChild->isElementNode())
</del><ins>+ if (!firstChild || !is<Element>(firstChild))
</ins><span class="cx"> return;
</span><del>- parent = toElement(firstChild);
</del><ins>+ parent = downcast<Element>(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->isImage() || renderer->isWidget() || renderer->isMedia())
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (renderer->node() && renderer->node()->isElementNode()) {
- Element& element = toElement(*renderer->node());
</del><ins>+ if (renderer->node() && is<Element>(renderer->node())) {
+ Element& element = downcast<Element>(*renderer->node());
</ins><span class="cx"> if (is<HTMLFormControlElement>(element) || is<HTMLLegendElement>(element) || is<HTMLMeterElement>(element) || is<HTMLProgressElement>(element))
</span><span class="cx"> return true;
</span><span class="cx"> if (equalIgnoringCase(element.fastGetAttribute(roleAttr), "img"))
</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 "FrameLoader.h"
</span><span class="cx"> #import "HTMLElement.h"
</span><span class="cx"> #import "HTMLFrameElementBase.h"
</span><ins>+#import "HTMLImageElement.h"
</ins><span class="cx"> #import "HTMLInputElement.h"
</span><span class="cx"> #import "HTMLMetaElement.h"
</span><span class="cx"> #import "HTMLNames.h"
</span><span class="lines">@@ -738,14 +739,14 @@
</span><span class="cx">
</span><span class="cx"> String HTMLConverterCaches::propertyValueForNode(Node& node, CSSPropertyID propertyId)
</span><span class="cx"> {
</span><del>- if (!node.isElementNode()) {
</del><ins>+ if (!is<Element>(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& element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(node);
</ins><span class="cx"> if (RefPtr<CSSValue> 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& node, CSSPropertyID propertyId, float& result)
</span><span class="cx"> {
</span><del>- if (!node.isElementNode()) {
</del><ins>+ if (!is<Element>(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& element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(node);
</ins><span class="cx"> if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyId)) {
</span><span class="cx"> if (value->isPrimitiveValue() && 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& node, CSSPropertyID propertyId)
</span><span class="cx"> {
</span><del>- if (!node.isElementNode()) {
</del><ins>+ if (!is<Element>(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& element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(node);
</ins><span class="cx"> if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyId)) {
</span><span class="cx"> if (value->isPrimitiveValue() && 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& node)
</span><span class="cx"> {
</span><span class="cx"> Node* ancestor = node.parentNode();
</span><del>- while (ancestor && !ancestor->isElementNode())
</del><ins>+ while (ancestor && !is<Element>(ancestor))
</ins><span class="cx"> ancestor = ancestor->parentNode();
</span><span class="cx"> if (!ancestor)
</span><span class="cx"> return nullptr;
</span><del>- return aggregatedAttributesForElementAndItsAncestors(*toElement(ancestor));
</del><ins>+ return aggregatedAttributesForElementAndItsAncestors(downcast<Element>(*ancestor));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> NSDictionary* HTMLConverter::aggregatedAttributesForElementAndItsAncestors(Element& 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 && !ancestor->isElementNode())
</del><ins>+ while (ancestor && !is<Element>(ancestor))
</ins><span class="cx"> ancestor = ancestor->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<NSMutableDictionary> attributesForAncestors = adoptNS([aggregatedAttributesForElementAndItsAncestors(*toElement(ancestor)) mutableCopy]);
</del><ins>+ RetainPtr<NSMutableDictionary> attributesForAncestors = adoptNS([aggregatedAttributesForElementAndItsAncestors(downcast<Element>(*ancestor)) mutableCopy]);
</ins><span class="cx"> [attributesForAncestors addEntriesFromDictionary:attributesForCurrentElement];
</span><span class="cx"> m_aggregatedAttributesForElements.set(&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->nextSibling();
</span><span class="cx"> }
</span><del>- } else if (node.isElementNode()) {
- Element& element = toElement(node);
</del><ins>+ } else if (is<Element>(node)) {
+ Element& element = downcast<Element>(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 && (startOffset == endOffset - 1)) {
</span><span class="cx"> Node* node = startContainer->traverseToChildAt(startOffset);
</span><del>- if (node && node->hasTagName(imgTag)) {
- NSFileWrapper* fileWrapper = fileWrapperForElement(toElement(node));
</del><ins>+ if (node && is<HTMLImageElement>(node)) {
+ NSFileWrapper* fileWrapper = fileWrapperForElement(downcast<HTMLImageElement>(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, &isTableCell));
</del><ins>+ Element* enclosingCell = downcast<Element>(enclosingNodeOfType(p, &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 && enclosingNode->isElementNode() ? toElement(enclosingNode) : 0;
</del><ins>+ return enclosingNode && is<Element>(enclosingNode) ? downcast<Element>(enclosingNode) : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TextDirection directionOfEnclosingBlock(const Position& position)
</span><span class="lines">@@ -550,10 +550,10 @@
</span><span class="cx"> for (Node* node = position.deprecatedNode(); node; node = node->parentNode()) {
</span><span class="cx"> if (root && !node->hasEditableStyle())
</span><span class="cx"> continue;
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><del>- if (toElement(*node).hasTagName(tagName))
- return toElement(node);
</del><ins>+ if (downcast<Element>(*node).hasTagName(tagName))
+ return downcast<Element>(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& p)
</span><span class="cx"> {
</span><del>- return toElement(enclosingNodeOfType(p, isTableCell));
</del><ins>+ return downcast<Element>(enclosingNodeOfType(p, isTableCell));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Element* enclosingAnchorElement(const Position& 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->parentNode()) {
</span><del>- if (node->isElementNode() && node->isLink())
- return toElement(node);
</del><ins>+ if (is<Element>(node) && node->isLink())
+ return downcast<Element>(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->isElementNode() || !second->isElementNode())
</del><ins>+ if (!is<Element>(first) || !is<Element>(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<Element>(first);
+ const Element* secondElement = downcast<Element>(second);
</ins><span class="cx"> if (!firstElement->hasTagName(secondElement->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->isElementNode())
- return false;
-
- const Element* element = toElement(node);
- return element->hasTagName(listingTag)
- || element->hasTagName(olTag)
- || element->hasTagName(preTag)
- || is<HTMLTableElement>(element)
- || element->hasTagName(ulTag)
- || element->hasTagName(xmpTag)
- || element->hasTagName(h1Tag)
- || element->hasTagName(h2Tag)
- || element->hasTagName(h3Tag)
- || element->hasTagName(h4Tag)
- || element->hasTagName(h5Tag);
</del><ins>+ return node->hasTagName(listingTag)
+ || node->hasTagName(olTag)
+ || node->hasTagName(preTag)
+ || is<HTMLTableElement>(node)
+ || node->hasTagName(ulTag)
+ || node->hasTagName(xmpTag)
+ || node->hasTagName(h1Tag)
+ || node->hasTagName(h2Tag)
+ || node->hasTagName(h3Tag)
+ || node->hasTagName(h4Tag)
+ || node->hasTagName(h5Tag);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Position adjustedSelectionStartForStyleComputation(const VisibleSelection& 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<Element>(node);
</ins><span class="cx"> while ((node = node->parentNode())) {
</span><del>- if (isBlockFlowElement(node) || node->hasTagName(bodyTag))
- return toElement(node);
</del><ins>+ if (isBlockFlowElement(node) || is<HTMLBodyElement>(node))
+ return downcast<Element>(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->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->isRenderBlockFlow() && 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& 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 && isBlock(&node), rangeFullySelectsNode);
</del><ins>+ if (is<Element>(node))
+ appendElement(markup, downcast<Element>(node), convertBlocksToInlines && isBlock(&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 && VisiblePosition(firstPositionInNode(body)) == VisiblePosition(range.startPosition())
</span><span class="cx"> && 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->style() || !fullySelectedRootStyle->style()->getPropertyCSSValue(CSSPropertyBackgroundImage))
</span><del>- && toElement(fullySelectedRoot)->hasAttribute(backgroundAttr))
- fullySelectedRootStyle->style()->setProperty(CSSPropertyBackgroundImage, "url('" + toElement(fullySelectedRoot)->getAttribute(backgroundAttr) + "')");
</del><ins>+ && fullySelectedRoot->hasAttribute(backgroundAttr))
+ fullySelectedRootStyle->style()->setProperty(CSSPropertyBackgroundImage, "url('" + fullySelectedRoot->getAttribute(backgroundAttr) + "')");
</ins><span class="cx">
</span><span class="cx"> if (fullySelectedRootStyle->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<Element>(blockNode);
</ins><span class="cx"> bool useClonesOfEnclosingBlock = blockNode
</span><span class="cx"> && blockNode->isElementNode()
</span><span class="cx"> && !block->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() && firstChild()->hasTagName(summaryTag));
</span><del>- return toElement(firstChild());
</del><ins>+ return downcast<Element>(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->isElementNode());
- return toElement(returnValue);
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(!returnValue || is<Element>(returnValue));
+ return downcast<Element>(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, "beforeBegin") || equalIgnoringCase(where, "afterEnd")) {
</span><span class="cx"> ContainerNode* parent = element->parentNode();
</span><del>- if (parent && !parent->isElementNode()) {
</del><ins>+ if (parent && !is<Element>(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->isElementNode());
- return toElement(parent);
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(!parent || is<Element>(parent));
+ return downcast<Element>(parent);
</ins><span class="cx"> }
</span><span class="cx"> if (equalIgnoringCase(where, "afterBegin") || equalIgnoringCase(where, "beforeEnd"))
</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->nodeName(), "bdi") || node->hasTagName(scriptTag) || node->hasTagName(styleTag)
</span><del>- || (node->isElementNode() && toElement(node)->isTextFormControl())) {
</del><ins>+ || (is<Element>(node) && downcast<Element>(*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->isElementNode()) {
- AtomicString dirAttributeValue = toElement(node)->fastGetAttribute(dirAttr);
</del><ins>+ if (is<Element>(node)) {
+ AtomicString dirAttributeValue = downcast<Element>(*node).fastGetAttribute(dirAttr);
</ins><span class="cx"> if (isLTROrRTLIgnoringCase(dirAttributeValue) || equalIgnoringCase(dirAttributeValue, "auto")) {
</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& element) { return element.isFormControlElement(); }
</span><del>- static bool isHTMLFormControlElement(const Node& node) { return node.isElementNode() && toElement(node).isFormControlElement(); }
</del><ins>+ static bool isHTMLFormControlElement(const Node& node) { return is<Element>(node) && downcast<Element>(node).isFormControlElement(); }
</ins><span class="cx"> static bool isHTMLFormControlElement(const FormAssociatedElement& 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& element) { return element.isMediaElement(); }
</span><del>- static bool isHTMLMediaElement(const Node& node) { return node.isElementNode() && isHTMLMediaElement(toElement(node)); }
</del><ins>+ static bool isHTMLMediaElement(const Node& node) { return is<Element>(node) && isHTMLMediaElement(downcast<Element>(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 && isNamedItem) {
</span><del>- if (child->isElementNode()) {
- Element* element = toElement(child);
</del><ins>+ if (is<Element>(child)) {
+ Element& element = downcast<Element>(*child);
</ins><span class="cx"> // FIXME: Use of isRecognizedTagName is almost certainly wrong here.
</span><del>- if (isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag))
</del><ins>+ if (isRecognizedTagName(element.tagQName()) && !element.hasTagName(paramTag))
</ins><span class="cx"> isNamedItem = false;
</span><span class="cx"> } else if (is<Text>(child)) {
</span><span class="cx"> if (!downcast<Text>(*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->isTextNode())
</del><ins>+ if (is<Text>(node))
</ins><span class="cx"> text.append(node->nodeValue());
</span><span class="cx"> // Text nodes inside script elements are not part of the option text.
</span><del>- if (node->isElementNode() && toScriptElementIfPossible(toElement(node)))
</del><ins>+ if (is<Element>(node) && toScriptElementIfPossible(downcast<Element>(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& removalRoot)
</span><span class="cx"> {
</span><span class="cx"> Element* parent = parentElement();
</span><del>- if (!parent && removalRoot.isElementNode())
- parent = &toElement(removalRoot);
</del><ins>+ if (!parent && is<Element>(removalRoot))
+ parent = &downcast<Element>(removalRoot);
</ins><span class="cx"> if (parent && is<HTMLMediaElement>(parent))
</span><span class="cx"> downcast<HTMLMediaElement>(*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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return false;
</span><del>- Element* element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> if (is<HTMLFormControlElement>(element))
</span><span class="cx"> return true;
</span><del>- Element* host = element->shadowHost();
</del><ins>+ Element* host = element.shadowHost();
</ins><span class="cx"> return host && is<HTMLFormControlElement>(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& element) { return element.isTextFormControl(); }
</span><del>- static bool isHTMLTextFormControlElement(const Node& node) { return node.isElementNode() && isHTMLTextFormControlElement(toElement(node)); }
</del><ins>+ static bool isHTMLTextFormControlElement(const Node& node) { return is<Element>(node) && isHTMLTextFormControlElement(downcast<Element>(node)); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx">
</span><span class="cx"> HTMLTextFormControlElement* enclosingTextFormControl(const Position&);
</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<Node> prpChild, bool selfClosing)
</span><span class="cx"> {
</span><del>- ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !prpChild.get()->isElementNode() || !toScriptElementIfPossible(toElement(prpChild.get())));
</del><ins>+ ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is<Element>(prpChild.get()) || !toScriptElementIfPossible(downcast<Element>(prpChild.get())));
</ins><span class="cx"> ASSERT(pluginContentIsAllowed(m_parserContentPolicy) || !prpChild->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<Element>(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<Element>(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->isElementNode())
- return toElement(parent);
</del><ins>+ if (is<Element>(parent))
+ return downcast<Element>(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->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->type() == eventNames().clickEvent) {
</span><span class="cx"> Node* target = event->target()->toNode();
</span><del>- if (!target || !target->isElementNode())
</del><ins>+ if (!target || !is<Element>(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<TextTrack> textTrack;
</span><del>- MenuItemToTrackMap::iterator iter = m_menuToTrackMap.find(toElement(target));
</del><ins>+ MenuItemToTrackMap::iterator iter = m_menuToTrackMap.find(downcast<Element>(target));
</ins><span class="cx"> if (iter != m_menuToTrackMap.end())
</span><span class="cx"> textTrack = iter->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<WebVTTElement>(*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)->setIdAttribute(id());
</del><ins>+ downcast<WebVTTElement>(*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<Element>(oldNode);
+ Element* newElement = downcast<Element>(newNode);
</ins><span class="cx"> if (oldDigest->m_attrsSHA1 != newDigest->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->hasAttributesWithoutUpdate()) {
</span><span class="lines">@@ -426,7 +426,7 @@
</span><span class="cx"> child = child->nextSibling();
</span><span class="cx"> digest->m_children.append(WTF::move(childInfo));
</span><span class="cx"> }
</span><del>- Element* element = toElement(node);
</del><ins>+ Element* element = downcast<Element>(node);
</ins><span class="cx">
</span><span class="cx"> if (element->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 = "No node with given id found";
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- if (!node->isElementNode()) {
</del><ins>+ if (!is<Element>(node)) {
</ins><span class="cx"> *errorString = "Not an element node";
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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 < regionList->length(); ++i) {
</span><span class="cx"> Inspector::Protocol::CSS::Region::RegionOverset regionOverset;
</span><span class="cx">
</span><del>- switch (toElement(regionList->item(i))->regionOversetState()) {
</del><ins>+ switch (downcast<Element>(regionList->item(i))->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<Document*> 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->nodeForId(it->key)))
</del><ins>+ if (Element* element = downcast<Element>(m_domAgent->nodeForId(it->key)))
</ins><span class="cx"> documentsToChange.add(&element->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->isElementNode()) {
- if (ShadowRoot* root = toElement(node)->shadowRoot())
</del><ins>+ if (is<Element>(node)) {
+ if (ShadowRoot* root = downcast<Element>(*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->isElementNode()) {
</del><ins>+ if (!is<Element>(node)) {
</ins><span class="cx"> *errorString = "Node is not an Element";
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- return toElement(node);
</del><ins>+ return downcast<Element>(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<Element>(child);
</ins><span class="cx"> if (!childElement->hasAttributes() && name) {
</span><span class="cx"> m_domEditor->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->isElementNode())
</del><ins>+ if (!oldNode || !is<Element>(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->cloneAttributesFromElement(*toElement(oldNode));
</del><ins>+ newElem->cloneAttributesFromElement(*downcast<Element>(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->setChildren(children.release());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (node->isElementNode()) {
- Element* element = toElement(node);
- value->setAttributes(buildArrayForElementAttributes(element));
- if (is<HTMLFrameOwnerElement>(node)) {
- HTMLFrameOwnerElement& frameOwner = downcast<HTMLFrameOwnerElement>(*node);
</del><ins>+ if (is<Element>(node)) {
+ Element& element = downcast<Element>(*node);
+ value->setAttributes(buildArrayForElementAttributes(&element));
+ if (is<HTMLFrameOwnerElement>(element)) {
+ HTMLFrameOwnerElement& frameOwner = downcast<HTMLFrameOwnerElement>(element);
</ins><span class="cx"> Frame* frame = frameOwner.contentFrame();
</span><span class="cx"> if (frame)
</span><span class="cx"> value->setFrameId(m_pageAgent->frameId(frame));
</span><span class="lines">@@ -1282,7 +1282,7 @@
</span><span class="cx"> value->setContentDocument(buildObjectForNode(document, 0, nodesMap));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (ShadowRoot* root = element->shadowRoot()) {
</del><ins>+ if (ShadowRoot* root = element.shadowRoot()) {
</ins><span class="cx"> RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> shadowRoots = Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>::create();
</span><span class="cx"> shadowRoots->addItem(buildObjectForNode(root, 0, nodesMap));
</span><span class="cx"> value->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<HTMLTemplateElement>(element))
</span><del>- value->setTemplateContent(buildObjectForNode(downcast<HTMLTemplateElement>(*element).content(), 0, nodesMap));
</del><ins>+ value->setTemplateContent(buildObjectForNode(downcast<HTMLTemplateElement>(element).content(), 0, nodesMap));
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> } else if (is<Document>(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->isElementNode()) {
- supportsFocused = toElement(node)->isFocusable();
</del><ins>+ if (is<Element>(node)) {
+ supportsFocused = downcast<Element>(*node).isFocusable();
</ins><span class="cx"> if (supportsFocused)
</span><span class="cx"> focused = axObject->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<RevalidateStyleAttributeTask>(this);
</span><del>- m_revalidateStyleAttrTask->scheduleFor(toElement(node));
</del><ins>+ m_revalidateStyleAttrTask->scheduleFor(downcast<Element>(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<Element>(*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<InspectorObject> buildObjectForElementInfo(Node* node)
</span><span class="cx"> {
</span><del>- if (!node->isElementNode() || !node->document().frame())
</del><ins>+ if (!is<Element>(node) || !node->document().frame())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> RefPtr<InspectorObject> elementInfo = InspectorObject::create();
</span><span class="cx">
</span><del>- Element* element = toElement(node);
- bool isXHTML = element->document().isXHTMLDocument();
- elementInfo->setString("tagName", isXHTML ? element->nodeName() : element->nodeName().lower());
- elementInfo->setString("idValue", element->getIdAttribute());
</del><ins>+ Element& element = downcast<Element>(*node);
+ bool isXHTML = element.document().isXHTMLDocument();
+ elementInfo->setString("tagName", isXHTML ? element.nodeName() : element.nodeName().lower());
+ elementInfo->setString("idValue", element.getIdAttribute());
</ins><span class="cx"> HashSet<AtomicString> usedClassNames;
</span><del>- if (element->hasClass() && is<StyledElement>(element)) {
</del><ins>+ if (element.hasClass() && is<StyledElement>(element)) {
</ins><span class="cx"> StringBuilder classNames;
</span><del>- const SpaceSplitString& classNamesString = downcast<StyledElement>(*element).classNames();
</del><ins>+ const SpaceSplitString& classNamesString = downcast<StyledElement>(element).classNames();
</ins><span class="cx"> size_t classNameCount = classNamesString.size();
</span><span class="cx"> for (size_t i = 0; i < classNameCount; ++i) {
</span><span class="cx"> const AtomicString& className = classNamesString[i];
</span><span class="lines">@@ -701,7 +701,7 @@
</span><span class="cx"> elementInfo->setString("className", classNames.toString());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RenderElement* renderer = element->renderer();
</del><ins>+ RenderElement* renderer = element.renderer();
</ins><span class="cx"> Frame* containingFrame = node->document().frame();
</span><span class="cx"> FrameView* containingView = containingFrame->view();
</span><span class="cx"> IntRect boundingBox = snappedIntRect(containingView->contentsToRootView(renderer->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->ownerNode();
</span><del>- if (!ownerNode || !ownerNode->isElementNode())
</del><ins>+ if (!ownerNode || !is<Element>(ownerNode))
</ins><span class="cx"> return false;
</span><del>- Element* ownerElement = toElement(ownerNode);
</del><ins>+ Element& ownerElement = downcast<Element>(*ownerNode);
</ins><span class="cx">
</span><span class="cx"> if (!is<HTMLStyleElement>(ownerElement) && !is<SVGStyleElement>(ownerElement))
</span><span class="cx"> return false;
</span><del>- *result = ownerElement->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->renderView()->hitTest(HitTestRequest(), result);
</span><span class="cx">
</span><del>- Node* n = result.innerNode();
- while (n && !n->isElementNode())
- n = n->parentNode();
- if (n)
- n = n->deprecatedShadowAncestorNode();
</del><ins>+ Node* node = result.innerNode();
+ while (node && !is<Element>(node))
+ node = node->parentNode();
+ if (node)
+ node = node->deprecatedShadowAncestorNode();
</ins><span class="cx">
</span><del>- return toElement(n);
</del><ins>+ return downcast<Element>(node);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool DragController::tryDocumentDrag(DragData& dragData, DragDestinationAction actionMask, DragOperation& 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->isElementNode() ? toElement(target) : target->parentElement();
</del><ins>+ Element* element = is<Element>(target) ? downcast<Element>(target) : target->parentElement();
</ins><span class="cx"> for (; element; element = element->parentElement()) {
</span><span class="cx"> bool matched = false;
</span><span class="cx"> String dropZoneStr = element->fastGetAttribute(webkitdropzoneAttr);
</span><span class="lines">@@ -2233,10 +2233,10 @@
</span><span class="cx"> RefPtr<Element> 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->isElementNode())
</del><ins>+ if (!is<Element>(targetNode))
</ins><span class="cx"> newTarget = targetNode->parentOrShadowHostElement();
</span><span class="cx"> else
</span><del>- newTarget = toElement(targetNode);
</del><ins>+ newTarget = downcast<Element>(targetNode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_autoscrollController->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. <rdar://problem/4196646>
</span><del>- if (!targetNode->isElementNode())
</del><ins>+ if (!is<Element>(targetNode))
</ins><span class="cx"> targetElement = targetNode->parentOrShadowHostElement();
</span><span class="cx"> else
</span><del>- targetElement = toElement(targetNode);
</del><ins>+ targetElement = downcast<Element>(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)->shadowRoot());
- return FocusNavigationScope(toElement(node)->shadowRoot());
</del><ins>+ ASSERT(downcast<Element>(*node).shadowRoot());
+ return FocusNavigationScope(downcast<Element>(*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& node, KeyboardEvent& event)
</span><span class="cx"> {
</span><del>- return node.isElementNode() && toElement(node).isKeyboardFocusable(&event) && toElement(node).shadowRoot() && !hasCustomFocusLogic(toElement(node));
</del><ins>+ return is<Element>(node) && downcast<Element>(node).isKeyboardFocusable(&event) && downcast<Element>(node).shadowRoot() && !hasCustomFocusLogic(downcast<Element>(node));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline int adjustedTabIndex(Node& node, KeyboardEvent& event)
</span><span class="cx"> {
</span><del>- if (!node.isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return 0;
</span><del>- return isNonFocusableShadowHost(toElement(node), event) ? 0 : toElement(node).tabIndex();
</del><ins>+ return isNonFocusableShadowHost(downcast<Element>(node), event) ? 0 : downcast<Element>(node).tabIndex();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline bool shouldVisit(Element& element, KeyboardEvent& 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->isElementNode() || !isNonFocusableShadowHost(*toElement(currentNode), *event));
</del><ins>+ ASSERT(!currentNode || !is<Element>(currentNode) || !isNonFocusableShadowHost(*downcast<Element>(currentNode), *event));
</ins><span class="cx"> Element* found;
</span><span class="cx"> if (currentNode && direction == FocusDirectionForward && 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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><del>- Element& element = toElement(*node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> if (shouldVisit(element, *event) && adjustedTabIndex(element, *event) == tabIndex)
</span><span class="cx"> return &element;
</span><span class="cx"> }
</span><span class="lines">@@ -425,9 +425,9 @@
</span><span class="cx"> int winningTabIndex = std::numeric_limits<short>::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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><del>- Element& element = toElement(*node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> if (shouldVisit(element, event) && element.tabIndex() > tabIndex && element.tabIndex() < winningTabIndex) {
</span><span class="cx"> winner = &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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><del>- Element& element = toElement(*node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> int currentTabIndex = adjustedTabIndex(element, event);
</span><span class="cx"> if ((shouldVisit(element, event) || isNonFocusableShadowHost(element, event)) && currentTabIndex < tabIndex && currentTabIndex > winningTabIndex) {
</span><span class="cx"> winner = &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 < 0) {
</span><span class="cx"> for (Node* node = nextInScope(start); node; node = nextInScope(node)) {
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><del>- Element& element = toElement(*node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> if (shouldVisit(element, *event) && adjustedTabIndex(element, *event) >= 0)
</span><span class="cx"> return &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 < 0) {
</span><span class="cx"> for (Node* node = startingNode; node; node = previousInScope(node)) {
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><del>- Element& element = toElement(*node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx"> if (shouldVisit(element, *event) && adjustedTabIndex(element, *event) >= 0)
</span><span class="cx"> return &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<Element>(focusCandidate.focusableNode);
</ins><span class="cx"> ASSERT(element);
</span><span class="cx">
</span><span class="cx"> element->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<Node*>::iterator iter = nodes.begin(); iter != nodes.end(); ++iter) {
</span><span class="cx"> Node* node = *iter;
</span><del>- if (!node->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- Element& element = toElement(*node);
</del><ins>+ Element& element = downcast<Element>(*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<StyledElement>(element))
</span><span class="cx"> retrieveResourcesForProperties(downcast<StyledElement>(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 <area> tags in image maps, walk the tree for the <area>, not the <img> using it.
</span><span class="cx"> for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = titleNode->parentNode()) {
</span><del>- if (titleNode->isElementNode()) {
- String title = toElement(titleNode)->title();
</del><ins>+ if (is<Element>(titleNode)) {
+ Element& titleElement = downcast<Element>(*titleNode);
+ String title = titleElement.title();
</ins><span class="cx"> if (!title.isEmpty()) {
</span><del>- if (auto renderer = titleNode->renderer())
</del><ins>+ if (auto renderer = titleElement.renderer())
</ins><span class="cx"> dir = renderer->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& dir) const
</span><span class="cx"> {
</span><span class="cx"> for (Node* truncatedNode = m_innerNode.get(); truncatedNode; truncatedNode = truncatedNode->parentNode()) {
</span><del>- if (!truncatedNode->isElementNode())
</del><ins>+ if (!is<Element>(truncatedNode))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (auto renderer = toElement(truncatedNode)->renderer()) {
</del><ins>+ if (auto renderer = downcast<Element>(*truncatedNode).renderer()) {
</ins><span class="cx"> if (renderer->isRenderBlockFlow()) {
</span><span class="cx"> RenderBlockFlow* block = toRenderBlockFlow(renderer);
</span><span class="cx"> if (block->style().textOverflow()) {
</span><span class="cx"> for (RootInlineBox* line = block->firstRootBox(); line; line = line->nextRootBox()) {
</span><span class="cx"> if (line->hasEllipsisBox()) {
</span><span class="cx"> dir = block->style().direction();
</span><del>- return toElement(truncatedNode)->innerText();
</del><ins>+ return downcast<Element>(*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<HTMLInputElement>(*m_innerNonSharedNode)
</span><span class="cx"> || is<HTMLObjectElement>(*m_innerNonSharedNode)
</span><span class="cx"> || is<SVGImageElement>(*m_innerNonSharedNode)) {
</span><del>- urlString = toElement(*m_innerNonSharedNode).imageSourceURL();
</del><ins>+ urlString = downcast<Element>(*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->isElementNode())
- return toElement(node);
</del><ins>+ return nullptr;
+ if (is<Element>(node))
+ return downcast<Element>(node);
</ins><span class="cx"> return node->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->isElementNode())
- return toElement(node);
</del><ins>+ return nullptr;
+ if (is<Element>(node))
+ return downcast<Element>(node);
</ins><span class="cx"> return node->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&, PassRef<RenderStyle>);
</span><span class="cx"> virtual ~RenderDeprecatedFlexibleBox();
</span><span class="cx">
</span><del>- Element& element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+ Element& element() const { return downcast<Element>(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 "Element.h"
</span><span class="cx"> #include "GraphicsContext.h"
</span><ins>+#include "HTMLDetailsElement.h"
</ins><span class="cx"> #include "HTMLInputElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="lines">@@ -143,8 +144,8 @@
</span><span class="cx"> for (RenderObject* renderer = parent(); renderer; renderer = renderer->parent()) {
</span><span class="cx"> if (!renderer->node())
</span><span class="cx"> continue;
</span><del>- if (renderer->node()->hasTagName(detailsTag))
- return !toElement(renderer->node())->getAttribute(openAttr).isNull();
</del><ins>+ if (is<HTMLDetailsElement>(renderer->node()))
+ return !downcast<HTMLDetailsElement>(*renderer->node()).getAttribute(openAttr).isNull();
</ins><span class="cx"> if (is<HTMLInputElement>(renderer->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<RenderStyle>);
</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<Element>(RenderObject::node()); }
+ Element* nonPseudoElement() const { return downcast<Element>(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() && isRenderNamedFlowFragment())
</span><span class="cx"> return parent()->generatingElement();
</span><del>- return toElement(RenderObject::generatingNode());
</del><ins>+ return downcast<Element>(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&, PassRef<RenderStyle>);
</span><span class="cx"> virtual ~RenderGrid();
</span><span class="cx">
</span><del>- Element& element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+ Element& element() const { return downcast<Element>(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->isEmbeddedObject())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- Element* element = toElement(renderer->node());
</del><ins>+ Element* element = downcast<Element>(renderer->node());
</ins><span class="cx"> if (!element || !is<HTMLPlugInElement>(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&, PassRef<RenderStyle>);
</span><del>- Element& element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+ Element& element() const { return downcast<Element>(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()->isElementNode());
</del><ins>+ ASSERT(is<Element>(child.node()));
</ins><span class="cx">
</span><span class="cx"> Node* originalParent = NodeRenderingTraversal::parent(child.node());
</span><del>- if (!originalParent || !originalParent->isElementNode() || !originalParent->renderer())
</del><ins>+ if (!originalParent || !is<Element>(originalParent) || !originalParent->renderer())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><del>- return toElement(originalParent)->renderer()->isChildAllowed(child, style);
</del><ins>+ return downcast<Element>(*originalParent).renderer()->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->isLink() || !n->isElementNode())
</del><ins>+ Node* node = this->node();
+ if (!node || !node->isLink() || !is<Element>(node))
</ins><span class="cx"> return;
</span><del>- const AtomicString& href = toElement(n)->getAttribute(hrefAttr);
</del><ins>+ const AtomicString& href = downcast<Element>(*node).getAttribute(hrefAttr);
</ins><span class="cx"> if (href.isNull())
</span><span class="cx"> return;
</span><del>- paintInfo.context->setURLForRect(n->document().completeURL(href), snappedIntRect(urlRect));
</del><ins>+ paintInfo.context->setURLForRect(node->document().completeURL(href), snappedIntRect(urlRect));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderObject::paintOutline(PaintInfo& paintInfo, const LayoutRect& 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 && node() && (style().affectedByDrag() || (node()->isElementNode() && toElement(node())->childrenAffectedByDrag())))
</del><ins>+ if (valueChanged && node() && (style().affectedByDrag() || (is<Element>(node()) && downcast<Element>(*node()).childrenAffectedByDrag())))
</ins><span class="cx"> node()->setNeedsStyleRecalc();
</span><span class="cx"> for (RenderObject* curr = firstChildSlow(); curr; curr = curr->nextSibling())
</span><span class="cx"> curr->updateDragState(dragOn);
</span><span class="lines">@@ -2225,7 +2225,7 @@
</span><span class="cx"> PassRefPtr<RenderStyle> RenderObject::getUncachedPseudoStyle(const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle, RenderStyle* ownStyle) const
</span><span class="cx"> {
</span><span class="cx"> if (pseudoStyleRequest.pseudoId < FIRST_INTERNAL_PSEUDOID && !ownStyle && !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 "find nearest element parent" should be a helper function.
</span><del>- Node* n = node();
- while (n && !n->isElementNode())
- n = n->parentNode();
- if (!n)
- return 0;
- Element* element = toElement(n);
</del><ins>+ Node* node = this->node();
+ while (node && !is<Element>(node))
+ node = node->parentNode();
+ if (!node)
+ return nullptr;
+ Element& element = downcast<Element>(*node);
</ins><span class="cx">
</span><span class="cx"> if (pseudoStyleRequest.pseudoId == FIRST_LINE_INHERITED) {
</span><del>- RefPtr<RenderStyle> result = document().ensureStyleResolver().styleForElement(element, parentStyle, DisallowStyleSharing);
</del><ins>+ RefPtr<RenderStyle> result = document().ensureStyleResolver().styleForElement(&element, parentStyle, DisallowStyleSharing);
</ins><span class="cx"> result->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(&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&, PassRef<RenderStyle>);
</span><span class="cx"> virtual ~RenderRubyAsBlock();
</span><span class="cx">
</span><del>- Element& element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+ Element& element() const { return downcast<Element>(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& 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&, PassRef<RenderStyle>);
</span><span class="cx"> virtual ~RenderRubyText();
</span><span class="cx">
</span><del>- Element& element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+ Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }
</ins><span class="cx">
</span><span class="cx"> virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) 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&, PassRef<RenderStyle>);
</span><span class="cx"> virtual ~RenderTableCaption();
</span><span class="cx">
</span><del>- Element& element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+ Element& element() const { return downcast<Element>(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&, PassRef<RenderStyle>);
</span><del>- Element& element() const { return toElement(nodeForNonAnonymous()); }
</del><ins>+ Element& element() const { return downcast<Element>(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->shouldAppearIndeterminate();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderTheme::isEnabled(const RenderObject& o) const
</del><ins>+bool RenderTheme::isEnabled(const RenderObject& renderer) const
</ins><span class="cx"> {
</span><del>- Node* node = o.node();
- if (!node || !node->isElementNode())
</del><ins>+ Node* node = renderer.node();
+ if (!node || !is<Element>(node))
</ins><span class="cx"> return true;
</span><del>- return !toElement(node)->isDisabledFormControl();
</del><ins>+ return !downcast<Element>(*node).isDisabledFormControl();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderTheme::isFocused(const RenderObject& o) const
</del><ins>+bool RenderTheme::isFocused(const RenderObject& renderer) const
</ins><span class="cx"> {
</span><del>- Node* node = o.node();
- if (!node || !node->isElementNode())
</del><ins>+ Node* node = renderer.node();
+ if (!node || !is<Element>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Element* focusDelegate = toElement(node)->focusDelegate();
</del><ins>+ Element* focusDelegate = downcast<Element>(*node).focusDelegate();
</ins><span class="cx"> Document& document = focusDelegate->document();
</span><span class="cx"> Frame* frame = document.frame();
</span><span class="cx"> return focusDelegate == document.focusedElement() && frame && frame->selection().isFocusedAndActive();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderTheme::isPressed(const RenderObject& o) const
</del><ins>+bool RenderTheme::isPressed(const RenderObject& renderer) const
</ins><span class="cx"> {
</span><del>- if (!o.node() || !o.node()->isElementNode())
</del><ins>+ if (!renderer.node() || !is<Element>(renderer.node()))
</ins><span class="cx"> return false;
</span><del>- return toElement(o.node())->active();
</del><ins>+ return downcast<Element>(*renderer.node()).active();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject& o) const
</del><ins>+bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject& renderer) const
</ins><span class="cx"> {
</span><del>- Node* node = o.node();
- if (!node || !node->isElementNode())
</del><ins>+ Node* node = renderer.node();
+ if (!node || !is<Element>(node))
</ins><span class="cx"> return false;
</span><del>- Element* element = toElement(node);
- if (!element->active() || !element->isSpinButtonElement())
</del><ins>+ Element& element = downcast<Element>(*node);
+ if (!element.active() || !element.isSpinButtonElement())
</ins><span class="cx"> return false;
</span><del>- return static_cast<SpinButtonElement*>(element)->upDownState() == SpinButtonElement::Up;
</del><ins>+ return static_cast<SpinButtonElement&>(element).upDownState() == SpinButtonElement::Up;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderTheme::isReadOnlyControl(const RenderObject& o) const
</del><ins>+bool RenderTheme::isReadOnlyControl(const RenderObject& 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<HTMLFormControlElement>(node))
</span><span class="cx"> return false;
</span><del>- return !toElement(*node).matchesReadWritePseudoClass();
</del><ins>+ return !downcast<Element>(*node).matchesReadWritePseudoClass();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderTheme::isHovered(const RenderObject& o) const
</del><ins>+bool RenderTheme::isHovered(const RenderObject& renderer) const
</ins><span class="cx"> {
</span><del>- Node* node = o.node();
- if (!node || !node->isElementNode())
</del><ins>+ Node* node = renderer.node();
+ if (!node || !is<Element>(node))
</ins><span class="cx"> return false;
</span><del>- if (!toElement(node)->isSpinButtonElement())
- return toElement(node)->hovered();
</del><ins>+ if (!downcast<Element>(*node).isSpinButtonElement())
+ return downcast<Element>(*node).hovered();
</ins><span class="cx"> SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
</span><span class="cx"> return element->hovered() && element->upDownState() != SpinButtonElement::Indeterminate;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject& o) const
</del><ins>+bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject& renderer) const
</ins><span class="cx"> {
</span><del>- Node* node = o.node();
- if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement())
</del><ins>+ Node* node = renderer.node();
+ if (!node || !is<Element>(node) || !downcast<Element>(*node).isSpinButtonElement())
</ins><span class="cx"> return false;
</span><span class="cx"> SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
</span><span class="cx"> return element->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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Element* element = toElement(node);
</del><ins>+ Element& element = downcast<Element>(*node);
</ins><span class="cx">
</span><del>- if (!element->hasClass())
</del><ins>+ if (!element.hasClass())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- return element->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& o)
</span><span class="cx"> {
</span><span class="cx"> bool oldPressed = [cell isHighlighted];
</span><del>- bool pressed = o.node() && o.node()->isElementNode() && toElement(o.node())->active();
</del><ins>+ bool pressed = o.node() && is<Element>(o.node()) && downcast<Element>(*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() && o.node()->isElementNode()) ? toElement(o.node())->focusDelegate() : 0;
</del><ins>+ Element* focusDelegate = (o.node() && is<Element>(o.node())) ? downcast<Element>(o.node())->focusDelegate() : nullptr;
</ins><span class="cx"> if (focusDelegate)
</span><span class="cx"> updateFocusedState(sliderThumbCell, *focusDelegate->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()->shadowHost();
</span><span class="cx"> if (!input)
</span><del>- input = toElement(o.node());
</del><ins>+ input = downcast<Element>(o.node());
</ins><span class="cx">
</span><span class="cx"> if (!input->renderer()->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 & RenderAsTextShowIDAndClass) {
</span><del>- if (Element* element = o.node() && o.node()->isElementNode() ? toElement(o.node()) : 0) {
</del><ins>+ if (Element* element = o.node() && is<Element>(o.node()) ? downcast<Element>(o.node()) : nullptr) {
</ins><span class="cx"> if (element->hasID())
</span><span class="cx"> ts << " id=\"" + element->getIdAttribute() + "\"";
</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->isListItem())
</span><span class="cx"> return renderer->isFloating() || renderer->isOutOfFlowPositioned();
</span><span class="cx"> // Avoid creating containers for text within text controls, buttons, or <select> buttons.
</span><del>- Node* parentNode = renderer->parent() ? renderer->parent()->generatingNode() : 0;
- if (parentNode && parentNode->isElementNode() && formInputTags().contains(toElement(parentNode)->tagQName()))
</del><ins>+ Node* parentNode = renderer->parent() ? renderer->parent()->generatingNode() : nullptr;
+ if (parentNode && is<Element>(parentNode) && formInputTags().contains(downcast<Element>(*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->node();
</span><del>- if (rendererNode && rendererNode->isElementNode()) {
- if (tags.contains(toElement(rendererNode)->tagQName()))
</del><ins>+ if (rendererNode && is<Element>(rendererNode)) {
+ if (tags.contains(downcast<Element>(*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& child, const RenderStyle&) const
</span><span class="cx"> {
</span><del>- return child.node() && isElement(*child.node());
</del><ins>+ return child.node() && is<Element>(*child.node());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RenderPtr<RenderMathMLBlock> 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<Text>(*child), renderTreePosition);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (child->isElementNode())
- attachRenderTree(*toElement(child), inheritedStyle, renderTreePosition, nullptr);
</del><ins>+ if (is<Element>(child))
+ attachRenderTree(downcast<Element>(*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<Text>(*current), renderTreePosition);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (current->isElementNode()) {
- Element& currentElement = toElement(*current);
</del><ins>+ if (is<Element>(current)) {
+ Element& currentElement = downcast<Element>(*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<Text>(*current));
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (current->isElementNode())
- detachRenderTree(*toElement(current));
</del><ins>+ if (is<Element>(current))
+ detachRenderTree(downcast<Element>(*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<Text>(*child));
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (child->isElementNode())
- detachRenderTree(*toElement(child), detachType);
</del><ins>+ if (is<Element>(child))
+ detachRenderTree(downcast<Element>(*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<Text>(*child), renderTreePosition);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (child->isElementNode())
- resolveTree(*toElement(child), host.renderer()->style(), renderTreePosition, change);
</del><ins>+ if (is<Element>(child))
+ resolveTree(downcast<Element>(*child), host.renderer()->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<Text>(*child), childRenderTreePosition);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (!child->isElementNode())
</del><ins>+ if (!is<Element>(child))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- Element* childElement = toElement(child);
</del><ins>+ Element& childElement = downcast<Element>(*child);
</ins><span class="cx"> if (elementNeedingStyleRecalcAffectsNextSiblingElementStyle) {
</span><del>- if (childElement->styleIsAffectedByPreviousSibling())
- childElement->setNeedsStyleRecalc();
- elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement->affectsNextSiblingElementStyle();
- } else if (childElement->styleChangeType() >= FullStyleChange)
- elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement->affectsNextSiblingElementStyle();
- if (change >= Inherit || childElement->childNeedsStyleRecalc() || childElement->needsStyleRecalc()) {
</del><ins>+ if (childElement.styleIsAffectedByPreviousSibling())
+ childElement.setNeedsStyleRecalc();
+ elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement.affectsNextSiblingElementStyle();
+ } else if (childElement.styleChangeType() >= FullStyleChange)
+ elementNeedingStyleRecalcAffectsNextSiblingElementStyle = childElement.affectsNextSiblingElementStyle();
+ if (change >= Inherit || childElement.childNeedsStyleRecalc() || childElement.needsStyleRecalc()) {
</ins><span class="cx"> parentPusher.push();
</span><del>- resolveTree(*childElement, renderer->style(), childRenderTreePosition, change);
</del><ins>+ resolveTree(childElement, renderer->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->hasTagName(SVGNames::symbolTag)) {
</del><ins>+ if (is<SVGSymbolElement>(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<SVGSVGElement> svgElement = SVGSVGElement::create(SVGNames::svgTag, *referencedDocument());
</span><span class="cx">
</span><span class="cx"> // Transfer all data (attributes, etc.) from <symbol> to the new <svg> element.
</span><del>- svgElement->cloneDataFromElement(*toElement(element));
</del><ins>+ svgElement->cloneDataFromElement(downcast<SVGSymbolElement>(*node));
</ins><span class="cx">
</span><span class="cx"> // Only clone symbol children, and add them to the new <svg> element
</span><del>- for (Node* child = element->firstChild(); child; child = child->nextSibling()) {
</del><ins>+ for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
</ins><span class="cx"> RefPtr<Node> newChild = child->cloneNode(true);
</span><span class="cx"> svgElement->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<Node> replacingElement(svgElement.get());
</del><ins>+ RefPtr<SVGSVGElement> replacingElement(svgElement.get());
</ins><span class="cx">
</span><span class="cx"> // Replace <symbol> with <svg>.
</span><del>- element->parentNode()->replaceChild(svgElement.release(), element);
</del><ins>+ node->parentNode()->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<Node> sibling = element->nextSibling(); sibling; sibling = sibling->nextSibling())
</del><ins>+ node = replacingElement.get();
+ for (RefPtr<Node> sibling = node->nextSibling(); sibling; sibling = sibling->nextSibling())
</ins><span class="cx"> expandSymbolElementsInShadowTree(sibling.get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (RefPtr<Node> child = element->firstChild(); child; child = child->nextSibling())
</del><ins>+ for (RefPtr<Node> child = node->firstChild(); child; child = child->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() && parentNode()->isElementNode() ? toElement(parentNode()) : nullptr;
</del><ins>+ target = parentNode() && is<Element>(parentNode()) ? downcast<Element>(parentNode()) : nullptr;
</ins><span class="cx"> else
</span><span class="cx"> target = SVGURIReference::targetElementFromIRIString(href, document(), &id);
</span><span class="cx"> SVGElement* svgTarget = target && is<SVGElement>(target) ? downcast<SVGElement>(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->isElementNode()) {
- Element* element = toElement(node);
- if (element->hasAttributes())
- languageAttribute = element->findAttributeByName(XMLNames::langAttr);
</del><ins>+ if (is<Element>(node)) {
+ Element& element = downcast<Element>(*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<RefPtr<Node>> 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->isElementNode())
</del><ins>+ if (!containsAttributeNodes || !is<Element>(node))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- Element* element = toElement(n);
- if (!element->hasAttributes())
</del><ins>+ Element& element = downcast<Element>(*node);
+ if (!element.hasAttributes())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- for (const Attribute& attribute : element->attributesIterator()) {
- RefPtr<Attr> attr = element->attrIfExists(attribute.name());
</del><ins>+ for (const Attribute& attribute : element.attributesIterator()) {
+ RefPtr<Attr> attr = element.attrIfExists(attribute.name());
</ins><span class="cx"> if (attr && 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 "Attr.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "HTMLDocument.h"
</ins><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><span class="cx"> #include "XMLNSNames.h"
</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<Element>(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<HTMLDocument>(node.document())) {
</ins><span class="cx"> if (is<HTMLElement>(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<HTMLElement>(node).localName(), name) && (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) && namespaceURI == node.namespaceURI() && !namespaceURI.isNull();
</del><ins>+ return downcast<Element>(node).hasLocalName(name) && namespaceURI == node.namespaceURI() && !namespaceURI.isNull();
</ins><span class="cx"> }
</span><del>- return toElement(node).hasLocalName(name) && namespaceURI == node.namespaceURI();
</del><ins>+ return downcast<Element>(node).hasLocalName(name) && 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<Element>(context))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- Element& contextElement = toElement(context);
</del><ins>+ Element& contextElement = downcast<Element>(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 && 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->parentNode();
- if (!n || !n->isElementNode())
</del><ins>+ ContainerNode* node = parentElement->parentNode();
+ if (!node || !is<Element>(node))
</ins><span class="cx"> break;
</span><del>- parentElement = toElement(n);
</del><ins>+ parentElement = downcast<Element>(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<ContainerNode> n = m_currentNode;
- n->finishParsingChildren();
</del><ins>+ RefPtr<ContainerNode> node = m_currentNode;
+ node->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() && context()->depth <= depthTriggeringEntityExpansion())
</span><span class="cx"> setDepthTriggeringEntityExpansion(-1);
</span><span class="cx">
</span><del>- if (!scriptingContentIsAllowed(parserContentPolicy()) && n->isElementNode() && toScriptElementIfPossible(toElement(n.get()))) {
</del><ins>+ if (!scriptingContentIsAllowed(parserContentPolicy()) && is<Element>(*node) && toScriptElementIfPossible(downcast<Element>(node.get()))) {
</ins><span class="cx"> popCurrentNode();
</span><del>- n->remove(IGNORE_EXCEPTION);
</del><ins>+ node->remove(IGNORE_EXCEPTION);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!n->isElementNode() || !m_view) {
</del><ins>+ if (!node->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& element = downcast<Element>(*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->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(&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->executeScript(ScriptSourceCode(scriptElement->scriptContent(), document()->url(), m_scriptStartPosition));
</span><span class="cx"> else if (scriptElement->willBeParserExecuted()) {
</span><span class="cx"> m_pendingScript = scriptElement->cachedScript();
</span><del>- m_scriptElement = element;
</del><ins>+ m_scriptElement = &element;
</ins><span class="cx"> m_pendingScript->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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for Element
+ https://bugs.webkit.org/show_bug.cgi?id=137241
+
+ Reviewed by Andreas Kling.
+
+ Use is<>() / downcast<>() for Element instead of isElementNode() /
+ toElement().
+
+ * WebView/WebRenderLayer.mm:
+ (+[WebRenderLayer nameForLayer:]):
+
</ins><span class="cx"> 2014-09-28 Gyuyoung Kim <gyuyoung.kim@samsung.com>
</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& renderer = layer->renderer();
</span><span class="cx"> NSString *name = [NSString stringWithUTF8String:renderer.renderName()];
</span><span class="cx">
</span><del>- if (Element* element = renderer.node() && renderer.node()->isElementNode() ? toElement(renderer.node()) : 0) {
</del><ins>+ if (Element* element = renderer.node() && is<Element>(renderer.node()) ? downcast<Element>(renderer.node()) : nullptr) {
</ins><span class="cx"> name = [name stringByAppendingFormat:@" %@", (NSString *)element->tagName()];
</span><span class="cx"> if (element->hasID())
</span><span class="cx"> name = [name stringByAppendingFormat:@" id=\"%@\"", (NSString *)element->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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for Element
+ https://bugs.webkit.org/show_bug.cgi?id=137241
+
+ Reviewed by Andreas Kling.
+
+ Use is<>() / downcast<>() for Element instead of isElementNode() /
+ toElement().
+
+ * DOMEventsClasses.cpp:
+ (DOMMouseEvent::toElement):
+ * DOMEventsClasses.h:
+
</ins><span class="cx"> 2014-09-29 Christophe Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Make is<>() / downcast<>() 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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for Element
+ https://bugs.webkit.org/show_bug.cgi?id=137241
+
+ Reviewed by Andreas Kling.
+
+ Use is<>() / downcast<>() 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 <cgarcia@igalia.com>
</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->renderName();
</span><span class="cx">
</span><span class="cx"> if (Node* node = renderer->node()) {
</span><del>- if (node->isElementNode()) {
- Element* element = toElement(node);
- m_elementTagName = element->tagName();
- m_elementID = element->getIdAttribute();
</del><ins>+ if (is<Element>(node)) {
+ Element& element = downcast<Element>(*node);
+ m_elementTagName = element.tagName();
+ m_elementID = element.getIdAttribute();
</ins><span class="cx">
</span><del>- if (element->isStyledElement() && element->hasClass()) {
</del><ins>+ if (element.isStyledElement() && element.hasClass()) {
</ins><span class="cx"> Vector<RefPtr<API::Object>> classNames;
</span><del>- classNames.reserveInitialCapacity(element->classNames().size());
</del><ins>+ classNames.reserveInitialCapacity(element.classNames().size());
</ins><span class="cx">
</span><del>- for (size_t i = 0, size = element->classNames().size(); i < size; ++i)
- classNames.append(API::String::create(element->classNames()[i]));
</del><ins>+ for (size_t i = 0, size = element.classNames().size(); i < 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())->hasAttribute(attribute);
</del><ins>+ return WebCore::downcast<WebCore::Element>(*_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())->getAttribute(attribute);
</del><ins>+ return WebCore::downcast<WebCore::Element>(*_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())->setAttribute(name, value, ec);
</del><ins>+ WebCore::downcast<WebCore::Element>(*_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())->tagName();
</del><ins>+ return WebCore::downcast<WebCore::Element>(*_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->isElementNode())
</del><ins>+ if (!is<Element>(*m_node))
</ins><span class="cx"> return IntRect();
</span><span class="cx">
</span><del>- return toElement(m_node.get())->boundsInRootViewSpace();
</del><ins>+ return downcast<Element>(*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->isElementNode())
</del><ins>+ if (!is<Element>(node))
</ins><span class="cx"> return BundleHitTestResultMediaTypeNone;
</span><span class="cx">
</span><del>- if (!toElement(node)->isMediaElement())
</del><ins>+ if (!downcast<Element>(*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<Element>(*node))
+ prefetchDNS(downcast<Element>(*node).absoluteLinkURL().host());
</ins><span class="cx">
</span><span class="cx"> Vector<FloatQuad> quads;
</span><span class="cx"> if (RenderObject *renderer = node->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 && m_assistedNode->isElementNode())
- toElement(m_assistedNode.get())->blur();
</del><ins>+ if (m_assistedNode && is<Element>(*m_assistedNode))
+ downcast<Element>(*m_assistedNode).blur();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPage::setAssistedNodeValue(const String& value)
</span><span class="lines">@@ -1888,7 +1888,7 @@
</span><span class="cx"> if (hitNode) {
</span><span class="cx"> info.clickableElementName = hitNode->nodeName();
</span><span class="cx">
</span><del>- Element* element = hitNode->isElementNode() ? toElement(hitNode) : 0;
</del><ins>+ Element* element = is<Element>(hitNode) ? downcast<Element>(hitNode) : nullptr;
</ins><span class="cx"> if (element) {
</span><span class="cx"> Element* linkElement = nullptr;
</span><span class="cx"> if (element->renderer() && element->renderer()->isRenderImage()) {
</span><span class="lines">@@ -2006,7 +2006,7 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<KeyboardEvent> key = KeyboardEvent::create();
</span><span class="cx">
</span><del>- Element* nextElement = toElement(startNode);
</del><ins>+ Element* nextElement = downcast<Element>(startNode);
</ins><span class="cx"> do {
</span><span class="cx"> nextElement = isForward ? page->focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&nextElement->document()), nextElement, key.get())
</span><span class="cx"> : page->focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&nextElement->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->willBeginInputSession(this, toElement(node), WebFrame::fromCoreFrame(*node->document().frame()), userData);
</del><ins>+ m_formClient->willBeginInputSession(this, downcast<Element>(node), WebFrame::fromCoreFrame(*node->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>