Use is<HTML*Element>() instead of isHTML*Element() - Part 2
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Sep 2014 23:37:12 +0000 (23:37 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Sep 2014 23:37:12 +0000 (23:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137103

Reviewed by Benjamin Poulain.

Source/WebCore:

Use is<HTML*Element>() instead of isHTML*Element() and drop support for
the generated isHTML*Element() macros.

No new tests, no behavior change.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedUIElementForPage):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::labelChanged):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::isEnabled):
(WebCore::AccessibilityListBoxOption::stringValue):
(WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::isNativeImage):
(WebCore::AccessibilityNodeObject::anchorElement):
(WebCore::AccessibilityNodeObject::alternativeText):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::anchorElement):
(WebCore::AccessibilityRenderObject::labelElementContainer):
(WebCore::AccessibilityRenderObject::internalLinkElement):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::url):
(WebCore::AccessibilityRenderObject::getDocumentLinks):
(WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
(WebCore::AccessibilityRenderObject::accessibilityHitTest):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::stringValueForMSAA):
(WebCore::AccessibilityRenderObject::isLinked):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableElement):
(WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
(WebCore::AccessibilityTable::title):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetCaption):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
* css/CSSDefaultStyleSheets.cpp:
(WebCore::elementCanUseSimpleDefaultStyle):
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* css/CSSStyleSheet.cpp:
(WebCore::isAcceptableCSSStyleSheetParent):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::getNamedItem):
* dom/CurrentScriptIncrementer.h:
(WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::setDragImage):
* dom/DocumentOrderedMap.cpp:
(WebCore::keyMatchesMapName):
(WebCore::keyMatchesLowercasedMapName):
(WebCore::keyMatchesLowercasedUsemap):
(WebCore::keyMatchesLabelForAttribute):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/Node.cpp:
(WebCore::Node::enclosingLinkEventParentOrSelf):
* dom/Position.cpp:
(WebCore::endsOfNodeAreVisuallyDistinctPositions):
* dom/ScriptElement.cpp:
(WebCore::toScriptElementIfPossible):
* dom/VisitedLinkState.cpp:
(WebCore::linkHashForElement):
(WebCore::VisitedLinkState::determineLinkStateSlowCase):
* dom/make_names.pl:
(printTypeHelpers):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
* editing/Editor.cpp:
(WebCore::imageElementFromImageDocument):
* editing/FrameSelection.cpp:
(WebCore::scanForForm):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::removeHeadContents):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_processElement):
* editing/htmlediting.cpp:
(WebCore::isNonTableCellHTMLBlockElement):
* editing/markup.cpp:
(WebCore::ancestorToRetainStructureAndAppearanceForBlock):
(WebCore::collectElementsToRemoveFromFragment):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::findAssociatedForm):
* html/HTMLAnchorElement.cpp:
(WebCore::appendServerMapMousePosition):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::imageElement):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::bgColor):
(WebCore::HTMLDocument::setBgColor):
(WebCore::HTMLDocument::fgColor):
(WebCore::HTMLDocument::setFgColor):
(WebCore::HTMLDocument::alinkColor):
(WebCore::HTMLDocument::setAlinkColor):
(WebCore::HTMLDocument::linkColor):
(WebCore::HTMLDocument::setLinkColor):
(WebCore::HTMLDocument::vlinkColor):
(WebCore::HTMLDocument::setVlinkColor):
(WebCore::HTMLDocument::isFrameSet):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerHTML):
* html/HTMLFieldSetElement.cpp:
(WebCore::updateFromControlElementsAncestorDisabledStateUnder):
(WebCore::HTMLFieldSetElement::disabledStateChanged):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
(WebCore::HTMLFormControlsCollection::formControlElements):
(WebCore::HTMLFormControlsCollection::formImageElements):
(WebCore::HTMLFormControlsCollection::namedItem):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::rendererIsNeeded):
* html/HTMLFrameElementBase.h:
(WebCore::isHTMLFrameElementBase):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::dispatchLoadEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::dataList):
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::virtualForm):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLNameCollection.cpp:
(WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
(WebCore::DocumentNameCollection::elementMatches):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::ownerDataListElement):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
(WebCore::HTMLOptionElement::isDisabledFormControl):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::recalcListItems):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::caption):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::findParentTable):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::rowIndex):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::rowAfter):
(WebCore::HTMLTableRowsCollection::lastRow):
* html/HTMLTagNames.in:
* html/LabelsNodeList.cpp:
(WebCore::LabelsNodeList::elementMatches):
* html/MediaDocument.cpp:
(WebCore::descendentVideoElement):
(WebCore::ancestorVideoElement):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeydownEvent):
* html/RadioNodeList.cpp:
(WebCore::RadioNodeList::RadioNodeList):
(WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::hasImpliedEndTag):
(WebCore::insert):
(WebCore::HTMLConstructionSite::insertHTMLFormElement):
(WebCore::HTMLConstructionSite::insertTextNode):
(WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLNames::isScopeMarker):
(WebCore::HTMLNames::isTableScopeMarker):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::inlineStyleSheetText):
* page/DragController.cpp:
(WebCore::DragController::draggableElement):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusDirectionally):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
(WebCore::areElementsOnSameLine):
* page/ios/FrameIOS.mm:
(WebCore::ancestorRespondingToClickEvents):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::altDisplayString):
(WebCore::HitTestResult::mediaSupportsFullscreen):
(WebCore::HitTestResult::mediaElement):
(WebCore::HitTestResult::enterFullscreenForVideo):
(WebCore::HitTestResult::mediaIsVideo):
(WebCore::HitTestResult::isLiveLink):
* rendering/RenderCounter.cpp:
(WebCore::planCounter):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::RenderImage):
(WebCore::RenderImage::paintAreaElementFocusRing):
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::imageMap):
(WebCore::RenderImage::updateAltText):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::updateFromElement):
(WebCore::RenderListBox::paintItemForeground):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::marqueeSpeed):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemText):
(RenderMenuList::itemIsEnabled):
(RenderMenuList::itemIsLabel):
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::meterElement):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldRespectImageOrientation):
(WebCore::RenderObject::getTextDecorationColors):
(WebCore::RenderObject::offsetParent):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::progressElement):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
* svg/graphics/SVGImageCache.cpp:
(WebCore::SVGImageCache::imageForRenderer):
* testing/Internals.cpp:
(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs):

Source/WebKit/win:

Use is<HTML*Element>() instead of isHTML*Element().

* DOMCoreClasses.cpp:
(DOMElement::createInstance):
* DOMHTMLClasses.cpp:
(DOMHTMLFormElement::action):
(DOMHTMLFormElement::method):
* WebFrame.cpp:
(formElementFromDOMElement):

Source/WebKit2:

Use is<HTML*Element>() instead of isHTML*Element().

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::containsAnyFormElements):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

91 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/css/CSSDefaultStyleSheets.cpp
Source/WebCore/css/CSSDefaultStyleSheets.h
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleSheetList.cpp
Source/WebCore/dom/CurrentScriptIncrementer.h
Source/WebCore/dom/DataTransfer.cpp
Source/WebCore/dom/DocumentOrderedMap.cpp
Source/WebCore/dom/DocumentStyleSheetCollection.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/dom/VisitedLinkState.cpp
Source/WebCore/dom/make_names.pl
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/InsertLineBreakCommand.cpp
Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLAreaElement.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlsCollection.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameElementBase.h
Source/WebCore/html/HTMLImageLoader.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLLegendElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLNameCollection.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTablePartElement.cpp
Source/WebCore/html/HTMLTableRowElement.cpp
Source/WebCore/html/HTMLTableRowsCollection.cpp
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/html/LabelsNodeList.cpp
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/RadioInputType.cpp
Source/WebCore/html/RadioNodeList.cpp
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/parser/HTMLElementStack.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/SpatialNavigation.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderMarquee.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderMeter.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderProgress.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/svg/graphics/SVGImageCache.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/DOMCoreClasses.cpp
Source/WebKit/win/DOMHTMLClasses.cpp
Source/WebKit/win/WebFrame.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

index 23ad7b2..995b699 100644 (file)
@@ -1,3 +1,247 @@
+2014-09-25  Christophe Dumez  <cdumez@apple.com>
+
+        Use is<HTML*Element>() instead of isHTML*Element() - Part 2
+        https://bugs.webkit.org/show_bug.cgi?id=137103
+
+        Reviewed by Benjamin Poulain.
+
+        Use is<HTML*Element>() instead of isHTML*Element() and drop support for
+        the generated isHTML*Element() macros.
+
+        No new tests, no behavior change.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::focusedUIElementForPage):
+        (WebCore::AXObjectCache::getOrCreate):
+        (WebCore::AXObjectCache::handleAttributeChanged):
+        (WebCore::AXObjectCache::labelChanged):
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::isEnabled):
+        (WebCore::AccessibilityListBoxOption::stringValue):
+        (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
+        (WebCore::AccessibilityNodeObject::isNativeImage):
+        (WebCore::AccessibilityNodeObject::anchorElement):
+        (WebCore::AccessibilityNodeObject::alternativeText):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::anchorElement):
+        (WebCore::AccessibilityRenderObject::labelElementContainer):
+        (WebCore::AccessibilityRenderObject::internalLinkElement):
+        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::url):
+        (WebCore::AccessibilityRenderObject::getDocumentLinks):
+        (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
+        (WebCore::AccessibilityRenderObject::accessibilityHitTest):
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        (WebCore::AccessibilityRenderObject::stringValueForMSAA):
+        (WebCore::AccessibilityRenderObject::isLinked):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::tableElement):
+        (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+        (WebCore::AccessibilityTable::title):
+        * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
+        (webkitAccessibleTableGetCaption):
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::nameGetter):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::isReachableFromDOM):
+        * css/CSSDefaultStyleSheets.cpp:
+        (WebCore::elementCanUseSimpleDefaultStyle):
+        (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
+        * css/CSSStyleSheet.cpp:
+        (WebCore::isAcceptableCSSStyleSheetParent):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustRenderStyle):
+        * css/StyleSheetList.cpp:
+        (WebCore::StyleSheetList::getNamedItem):
+        * dom/CurrentScriptIncrementer.h:
+        (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
+        * dom/DataTransfer.cpp:
+        (WebCore::DataTransfer::setDragImage):
+        * dom/DocumentOrderedMap.cpp:
+        (WebCore::keyMatchesMapName):
+        (WebCore::keyMatchesLowercasedMapName):
+        (WebCore::keyMatchesLowercasedUsemap):
+        (WebCore::keyMatchesLabelForAttribute):
+        * dom/DocumentStyleSheetCollection.cpp:
+        (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
+        * dom/Node.cpp:
+        (WebCore::Node::enclosingLinkEventParentOrSelf):
+        * dom/Position.cpp:
+        (WebCore::endsOfNodeAreVisuallyDistinctPositions):
+        * dom/ScriptElement.cpp:
+        (WebCore::toScriptElementIfPossible):
+        * dom/VisitedLinkState.cpp:
+        (WebCore::linkHashForElement):
+        (WebCore::VisitedLinkState::determineLinkStateSlowCase):
+        * dom/make_names.pl:
+        (printTypeHelpers):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::handleGeneralDelete):
+        * editing/Editor.cpp:
+        (WebCore::imageElementFromImageDocument):
+        * editing/FrameSelection.cpp:
+        (WebCore::scanForForm):
+        * editing/InsertLineBreakCommand.cpp:
+        (WebCore::InsertLineBreakCommand::doApply):
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::doApply):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::removeHeadContents):
+        * editing/cocoa/HTMLConverter.mm:
+        (HTMLConverter::_processElement):
+        * editing/htmlediting.cpp:
+        (WebCore::isNonTableCellHTMLBlockElement):
+        * editing/markup.cpp:
+        (WebCore::ancestorToRetainStructureAndAppearanceForBlock):
+        (WebCore::collectElementsToRemoveFromFragment):
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
+        * html/FormAssociatedElement.cpp:
+        (WebCore::FormAssociatedElement::findAssociatedForm):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::appendServerMapMousePosition):
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::imageElement):
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::bgColor):
+        (WebCore::HTMLDocument::setBgColor):
+        (WebCore::HTMLDocument::fgColor):
+        (WebCore::HTMLDocument::setFgColor):
+        (WebCore::HTMLDocument::alinkColor):
+        (WebCore::HTMLDocument::setAlinkColor):
+        (WebCore::HTMLDocument::linkColor):
+        (WebCore::HTMLDocument::setLinkColor):
+        (WebCore::HTMLDocument::vlinkColor):
+        (WebCore::HTMLDocument::setVlinkColor):
+        (WebCore::HTMLDocument::isFrameSet):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::setInnerHTML):
+        * html/HTMLFieldSetElement.cpp:
+        (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
+        (WebCore::HTMLFieldSetElement::disabledStateChanged):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
+        * html/HTMLFormControlsCollection.cpp:
+        (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
+        (WebCore::HTMLFormControlsCollection::formControlElements):
+        (WebCore::HTMLFormControlsCollection::formImageElements):
+        (WebCore::HTMLFormControlsCollection::namedItem):
+        (WebCore::HTMLFormControlsCollection::updateNamedElementCache):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::rendererIsNeeded):
+        * html/HTMLFrameElementBase.h:
+        (WebCore::isHTMLFrameElementBase):
+        * html/HTMLImageLoader.cpp:
+        (WebCore::HTMLImageLoader::dispatchLoadEvent):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::dataList):
+        * html/HTMLLegendElement.cpp:
+        (WebCore::HTMLLegendElement::virtualForm):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::parseAttribute):
+        * html/HTMLNameCollection.cpp:
+        (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
+        (WebCore::DocumentNameCollection::elementMatches):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::ownerDataListElement):
+        (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
+        (WebCore::HTMLOptionElement::isDisabledFormControl):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::recalcListItems):
+        * html/HTMLTableElement.cpp:
+        (WebCore::HTMLTableElement::caption):
+        * html/HTMLTablePartElement.cpp:
+        (WebCore::HTMLTablePartElement::findParentTable):
+        * html/HTMLTableRowElement.cpp:
+        (WebCore::HTMLTableRowElement::rowIndex):
+        * html/HTMLTableRowsCollection.cpp:
+        (WebCore::HTMLTableRowsCollection::rowAfter):
+        (WebCore::HTMLTableRowsCollection::lastRow):
+        * html/HTMLTagNames.in:
+        * html/LabelsNodeList.cpp:
+        (WebCore::LabelsNodeList::elementMatches):
+        * html/MediaDocument.cpp:
+        (WebCore::descendentVideoElement):
+        (WebCore::ancestorVideoElement):
+        * html/RadioInputType.cpp:
+        (WebCore::RadioInputType::handleKeydownEvent):
+        * html/RadioNodeList.cpp:
+        (WebCore::RadioNodeList::RadioNodeList):
+        (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::hasImpliedEndTag):
+        (WebCore::insert):
+        (WebCore::HTMLConstructionSite::insertHTMLFormElement):
+        (WebCore::HTMLConstructionSite::insertTextNode):
+        (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
+        * html/parser/HTMLElementStack.cpp:
+        (WebCore::HTMLNames::isScopeMarker):
+        (WebCore::HTMLNames::isTableScopeMarker):
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+        (WebCore::HTMLTreeBuilder::processStartTag):
+        (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
+        (WebCore::HTMLTreeBuilder::processEndTag):
+        (WebCore::HTMLTreeBuilder::processCharacterBuffer):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyleSheet::inlineStyleSheetText):
+        * page/DragController.cpp:
+        (WebCore::DragController::draggableElement):
+        * page/FocusController.cpp:
+        (WebCore::FocusController::advanceFocusDirectionally):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::serializeFrame):
+        * page/SpatialNavigation.cpp:
+        (WebCore::FocusCandidate::FocusCandidate):
+        (WebCore::areElementsOnSameLine):
+        * page/ios/FrameIOS.mm:
+        (WebCore::ancestorRespondingToClickEvents):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::altDisplayString):
+        (WebCore::HitTestResult::mediaSupportsFullscreen):
+        (WebCore::HitTestResult::mediaElement):
+        (WebCore::HitTestResult::enterFullscreenForVideo):
+        (WebCore::HitTestResult::mediaIsVideo):
+        (WebCore::HitTestResult::isLiveLink):
+        * rendering/RenderCounter.cpp:
+        (WebCore::planCounter):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::RenderImage):
+        (WebCore::RenderImage::paintAreaElementFocusRing):
+        (WebCore::RenderImage::paintIntoRect):
+        (WebCore::RenderImage::imageMap):
+        (WebCore::RenderImage::updateAltText):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::updateFromElement):
+        (WebCore::RenderListBox::paintItemForeground):
+        * rendering/RenderMarquee.cpp:
+        (WebCore::RenderMarquee::marqueeSpeed):
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::itemText):
+        (RenderMenuList::itemIsEnabled):
+        (RenderMenuList::itemIsLabel):
+        * rendering/RenderMeter.cpp:
+        (WebCore::RenderMeter::meterElement):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::shouldRespectImageOrientation):
+        (WebCore::RenderObject::getTextDecorationColors):
+        (WebCore::RenderObject::offsetParent):
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::progressElement):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
+        (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
+        * svg/graphics/SVGImageCache.cpp:
+        (WebCore::SVGImageCache::imageForRenderer):
+        * testing/Internals.cpp:
+        (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::startElementNs):
+
 2014-09-25  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Replay: Check event loop input extents during replay too
index b0ec59b..67475c2 100644 (file)
@@ -176,7 +176,7 @@ AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page* page)
     // get the focused node in the page
     Document* focusedDocument = page->focusController().focusedOrMainFrame().document();
     Element* focusedElement = focusedDocument->focusedElement();
