Stop using legacy NODE_TYPE_CASTS() macro for HTML Elements
https://bugs.webkit.org/show_bug.cgi?id=137137
Reviewed by Benjamin Poulain.
Source/WebCore:
Stop using legacy NODE_TYPE_CASTS() macro for HTML Elements and use the
new SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() /
downcast<>() works for those types.
No new tests, no behavior change.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::labelForElement):
(WebCore::AccessibilityNodeObject::text):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetName):
(webkitAccessibleGetDescription):
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginInstance):
(WebCore::pluginScriptObjectFromPluginViewBase):
(WebCore::pluginScriptObject):
(WebCore::pluginElementCustomPut):
(WebCore::isPluginElement): Deleted.
* bindings/objc/DOM.mm:
(kitClass):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAllRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::locateCousinList):
(WebCore::elementHasDirectionAuto):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
(WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
(WebCore::SelectorCompiler::isPlaceholderShown):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::assertConnectedSubrameCountIsConsistent):
(WebCore::collectFrameOwners):
(WebCore::disconnectSubframes):
* dom/Document.cpp:
(WebCore::Document::adoptNode):
(WebCore::Document::setBody):
(WebCore::Document::iconURLs):
(WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
(WebCore::Document::updateHoverActiveState):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/Range.cpp:
(WebCore::Range::createContextualFragment):
* dom/make_names.pl:
(printTypeHelpers):
* editing/ApplyStyleCommand.cpp:
(WebCore::isLegacyAppleStyleSpan):
(WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
(WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
(WebCore::isEmptyFontTag):
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
(WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
(WebCore::ApplyStyleCommand::removeInlineStyle):
(WebCore::ApplyStyleCommand::shouldSplitTextElement):
(WebCore::ApplyStyleCommand::applyInlineStyleChange):
* editing/DeleteButtonController.cpp:
(WebCore::enclosingDeletableElement):
* editing/Editor.cpp:
(WebCore::Editor::selectionForCommand):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::findFirstMarkable):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::selectAll):
(WebCore::scanForForm):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::mergeWithNeighboringLists):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::elementCannotHaveEndTag):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
* editing/TextIterator.cpp:
(WebCore::shouldEmitNewlinesBeforeAndAfterNode):
(WebCore::shouldEmitExtraNewlineForNode):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_addTableCellForElement):
(HTMLConverter::_processElement):
* editing/htmlediting.cpp:
(WebCore::enclosingList):
(WebCore::embeddedSublist):
(WebCore::appendedSublist):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
* editing/mac/EditorMac.mm:
(WebCore::maybeCopyNodeAttributesToFragment):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendElement):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::shadowColorSwatch):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::namedItem):
(WebCore::HTMLCollection::updateNamedElementCache):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::matchesReadWritePseudoClass):
(WebCore::HTMLElement::setOuterHTML):
(WebCore::elementAffectsDirectionality):
(WebCore::HTMLElement::directionality):
(WebCore::HTMLElement::dirAttributeChanged):
* html/HTMLElement.h:
(WebCore::isHTMLElement):
(WebCore::Node::hasTagName):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::getNamedElements):
* html/HTMLFrameElementBase.h:
(WebCore::isHTMLFrameElementBase):
* html/HTMLFrameOwnerElement.h:
(WebCore::isHTMLFrameOwnerElement):
* html/HTMLMediaElement.h:
(WebCore::isHTMLMediaElement):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::isDisabledFormControl):
* html/HTMLPlugInElement.h:
(WebCore::isHTMLPlugInElement):
* html/HTMLPlugInImageElement.cpp:
(WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
* html/HTMLPlugInImageElement.h:
(WebCore::isHTMLPlugInImageElement):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setOption):
(WebCore::HTMLSelectElement::setLength):
(WebCore::HTMLSelectElement::recalcListItems):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::cellAbove):
* html/HTMLTableCellElement.h:
(WebCore::isHTMLTableCellElement):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::tHead):
(WebCore::HTMLTableElement::tFoot):
(WebCore::HTMLTableElement::lastBody):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::rowIndex):
* html/HTMLTableRowsCollection.cpp:
(WebCore::isInSection):
* html/HTMLTableSectionElement.h:
(WebCore::isHTMLTableSectionElement):
* html/HTMLTagNames.in:
* html/HTMLTextFormControlElement.cpp:
(WebCore::enclosingTextFormControl):
* html/HTMLTextFormControlElement.h:
(WebCore::isHTMLTextFormControlElement):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::removedFrom):
(WebCore::HTMLTrackElement::mediaElement):
* html/LabelableElement.h:
(WebCore::isLabelableElement):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::sliderTrackElement):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::parentMediaElement):
(WebCore::mediaControlElementType):
* html/shadow/TextControlInnerElements.h:
(WebCore::isTextControlInnerTextElement):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadSubframe):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isPhrasingContent):
(WebCore::MathMLElement::isFlowContent):
(WebCore::MathMLElement::childShouldCreateRenderer):
* mathml/mathtags.in:
* page/DragController.cpp:
(WebCore::DragController::canProcessDrag):
* page/EventHandler.cpp:
(WebCore::targetIsFrame):
* page/FocusController.cpp:
(WebCore::hasCustomFocusLogic):
(WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
(WebCore::FocusController::advanceFocusInDocumentOrder):
* page/Frame.cpp:
(WebCore::Frame::searchForLabelsBeforeElement):
* page/FrameView.cpp:
(WebCore::FrameView::init):
(WebCore::FrameView::addEmbeddedObjectToUpdate):
(WebCore::FrameView::updateEmbeddedObject):
* page/PageSerializer.cpp:
(WebCore::isCharsetSpecifyingNode):
(WebCore::SerializerMarkupAccumulator::appendCustomAttributes):
* page/SpatialNavigation.cpp:
(WebCore::frameOwnerElement):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::absolutePDFURL):
(WebCore::HitTestResult::mediaElement):
* rendering/RenderBlockFlow.cpp:
(WebCore::resizeTextPermitted):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintContents):
(WebCore::RenderEmbeddedObject::layout):
(WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::updateSnapOffsets):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::isRestartedPlugin):
* rendering/RenderMedia.h:
(WebCore::RenderMedia::mediaElement):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::offsetParent):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::plugInImageElement):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::parseColSpanFromDOM):
(WebCore::RenderTableCell::parseRowSpanFromDOM):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::textFormControlElement):
* rendering/RenderThemeGtk.cpp:
(WebCore::getMediaElementFromRenderObject):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
* rendering/RenderTreeAsText.cpp:
(WebCore::isEmptyOrUnstyledAppleStyleSpan):
* rendering/RenderWidget.h:
(WebCore::RenderWidget::frameOwnerElement):
* testing/Internals.cpp:
(WebCore::Internals::visiblePlaceholder):
(WebCore::Internals::simulateAudioInterruption):
(WebCore::Internals::isPluginSnapshotted):
* xml/XPathStep.cpp:
(WebCore::XPath::nodeMatchesBasicTest):
Source/WebKit/win:
Use is<>() / downcast<>() where appropriate.
* DOMHTMLClasses.cpp:
(DOMHTMLElement::idName):
(DOMHTMLElement::innerText):
(DOMHTMLElement::setInnerText):
Source/WebKit2:
Use is<>() / downcast<>() where appropriate.
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
(WebKit::PDFPluginTextAnnotation::value):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::initializePlugin):
(WebKit::PluginView::pluginSnapshotTimerFired):
(WebKit::PluginView::pluginDidReceiveUserInteraction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performActionOnElement):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/page/SpatialNavigation.cpp b/Source/WebCore/page/SpatialNavigation.cpp
index 4e38924..e5fb05e 100644
--- a/Source/WebCore/page/SpatialNavigation.cpp
+++ b/Source/WebCore/page/SpatialNavigation.cpp
@@ -758,7 +758,7 @@
HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate)
{
- return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.visibleNode) : nullptr;
-};
+ return candidate.isFrameOwnerElement() ? downcast<HTMLFrameOwnerElement>(candidate.visibleNode) : nullptr;
+}
} // namespace WebCore