-    if (focusedElement && isHTMLAreaElement(focusedElement))
+    if (focusedElement && is<HTMLAreaElement>(focusedElement))
         return focusedImageMapUIElement(downcast<HTMLAreaElement>(focusedElement));
 
     AccessibilityObject* obj = focusedDocument->axObjectCache()->getOrCreate(focusedElement ? static_cast<Node*>(focusedElement) : focusedDocument);
@@ -386,7 +386,7 @@ AccessibilityObject* AXObjectCache::getOrCreate(Node* node)
 
     bool insideMeterElement = false;
 #if ENABLE(METER_ELEMENT)
-    insideMeterElement = isHTMLMeterElement(node->parentElement());
+    insideMeterElement = is<HTMLMeterElement>(node->parentElement());
 #endif
     
     if (!inCanvasSubtree && !isHidden && !insideMeterElement)
@@ -917,7 +917,7 @@ void AXObjectCache::handleAttributeChanged(const QualifiedName& attrName, Elemen
         handleAriaRoleChanged(element);
     else if (attrName == altAttr || attrName == titleAttr)
         textChanged(element);
-    else if (attrName == forAttr && isHTMLLabelElement(element))
+    else if (attrName == forAttr && is<HTMLLabelElement>(element))
         labelChanged(element);
 
     if (!attrName.localName().string().startsWith("aria-"))
@@ -947,7 +947,7 @@ void AXObjectCache::handleAttributeChanged(const QualifiedName& attrName, Elemen
 
 void AXObjectCache::labelChanged(Element* element)
 {
-    ASSERT(isHTMLLabelElement(element));
+    ASSERT(is<HTMLLabelElement>(element));
     HTMLElement* correspondingControl = downcast<HTMLLabelElement>(element)->control();
     textChanged(correspondingControl);
 }
index c327008..f03887c 100644 (file)
@@ -64,7 +64,7 @@ bool AccessibilityListBoxOption::isEnabled() const
     if (!m_optionElement)
         return false;
     
-    if (isHTMLOptGroupElement(m_optionElement))
+    if (is<HTMLOptGroupElement>(m_optionElement))
         return false;
 
     if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true"))
@@ -159,7 +159,7 @@ String AccessibilityListBoxOption::stringValue() const
     if (is<HTMLOptionElement>(m_optionElement))
         return downcast<HTMLOptionElement>(*m_optionElement).text();
     
-    if (isHTMLOptGroupElement(m_optionElement))
+    if (is<HTMLOptGroupElement>(m_optionElement))
         return downcast<HTMLOptGroupElement>(*m_optionElement).groupLabelText();
     
     return String();
@@ -205,7 +205,7 @@ HTMLSelectElement* AccessibilityListBoxOption::listBoxOptionParentNode() const
     if (is<HTMLOptionElement>(m_optionElement))
         return downcast<HTMLOptionElement>(*m_optionElement).ownerSelectElement();
 
-    if (isHTMLOptGroupElement(m_optionElement))
+    if (is<HTMLOptGroupElement>(m_optionElement))
         return downcast<HTMLOptGroupElement>(*m_optionElement).ownerSelectElement();
 
     return nullptr;
index 262fb97..d74c120 100644 (file)
@@ -321,7 +321,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole()
         return DivRole;
     if (node()->hasTagName(pTag))
         return ParagraphRole;
-    if (isHTMLLabelElement(node()))
+    if (is<HTMLLabelElement>(node()))
         return LabelRole;
     if (node()->isElementNode() && toElement(node())->isFocusable())
         return GroupRole;
@@ -512,7 +512,7 @@ bool AccessibilityNodeObject::isNativeImage() const
     if (!node)
         return false;
 
-    if (isHTMLImageElement(node))
+    if (is<HTMLImageElement>(node))
         return true;
 
     if (node->hasTagName(appletTag) || node->hasTagName(embedTag) || node->hasTagName(objectTag))
@@ -963,7 +963,7 @@ Element* AccessibilityNodeObject::anchorElement() const
     // search up the DOM tree for an anchor element
     // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElement
     for ( ; node; node = node->parentNode()) {
-        if (isHTMLAnchorElement(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
+        if (is<HTMLAnchorElement>(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
             return toElement(node);
     }
 
@@ -1305,7 +1305,7 @@ void AccessibilityNodeObject::alternativeText(Vector<AccessibilityText>& textOrd
         return;
     
     // The fieldset element derives its alternative text from the first associated legend element if one is available.
-    if (isHTMLFieldSetElement(node)) {
+    if (is<HTMLFieldSetElement>(node)) {
         AccessibilityObject* object = axObjectCache()->getOrCreate(downcast<HTMLFieldSetElement>(*node).legend());
         if (object && !object->isHidden())
             textOrder.append(AccessibilityText(accessibleNameForNode(object->node()), AlternativeText));
index 3e2a8f7..444fafa 100644 (file)
@@ -585,7 +585,7 @@ Element* AccessibilityRenderObject::anchorElement() const
     // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElement
     Node* node = currRenderer->node();
     for ( ; node; node = node->parentNode()) {
-        if (isHTMLAnchorElement(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
+        if (is<HTMLAnchorElement>(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
             return toElement(node);
     }
     
@@ -782,7 +782,7 @@ HTMLLabelElement* AccessibilityRenderObject::labelElementContainer() const
     
     // find if this has a parent that is a label
     for (Node* parentNode = m_renderer->node(); parentNode; parentNode = parentNode->parentNode()) {
-        if (isHTMLLabelElement(parentNode))
+        if (is<HTMLLabelElement>(parentNode))
             return downcast<HTMLLabelElement>(parentNode);
     }
     
@@ -914,7 +914,7 @@ AccessibilityObject* AccessibilityRenderObject::internalLinkElement() const
         return nullptr;
     
     // Right now, we do not support ARIA links as internal link elements
-    if (!isHTMLAnchorElement(element))
+    if (!is<HTMLAnchorElement>(element))
         return nullptr;
     HTMLAnchorElement& anchor = downcast<HTMLAnchorElement>(*element);
     
@@ -1275,7 +1275,7 @@ bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
     
     // don't ignore labels, because they serve as TitleUIElements
     Node* node = m_renderer->node();
-    if (node && isHTMLLabelElement(node))
+    if (node && is<HTMLLabelElement>(node))
         return false;
     
     // Anything that is content editable should not be ignored.
@@ -1507,7 +1507,7 @@ void AccessibilityRenderObject::setSelectedTextRange(const PlainTextRange& range
 
 URL AccessibilityRenderObject::url() const
 {
-    if (isAnchor() && isHTMLAnchorElement(m_renderer->node())) {
+    if (isAnchor() && is<HTMLAnchorElement>(m_renderer->node())) {
         if (HTMLAnchorElement* anchor = downcast<HTMLAnchorElement>(anchorElement()))
             return anchor->href();
     }
@@ -1515,7 +1515,7 @@ URL AccessibilityRenderObject::url() const
     if (isWebArea())
         return m_renderer->document().url();
     
-    if (isImage() && m_renderer->node() && isHTMLImageElement(m_renderer->node()))
+    if (isImage() && m_renderer->node() && is<HTMLImageElement>(m_renderer->node()))
         return downcast<HTMLImageElement>(*m_renderer->node()).src();
     
     if (isInputImage())
@@ -1759,7 +1759,7 @@ void AccessibilityRenderObject::getDocumentLinks(AccessibilityChildrenVector& re
                 result.append(axobj);
         } else {
             Node* parent = curr->parentNode();
-            if (parent && isHTMLAreaElement(curr) && isHTMLMapElement(parent)) {
+            if (parent && is<HTMLAreaElement>(curr) && is<HTMLMapElement>(parent)) {
                 AccessibilityImageMapLink* areaObject = toAccessibilityImageMapLink(axObjectCache()->getOrCreate(ImageMapLinkRole));
                 HTMLMapElement& map = downcast<HTMLMapElement>(*parent);
                 areaObject->setHTMLAreaElement(downcast<HTMLAreaElement>(curr));
@@ -2158,7 +2158,7 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityImageMapHitTest(HTM
 
     AccessibilityObject* parent = nullptr;
     for (Element* mapParent = area->parentElement(); mapParent; mapParent = mapParent->parentElement()) {
-        if (isHTMLMapElement(mapParent)) {
+        if (is<HTMLMapElement>(mapParent)) {
             parent = accessibilityParentForImageMap(downcast<HTMLMapElement>(mapParent));
             break;
         }
@@ -2208,7 +2208,7 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityHitTest(const IntPo
         return nullptr;
     Node* node = hitTestResult.innerNode()->deprecatedShadowAncestorNode();
 
-    if (isHTMLAreaElement(node))
+    if (is<HTMLAreaElement>(node))
         return accessibilityImageMapHitTest(downcast<HTMLAreaElement>(node), point);
     
     if (is<HTMLOptionElement>(node))
@@ -2572,7 +2572,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (node && node->hasTagName(trTag))
         return RowRole;
 
-    if (node && isHTMLTableElement(node))
+    if (node && is<HTMLTableElement>(node))
         return TableRole;
 #endif
 
@@ -2586,7 +2586,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (node && node->hasTagName(pTag))
         return ParagraphRole;
 
-    if (node && isHTMLLabelElement(node))
+    if (node && is<HTMLLabelElement>(node))
         return LabelRole;
 
     if (node && node->hasTagName(dfnTag))
@@ -2595,7 +2595,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (node && node->hasTagName(divTag))
         return DivRole;
 
-    if (node && isHTMLFormElement(node))
+    if (node && is<HTMLFormElement>(node))
         return FormRole;
 
     if (node && node->hasTagName(articleTag))
@@ -2617,9 +2617,9 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
         return LandmarkContentInfoRole;
 
 #if ENABLE(VIDEO)
-    if (node && isHTMLVideoElement(node))
+    if (node && is<HTMLVideoElement>(node))
         return VideoRole;
-    if (node && isHTMLAudioElement(node))
+    if (node && is<HTMLAudioElement>(node))
         return AudioRole;
 #endif
     
@@ -3269,7 +3269,7 @@ String AccessibilityRenderObject::stringValueForMSAA() const
 {
     if (isLinkable(*this)) {
         Element* anchor = anchorElement();
-        if (anchor && isHTMLAnchorElement(anchor))
+        if (anchor && is<HTMLAnchorElement>(anchor))
             return downcast<HTMLAnchorElement>(*anchor).href();
     }
 
@@ -3282,7 +3282,7 @@ bool AccessibilityRenderObject::isLinked() const
         return false;
 
     Element* anchor = anchorElement();
-    if (!anchor || !isHTMLAnchorElement(anchor))
+    if (!anchor || !is<HTMLAnchorElement>(anchor))
         return false;
 
     return !downcast<HTMLAnchorElement>(*anchor).href().isEmpty();
index e25443c..6b7e6cf 100644 (file)
@@ -96,7 +96,7 @@ HTMLTableElement* AccessibilityTable::tableElement() const
         return nullptr;
     
     RenderTable* table = toRenderTable(m_renderer);
-    if (table->element() && isHTMLTableElement(table->element()))
+    if (table->element() && is<HTMLTableElement>(table->element()))
         return downcast<HTMLTableElement>(table->element());
     
     // If the table has a display:table-row-group, then the RenderTable does not have a pointer to it's HTMLTableElement.
@@ -106,7 +106,7 @@ HTMLTableElement* AccessibilityTable::tableElement() const
         return nullptr;
     
     Element* actualTable = firstBody->element()->parentElement();
-    if (!actualTable || !isHTMLTableElement(actualTable))
+    if (!actualTable || !is<HTMLTableElement>(actualTable))
         return nullptr;
     
     return downcast<HTMLTableElement>(actualTable);
@@ -328,7 +328,7 @@ bool AccessibilityTable::isTableExposableThroughAccessibility() const
     // Gtk+ ATs expect all tables to be exposed as tables.
 #if PLATFORM(GTK) || PLATFORM(EFL)
     Element* tableNode = toRenderTable(m_renderer)->element();
-    return tableNode && isHTMLTableElement(tableNode);
+    return tableNode && is<HTMLTableElement>(tableNode);
 #endif
 
     return isDataTable();
@@ -607,7 +607,7 @@ String AccessibilityTable::title() const
     
     // see if there is a caption
     Node* tableElement = m_renderer->node();
-    if (tableElement && isHTMLTableElement(tableElement)) {
+    if (tableElement && is<HTMLTableElement>(tableElement)) {
         if (HTMLTableCaptionElement* caption = downcast<HTMLTableElement>(*tableElement).caption())
             title = caption->innerText();
     }
index 659b88f..3492b7e 100644 (file)
@@ -244,7 +244,7 @@ static AtkObject* webkitAccessibleTableGetCaption(AtkTable* table)
     AccessibilityObject* accTable = core(table);
     if (accTable->isAccessibilityRenderObject()) {
         Node* node = accTable->node();
-        if (node && isHTMLTableElement(node)) {
+        if (node && is<HTMLTableElement>(node)) {
             HTMLTableCaptionElement* caption = downcast<HTMLTableElement>(*node).caption();
             if (caption)
                 return AccessibilityObject::firstAccessibleObjectFromNode(caption->renderer()->element())->wrapper();
index 7953c6c..5221e1d 100644 (file)
@@ -73,7 +73,7 @@ EncodedJSValue JSHTMLDocument::nameGetter(ExecState* exec, JSObject* slotBase, E
     }
 
     Element* element = document.documentNamedItem(*atomicPropertyName);
-    if (UNLIKELY(isHTMLIFrameElement(element))) {
+    if (UNLIKELY(is<HTMLIFrameElement>(element))) {
         if (Frame* frame = downcast<HTMLIFrameElement>(*element).contentFrame())
             return JSValue::encode(toJS(exec, frame));
     }
index 2e1d126..7cab184 100644 (file)
@@ -105,12 +105,12 @@ static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, SlotVisitor& v
             // because it is the only thing keeping the image element alive, and if
             // the element is destroyed, its load event will not fire.
             // FIXME: The DOM should manage this issue without the help of JavaScript wrappers.
-            if (isHTMLImageElement(element)) {
+            if (is<HTMLImageElement>(element)) {
                 if (downcast<HTMLImageElement>(element).hasPendingActivity())
                     return true;
             }
 #if ENABLE(VIDEO)
-            else if (isHTMLAudioElement(element)) {
+            else if (is<HTMLAudioElement>(element)) {
                 if (!downcast<HTMLAudioElement>(element).paused())
                     return true;
             }
index 739aa61..a247ce9 100644 (file)
@@ -33,6 +33,7 @@
 #include "ChromeClient.h"
 #include "HTMLAnchorElement.h"
 #include "HTMLAudioElement.h"
+#include "HTMLBRElement.h"
 #include "MediaQueryEvaluator.h"
 #include "Page.h"
 #include "RenderTheme.h"
@@ -62,9 +63,12 @@ StyleSheetContents* CSSDefaultStyleSheets::imageControlsStyleSheet;
 // FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet.
 static const char* simpleUserAgentStyleSheet = "html,body,div{display:block}head{display:none}body{margin:8px}div:focus,span:focus,a:focus{outline:auto 5px -webkit-focus-ring-color}a:-webkit-any-link{color:-webkit-link;text-decoration:underline}a:-webkit-any-link:active{color:-webkit-activelink}";
 
-static inline bool elementCanUseSimpleDefaultStyle(Element* e)
+static inline bool elementCanUseSimpleDefaultStyle(Element& element)
 {
-    return e->hasTagName(htmlTag) || e->hasTagName(headTag) || e->hasTagName(bodyTag) || e->hasTagName(divTag) || e->hasTagName(spanTag) || e->hasTagName(brTag) || isHTMLAnchorElement(e);
+    return is<HTMLHtmlElement>(element) || is<HTMLHeadElement>(element)
+        || is<HTMLBodyElement>(element) || is<HTMLDivElement>(element)
+        || is<HTMLSpanElement>(element) || is<HTMLBRElement>(element)
+        || is<HTMLAnchorElement>(element);
 }
 
 static const MediaQueryEvaluator& screenEval()
@@ -94,7 +98,7 @@ static StyleSheetContents* parseUASheet(const char* characters, unsigned size)
 void CSSDefaultStyleSheets::initDefaultStyle(Element* root)
 {
     if (!defaultStyle) {
-        if (!root || elementCanUseSimpleDefaultStyle(root))
+        if (!root || elementCanUseSimpleDefaultStyle(*root))
             loadSimpleDefaultStyle();
         else
             loadFullDefaultStyle();
@@ -146,14 +150,14 @@ void CSSDefaultStyleSheets::loadSimpleDefaultStyle()
     // No need to initialize quirks sheet yet as there are no quirk rules for elements allowed in simple default style.
 }
 
-void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element, bool& changedDefaultStyle)
+void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element& element, bool& changedDefaultStyle)
 {
     if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(element)) {
         loadFullDefaultStyle();
         changedDefaultStyle = true;
     }
 
-    if (element->isSVGElement() && !svgStyleSheet) {
+    if (element.isSVGElement() && !svgStyleSheet) {
         // SVG rules.
         svgStyleSheet = parseUASheet(svgUserAgentStyleSheet, sizeof(svgUserAgentStyleSheet));
         defaultStyle->addRulesFromSheet(svgStyleSheet, screenEval());
@@ -162,7 +166,7 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
     }
 
 #if ENABLE(MATHML)
-    if (element->isMathMLElement() && !mathMLStyleSheet) {
+    if (element.isMathMLElement() && !mathMLStyleSheet) {
         // MathML rules.
         mathMLStyleSheet = parseUASheet(mathmlUserAgentStyleSheet, sizeof(mathmlUserAgentStyleSheet));
         defaultStyle->addRulesFromSheet(mathMLStyleSheet, screenEval());
@@ -172,10 +176,10 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
 #endif
 
 #if ENABLE(VIDEO)
-    if (!mediaControlsStyleSheet && (element->hasTagName(videoTag) || isHTMLAudioElement(element))) {
-        String mediaRules = RenderTheme::themeForPage(element->document().page())->mediaControlsStyleSheet();
+    if (!mediaControlsStyleSheet && (is<HTMLVideoElement>(element) || is<HTMLAudioElement>(element))) {
+        String mediaRules = RenderTheme::themeForPage(element.document().page())->mediaControlsStyleSheet();
         if (mediaRules.isEmpty())
-            mediaRules = String(mediaControlsUserAgentStyleSheet, sizeof(mediaControlsUserAgentStyleSheet)) + RenderTheme::themeForPage(element->document().page())->extraMediaControlsStyleSheet();
+            mediaRules = String(mediaControlsUserAgentStyleSheet, sizeof(mediaControlsUserAgentStyleSheet)) + RenderTheme::themeForPage(element.document().page())->extraMediaControlsStyleSheet();
         mediaControlsStyleSheet = parseUASheet(mediaRules);
         defaultStyle->addRulesFromSheet(mediaControlsStyleSheet, screenEval());
         defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet, printEval());
@@ -184,7 +188,7 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
 #endif
 
 #if ENABLE(FULLSCREEN_API)
-    if (!fullscreenStyleSheet && element->document().webkitIsFullScreen()) {
+    if (!fullscreenStyleSheet && element.document().webkitIsFullScreen()) {
         String fullscreenRules = String(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraFullScreenStyleSheet();
         fullscreenStyleSheet = parseUASheet(fullscreenRules);
         defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval());
@@ -194,8 +198,8 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
 #endif
 
 #if ENABLE(SERVICE_CONTROLS)
-    if (!imageControlsStyleSheet && element->isImageControlsRootElement()) {
-        String imageControlsRules = RenderTheme::themeForPage(element->document().page())->imageControlsStyleSheet();
+    if (!imageControlsStyleSheet && element.isImageControlsRootElement()) {
+        String imageControlsRules = RenderTheme::themeForPage(element.document().page())->imageControlsStyleSheet();
         imageControlsStyleSheet = parseUASheet(imageControlsRules);
         defaultStyle->addRulesFromSheet(imageControlsStyleSheet, screenEval());
         defaultPrintStyle->addRulesFromSheet(imageControlsStyleSheet, printEval());
@@ -203,8 +207,8 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
     }
 #endif
 
-    if (!plugInsStyleSheet && (element->hasTagName(objectTag) || element->hasTagName(embedTag))) {
-        String plugInsRules = RenderTheme::themeForPage(element->document().page())->extraPlugInsStyleSheet() + element->document().page()->chrome().client().plugInExtraStyleSheet();
+    if (!plugInsStyleSheet && (is<HTMLObjectElement>(element) || is<HTMLEmbedElement>(element))) {
+        String plugInsRules = RenderTheme::themeForPage(element.document().page())->extraPlugInsStyleSheet() + element.document().page()->chrome().client().plugInExtraStyleSheet();
         if (plugInsRules.isEmpty())
             plugInsRules = String(plugInsUserAgentStyleSheet, sizeof(plugInsUserAgentStyleSheet));
         plugInsStyleSheet = parseUASheet(plugInsRules);
index fecd46d..793cc9a 100644 (file)
@@ -45,7 +45,7 @@ public:
     static StyleSheetContents* plugInsStyleSheet;
     static StyleSheetContents* imageControlsStyleSheet;
 
-    static void ensureDefaultStyleSheetsForElement(Element*, bool& changedDefaultStyle);
+    static void ensureDefaultStyleSheetsForElement(Element&, bool& changedDefaultStyle);
     static void loadFullDefaultStyle();
     static void loadSimpleDefaultStyle();
     static void initDefaultStyle(Element*);
index b838355..aad6e58 100644 (file)
@@ -36,6 +36,7 @@
 #include "MediaList.h"
 #include "Node.h"
 #include "SVGNames.h"
+#include "SVGStyleElement.h"
 #include "SecurityOrigin.h"
 #include "StyleResolver.h"
 #include "StyleRule.h"
@@ -67,9 +68,9 @@ static bool isAcceptableCSSStyleSheetParent(Node* parentNode)
     // Only these nodes can be parents of StyleSheets, and they need to call clearOwnerNode() when moved out of document.
     return !parentNode
         || parentNode->isDocumentNode()
-        || parentNode->hasTagName(HTMLNames::linkTag)
-        || isHTMLStyleElement(parentNode)
-        || parentNode->hasTagName(SVGNames::styleTag)
+        || is<HTMLLinkElement>(parentNode)
+        || is<HTMLStyleElement>(parentNode)
+        || is<SVGStyleElement>(parentNode)
         || parentNode->nodeType() == Node::PROCESSING_INSTRUCTION_NODE;
 }
 #endif
index 90766bb..884f694 100644 (file)
@@ -783,7 +783,7 @@ PassRef<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyl
     }
 
     bool needsCollection = false;
-    CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(element, needsCollection);
+    CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(*element, needsCollection);
     if (needsCollection)
         m_ruleSets.collectFeatures();
 
@@ -1170,7 +1170,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par
             if (e->hasTagName(tdTag)) {
                 style.setDisplay(TABLE_CELL);
                 style.setFloating(NoFloat);
-            } else if (isHTMLTableElement(e))
+            } else if (is<HTMLTableElement>(e))
                 style.setDisplay(style.isDisplayInlineType() ? INLINE_TABLE : TABLE);
         }
 
@@ -1187,7 +1187,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par
         }
 
         // Tables never support the -webkit-* values for text-align and will reset back to the default.
-        if (e && isHTMLTableElement(e) && (style.textAlign() == WEBKIT_LEFT || style.textAlign() == WEBKIT_CENTER || style.textAlign() == WEBKIT_RIGHT))
+        if (e && is<HTMLTableElement>(e) && (style.textAlign() == WEBKIT_LEFT || style.textAlign() == WEBKIT_CENTER || style.textAlign() == WEBKIT_RIGHT))
             style.setTextAlign(TASTART);
 
         // Frames and framesets never honor position:relative or position:absolute. This is necessary to
index 0720037..e9016d9 100644 (file)
@@ -76,7 +76,7 @@ HTMLStyleElement* StyleSheetList::getNamedItem(const String& name) const
     // and doesn't look for name attribute.
     // But unicity of stylesheet ids is good practice anyway ;)
     Element* element = m_document->getElementById(name);
-    if (element && isHTMLStyleElement(element))
+    if (element && is<HTMLStyleElement>(element))
         return downcast<HTMLStyleElement>(element);
     return nullptr;
 }
index 7c488c0..bd7de07 100644 (file)
@@ -39,7 +39,7 @@ class CurrentScriptIncrementer {
 public:
     CurrentScriptIncrementer(Document* document, Element* element)
         : m_document(document)
-        , m_isHTMLScriptElement(isHTMLScriptElement(element))
+        , m_isHTMLScriptElement(is<HTMLScriptElement>(element))
     {
         if (m_isHTMLScriptElement)
             m_document->pushCurrentScript(downcast<HTMLScriptElement>(element));
index aa01ae1..c783959 100644 (file)
@@ -254,7 +254,7 @@ void DataTransfer::setDragImage(Element* element, int x, int y)
         return;
 
     CachedImage* image = nullptr;
-    if (element && isHTMLImageElement(element) && !element->inDocument())
+    if (element && is<HTMLImageElement>(element) && !element->inDocument())
         image = downcast<HTMLImageElement>(*element).cachedImage();
 
     m_dragLocation = IntPoint(x, y);
index 77eec3b..34ce9c2 100644 (file)
@@ -53,23 +53,23 @@ inline bool keyMatchesName(const AtomicStringImpl& key, const Element& element)
 
 inline bool keyMatchesMapName(const AtomicStringImpl& key, const Element& element)
 {
-    return isHTMLMapElement(element) && downcast<HTMLMapElement>(element).getName().impl() == &key;
+    return is<HTMLMapElement>(element) && downcast<HTMLMapElement>(element).getName().impl() == &key;
 }
 
 inline bool keyMatchesLowercasedMapName(const AtomicStringImpl& key, const Element& element)
 {
-    return isHTMLMapElement(element) && downcast<HTMLMapElement>(element).getName().lower().impl() == &key;
+    return is<HTMLMapElement>(element) && downcast<HTMLMapElement>(element).getName().lower().impl() == &key;
 }
 
 inline bool keyMatchesLowercasedUsemap(const AtomicStringImpl& key, const Element& element)
 {
     // FIXME: HTML5 specification says we should match both image and object elements.
-    return isHTMLImageElement(element) && downcast<HTMLImageElement>(element).matchesLowercasedUsemap(key);
+    return is<HTMLImageElement>(element) && downcast<HTMLImageElement>(element).matchesLowercasedUsemap(key);
 }
 
 inline bool keyMatchesLabelForAttribute(const AtomicStringImpl& key, const Element& element)
 {
-    return isHTMLLabelElement(element) && element.fastGetAttribute(forAttr).impl() == &key;
+    return is<HTMLLabelElement>(element) && element.fastGetAttribute(forAttr).impl() == &key;
 }
 
 inline bool keyMatchesWindowNamedItem(const AtomicStringImpl& key, const Element& element)
index 889ae62..83a4303 100644 (file)
@@ -284,7 +284,7 @@ void DocumentStyleSheetCollection::collectActiveStyleSheets(Vector<RefPtr<StyleS
             Element& element = toElement(*node);
             AtomicString title = element.fastGetAttribute(titleAttr);
             bool enabledViaScript = false;
-            if (isHTMLLinkElement(element)) {
+            if (is<HTMLLinkElement>(element)) {
                 // <LINK> element
                 HTMLLinkElement& linkElement = downcast<HTMLLinkElement>(element);
                 if (linkElement.isDisabled())
@@ -307,7 +307,7 @@ void DocumentStyleSheetCollection::collectActiveStyleSheets(Vector<RefPtr<StyleS
             // set of sheets that will be enabled.
             if (is<SVGStyleElement>(element))
                 sheet = downcast<SVGStyleElement>(element).sheet();
-            else if (isHTMLLinkElement(element))
+            else if (is<HTMLLinkElement>(element))
                 sheet = downcast<HTMLLinkElement>(element).sheet();
             else
                 sheet = downcast<HTMLStyleElement>(element).sheet();
@@ -322,7 +322,7 @@ void DocumentStyleSheetCollection::collectActiveStyleSheets(Vector<RefPtr<StyleS
                     // we are NOT an alternate sheet, then establish
                     // us as the preferred set. Otherwise, just ignore
                     // this sheet.
-                    if (isHTMLStyleElement(element) || !rel.contains("alternate"))
+                    if (is<HTMLStyleElement>(element) || !rel.contains("alternate"))
                         m_preferredStylesheetSetName = m_selectedStylesheetSetName = title;
                 }
                 if (title != m_preferredStylesheetSetName)
index d1ccb94..d1503ff 100644 (file)
@@ -1716,7 +1716,7 @@ Element* Node::enclosingLinkEventParentOrSelf()
         // For imagemaps, the enclosing link element is the associated area element not the image itself.
         // So we don't let images be the enclosing link element, even though isLink sometimes returns
         // true for them.
-        if (node->isLink() && !isHTMLImageElement(node))
+        if (node->isLink() && !is<HTMLImageElement>(node))
             return toElement(node);
     }
 
index 232d777..676d1c7 100644 (file)
@@ -529,7 +529,7 @@ static bool endsOfNodeAreVisuallyDistinctPositions(Node* node)
         return true;
         
     // Don't include inline tables.
-    if (isHTMLTableElement(node))
+    if (is<HTMLTableElement>(node))
         return false;
     
     // There is a VisiblePosition inside an empty inline-block container.
index a5c2d32..e7a6716 100644 (file)
@@ -382,7 +382,7 @@ String ScriptElement::scriptContent() const
 
 ScriptElement* toScriptElementIfPossible(Element* element)
 {
-    if (isHTMLScriptElement(element))
+    if (is<HTMLScriptElement>(element))
         return downcast<HTMLScriptElement>(element);
 
     if (is<SVGScriptElement>(element))
index 4c22d00..586909a 100644 (file)
@@ -69,7 +69,7 @@ void VisitedLinkState::invalidateStyleForAllLinks()
 
 inline static LinkHash linkHashForElement(Document& document, Element& element)
 {
-    if (isHTMLAnchorElement(element))
+    if (is<HTMLAnchorElement>(element))
         return downcast<HTMLAnchorElement>(element).visitedLinkHash();
     if (const AtomicString* attribute = linkAttribute(element))
         return WebCore::visitedLinkHash(document.baseURL(), *attribute);
@@ -100,7 +100,7 @@ EInsideLink VisitedLinkState::determineLinkStateSlowCase(Element& element)
         return InsideVisitedLink;
 
     LinkHash hash;
-    if (isHTMLAnchorElement(element))
+    if (is<HTMLAnchorElement>(element))
         hash = downcast<HTMLAnchorElement>(element).visitedLinkHash();
     else
         hash = WebCore::visitedLinkHash(element.document().baseURL(), *attribute);
index 7957ea4..ff5f166 100755 (executable)
@@ -659,15 +659,7 @@ END
 };
 END
        ;
-       if ($parameters{namespace} eq "HTML") {
-           print F <<END
-// FIXME: Remove these macros once the code has been ported to using
-// is<*Element>().
-#define is$class(x) WebCore::is<WebCore::$class>(x)
-END
-           ;
-        }
-        print F "\n";
+       print F "\n";
     }
 }
 
index f8a644a..3a57931 100644 (file)
@@ -457,7 +457,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
     makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss();
 
     // Never remove the start block unless it's a table, in which case we won't merge content in.
-    if (startNode == m_startBlock && startOffset == 0 && canHaveChildrenForEditing(startNode) && !isHTMLTableElement(startNode)) {
+    if (startNode == m_startBlock && !startOffset && canHaveChildrenForEditing(startNode) && !is<HTMLTableElement>(startNode)) {
         startOffset = 0;
         startNode = NodeTraversal::next(startNode);
         if (!startNode)
index 302de41..e5b5b72 100644 (file)
@@ -330,7 +330,7 @@ static HTMLImageElement* imageElementFromImageDocument(Document& document)
     Node* node = body->firstChild();
     if (!node)
         return nullptr;
-    if (!isHTMLImageElement(node))
+    if (!is<HTMLImageElement>(node))
         return nullptr;
     return downcast<HTMLImageElement>(node);
 }
index 7e63393..690b691 100644 (file)
@@ -2021,7 +2021,7 @@ static HTMLFormElement* scanForForm(Element* start)
     auto descendants = descendantsOfType<HTMLElement>(start->document());
     for (auto it = descendants.from(*start), end = descendants.end(); it != end; ++it) {
         HTMLElement& element = *it;
-        if (isHTMLFormElement(&element))
+        if (is<HTMLFormElement>(&element))
             return downcast<HTMLFormElement>(&element);
         if (is<HTMLFormControlElement>(element))
             return downcast<HTMLFormControlElement>(element).form();
index e563950..11a0747 100644 (file)
@@ -30,6 +30,7 @@
 #include "Frame.h"
 #include "FrameSelection.h"
 #include "HTMLElement.h"
+#include "HTMLHRElement.h"
 #include "HTMLNames.h"
 #include "HTMLTableElement.h"
 #include "RenderElement.h"
@@ -114,7 +115,7 @@ void InsertLineBreakCommand::doApply()
     // FIXME: Need to merge text nodes when inserting just after or before text.
     
     if (isEndOfParagraph(caret) && !lineBreakExistsAtVisiblePosition(caret)) {
-        bool needExtraLineBreak = !pos.deprecatedNode()->hasTagName(hrTag) && !isHTMLTableElement(pos.deprecatedNode());
+        bool needExtraLineBreak = !is<HTMLHRElement>(pos.deprecatedNode()) && !is<HTMLTableElement>(pos.deprecatedNode());
         
         insertNodeAt(nodeToInsert.get(), pos);
         
index 7fb7503..499dad9 100644 (file)
@@ -169,7 +169,7 @@ void InsertParagraphSeparatorCommand::doApply()
     if (!startBlock
         || !startBlock->nonShadowBoundaryParentNode()
         || isTableCell(startBlock.get())
-        || isHTMLFormElement(startBlock.get())
+        || is<HTMLFormElement>(startBlock.get())
         // FIXME: If the node is hidden, we don't have a canonical position so we will do the wrong thing for tables and <hr>. https://bugs.webkit.org/show_bug.cgi?id=40342
         || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->renderer() && canonicalPos.deprecatedNode()->renderer()->isTable())
         || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->hasTagName(hrTag))) {
index 3113af3..816ea0a 100644 (file)
@@ -721,7 +721,7 @@ static void removeHeadContents(ReplacementFragment& fragment)
     auto it = descendantsOfType<Element>(*fragment.fragment()).begin();
     auto end = descendantsOfType<Element>(*fragment.fragment()).end();
     while (it != end) {
-        if (it->hasTagName(baseTag) || it->hasTagName(linkTag) || it->hasTagName(metaTag) || it->hasTagName(styleTag) || isHTMLTitleElement(*it)) {
+        if (is<HTMLBaseElement>(*it) || is<HTMLLinkElement>(*it) || is<HTMLMetaElement>(*it) || is<HTMLStyleElement>(*it) || is<HTMLTitleElement>(*it)) {
             toRemove.append(&*it);
             it.traverseNextSkippingChildren();
             continue;
index 3bca947..079db94 100644 (file)
@@ -2034,7 +2034,7 @@ BOOL HTMLConverter::_processElement(Element& element, NSInteger depth)
         if (!listStyleType.length())
             listStyleType = "decimal";
         list = adoptNS([[PlatformNSTextList alloc] initWithMarkerFormat:String("{" + listStyleType + "}") options:0]);
-        if (isHTMLOListElement(element)) {
+        if (is<HTMLOListElement>(element)) {
             NSInteger startingItemNumber = downcast<HTMLOListElement>(element).start();
             [list setStartingItemNumber:startingItemNumber];
         }
index e8c608b..5e8f595 100644 (file)
@@ -1204,7 +1204,7 @@ bool isNonTableCellHTMLBlockElement(const Node* node)
     return element->hasTagName(listingTag)
         || element->hasTagName(olTag)
         || element->hasTagName(preTag)
-        || isHTMLTableElement(element)
+        || is<HTMLTableElement>(element)
         || element->hasTagName(ulTag)
         || element->hasTagName(xmpTag)
         || element->hasTagName(h1Tag)
index 56c7007..09f4687 100644 (file)
@@ -452,7 +452,7 @@ static Node* ancestorToRetainStructureAndAppearanceForBlock(Node* commonAncestor
 
     if (commonAncestorBlock->hasTagName(tbodyTag) || commonAncestorBlock->hasTagName(trTag)) {
         ContainerNode* table = commonAncestorBlock->parentNode();
-        while (table && !isHTMLTableElement(table))
+        while (table && !is<HTMLTableElement>(table))
             table = table->parentNode();
 
         return table;
@@ -934,7 +934,7 @@ static Vector<Ref<HTMLElement>> collectElementsToRemoveFromFragment(ContainerNod
             collectElementsToRemoveFromFragment(element);
             continue;
         }
-        if (isHTMLHeadElement(element) || isHTMLBodyElement(element))
+        if (is<HTMLHeadElement>(element) || is<HTMLBodyElement>(element))
             toRemove.append(element);
     }
     return toRemove;
index d6f14d7..9b0fdea 100644 (file)
@@ -300,7 +300,7 @@ bool FTPDirectoryDocumentParser::loadDocumentTemplate()
     RefPtr<Element> tableElement = document()->getElementById(String(ASCIILiteral("ftpDirectoryTable")));
     if (!tableElement)
         LOG_ERROR("Unable to find element by id \"ftpDirectoryTable\" in the template document.");
-    else if (!isHTMLTableElement(tableElement.get()))
+    else if (!is<HTMLTableElement>(tableElement.get()))
         LOG_ERROR("Element of id \"ftpDirectoryTable\" is not a table element");
     else 
         m_tableElement = downcast<HTMLTableElement>(tableElement.get());
index 9df4059..7045a8f 100644 (file)
@@ -98,7 +98,7 @@ HTMLFormElement* FormAssociatedElement::findAssociatedForm(const HTMLElement* el
         // treeScope().getElementById() over the given element.
         HTMLFormElement* newForm = nullptr;
         Element* newFormCandidate = element->treeScope().getElementById(formId);
-        if (newFormCandidate && isHTMLFormElement(newFormCandidate))
+        if (newFormCandidate && is<HTMLFormElement>(newFormCandidate))
             newForm = downcast<HTMLFormElement>(newFormCandidate);
         return newForm;
     }
index 34afeb9..655aab0 100644 (file)
@@ -158,7 +158,7 @@ static void appendServerMapMousePosition(StringBuilder& url, Event* event)
     ASSERT(event->target());
     Node* target = event->target()->toNode();
     ASSERT(target);
-    if (!isHTMLImageElement(target))
+    if (!is<HTMLImageElement>(target))
         return;
 
     HTMLImageElement& imageElement = downcast<HTMLImageElement>(*target);
index dd84bdc..b1153e7 100644 (file)
@@ -182,7 +182,7 @@ Path HTMLAreaElement::getRegion(const LayoutSize& size) const
 HTMLImageElement* HTMLAreaElement::imageElement() const
 {
     Node* mapElement = parentNode();
-    if (!mapElement || !isHTMLMapElement(mapElement))
+    if (!mapElement || !is<HTMLMapElement>(mapElement))
         return nullptr;
     
     return downcast<HTMLMapElement>(*mapElement).imageElement();
index 0ce2b06..b2d6595 100644 (file)
@@ -139,7 +139,7 @@ void HTMLDocument::setDesignMode(const String& value)
 const AtomicString& HTMLDocument::bgColor() const
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return emptyAtom;
     return bodyElement->fastGetAttribute(bgcolorAttr);
 }
@@ -147,7 +147,7 @@ const AtomicString& HTMLDocument::bgColor() const
 void HTMLDocument::setBgColor(const String& value)
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return;
     bodyElement->setAttribute(bgcolorAttr, value);
 }
@@ -155,7 +155,7 @@ void HTMLDocument::setBgColor(const String& value)
 const AtomicString& HTMLDocument::fgColor() const
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return emptyAtom;
     return bodyElement->fastGetAttribute(textAttr);
 }
@@ -163,7 +163,7 @@ const AtomicString& HTMLDocument::fgColor() const
 void HTMLDocument::setFgColor(const String& value)
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return;
     bodyElement->setAttribute(textAttr, value);
 }
@@ -171,7 +171,7 @@ void HTMLDocument::setFgColor(const String& value)
 const AtomicString& HTMLDocument::alinkColor() const
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return emptyAtom;
     return bodyElement->fastGetAttribute(alinkAttr);
 }
@@ -179,7 +179,7 @@ const AtomicString& HTMLDocument::alinkColor() const
 void HTMLDocument::setAlinkColor(const String& value)
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return;
     bodyElement->setAttribute(alinkAttr, value);
 }
@@ -187,7 +187,7 @@ void HTMLDocument::setAlinkColor(const String& value)
 const AtomicString& HTMLDocument::linkColor() const
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return emptyAtom;
     return bodyElement->fastGetAttribute(linkAttr);
 }
@@ -195,7 +195,7 @@ const AtomicString& HTMLDocument::linkColor() const
 void HTMLDocument::setLinkColor(const String& value)
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return;
     return bodyElement->setAttribute(linkAttr, value);
 }
@@ -203,7 +203,7 @@ void HTMLDocument::setLinkColor(const String& value)
 const AtomicString& HTMLDocument::vlinkColor() const
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return emptyAtom;
     return bodyElement->fastGetAttribute(vlinkAttr);
 }
@@ -211,7 +211,7 @@ const AtomicString& HTMLDocument::vlinkColor() const
 void HTMLDocument::setVlinkColor(const String& value)
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !isHTMLBodyElement(bodyElement))
+    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
         return;
     return bodyElement->setAttribute(vlinkAttr, value);
 }
@@ -340,7 +340,7 @@ void HTMLDocument::clear()
 bool HTMLDocument::isFrameSet() const
 {
     HTMLElement* bodyElement = body();
-    return bodyElement && isHTMLFrameSetElement(bodyElement);
+    return bodyElement && is<HTMLFrameSetElement>(bodyElement);
 }
 
 PassRefPtr<Document> HTMLDocument::cloneDocumentWithoutChildren() const
index d8d4d96..cd92ff8 100644 (file)
@@ -427,7 +427,7 @@ void HTMLElement::setInnerHTML(const String& html, ExceptionCode& ec)
     if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, this, AllowScriptingContent, ec)) {
         ContainerNode* container = this;
 #if ENABLE(TEMPLATE_ELEMENT)
-        if (isHTMLTemplateElement(*this))
+        if (is<HTMLTemplateElement>(*this))
             container = downcast<HTMLTemplateElement>(*this).content();
 #endif
         replaceChildrenWithFragment(*container, fragment.release(), ec);
index 5fd2d4c..ac3651f 100644 (file)
@@ -65,7 +65,7 @@ static void updateFromControlElementsAncestorDisabledStateUnder(HTMLElement& sta
     while (control) {
         control->setAncestorDisabled(isDisabled);
         // Don't call setAncestorDisabled(false) on form contorls inside disabled fieldsets.
-        if (isHTMLFieldSetElement(control) && control->fastHasAttribute(disabledAttr))
+        if (is<HTMLFieldSetElement>(control) && control->fastHasAttribute(disabledAttr))
             control = Traversal<HTMLFormControlElement>::nextSkippingChildren(control, &startNode);
         else
             control = Traversal<HTMLFormControlElement>::next(control, &startNode);
@@ -93,7 +93,7 @@ void HTMLFieldSetElement::disabledStateChanged()
     bool thisFieldsetIsDisabled = fastHasAttribute(disabledAttr);
     bool hasSeenFirstLegendElement = false;
     for (HTMLElement* control = Traversal<HTMLElement>::firstChild(this); control; control = Traversal<HTMLElement>::nextSibling(control)) {
-        if (!hasSeenFirstLegendElement && isHTMLLegendElement(control)) {
+        if (!hasSeenFirstLegendElement && is<HTMLLegendElement>(control)) {
             hasSeenFirstLegendElement = true;
             updateFromControlElementsAncestorDisabledStateUnder(*control, false /* isDisabled */);
             continue;
index 8c7af16..15b03dd 100644 (file)
@@ -103,9 +103,9 @@ bool HTMLFormControlElement::computeIsDisabledByFieldsetAncestor() const
 {
     Element* previousAncestor = nullptr;
     for (Element* ancestor = parentElement(); ancestor; ancestor = ancestor->parentElement()) {
-        if (isHTMLFieldSetElement(ancestor) && ancestor->fastHasAttribute(disabledAttr)) {
+        if (is<HTMLFieldSetElement>(ancestor) && ancestor->fastHasAttribute(disabledAttr)) {
             HTMLFieldSetElement& fieldSetAncestor = downcast<HTMLFieldSetElement>(*ancestor);
-            bool isInFirstLegend = previousAncestor && isHTMLLegendElement(previousAncestor) && previousAncestor == fieldSetAncestor.legend();
+            bool isInFirstLegend = previousAncestor && is<HTMLLegendElement>(previousAncestor) && previousAncestor == fieldSetAncestor.legend();
             return !isInFirstLegend;
         }
         previousAncestor = ancestor;
index 68c1dee..05248ac 100644 (file)
@@ -40,7 +40,7 @@ HTMLFormControlsCollection::HTMLFormControlsCollection(ContainerNode& ownerNode)
     , m_cachedElement(nullptr)
     , m_cachedElementOffsetInArray(0)
 {
-    ASSERT(isHTMLFormElement(ownerNode) || isHTMLFieldSetElement(ownerNode));
+    ASSERT(is<HTMLFormElement>(ownerNode) || is<HTMLFieldSetElement>(ownerNode));
 }
 
 PassRef<HTMLFormControlsCollection> HTMLFormControlsCollection::create(ContainerNode& ownerNode, CollectionType)
@@ -54,15 +54,15 @@ HTMLFormControlsCollection::~HTMLFormControlsCollection()
 
 const Vector<FormAssociatedElement*>& HTMLFormControlsCollection::formControlElements() const
 {
-    ASSERT(isHTMLFormElement(ownerNode()) || ownerNode().hasTagName(fieldsetTag));
-    if (isHTMLFormElement(ownerNode()))
+    ASSERT(is<HTMLFormElement>(ownerNode()) || is<HTMLFieldSetElement>(ownerNode()));
+    if (is<HTMLFormElement>(ownerNode()))
         return downcast<HTMLFormElement>(ownerNode()).associatedElements();
     return downcast<HTMLFieldSetElement>(ownerNode()).associatedElements();
 }
 
 const Vector<HTMLImageElement*>& HTMLFormControlsCollection::formImageElements() const
 {
-    ASSERT(isHTMLFormElement(ownerNode()));
+    ASSERT(is<HTMLFormElement>(ownerNode()));
     return downcast<HTMLFormElement>(ownerNode()).imageElements();
 }
 
@@ -128,7 +128,7 @@ Node* HTMLFormControlsCollection::namedItem(const AtomicString& name) const
     // attribute. If a match is not found, the method then searches for an
     // object with a matching name attribute, but only on those elements
     // that are allowed a name attribute.
-    const Vector<HTMLImageElement*>* imagesElements = ownerNode().hasTagName(fieldsetTag) ? nullptr : &formImageElements();
+    const Vector<HTMLImageElement*>* imagesElements = is<HTMLFieldSetElement>(ownerNode()) ? nullptr : &formImageElements();
     if (HTMLElement* item = firstNamedItem(formControlElements(), imagesElements, idAttr, name))
         return item;
 
@@ -161,7 +161,7 @@ void HTMLFormControlsCollection::updateNamedElementCache() const
         }
     }
 
-    if (isHTMLFormElement(ownerNode())) {
+    if (is<HTMLFormElement>(ownerNode())) {
         const Vector<HTMLImageElement*>& imageElementsArray = formImageElements();
         for (unsigned i = 0; i < imageElementsArray.size(); ++i) {
             HTMLImageElement& element = *imageElementsArray[i];
index dcd2a88..eaff71f 100644 (file)
@@ -110,7 +110,7 @@ bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style)
         return false;
 
     // FIXME: Shouldn't we also check for table caption (see |formIsTablePart| below).
-    bool parentIsTableElementPart = (parentRenderer->isTable() && isHTMLTableElement(parent))
+    bool parentIsTableElementPart = (parentRenderer->isTable() && is<HTMLTableElement>(parent))
         || (parentRenderer->isTableRow() && parent->hasTagName(trTag))
         || (parentRenderer->isTableSection() && parent->hasTagName(tbodyTag))
         || (parentRenderer->isRenderTableCol() && parent->hasTagName(colTag))
index 279ebd8..b475bd5 100644 (file)
@@ -77,8 +77,8 @@ private:
 };
 
 void isHTMLFrameElementBase(const HTMLFrameElementBase&); // Catch unnecessary runtime check of type known at compile time.
-inline bool isHTMLFrameElementBase(const HTMLElement& element) { return isHTMLFrameElement(element) || isHTMLIFrameElement(element); }
-inline bool isHTMLFrameElementBase(const Node& node) { return isHTMLFrameElement(node) || isHTMLIFrameElement(node); }
+inline bool isHTMLFrameElementBase(const HTMLElement& element) { return is<HTMLFrameElement>(element) || is<HTMLIFrameElement>(element); }
+inline bool isHTMLFrameElementBase(const Node& node) { return is<HTMLFrameElement>(node) || is<HTMLIFrameElement>(node); }
 
 NODE_TYPE_CASTS(HTMLFrameElementBase)
 
index 29fbcde..30aa170 100644 (file)
@@ -49,7 +49,7 @@ HTMLImageLoader::~HTMLImageLoader()
 void HTMLImageLoader::dispatchLoadEvent()
 {
     // HTMLVideoElement uses this class to load the poster image, but it should not fire events for loading or failure.
-    if (isHTMLVideoElement(element()))
+    if (is<HTMLVideoElement>(element()))
         return;
 
     bool errorOccurred = image()->errorOccurred();
index e2d55e3..439a0a1 100644 (file)
@@ -1521,7 +1521,7 @@ HTMLDataListElement* HTMLInputElement::dataList() const
         return nullptr;
 
     Element* element = treeScope().getElementById(fastGetAttribute(listAttr));
-    if (!element || !isHTMLDataListElement(element))
+    if (!element || !is<HTMLDataListElement>(element))
         return nullptr;
 
     return downcast<HTMLDataListElement>(element);
index 2fb4d25..8e9c829 100644 (file)
@@ -79,7 +79,7 @@ HTMLFormElement* HTMLLegendElement::virtualForm() const
     // its parent, then the form attribute must return the same value as the
     // form attribute on that fieldset element. Otherwise, it must return null.
     ContainerNode* fieldset = parentNode();
-    if (!fieldset || !isHTMLFieldSetElement(fieldset))
+    if (!fieldset || !is<HTMLFieldSetElement>(fieldset))
         return nullptr;
 
     return downcast<HTMLFieldSetElement>(*fieldset).form();
index 9b42292..74f943e 100644 (file)
@@ -4882,7 +4882,7 @@ void HTMLMediaElement::enterFullscreen()
     m_isInVideoFullscreen = true;
     if (hasMediaControls())
         mediaControls()->enteredFullscreen();
-    if (document().page() && isHTMLVideoElement(this)) {
+    if (document().page() && is<HTMLVideoElement>(this)) {
         HTMLVideoElement& asVideo = downcast<HTMLVideoElement>(*this);
         if (document().page()->chrome().client().supportsVideoFullscreen()) {
             document().page()->chrome().client().enterVideoFullscreenForVideoElement(&asVideo);
@@ -4906,7 +4906,7 @@ void HTMLMediaElement::exitFullscreen()
     m_isInVideoFullscreen = false;
     if (hasMediaControls())
         mediaControls()->exitedFullscreen();
-    if (document().page() && isHTMLVideoElement(this)) {
+    if (document().page() && is<HTMLVideoElement>(this)) {
         if (m_mediaSession->requiresFullscreenForVideoPlayback(*this))
             pauseInternal();
 
index af3c363..37f58c1 100644 (file)
@@ -51,8 +51,8 @@ HTMLNameCollection::~HTMLNameCollection()
 
 bool WindowNameCollection::elementMatchesIfNameAttributeMatch(const Element& element)
 {
-    return isHTMLImageElement(element) || isHTMLFormElement(element) || element.hasTagName(appletTag)
-        || element.hasTagName(embedTag) || element.hasTagName(objectTag);
+    return is<HTMLImageElement>(element) || is<HTMLFormElement>(element) || is<HTMLAppletElement>(element)
+        || is<HTMLEmbedElement>(element) || is<HTMLObjectElement>(element);
 }
 
 bool WindowNameCollection::elementMatches(const Element& element, const AtomicStringImpl* name)
@@ -81,13 +81,13 @@ bool DocumentNameCollection::elementMatches(const Element& element, const Atomic
 {
     // Find images, forms, applets, embeds, objects and iframes by name, applets and object by id, and images by id
     // but only if they have a name attribute (this very strange rule matches IE)
-    if (isHTMLFormElement(element) || element.hasTagName(embedTag) || element.hasTagName(iframeTag))
+    if (is<HTMLFormElement>(element) || is<HTMLEmbedElement>(element) || is<HTMLIFrameElement>(element))
         return element.getNameAttribute().impl() == name;
-    if (element.hasTagName(appletTag))
+    if (is<HTMLAppletElement>(element))
         return element.getNameAttribute().impl() == name || element.getIdAttribute().impl() == name;
     if (is<HTMLObjectElement>(element))
         return (element.getNameAttribute().impl() == name || element.getIdAttribute().impl() == name) && downcast<HTMLObjectElement>(element).isDocNamedItem();
-    if (isHTMLImageElement(element))
+    if (is<HTMLImageElement>(element))
         return element.getNameAttribute().impl() == name || (element.getIdAttribute().impl() == name && element.hasName());
     return false;
 }
index ce65127..3c37708 100644 (file)
@@ -257,7 +257,7 @@ void HTMLOptionElement::childrenChanged(const ChildChange& change)
 HTMLDataListElement* HTMLOptionElement::ownerDataListElement() const
 {
     for (ContainerNode* parent = parentNode(); parent ; parent = parent->parentNode()) {
-        if (isHTMLDataListElement(parent))
+        if (is<HTMLDataListElement>(parent))
             return downcast<HTMLDataListElement>(parent);
     }
     return nullptr;
@@ -302,7 +302,7 @@ void HTMLOptionElement::willResetComputedStyle()
 String HTMLOptionElement::textIndentedToRespectGroupLabel() const
 {
     ContainerNode* parent = parentNode();
-    if (parent && isHTMLOptGroupElement(parent))
+    if (parent && is<HTMLOptGroupElement>(parent))
         return "    " + text();
     return text();
 }
@@ -316,7 +316,7 @@ bool HTMLOptionElement::isDisabledFormControl() const
         return false;
 
     HTMLElement& parentElement = toHTMLElement(*parentNode());
-    return isHTMLOptGroupElement(parentElement) && parentElement.isDisabledFormControl();
+    return is<HTMLOptGroupElement>(parentElement) && parentElement.isDisabledFormControl();
 }
 
 Node::InsertionNotificationRequest HTMLOptionElement::insertedInto(ContainerNode& insertionPoint)
index c963262..5d32e38 100644 (file)
@@ -790,7 +790,7 @@ void HTMLSelectElement::recalcListItems(bool updateSelectedStates) const
         // optgroup tags may not nest. However, both FireFox and IE will
         // flatten the tree automatically, so we follow suit.
         // (http://www.w3.org/TR/html401/interact/forms.html#h-17.6)
-        if (isHTMLOptGroupElement(current)) {
+        if (is<HTMLOptGroupElement>(current)) {
             m_listItems.append(current);
             if (Element* nextElement = ElementTraversal::firstWithin(current)) {
                 currentElement = nextElement;
index ab701f3..6284cec 100644 (file)
@@ -70,7 +70,7 @@ PassRefPtr<HTMLTableElement> HTMLTableElement::create(const QualifiedName& tagNa
 HTMLTableCaptionElement* HTMLTableElement::caption() const
 {
     for (Node* child = firstChild(); child; child = child->nextSibling()) {
-        if (isHTMLTableCaptionElement(child))
+        if (is<HTMLTableCaptionElement>(child))
             return downcast<HTMLTableCaptionElement>(child);
     }
     return nullptr;
index f510824..bbdd84b 100644 (file)
@@ -86,7 +86,7 @@ void HTMLTablePartElement::collectStyleForPresentationAttribute(const QualifiedN
 HTMLTableElement* HTMLTablePartElement::findParentTable() const
 {
     ContainerNode* parent = parentNode();
-    while (parent && !isHTMLTableElement(parent))
+    while (parent && !is<HTMLTableElement>(parent))
         parent = parent->parentNode();
     return downcast<HTMLTableElement>(parent);
 }
index 47ff33b..1ff671c 100644 (file)
@@ -60,7 +60,7 @@ int HTMLTableRowElement::rowIndex() const
     if (!table)
         return -1;
     table = table->parentNode();
-    if (!table || !isHTMLTableElement(table))
+    if (!table || !is<HTMLTableElement>(table))
         return -1;
 
     // To match Firefox, the row indices work like this:
index 04a9604..3ad22a5 100644 (file)
@@ -97,7 +97,7 @@ HTMLTableRowElement* HTMLTableRowsCollection::rowAfter(HTMLTableElement* table,
     else if (isInSection(*previous, tbodyTag))
         child = ElementTraversal::nextSibling(previous->parentNode());
     for (; child; child = ElementTraversal::nextSibling(child)) {
-        if (isHTMLTableRowElement(child))
+        if (is<HTMLTableRowElement>(child))
             return downcast<HTMLTableRowElement>(child);
         if (child->hasTagName(tbodyTag)) {
             if (auto row = childrenOfType<HTMLTableRowElement>(*child).first())
@@ -130,7 +130,7 @@ HTMLTableRowElement* HTMLTableRowsCollection::lastRow(HTMLTableElement* table)
     }
 
     for (auto* child = ElementTraversal::lastChild(table); child; child = ElementTraversal::previousSibling(child)) {
-        if (isHTMLTableRowElement(child))
+        if (is<HTMLTableRowElement>(child))
             return downcast<HTMLTableRowElement>(child);
         if (child->hasTagName(tbodyTag)) {
             if (auto* row = childrenOfType<HTMLTableRowElement>(*child).last())
index 12a5c0f..c54afa1 100644 (file)
@@ -21,7 +21,7 @@ bgsound interfaceName=HTMLElement
 big interfaceName=HTMLElement
 blockquote interfaceName=HTMLQuoteElement
 body generateTypeHelpers
-br interfaceName=HTMLBRElement
+br interfaceName=HTMLBRElement, generateTypeHelpers
 button constructorNeedsFormElement, generateTypeHelpers
 canvas generateTypeHelpers
 caption interfaceName=HTMLTableCaptionElement, generateTypeHelpers
@@ -60,7 +60,7 @@ h6 interfaceName=HTMLHeadingElement
 head generateTypeHelpers
 header interfaceName=HTMLElement
 hgroup interfaceName=HTMLElement
-hr interfaceName=HTMLHRElement
+hr interfaceName=HTMLHRElement, generateTypeHelpers
 html generateTypeHelpers
 i interfaceName=HTMLElement
 iframe interfaceName=HTMLIFrameElement, generateTypeHelpers
@@ -112,7 +112,7 @@ section interfaceName=HTMLElement
 select constructorNeedsFormElement, generateTypeHelpers
 small interfaceName=HTMLElement
 source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, generateTypeHelpers
-span
+span generateTypeHelpers
 strike interfaceName=HTMLElement
 strong interfaceName=HTMLElement
 style constructorNeedsCreatedByParser, generateTypeHelpers
index 8c29620..11cf07b 100644 (file)
@@ -45,7 +45,7 @@ LabelsNodeList::~LabelsNodeList()
     
 bool LabelsNodeList::elementMatches(Element& testNode) const
 {
-    return isHTMLLabelElement(testNode) && downcast<HTMLLabelElement>(testNode).control() == &ownerNode();
+    return is<HTMLLabelElement>(testNode) && downcast<HTMLLabelElement>(testNode).control() == &ownerNode();
 }
 
 } // namespace WebCore
index 0c25b3b..95afd92 100644 (file)
@@ -160,7 +160,7 @@ PassRefPtr<DocumentParser> MediaDocument::createParser()
 
 static inline HTMLVideoElement* descendentVideoElement(ContainerNode& node)
 {
-    if (isHTMLVideoElement(node))
+    if (is<HTMLVideoElement>(node))
         return downcast<HTMLVideoElement>(&node);
 
     RefPtr<NodeList> nodeList = node.getElementsByTagNameNS(videoTag.namespaceURI(), videoTag.localName());
@@ -173,7 +173,7 @@ static inline HTMLVideoElement* descendentVideoElement(ContainerNode& node)
 
 static inline HTMLVideoElement* ancestorVideoElement(Node* node)
 {
-    while (node && !isHTMLVideoElement(node))
+    while (node && !is<HTMLVideoElement>(node))
         node = node->parentOrShadowHostNode();
 
     return downcast<HTMLVideoElement>(node);
index 8a5e885..5f5ec75 100644 (file)
@@ -81,7 +81,7 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
     Node* node = &element();
     while ((node = (forward ? NodeTraversal::next(node) : NodeTraversal::previous(node)))) {
         // Once we encounter a form element, we know we're through.
-        if (isHTMLFormElement(node))
+        if (is<HTMLFormElement>(node))
             break;
         // Look for more radio buttons.
         if (!is<HTMLInputElement>(node))
index 8d46921..5e4025e 100644 (file)
@@ -41,7 +41,7 @@ using namespace HTMLNames;
 RadioNodeList::RadioNodeList(ContainerNode& rootNode, const AtomicString& name)
     : CachedLiveNodeList(rootNode, InvalidateForFormControls)
     , m_name(name)
-    , m_isRootedAtDocument(isHTMLFormElement(ownerNode()))
+    , m_isRootedAtDocument(is<HTMLFormElement>(ownerNode()))
 {
 }
 
@@ -86,7 +86,7 @@ void RadioNodeList::setValue(const String& value)
 bool RadioNodeList::checkElementMatchesRadioNodeListFilter(const Element& testElement) const
 {
     ASSERT(is<HTMLObjectElement>(testElement) || is<HTMLFormControlElement>(testElement));
-    if (isHTMLFormElement(ownerNode())) {
+    if (is<HTMLFormElement>(ownerNode())) {
         HTMLFormElement* formElement = nullptr;
         if (testElement.hasTagName(objectTag))
             formElement = downcast<HTMLObjectElement>(testElement).form();
index b78de60..90396ff 100644 (file)
@@ -62,7 +62,7 @@ static bool hasImpliedEndTag(const HTMLStackItem* item)
         || item->hasTagName(dtTag)
         || item->hasTagName(liTag)
         || is<HTMLOptionElement>(item->node())
-        || isHTMLOptGroupElement(item->node())
+        || is<HTMLOptGroupElement>(item->node())
         || item->hasTagName(pTag)
         || item->hasTagName(rbTag)
         || item->hasTagName(rpTag)
@@ -85,7 +85,7 @@ static inline bool isAllWhitespace(const String& string)
 static inline void insert(HTMLConstructionSiteTask& task)
 {
 #if ENABLE(TEMPLATE_ELEMENT)
-    if (isHTMLTemplateElement(*task.parent))
+    if (is<HTMLTemplateElement>(*task.parent))
         task.parent = downcast<HTMLTemplateElement>(*task.parent).content();
 #endif
 
@@ -458,7 +458,7 @@ void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken* token)
 void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken* token, bool isDemoted)
 {
     RefPtr<Element> element = createHTMLElement(token);
-    ASSERT(isHTMLFormElement(element.get()));
+    ASSERT(is<HTMLFormElement>(element.get()));
     RefPtr<HTMLFormElement> form = static_pointer_cast<HTMLFormElement>(element.release());
     if (!insideTemplateElement())
         m_form = form;
@@ -531,7 +531,7 @@ void HTMLConstructionSite::insertTextNode(const String& characters, WhitespaceMo
         findFosterSite(task);
 
 #if ENABLE(TEMPLATE_ELEMENT)
-    if (isHTMLTemplateElement(*task.parent))
+    if (is<HTMLTemplateElement>(*task.parent))
         task.parent = downcast<HTMLTemplateElement>(*task.parent).content();
 #endif
 
@@ -618,7 +618,7 @@ PassRefPtr<Element> HTMLConstructionSite::createElement(AtomicHTMLToken* token,
 inline Document& HTMLConstructionSite::ownerDocumentForCurrentNode()
 {
 #if ENABLE(TEMPLATE_ELEMENT)
-    if (isHTMLTemplateElement(currentNode()))
+    if (is<HTMLTemplateElement>(currentNode()))
         return downcast<HTMLTemplateElement>(*currentElement()).content()->document();
 #endif
     return currentNode()->document();
index ada20cd..cd6a201 100644 (file)
@@ -51,7 +51,7 @@ inline bool isScopeMarker(HTMLStackItem* item)
         || item->hasTagName(captionTag)
         || item->hasTagName(marqueeTag)
         || item->hasTagName(objectTag)
-        || isHTMLTableElement(item->node())
+        || is<HTMLTableElement>(item->node())
         || item->hasTagName(tdTag)
         || item->hasTagName(thTag)
         || item->hasTagName(MathMLNames::miTag)
@@ -78,7 +78,7 @@ inline bool isListItemScopeMarker(HTMLStackItem* item)
 
 inline bool isTableScopeMarker(HTMLStackItem* item)
 {
-    return isHTMLTableElement(item->node())
+    return is<HTMLTableElement>(item->node())
 #if ENABLE(TEMPLATE_ELEMENT)
         || item->hasTagName(templateTag)
 #endif
index a4896c5..f7ecac8 100644 (file)
@@ -298,7 +298,7 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser& parser, DocumentFragment& f
 #endif
 
         resetInsertionModeAppropriately();
-        m_tree.setForm(!contextElement || isHTMLFormElement(contextElement) ? downcast<HTMLFormElement>(contextElement) : HTMLFormElement::findClosestFormAncestor(*contextElement));
+        m_tree.setForm(!contextElement || is<HTMLFormElement>(contextElement) ? downcast<HTMLFormElement>(contextElement) : HTMLFormElement::findClosestFormAncestor(*contextElement));
     }
 }
 
@@ -1372,7 +1372,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
                 AtomicHTMLToken endOption(HTMLToken::EndTag, optionTag.localName());
                 processEndTag(&endOption);
             }
-            if (isHTMLOptGroupElement(m_tree.currentStackItem()->node())) {
+            if (is<HTMLOptGroupElement>(m_tree.currentStackItem()->node())) {
                 AtomicHTMLToken endOptgroup(HTMLToken::EndTag, optgroupTag.localName());
                 processEndTag(&endOptgroup);
             }
@@ -1629,7 +1629,7 @@ void HTMLTreeBuilder::resetInsertionModeAppropriately()
                 while (item->node() != m_tree.openElements()->rootNode() && !item->hasTagName(templateTag)) {
                     nodeRecord = nodeRecord->next();
                     item = nodeRecord->stackItem();
-                    if (isHTMLTableElement(item->node()))
+                    if (is<HTMLTableElement>(item->node()))
                         return setInsertionMode(InsertionMode::InSelectInTable);
                 }
             }
@@ -1647,7 +1647,7 @@ void HTMLTreeBuilder::resetInsertionModeAppropriately()
         if (item->hasTagName(colgroupTag)) {
             return setInsertionMode(InsertionMode::InColumnGroup);
         }
-        if (isHTMLTableElement(item->node()))
+        if (is<HTMLTableElement>(item->node()))
             return setInsertionMode(InsertionMode::InTable);
         if (item->hasTagName(headTag)) {
 #if ENABLE(TEMPLATE_ELEMENT)
@@ -2234,9 +2234,9 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
     case InsertionMode::InSelect:
         ASSERT(insertionMode() == InsertionMode::InSelect || insertionMode() == InsertionMode::InSelectInTable);
         if (token->name() == optgroupTag) {
-            if (is<HTMLOptionElement>(m_tree.currentStackItem()->node()) && m_tree.oneBelowTop() && isHTMLOptGroupElement(m_tree.oneBelowTop()->node()))
+            if (is<HTMLOptionElement>(m_tree.currentStackItem()->node()) && m_tree.oneBelowTop() && is<HTMLOptGroupElement>(m_tree.oneBelowTop()->node()))
                 processFakeEndTag(optionTag);
-            if (isHTMLOptGroupElement(m_tree.currentStackItem()->node())) {
+            if (is<HTMLOptGroupElement>(m_tree.currentStackItem()->node())) {
                 m_tree.openElements()->pop();
                 return;
             }
@@ -2486,7 +2486,7 @@ ReprocessBuffer:
         ASSERT(insertionMode() == InsertionMode::InTable || insertionMode() == InsertionMode::InTableBody || insertionMode() == InsertionMode::InRow);
         ASSERT(m_pendingTableCharacters.isEmpty());
         if (m_tree.currentStackItem()->isElementNode()
-            && (isHTMLTableElement(m_tree.currentStackItem()->node())
+            && (is<HTMLTableElement>(m_tree.currentStackItem()->node())
                 || m_tree.currentStackItem()->hasTagName(HTMLNames::tbodyTag)
                 || m_tree.currentStackItem()->hasTagName(HTMLNames::tfootTag)
                 || m_tree.currentStackItem()->hasTagName(HTMLNames::theadTag)
index bba39f6..0f8a29d 100644 (file)
@@ -1297,7 +1297,7 @@ PassRefPtr<Inspector::Protocol::DOM::Node> InspectorDOMAgent::buildObjectForNode
         }
 
 #if ENABLE(TEMPLATE_ELEMENT)
-        if (isHTMLTemplateElement(element))
+        if (is<HTMLTemplateElement>(element))
             value->setTemplateContent(buildObjectForNode(downcast<HTMLTemplateElement>(*element).content(), 0, nodesMap));
 #endif
 
index a35f1e6..721abe3 100644 (file)
@@ -1392,7 +1392,7 @@ bool InspectorStyleSheet::inlineStyleSheetText(String* result) const
         return false;
     Element* ownerElement = toElement(ownerNode);
 
-    if (!isHTMLStyleElement(ownerElement) && !ownerElement->hasTagName(SVGNames::styleTag))
+    if (!is<HTMLStyleElement>(ownerElement) && !is<SVGStyleElement>(ownerElement))
         return false;
     *result = ownerElement->textContent();
     return true;
index 5ad33bc..179eea5 100644 (file)
@@ -639,13 +639,13 @@ Element* DragController::draggableElement(const Frame* sourceFrame, Element* sta
         }
         if (dragMode == DRAG_AUTO) {
             if ((m_dragSourceAction & DragSourceActionImage)
-                && isHTMLImageElement(element)
+                && is<HTMLImageElement>(element)
                 && sourceFrame->settings().loadsImagesAutomatically()) {
                 state.type = static_cast<DragSourceAction>(state.type | DragSourceActionImage);
                 return element;
             }
             if ((m_dragSourceAction & DragSourceActionLink)
-                && isHTMLAnchorElement(element)
+                && is<HTMLAnchorElement>(element)
                 && downcast<HTMLAnchorElement>(*element).isLiveLink()) {
                 state.type = static_cast<DragSourceAction>(state.type | DragSourceActionLink);
                 return element;
index f7bd722..ec85606 100644 (file)
@@ -884,7 +884,7 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa
         if (!hasOffscreenRect(focusedElement)) {
             container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direction, focusedElement);
             startingRect = nodeRectInAbsoluteCoordinates(focusedElement, true /* ignore border */);
-        } else if (isHTMLAreaElement(focusedElement)) {
+        } else if (is<HTMLAreaElement>(focusedElement)) {
             HTMLAreaElement& area = downcast<HTMLAreaElement>(*focusedElement);
             container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direction, area.imageElement());
             startingRect = virtualRectForAreaElementAndDirection(&area, direction);
index 8cc68e9..8e1dcef 100644 (file)
@@ -230,19 +230,19 @@ void PageSerializer::serializeFrame(Frame* frame)
         if (element->isStyledElement())
             retrieveResourcesForProperties(toStyledElement(element)->inlineStyle(), document);
 
-        if (isHTMLImageElement(element)) {
+        if (is<HTMLImageElement>(element)) {
             HTMLImageElement& imageElement = downcast<HTMLImageElement>(*element);
             URL url = document->completeURL(imageElement.fastGetAttribute(HTMLNames::srcAttr));
             CachedImage* cachedImage = imageElement.cachedImage();
             addImageToResources(cachedImage, imageElement.renderer(), url);
-        } else if (isHTMLLinkElement(element)) {
+        } else if (is<HTMLLinkElement>(element)) {
             HTMLLinkElement& linkElement = downcast<HTMLLinkElement>(*element);
             if (CSSStyleSheet* sheet = linkElement.sheet()) {
                 URL url = document->completeURL(linkElement.getAttribute(HTMLNames::hrefAttr));
                 serializeCSSStyleSheet(sheet, url);
                 ASSERT(m_resourceURLs.contains(url));
             }
-        } else if (isHTMLStyleElement(element)) {
+        } else if (is<HTMLStyleElement>(element)) {
             if (CSSStyleSheet* sheet = downcast<HTMLStyleElement>(*element).sheet())
                 serializeCSSStyleSheet(sheet, URL());
         }
index d56c9f0..4e38924 100644 (file)
@@ -66,7 +66,7 @@ FocusCandidate::FocusCandidate(Node* node, FocusDirection direction)
     ASSERT(node);
     ASSERT(node->isElementNode());
 
-    if (isHTMLAreaElement(node)) {
+    if (is<HTMLAreaElement>(node)) {
         HTMLAreaElement& area = downcast<HTMLAreaElement>(*node);
         HTMLImageElement* image = area.imageElement();
         if (!image || !image->renderer())
@@ -607,7 +607,7 @@ bool areElementsOnSameLine(const FocusCandidate& firstCandidate, const FocusCand
     if (!firstCandidate.rect.intersects(secondCandidate.rect))
         return false;
 
-    if (isHTMLAreaElement(firstCandidate.focusableNode) || isHTMLAreaElement(secondCandidate.focusableNode))
+    if (is<HTMLAreaElement>(firstCandidate.focusableNode) || is<HTMLAreaElement>(secondCandidate.focusableNode))
         return false;
 
     if (!firstCandidate.visibleNode->renderer()->isRenderInline() || !secondCandidate.visibleNode->renderer()->isRenderInline())
index b82f9eb..e3a0c71 100644 (file)
@@ -351,7 +351,7 @@ static Node* ancestorRespondingToClickEvents(const HitTestResult& hitTestResult,
             // If we are interested about the frame, use it.
             if (nodeBounds) {
                 // This is a check to see whether this node is an area element.  The only way this can happen is if this is the first check.
-                if (node == hitTestResult.innerNode() && node != hitTestResult.innerNonSharedNode() && isHTMLAreaElement(node))
+                if (node == hitTestResult.innerNode() && node != hitTestResult.innerNonSharedNode() && is<HTMLAreaElement>(node))
                     *nodeBounds = snappedIntRect(downcast<HTMLAreaElement>(*node).computeRect(hitTestResult.innerNonSharedNode()->renderer()));
                 else if (node && node->renderer())
                     *nodeBounds = node->renderer()->absoluteBoundingBoxRect(true);
index 063789c..93ce49d 100644 (file)
@@ -273,7 +273,7 @@ String HitTestResult::altDisplayString() const
     if (!m_innerNonSharedNode)
         return String();
     
-    if (isHTMLImageElement(*m_innerNonSharedNode)) {
+    if (is<HTMLImageElement>(*m_innerNonSharedNode)) {
         HTMLImageElement& image = downcast<HTMLImageElement>(*m_innerNonSharedNode);
         return displayString(image.fastGetAttribute(altAttr), m_innerNonSharedNode.get());
     }
@@ -362,7 +362,7 @@ bool HitTestResult::mediaSupportsFullscreen() const
 {
 #if ENABLE(VIDEO)
     HTMLMediaElement* mediaElt(mediaElement());
-    return (mediaElt && isHTMLVideoElement(mediaElt) && mediaElt->supportsFullscreen());
+    return (mediaElt && is<HTMLVideoElement>(mediaElt) && mediaElt->supportsFullscreen());
 #else
     return false;
 #endif
@@ -377,7 +377,7 @@ HTMLMediaElement* HitTestResult::mediaElement() const
     if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()->isMedia()))
         return 0;
 
-    if (isHTMLVideoElement(m_innerNonSharedNode.get()) || isHTMLAudioElement(m_innerNonSharedNode.get()))
+    if (is<HTMLVideoElement>(m_innerNonSharedNode.get()) || is<HTMLAudioElement>(m_innerNonSharedNode.get()))
         return toHTMLMediaElement(m_innerNonSharedNode.get());
     return 0;
 }
@@ -424,7 +424,7 @@ void HitTestResult::enterFullscreenForVideo() const
 {
 #if ENABLE(VIDEO)
     HTMLMediaElement* mediaElement(this->mediaElement());
-    if (mediaElement && isHTMLVideoElement(mediaElement)) {
+    if (mediaElement && is<HTMLVideoElement>(mediaElement)) {
         HTMLVideoElement& videoElement = downcast<HTMLVideoElement>(*mediaElement);
         if (!videoElement.isFullscreen() && mediaElement->supportsFullscreen()) {
             UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
@@ -482,7 +482,7 @@ bool HitTestResult::mediaIsVideo() const
 {
 #if ENABLE(VIDEO)
     if (HTMLMediaElement* mediaElt = mediaElement())
-        return isHTMLVideoElement(mediaElt);
+        return is<HTMLVideoElement>(mediaElt);
 #endif
     return false;
 }
@@ -516,7 +516,7 @@ bool HitTestResult::isLiveLink() const
     if (!m_innerURLElement)
         return false;
 
-    if (isHTMLAnchorElement(*m_innerURLElement))
+    if (is<HTMLAnchorElement>(*m_innerURLElement))
         return downcast<HTMLAnchorElement>(*m_innerURLElement).isLiveLink();
 
     if (is<SVGAElement>(*m_innerURLElement))
index 4970c04..e36aaec 100644 (file)
@@ -142,7 +142,7 @@ static bool planCounter(RenderElement& renderer, const AtomicString& identifier,
             return true;
         }
         if (Element* element = renderer.element()) {
-            if (isHTMLOListElement(element)) {
+            if (is<HTMLOListElement>(element)) {
                 value = downcast<HTMLOListElement>(*element).start();
                 isReset = true;
                 return true;
index 42f329c..7fc3330 100644 (file)
@@ -130,7 +130,7 @@ RenderImage::RenderImage(Element& element, PassRef<RenderStyle> style, StyleImag
     updateAltText();
     imageResource().initialize(this);
 
-    if (isHTMLImageElement(element))
+    if (is<HTMLImageElement>(element))
         m_hasShadowControls = downcast<HTMLImageElement>(element).hasShadowControls();
 }
 
@@ -514,7 +514,7 @@ void RenderImage::paintAreaElementFocusRing(PaintInfo& paintInfo)
         return;
 
     Element* focusedElement = document().focusedElement();
-    if (!focusedElement || !isHTMLAreaElement(focusedElement))
+    if (!focusedElement || !is<HTMLAreaElement>(focusedElement))
         return;
 
     HTMLAreaElement& areaElement = downcast<HTMLAreaElement>(*focusedElement);
@@ -560,7 +560,7 @@ void RenderImage::paintIntoRect(GraphicsContext* context, const FloatRect& rect)
     if (!img || img->isNull())
         return;
 
-    HTMLImageElement* imageElement = (element() && isHTMLImageElement(element())) ? downcast<HTMLImageElement>(element()) : nullptr;
+    HTMLImageElement* imageElement = (element() && is<HTMLImageElement>(element())) ? downcast<HTMLImageElement>(element()) : nullptr;
     CompositeOperator compositeOperator = imageElement ? imageElement->compositeOperator() : CompositeSourceOver;
     Image* image = imageResource().image().get();
     bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, LayoutSize(rect.size()));
@@ -622,7 +622,7 @@ LayoutUnit RenderImage::minimumReplacedHeight() const
 
 HTMLMapElement* RenderImage::imageMap() const
 {
-    HTMLImageElement* image = element() && isHTMLImageElement(element()) ? downcast<HTMLImageElement>(element()) : nullptr;
+    HTMLImageElement* image = element() && is<HTMLImageElement>(element()) ? downcast<HTMLImageElement>(element()) : nullptr;
     return image ? image->treeScope().getImageMap(image->fastGetAttribute(usemapAttr)) : nullptr;
 }
 
@@ -657,7 +657,7 @@ void RenderImage::updateAltText()
 
     if (is<HTMLInputElement>(*element()))
         m_altText = downcast<HTMLInputElement>(*element()).altText();
-    else if (isHTMLImageElement(*element()))
+    else if (is<HTMLImageElement>(*element()))
         m_altText = downcast<HTMLImageElement>(*element()).altText();
 }
 
index c1e8445..d2ad743 100644 (file)
@@ -118,7 +118,7 @@ void RenderListBox::updateFromElement()
             Font itemFont = style().font();
             if (is<HTMLOptionElement>(element))
                 text = downcast<HTMLOptionElement>(*element).textIndentedToRespectGroupLabel();
-            else if (isHTMLOptGroupElement(element)) {
+            else if (is<HTMLOptGroupElement>(element)) {
                 text = downcast<HTMLOptGroupElement>(*element).groupLabelText();
                 FontDescription d = itemFont.fontDescription();
                 d.setWeight(d.bolderWeight());
@@ -388,7 +388,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
     bool isOptionElement = is<HTMLOptionElement>(listItemElement);
     if (isOptionElement)
         itemText = downcast<HTMLOptionElement>(*listItemElement).textIndentedToRespectGroupLabel();
-    else if (isHTMLOptGroupElement(listItemElement))
+    else if (is<HTMLOptGroupElement>(listItemElement))
         itemText = downcast<HTMLOptGroupElement>(*listItemElement).groupLabelText();
     applyTextTransform(style(), itemText, ' ');
 
@@ -409,7 +409,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
     LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
     r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
 
-    if (isHTMLOptGroupElement(listItemElement)) {
+    if (is<HTMLOptGroupElement>(listItemElement)) {
         FontDescription d = itemFont.fontDescription();
         d.setWeight(d.bolderWeight());
         itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
index 25a97e6..f4af70e 100644 (file)
@@ -73,7 +73,7 @@ int RenderMarquee::marqueeSpeed() const
 {
     int result = m_layer->renderer().style().marqueeSpeed();
     Element* element = m_layer->renderer().element();
-    if (element && isHTMLMarqueeElement(element))
+    if (element && is<HTMLMarqueeElement>(element))
         result = std::max(result, downcast<HTMLMarqueeElement>(*element).minimumDelay());
     return result;
 }
index 6ee1b30..7ca352d 100644 (file)
@@ -450,7 +450,7 @@ String RenderMenuList::itemText(unsigned listIndex) const
 
     String itemString;
     Element* element = listItems[listIndex];
-    if (isHTMLOptGroupElement(element))
+    if (is<HTMLOptGroupElement>(element))
         itemString = downcast<HTMLOptGroupElement>(*element).groupLabelText();
     else if (is<HTMLOptionElement>(element))
         itemString = downcast<HTMLOptionElement>(*element).textIndentedToRespectGroupLabel();
@@ -497,7 +497,7 @@ bool RenderMenuList::itemIsEnabled(unsigned listIndex) const
 
     bool groupEnabled = true;
     if (Element* parentElement = element->parentElement()) {
-        if (isHTMLOptGroupElement(parentElement))
+        if (is<HTMLOptGroupElement>(parentElement))
             groupEnabled = !parentElement->isDisabledFormControl();
     }
     if (!groupEnabled)
@@ -645,7 +645,7 @@ bool RenderMenuList::itemIsSeparator(unsigned listIndex) const
 bool RenderMenuList::itemIsLabel(unsigned listIndex) const
 {
     const Vector<HTMLElement*>& listItems = selectElement().listItems();
-    return listIndex < listItems.size() && isHTMLOptGroupElement(listItems[listIndex]);
+    return listIndex < listItems.size() && is<HTMLOptGroupElement>(listItems[listIndex]);
 }
 
 bool RenderMenuList::itemIsSelected(unsigned listIndex) const
index 9edbbd9..990596d 100644 (file)
@@ -43,7 +43,7 @@ HTMLMeterElement* RenderMeter::meterElement() const
 {
     ASSERT(element());
 
-    if (isHTMLMeterElement(element()))
+    if (is<HTMLMeterElement>(element()))
         return downcast<HTMLMeterElement>(element());
 
     ASSERT(element()->shadowHost());
index 7d14566..f78baf3 100644 (file)
@@ -41,6 +41,7 @@
 #include "HTMLElement.h"
 #include "HTMLImageElement.h"
 #include "HTMLNames.h"
+#include "HTMLTableCellElement.h"
 #include "HTMLTableElement.h"
 #include "HitTestResult.h"
 #include "LogicalSelectionOffsetCaches.h"
@@ -1917,7 +1918,7 @@ RespectImageOrientationEnum RenderObject::shouldRespectImageOrientation() const
 #endif
     // Respect the image's orientation if it's being used as a full-page image or it's
     // an <img> and the setting to respect it everywhere is set.
-    return (frame().settings().shouldRespectImageOrientation() && node() && isHTMLImageElement(node())) ? RespectImageOrientation : DoNotRespectImageOrientation;
+    return (frame().settings().shouldRespectImageOrientation() && node() && is<HTMLImageElement>(node())) ? RespectImageOrientation : DoNotRespectImageOrientation;
 }
 
 bool RenderObject::hasOutlineAnnotation() const
@@ -2297,7 +2298,7 @@ void RenderObject::getTextDecorationColors(int decorations, Color& underline, Co
         curr = curr->parent();
         if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuation())
             curr = toRenderBlock(curr)->continuation();
-    } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnchorElement(curr->node()) && !curr->node()->hasTagName(fontTag))));
+    } while (curr && decorations && (!quirksMode || !curr->node() || (!is<HTMLAnchorElement>(curr->node()) && !curr->node()->hasTagName(fontTag))));
 
     // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
     if (decorations && curr) {
@@ -2443,7 +2444,7 @@ RenderBoxModelObject* RenderObject::offsetParent() const
     auto curr = parent();
     while (curr && (!curr->element() || (!curr->isPositioned() && !curr->isBody())) && !curr->isRenderNamedFlowThread()) {
         Element* element = curr->element();
-        if (!skipTables && element && (isHTMLTableElement(element) || element->hasTagName(tdTag) || element->hasTagName(thTag)))
+        if (!skipTables && element && (is<HTMLTableElement>(*element) || isHTMLTableCellElement(*element)))
             break;
  
         float newZoom = curr->style().effectiveZoom();
index 2b4f057..6b8cd42 100644 (file)
@@ -110,7 +110,7 @@ HTMLProgressElement* RenderProgress::progressElement() const
     if (!element())
         return nullptr;
 
-    if (isHTMLProgressElement(element()))
+    if (is<HTMLProgressElement>(element()))
         return downcast<HTMLProgressElement>(element());
 
     ASSERT(element()->shadowHost());
index 5b61867..597177a 100644 (file)
@@ -350,7 +350,7 @@ LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st
 
     // HTML tables' width styles already include borders and paddings, but CSS tables' width styles do not.
     LayoutUnit borders = 0;
-    bool isCSSTable = !element() || !isHTMLTableElement(element());
+    bool isCSSTable = !element() || !is<HTMLTableElement>(element());
     if (isCSSTable && styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive() && style().boxSizing() == CONTENT_BOX)
         borders = borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd());
 
@@ -364,7 +364,7 @@ LayoutUnit RenderTable::convertStyleLogicalHeightToComputedHeight(const Length&
         // HTML tables size as though CSS height includes border/padding, CSS tables do not.
         LayoutUnit borders = LayoutUnit();
         // FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow.
-        if ((element() && isHTMLTableElement(element())) || style().boxSizing() == BORDER_BOX) {
+        if ((element() && is<HTMLTableElement>(element())) || style().boxSizing() == BORDER_BOX) {
             LayoutUnit borderAndPaddingBefore = borderBefore() + (collapseBorders() ? LayoutUnit() : paddingBefore());
             LayoutUnit borderAndPaddingAfter = borderAfter() + (collapseBorders() ? LayoutUnit() : paddingAfter());
             borders = borderAndPaddingBefore + borderAndPaddingAfter;
index 3f2111f..9e1b7c8 100644 (file)
@@ -92,7 +92,7 @@ Image* SVGImageCache::imageForRenderer(const RenderObject* renderer)
     RefPtr<SVGImageForContainer> imageForContainer = it->value;
     
     Node* node = renderer->node();
-    if (node && isHTMLImageElement(node)) {
+    if (node && is<HTMLImageElement>(node)) {
         const AtomicString& urlString = downcast<HTMLImageElement>(*node).imageSourceURL();
         URL url = node->document().completeURL(urlString);
         imageForContainer->setURL(url);
index a5dde03..d2ae130 100644 (file)
@@ -1918,7 +1918,7 @@ void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*
         document = contextDocument();
     else if (node->isDocumentNode())
         document = toDocument(node);
-    else if (isHTMLIFrameElement(node))
+    else if (is<HTMLIFrameElement>(node))
         document = downcast<HTMLIFrameElement>(*node).contentDocument();
     else {
         ec = TypeError;
index c37cf80..8ae511d 100644 (file)
@@ -850,7 +850,7 @@ void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlCha
         return;
 
 #if ENABLE(TEMPLATE_ELEMENT)
-    if (isHTMLTemplateElement(*newElement))
+    if (is<HTMLTemplateElement>(*newElement))
         pushCurrentNode(downcast<HTMLTemplateElement>(*newElement).content());
     else
         pushCurrentNode(newElement.get());
index 40460df..33783ac 100644 (file)
@@ -1,3 +1,20 @@
+2014-09-25  Christophe Dumez  <cdumez@apple.com>
+
+        Use is<HTML*Element>() instead of isHTML*Element() - Part 2
+        https://bugs.webkit.org/show_bug.cgi?id=137103
+
+        Reviewed by Benjamin Poulain.
+
+        Use is<HTML*Element>() instead of isHTML*Element().
+
+        * DOMCoreClasses.cpp:
+        (DOMElement::createInstance):
+        * DOMHTMLClasses.cpp:
+        (DOMHTMLFormElement::action):
+        (DOMHTMLFormElement::method):
+        * WebFrame.cpp:
+        (formElementFromDOMElement):
+
 2014-09-24  Christophe Dumez  <cdumez@apple.com>
 
         Add initial is<>() / downcast<>() support for any type of Nodes
index 9fc3ce6..337cda1 100644 (file)
@@ -1500,7 +1500,7 @@ IDOMElement* DOMElement::createInstance(WebCore::Element* e)
     HRESULT hr;
     IDOMElement* domElement = 0;
 
-    if (isHTMLFormElement(e)) {
+    if (WebCore::is<WebCore::HTMLFormElement>(e)) {
         DOMHTMLFormElement* newElement = new DOMHTMLFormElement(e);
         hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement);
     } else if (e->hasTagName(iframeTag)) {
index 7ffaeac..1d1d240 100644 (file)
@@ -559,7 +559,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setAcceptCharset(
 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::action( 
         /* [retval][out] */ BSTR* result)
 {
-    ASSERT(m_element && isHTMLFormElement(m_element));
+    ASSERT(m_element && is<HTMLFormElement>(m_element));
     WTF::String actionString = downcast<HTMLFormElement>(*m_element).action();
     *result = BString(actionString).release();
     return S_OK;
@@ -589,7 +589,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setEnctype(
 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::method( 
         /* [retval][out] */ BSTR* result)
 {
-    ASSERT(m_element && isHTMLFormElement(m_element));
+    ASSERT(m_element && is<HTMLFormElement>(m_element));
     WTF::String methodString = downcast<HTMLFormElement>(*m_element).method();
     *result = BString(methodString).release();
     return S_OK;
index e33048a..c57522a 100644 (file)
@@ -202,7 +202,7 @@ static HTMLFormElement *formElementFromDOMElement(IDOMElement *element)
         Element* ele;
         hr = elePriv->coreElement((void**)&ele);
         elePriv->Release();
-        if (SUCCEEDED(hr) && ele && isHTMLFormElement(ele))
+        if (SUCCEEDED(hr) && ele && is<HTMLFormElement>(ele))
             return downcast<HTMLFormElement>(ele);
     }
     return nullptr;
index 4b37ad7..5302b0b 100644 (file)
@@ -1,3 +1,21 @@
+2014-09-25  Christophe Dumez  <cdumez@apple.com>
+
+        Use is<HTML*Element>() instead of isHTML*Element() - Part 2
+        https://bugs.webkit.org/show_bug.cgi?id=137103
+
+        Reviewed by Benjamin Poulain.
+
+        Use is<HTML*Element>() instead of isHTML*Element().
+
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+        (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::containsAnyFormElements):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getAssistedNodeInformation):
+
 2014-09-25  Anders Carlsson  <andersca@apple.com>
 
         Expand WK_MAC_TBA and WK_IOS_TBA to the current deployment target version (or NA).
index ced90ac..32e187b 100644 (file)
@@ -276,7 +276,7 @@ PassRefPtr<WebFrame> InjectedBundleNodeHandle::htmlFrameElementContentFrame()
 
 PassRefPtr<WebFrame> InjectedBundleNodeHandle::htmlIFrameElementContentFrame()
 {
-    if (!isHTMLIFrameElement(*m_node))
+    if (!is<HTMLIFrameElement>(*m_node))
         return nullptr;
 
     Frame* frame = downcast<HTMLIFrameElement>(*m_node).contentFrame();
index 372de43..d9adcc6 100644 (file)
@@ -615,7 +615,7 @@ bool WebFrame::containsAnyFormElements() const
     for (Node* node = document->documentElement(); node; node = NodeTraversal::next(node)) {
         if (!node->isElementNode())
             continue;
-        if (isHTMLFormElement(node))
+        if (is<HTMLFormElement>(node))
             return true;
     }
     return false;
index ccc63b5..b53dec2 100644 (file)
@@ -4609,7 +4609,7 @@ void WebPage::determinePrimarySnapshottedPlugIn()
             inflatedPluginRect.inflateY(yOffset);
 
             if (element != &plugInImageElement) {
-                if (!(isHTMLImageElement(element)
+                if (!(is<HTMLImageElement>(element)
                     && inflatedPluginRect.contains(elementRectRelativeToTopDocument)
                     && elementRectRelativeToTopDocument.width() > pluginRenderBox.width() * minimumOverlappingImageToPluginDimensionScale
                     && elementRectRelativeToTopDocument.height() > pluginRenderBox.height() * minimumOverlappingImageToPluginDimensionScale))
index e7af1ad..b69f866 100644 (file)
@@ -2080,7 +2080,7 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
             if (is<HTMLOptionElement>(item)) {
                 HTMLOptionElement& option = downcast<HTMLOptionElement>(*item);
                 information.selectOptions.append(OptionItem(option.text(), false, parentGroupID, option.selected(), option.fastHasAttribute(WebCore::HTMLNames::disabledAttr)));
-            } else if (isHTMLOptGroupElement(item)) {
+            } else if (is<HTMLOptGroupElement>(item)) {
                 HTMLOptGroupElement& group = downcast<HTMLOptGroupElement>(*item);
                 parentGroupID++;
                 information.selectOptions.append(OptionItem(group.groupLabelText(), true, 0, false, group.fastHasAttribute(WebCore::HTMLNames::disabledAttr)));