Have is<>(T*) function do a null check on the pointer argument
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 19:39:41 +0000 (19:39 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 19:39:41 +0000 (19:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137333

Reviewed by Gavin Barraclough.

Have is<>(T*) function do a null check on the argument instead of a
simple assertion. This makes sense for 2 reasons:
1. It is more consistent with downcast<>(T*), which will succeed even
   if the argument is a nullptr.
2. It simplifies the code a bit as it gets rid of a lot of explicit
   null checks.

Source/WebCore:

No new tests, no behavior change.

* Modules/indexeddb/IDBFactory.cpp:
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::create):
* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeMessage):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedUIElementForPage):
(WebCore::createFromRenderer):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::handleLiveRegionCreated):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::labelChanged):
(WebCore::AXObjectCache::rootAXEditableElement):
(WebCore::isNodeAriaVisible):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::isEnabled):
(WebCore::AccessibilityListBoxOption::isSelected):
(WebCore::AccessibilityListBoxOption::canSetSelectedAttribute):
(WebCore::AccessibilityListBoxOption::stringValue):
(WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaTimeline::valueDescription):
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
(WebCore::AccessibilityNodeObject::isNativeTextControl):
(WebCore::AccessibilityNodeObject::isNativeImage):
(WebCore::AccessibilityNodeObject::isInputImage):
(WebCore::AccessibilityNodeObject::isEnabled):
(WebCore::AccessibilityNodeObject::isPressed):
(WebCore::AccessibilityNodeObject::isHovered):
(WebCore::AccessibilityNodeObject::isReadOnly):
(WebCore::AccessibilityNodeObject::isRequired):
(WebCore::AccessibilityNodeObject::valueForRange):
(WebCore::AccessibilityNodeObject::maxValueForRange):
(WebCore::AccessibilityNodeObject::minValueForRange):
(WebCore::AccessibilityNodeObject::isControl):
(WebCore::AccessibilityNodeObject::anchorElement):
(WebCore::isNodeActionElement):
(WebCore::AccessibilityNodeObject::mouseButtonListener):
(WebCore::AccessibilityNodeObject::labelForElement):
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::alternativeText):
(WebCore::AccessibilityNodeObject::visibleText):
(WebCore::AccessibilityNodeObject::accessibilityDescription):
(WebCore::AccessibilityNodeObject::helpText):
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
(WebCore::AccessibilityNodeObject::textUnderElement):
(WebCore::AccessibilityNodeObject::title):
(WebCore::AccessibilityNodeObject::colorValue):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::hasTagName):
(WebCore::AccessibilityObject::hasAttribute):
(WebCore::AccessibilityObject::element):
(WebCore::AccessibilityObject::classList):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isFileUploadButton):
(WebCore::AccessibilityRenderObject::anchorElement):
(WebCore::AccessibilityRenderObject::helpText):
(WebCore::AccessibilityRenderObject::labelElementContainer):
(WebCore::AccessibilityRenderObject::internalLinkElement):
(WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
(WebCore::AccessibilityRenderObject::titleUIElement):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::accessKey):
(WebCore::AccessibilityRenderObject::url):
(WebCore::AccessibilityRenderObject::setElementAttributeValue):
(WebCore::AccessibilityRenderObject::setFocused):
(WebCore::AccessibilityRenderObject::setValue):
(WebCore::AccessibilityRenderObject::getDocumentLinks):
(WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
(WebCore::AccessibilityRenderObject::accessibilityHitTest):
(WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
(WebCore::AccessibilityRenderObject::renderObjectIsObservable):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
(WebCore::AccessibilityRenderObject::addTextFieldChildren):
(WebCore::AccessibilityRenderObject::remoteSVGRootElement):
(WebCore::AccessibilityRenderObject::setAccessibleName):
(WebCore::AccessibilityRenderObject::stringValueForMSAA):
(WebCore::AccessibilityRenderObject::isLinked):
(WebCore::AccessibilityRenderObject::stringRoleForMSAA):
(WebCore::AccessibilityRenderObject::isMathElement):
* accessibility/AccessibilitySearchFieldButtons.cpp:
(WebCore::AccessibilitySearchFieldCancelButton::press):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableElement):
(WebCore::AccessibilityTable::isDataTable):
(WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
(WebCore::AccessibilityTable::title):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::notifyChildrenSelectionChange):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetCaption):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetName):
(webkitAccessibleGetDescription):
(webkitAccessibleGetAttributes):
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::constructJSAudioContext):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::toJSDOMGlobalObject):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
(WebCore::createWrapperInline):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/js/ScriptState.cpp:
(WebCore::frameFromExecState):
* bindings/objc/DOM.mm:
(kitClass):
* css/CSSCursorImageValue.cpp:
(WebCore::resourceReferencedByCursorElement):
* css/CSSStyleSheet.cpp:
(WebCore::isAcceptableCSSStyleSheetParent):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isAutofilled):
(WebCore::isDisabled):
(WebCore::isEnabled):
(WebCore::isChecked):
(WebCore::matchesLangPseudoClass):
(WebCore::matchesFutureCuePseudoClass):
(WebCore::matchesPastCuePseudoClass):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::initElement):
(WebCore::StyleResolver::locateCousinList):
(WebCore::elementHasDirectionAuto):
(WebCore::StyleResolver::canShareStyleWithElement):
(WebCore::StyleResolver::findSiblingForStyleSharing):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::useSVGZoomRulesForLength):
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::getNamedItem):
* dom/Attr.cpp:
(WebCore::Attr::style):
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/ContainerNode.cpp:
(WebCore::checkAcceptChild):
(WebCore::ContainerNode::notifyChildRemoved):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
* dom/CurrentScriptIncrementer.h:
(WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::setDragImage):
* dom/Document.cpp:
(WebCore::Document::elementFromPoint):
(WebCore::Document::setTitle):
(WebCore::Document::iconURLs):
(WebCore::eventTargetElementForDocument):
(WebCore::Document::updateHoverActiveState):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/Element.cpp:
(WebCore::Element::computeInheritedLanguage):
* dom/Element.h:
(WebCore::Node::parentElement):
* dom/ElementTraversal.h:
(WebCore::Traversal<Element>::nextTemplate):
(WebCore::ElementTraversal::previousIncludingPseudo):
(WebCore::ElementTraversal::nextIncludingPseudo):
(WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
(WebCore::ElementTraversal::pseudoAwarePreviousSibling):
* dom/EventDispatcher.cpp:
(WebCore::WindowEventContext::WindowEventContext):
(WebCore::EventDispatcher::dispatchEvent):
(WebCore::nodeOrHostIfPseudoElement):
(WebCore::EventPath::EventPath):
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/KeyboardEvent.cpp:
(WebCore::findKeyboardEvent):
* dom/LiveNodeList.cpp:
(WebCore::LiveNodeList::namedItem):
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
* dom/MouseEvent.cpp:
(WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::setNamedItem):
* dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::Node::pseudoAwarePreviousSibling):
(WebCore::Node::pseudoAwareNextSibling):
(WebCore::Node::computedStyle):
(WebCore::Node::parentOrShadowHostElement):
(WebCore::Node::rootEditableElement):
(WebCore::Node::ancestorElement):
(WebCore::Node::compareDocumentPosition):
(WebCore::appendAttributeDesc):
(WebCore::Node::showNodePathForThis):
(WebCore::Node::enclosingLinkEventParentOrSelf):
(WebCore::Node::dispatchEvent):
(WebCore::Node::defaultEventHandler):
* dom/NodeRenderingTraversal.cpp:
(WebCore::NodeRenderingTraversal::nodeCanBeDistributed):
(WebCore::NodeRenderingTraversal::traverseParent):
* dom/NodeTraversal.cpp:
(WebCore::NodeTraversal::previousIncludingPseudo):
(WebCore::NodeTraversal::nextIncludingPseudo):
(WebCore::NodeTraversal::nextIncludingPseudoSkippingChildren):
* dom/Position.cpp:
(WebCore::Position::element):
(WebCore::endsOfNodeAreVisuallyDistinctPositions):
(WebCore::Position::isRenderedCharacter):
(WebCore::Position::leadingWhitespacePosition):
* dom/Range.cpp:
(WebCore::Range::insertNode):
(WebCore::Range::getBorderAndTextQuads):
* dom/ScriptElement.cpp:
(WebCore::toScriptElementIfPossible):
* dom/ShadowRoot.h:
(WebCore::Node::parentOrShadowHostNode):
* dom/Text.cpp:
(WebCore::earliestLogicallyAdjacentTextNode):
(WebCore::latestLogicallyAdjacentTextNode):
(WebCore::isSVGShadowText):
* dom/TextNodeTraversal.cpp:
(WebCore::TextNodeTraversal::contentsAsString):
* dom/TextNodeTraversal.h:
(WebCore::TextNodeTraversal::firstTextChildTemplate):
(WebCore::TextNodeTraversal::firstTextWithinTemplate):
(WebCore::TextNodeTraversal::traverseNextTextTemplate):
(WebCore::TextNodeTraversal::nextSibling):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition):
(WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
* editing/ApplyStyleCommand.cpp:
(WebCore::isLegacyAppleStyleSpan):
(WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
(WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
(WebCore::isEmptyFontTag):
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::dummySpanAncestorForNode):
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
(WebCore::ApplyStyleCommand::splitTextAtEnd):
(WebCore::ApplyStyleCommand::splitTextElementAtEnd):
(WebCore::ApplyStyleCommand::shouldSplitTextElement):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
(WebCore::ApplyStyleCommand::applyInlineStyleChange):
(WebCore::ApplyStyleCommand::joinChildTextNodes):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::isRemovableBlock):
(WebCore::CompositeEditCommand::insertNodeAt):
(WebCore::CompositeEditCommand::canRebalance):
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
(WebCore::CompositeEditCommand::deleteInsignificantText):
(WebCore::CompositeEditCommand::removePlaceholderAt):
(WebCore::CompositeEditCommand::cleanupAfterDeletion):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteButtonController.cpp:
(WebCore::enclosingDeletableElement):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::fixupWhitespace):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::wrappingStyleForSerialization):
* editing/Editor.cpp:
(WebCore::imageElementFromImageDocument):
(WebCore::Editor::shouldInsertFragment):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::setComposition):
(WebCore::Editor::isSpellCheckingEnabledFor):
(WebCore::Editor::applyEditingStyleToElement):
* editing/FormatBlockCommand.cpp:
(WebCore::isElementForFormatBlock):
* editing/FrameSelection.cpp:
(WebCore::removingNodeRemovesPosition):
(WebCore::CaretBase::paintCaret):
(WebCore::FrameSelection::debugRenderer):
(WebCore::FrameSelection::selectAll):
(WebCore::scanForForm):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::mergeWithNeighboringLists):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::insertTab):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::haveSameTagName):
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
(WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
(WebCore::ReplaceSelectionCommand::performTrivialReplace):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::isCheckable):
* editing/SplitTextNodeContainingElementCommand.cpp:
(WebCore::SplitTextNodeContainingElementCommand::doApply):
* editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::isInPasswordField):
* editing/VisibleUnits.cpp:
(WebCore::startPositionForLine):
(WebCore::endPositionForLine):
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
(WebCore::editingAttributedStringFromRange):
* editing/htmlediting.cpp:
(WebCore::enclosingBlock):
(WebCore::enclosingElementWithTag):
(WebCore::enclosingAnchorElement):
(WebCore::enclosingList):
(WebCore::lineBreakExistsAtPosition):
(WebCore::areIdenticalElements):
(WebCore::isNonTableCellHTMLBlockElement):
(WebCore::deprecatedEnclosingBlockFlowElement):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendText):
(WebCore::ancestorToRetainStructureAndAppearanceForBlock):
(WebCore::isPlainTextMarkup):
* fileapi/FileReader.cpp:
(WebCore::FileReader::readAsArrayBuffer):
(WebCore::FileReader::readAsBinaryString):
(WebCore::FileReader::readAsText):
(WebCore::FileReader::readAsDataURL):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::findAssociatedForm):
* html/HTMLAnchorElement.cpp:
(WebCore::appendServerMapMousePosition):
(WebCore::HTMLAnchorElement::defaultEventHandler):
(WebCore::HTMLAnchorElement::eventType):
(WebCore::isEnterKeyKeydownEvent):
(WebCore::isLinkClick):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::imageElement):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::namedItem):
(WebCore::HTMLCollection::updateNamedElementCache):
* 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::matchesReadWritePseudoClass):
(WebCore::mergeWithNextTextNode):
(WebCore::HTMLElement::setOuterHTML):
(WebCore::HTMLElement::setOuterText):
(WebCore::HTMLElement::insertAdjacentElement):
(WebCore::contextElementForInsertion):
(WebCore::HTMLElement::directionality):
(WebCore::HTMLElement::dirAttributeChanged):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* html/HTMLFieldSetElement.cpp:
(WebCore::updateFromControlElementsAncestorDisabledStateUnder):
(WebCore::HTMLFieldSetElement::disabledStateChanged):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
(WebCore::shouldAutofocus):
(WebCore::HTMLFormControlElement::enclosingFormControlElement):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::rendererIsNeeded):
(WebCore::HTMLFormElement::submitImplicitly):
(WebCore::submitElementFromEvent):
(WebCore::HTMLFormElement::validateInteractively):
(WebCore::HTMLFormElement::submit):
(WebCore::HTMLFormElement::reset):
(WebCore::HTMLFormElement::defaultButton):
(WebCore::HTMLFormElement::documentDidResumeFromPageCache):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::defaultEventHandler):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler):
(WebCore::HTMLInputElement::dataList):
* html/HTMLLabelElement.cpp:
(WebCore::nodeAsSupportedLabelableElement):
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::virtualForm):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::hasFallbackContent):
(WebCore::HTMLObjectElement::updateDocNamedItem):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::recalcSelectOptions):
(WebCore::HTMLOptGroupElement::ownerSelectElement):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
(WebCore::HTMLOptionElement::index):
(WebCore::HTMLOptionElement::ownerDataListElement):
(WebCore::HTMLOptionElement::ownerSelectElement):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
(WebCore::HTMLOptionElement::isDisabledFormControl):
(WebCore::HTMLOptionElement::collectOptionInnerText):
* html/HTMLPlugInImageElement.cpp:
(WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
(WebCore::HTMLPlugInImageElement::defaultEventHandler):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::nextValidIndex):
(WebCore::HTMLSelectElement::saveLastSelection):
(WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
(WebCore::HTMLSelectElement::updateListBoxSelection):
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::recalcListItems):
(WebCore::HTMLSelectElement::selectedIndex):
(WebCore::HTMLSelectElement::selectOption):
(WebCore::HTMLSelectElement::optionToListIndex):
(WebCore::HTMLSelectElement::listToOptionIndex):
(WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
(WebCore::HTMLSelectElement::saveFormControlState):
(WebCore::HTMLSelectElement::searchOptionsForValue):
(WebCore::HTMLSelectElement::restoreFormControlState):
(WebCore::HTMLSelectElement::appendFormData):
(WebCore::HTMLSelectElement::reset):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::updateSelectedState):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
(WebCore::HTMLSelectElement::defaultEventHandler):
(WebCore::HTMLSelectElement::lastSelectedListIndex):
(WebCore::HTMLSelectElement::optionAtIndex):
(WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
(WebCore::HTMLSelectElement::length):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLSummaryElement.cpp:
(WebCore::isClickableControl):
(WebCore::HTMLSummaryElement::defaultEventHandler):
* 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/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::defaultEventHandler):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::innerTextValue):
(WebCore::positionForIndex):
(WebCore::HTMLTextFormControlElement::indexForPosition):
(WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::mediaElement):
* html/ImageDocument.cpp:
(WebCore::ImageEventListener::handleEvent):
* html/InputType.cpp:
(WebCore::InputType::shouldSubmitImplicitly):
* html/MediaDocument.cpp:
(WebCore::ancestorVideoElement):
(WebCore::MediaDocument::defaultEventHandler):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::isKeyboardFocusable):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldSubmitImplicitly):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::hasImpliedEndTag):
(WebCore::HTMLConstructionSite::attachLater):
(WebCore::HTMLConstructionSite::insertHTMLFormElement):
(WebCore::HTMLConstructionSite::insertTextNode):
(WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
(WebCore::HTMLConstructionSite::findFosterSite):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLNames::isScopeMarker):
(WebCore::HTMLNames::isTableScopeMarker):
(WebCore::HTMLNames::isSelectScopeMarker):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
* html/shadow/InsertionPoint.h:
(WebCore::isActiveInsertionPoint):
(WebCore::parentNodeForDistribution):
(WebCore::parentElementForDistribution):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::parentMediaElement):
(WebCore::mediaControlElementType):
(WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::defaultEventHandler):
(WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
(WebCore::MediaControlTimelineElement::defaultEventHandler):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::containsRelatedTarget):
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsAppleEventListener::handleEvent):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::defaultEventHandler):
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::forwardEvent):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::copyWebVTTNodeToDOMTree):
(WebCore::VTTCue::markFutureAndPastNodes):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::elementForId):
(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::unbind):
(WebCore::InspectorDOMAgent::assertDocument):
(WebCore::InspectorDOMAgent::assertElement):
(WebCore::InspectorDOMAgent::querySelector):
(WebCore::InspectorDOMAgent::querySelectorAll):
(WebCore::InspectorDOMAgent::setNodeName):
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
(WebCore::InspectorDOMAgent::innerParentNode):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
* inspector/InspectorInstrumentation.cpp:
(WebCore::frameForScriptExecutionContext):
(WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
(WebCore::InspectorNodeFinder::searchUsingXPath):
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementInfo):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::inlineStyleSheetText):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::handleFallbackContent):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::create):
(WebCore::ThreadableLoader::loadResourceSynchronously):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::removeRequestFromCache):
(WebCore::MemoryCache::removeRequestFromSessionCaches):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::attributeChanged):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::getSelectedSemanticsChild):
* page/Chrome.cpp:
(WebCore::Chrome::setToolTip):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::maybeCreateContextMenu):
(WebCore::ContextMenuController::populate):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
(WebCore::DragController::operationForLoad):
(WebCore::DragController::canProcessDrag):
(WebCore::DragController::draggableElement):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::isSubmitImage):
(WebCore::targetIsFrame):
(WebCore::findDropZone):
(WebCore::EventHandler::updateDragAndDrop):
(WebCore::EventHandler::updateMouseEventTargetNode):
(WebCore::EventHandler::handleTextInputEvent):
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::owner):
(WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
(WebCore::FocusController::findFocusableElementAcrossFocusScope):
(WebCore::FocusController::findElementWithExactTabIndex):
(WebCore::nextElementWithGreaterTabIndex):
(WebCore::previousElementWithLowerTabIndex):
(WebCore::FocusController::nextFocusableElement):
(WebCore::FocusController::previousFocusableElement):
(WebCore::clearSelectionIfNeeded):
(WebCore::FocusController::advanceFocusDirectionally):
* page/Frame.cpp:
(WebCore::Frame::searchForLabelsBeforeElement):
(WebCore::Frame::setPageAndTextZoomFactors):
* page/FrameView.cpp:
(WebCore::FrameView::init):
(WebCore::FrameView::scrollToAnchor):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
(WebCore::scrollInDirection):
(WebCore::scrollableEnclosingBoxOrParentFrameForNodeInDirection):
(WebCore::canScrollInDirection):
(WebCore::nodeRectInAbsoluteCoordinates):
(WebCore::areElementsOnSameLine):
* page/ios/FrameIOS.mm:
(WebCore::ancestorRespondingToClickEvents):
* platform/network/FormData.cpp:
(WebCore::FormData::appendKeyValuePairItems):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::setInnerNode):
(WebCore::HitTestResult::setInnerNonSharedNode):
(WebCore::HitTestResult::title):
(WebCore::HitTestResult::innerTextIfTruncated):
(WebCore::HitTestResult::mediaSupportsFullscreen):
(WebCore::HitTestResult::enterFullscreenForVideo):
(WebCore::HitTestResult::mediaIsVideo):
(WebCore::HitTestResult::innerElement):
(WebCore::HitTestResult::innerNonSharedElement):
* rendering/RenderBlockFlow.cpp:
(WebCore::resizeTextPermitted):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::sizesLogicalWidthToFitContent):
* rendering/RenderCounter.cpp:
(WebCore::planCounter):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::isOpen):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::uploadButton):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::imageMap):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::updateSnapOffsets):
* rendering/RenderLayerBacking.cpp:
(WebCore::isRestartedPlugin):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::updateFromElement):
(WebCore::RenderListBox::addFocusRingRects):
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::marqueeSpeed):
* rendering/RenderMenuList.cpp:
(WebCore::selectedOptionCount):
(RenderMenuList::updateOptionsWidth):
(RenderMenuList::setTextFromOption):
(RenderMenuList::itemText):
(RenderMenuList::itemIsEnabled):
(RenderMenuList::itemIsLabel):
(RenderMenuList::itemIsSelected):
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::meterElement):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::isChildAllowed):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
(WebCore::RenderObject::shouldRespectImageOrientation):
(WebCore::RenderObject::updateDragState):
(WebCore::RenderObject::getUncachedPseudoStyle):
(WebCore::RenderObject::getTextDecorationColors):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::progressElement):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::handleEvent):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::parseColSpanFromDOM):
(WebCore::RenderTableCell::parseRowSpanFromDOM):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isEnabled):
(WebCore::RenderTheme::isFocused):
(WebCore::RenderTheme::isPressed):
(WebCore::RenderTheme::isSpinUpButtonPartPressed):
(WebCore::RenderTheme::isReadOnlyControl):
(WebCore::RenderTheme::isHovered):
(WebCore::RenderTheme::isSpinUpButtonPartHovered):
(WebCore::RenderTheme::paintSliderTicks):
* rendering/RenderThemeGtk.cpp:
(WebCore::getMediaElementFromRenderObject):
(WebCore::nodeHasClass):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updatePressedState):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
* rendering/RenderTreeAsText.cpp:
(WebCore::isEmptyOrUnstyledAppleStyleSpan):
(WebCore::RenderTreeAsText::writeRenderObject):
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::isAutosizingContainer):
(WebCore::TextAutosizer::containerContainsOneOfTags):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::isChildAllowed):
* rendering/svg/RenderSVGGradientStop.cpp:
(WebCore::RenderSVGGradientStop::gradientElement):
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
* style/StyleResolveTree.cpp:
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
(WebCore::Style::attachChildren):
(WebCore::Style::attachDistributedChildren):
(WebCore::Style::detachDistributedChildren):
(WebCore::Style::detachChildren):
(WebCore::Style::resolveShadowTree):
(WebCore::Style::resolveTree):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::hasValidAttributeType):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::rootElement):
* svg/SVGElement.cpp:
(WebCore::SVGElement::isOutermostSVGSVGElement):
(WebCore::SVGElement::ownerSVGElement):
(WebCore::SVGElement::viewportElement):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::associatedFontElement):
(WebCore::SVGFontFaceElement::rebuildFontFace):
* svg/SVGFontFaceSrcElement.cpp:
(WebCore::SVGFontFaceSrcElement::childrenChanged):
* svg/SVGGlyphElement.cpp:
(WebCore::SVGGlyphElement::invalidateGlyphCache):
* svg/SVGHKernElement.cpp:
(WebCore::SVGHKernElement::insertedInto):
(WebCore::SVGHKernElement::removedFrom):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::determineViewport):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGLocatable.cpp:
(WebCore::isViewportElement):
(WebCore::SVGLocatable::getTransformToElement):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::pathElement):
(WebCore::SVGMPathElement::notifyParentOfPathChange):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::invalidateMPathDependencies):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::collectPatternAttributes):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::setupInitialView):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::elementFromRenderer):
* svg/SVGUseElement.cpp:
(WebCore::dumpInstanceTree):
(WebCore::SVGUseElement::toClipPath):
(WebCore::SVGUseElement::expandUseElementsInShadowTree):
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
* svg/SVGVKernElement.cpp:
(WebCore::SVGVKernElement::insertedInto):
(WebCore::SVGVKernElement::removedFrom):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
* svg/graphics/SVGImageCache.cpp:
(WebCore::SVGImageCache::imageForRenderer):
* testing/Internals.cpp:
(WebCore::Internals::shadowRootType):
(WebCore::Internals::visiblePlaceholder):
(WebCore::Internals::selectColorInColorChooser):
(WebCore::Internals::wasLastChangeUserEdit):
(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
(WebCore::Internals::isSelectPopupVisible):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
* xml/XPathFunctions.cpp:
(WebCore::XPath::expandedNameLocalPart):
(WebCore::XPath::FunLang::evaluate):
* xml/XPathNodeSet.cpp:
(WebCore::XPath::sortBlock):
(WebCore::XPath::NodeSet::sort):
(WebCore::XPath::findRootNode):
(WebCore::XPath::NodeSet::traversalSort):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):

Source/WebKit/ios:

* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::focusedElementChanged):

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::focusedElementChanged):
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::textFieldDidBeginEditing):
(WebEditorClient::textFieldDidEndEditing):
(WebEditorClient::textDidChangeInTextField):
(WebEditorClient::doTextFieldCommandFromEvent):
(WebEditorClient::textWillBeDeletedInTextField):
(WebEditorClient::textDidChangeInTextArea):
* WebView/WebHTMLRepresentation.mm:
(inputElementFromDOMElement):
(searchForLabelsBeforeElement):
* WebView/WebRenderLayer.mm:
(+[WebRenderLayer nameForLayer:]):

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMElement::createInstance):
* DOMHTMLClasses.cpp:
(DOMHTMLDocument::body):
(DOMHTMLDocument::forms):
(DOMHTMLElement::idName):
(DOMHTMLElement::innerText):
(DOMHTMLElement::setInnerText):
(DOMHTMLFormElement::action):
(DOMHTMLFormElement::method):
(DOMHTMLOptionElement::text):
(DOMHTMLOptionElement::label):
(DOMHTMLInputElement::form):
(DOMHTMLInputElement::disabled):
(DOMHTMLInputElement::readOnly):
(DOMHTMLInputElement::setType):
(DOMHTMLInputElement::value):
(DOMHTMLInputElement::setValue):
(DOMHTMLInputElement::setValueForUser):
(DOMHTMLInputElement::select):
(DOMHTMLInputElement::setSelectionStart):
(DOMHTMLInputElement::selectionStart):
(DOMHTMLInputElement::setSelectionEnd):
(DOMHTMLInputElement::selectionEnd):
(DOMHTMLInputElement::isTextField):
(DOMHTMLInputElement::rectOnScreen):
(DOMHTMLInputElement::replaceCharactersInRange):
(DOMHTMLInputElement::selectedRange):
(DOMHTMLInputElement::setAutofilled):
(DOMHTMLInputElement::isAutofilled):
(DOMHTMLInputElement::isUserEdited):
(DOMHTMLTextAreaElement::form):
(DOMHTMLTextAreaElement::value):
(DOMHTMLTextAreaElement::setValue):
(DOMHTMLTextAreaElement::select):
(DOMHTMLTextAreaElement::isUserEdited):
* WebFrame.cpp:
(formElementFromDOMElement):
(inputElementFromDOMElement):
(WebFrame::elementWithName):

Source/WebKit2:

* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::WebRenderObject):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::mediaType):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::handleEvent):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::focusedElementChanged):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::textFieldDidBeginEditing):
(WebKit::WebEditorClient::textFieldDidEndEditing):
(WebKit::WebEditorClient::textDidChangeInTextField):
(WebKit::WebEditorClient::textDidChangeInTextArea):
(WebKit::WebEditorClient::doTextFieldCommandFromEvent):
(WebKit::WebEditorClient::textWillBeDeletedInTextField):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::containsAnyFormElements):
(WebKit::WebFrame::containsAnyFormControls):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pdfDocumentForPrintingFrame):
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::blurAssistedNode):
(WebKit::WebPage::setAssistedNodeValue):
(WebKit::WebPage::setAssistedNodeValueAsNumber):
(WebKit::WebPage::setAssistedNodeSelectedIndex):
(WebKit::WebPage::getPositionInformation):
(WebKit::WebPage::performActionOnElement):
(WebKit::isAssistableNode):
(WebKit::WebPage::getAssistedNodeInformation):

Source/WTF:

* wtf/TypeCasts.h:
(WTF::is):

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

251 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/TypeCasts.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBFactory.cpp
Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
Source/WebCore/accessibility/AccessibilityMediaControls.cpp
Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp
Source/WebCore/bindings/js/JSAudioContextCustom.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSElementCustom.cpp
Source/WebCore/bindings/js/JSErrorHandler.cpp
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/js/JSLazyEventListener.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/ScheduledAction.cpp
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/bindings/objc/DOM.mm
Source/WebCore/css/CSSCursorImageValue.cpp
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/SelectorCheckerTestFunctions.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleSheetList.cpp
Source/WebCore/dom/Attr.cpp
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNodeAlgorithms.cpp
Source/WebCore/dom/CurrentScriptIncrementer.h
Source/WebCore/dom/DataTransfer.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/DocumentStyleSheetCollection.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementTraversal.h
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/KeyboardEvent.cpp
Source/WebCore/dom/LiveNodeList.cpp
Source/WebCore/dom/MessagePort.cpp
Source/WebCore/dom/MouseEvent.cpp
Source/WebCore/dom/NamedNodeMap.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/NodeRenderingTraversal.cpp
Source/WebCore/dom/NodeTraversal.cpp
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/dom/ShadowRoot.h
Source/WebCore/dom/Text.cpp
Source/WebCore/dom/TextNodeTraversal.cpp
Source/WebCore/dom/TextNodeTraversal.h
Source/WebCore/dom/TreeScopeAdopter.cpp
Source/WebCore/editing/ApplyBlockElementCommand.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/BreakBlockquoteCommand.cpp
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FormatBlockCommand.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/InsertLineBreakCommand.cpp
Source/WebCore/editing/InsertListCommand.cpp
Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
Source/WebCore/editing/InsertTextCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/SpellChecker.cpp
Source/WebCore/editing/SplitTextNodeContainingElementCommand.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/editing/VisibleSelection.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/editing/markup.cpp
Source/WebCore/fileapi/FileReader.cpp
Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLAreaElement.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.cpp
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLLabelElement.cpp
Source/WebCore/html/HTMLLegendElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLScriptElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTablePartElement.cpp
Source/WebCore/html/HTMLTableRowElement.cpp
Source/WebCore/html/HTMLTableRowsCollection.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTitleElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/html/InputType.cpp
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/RadioInputType.cpp
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/parser/HTMLElementStack.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp
Source/WebCore/html/shadow/InsertionPoint.h
Source/WebCore/html/shadow/MediaControlElementTypes.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/html/shadow/MediaControlsApple.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SpinButtonElement.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/track/VTTCue.cpp
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorNodeFinder.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/loader/FormSubmission.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/loader/ThreadableLoader.cpp
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/mathml/MathMLSelectElement.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DOMTimer.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/SpatialNavigation.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/platform/network/FormData.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderDetailsMarker.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderMarquee.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderMeter.cpp
Source/WebCore/rendering/RenderNamedFlowThread.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderProgress.cpp
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderThemeGtk.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderTreeAsText.cpp
Source/WebCore/rendering/TextAutosizer.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp
Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/style/StyleResolveTree.cpp
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAltGlyphElement.cpp
Source/WebCore/svg/SVGAnimateMotionElement.cpp
Source/WebCore/svg/SVGDocument.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGFontData.cpp
Source/WebCore/svg/SVGFontFaceElement.cpp
Source/WebCore/svg/SVGFontFaceSrcElement.cpp
Source/WebCore/svg/SVGGlyphElement.cpp
Source/WebCore/svg/SVGHKernElement.cpp
Source/WebCore/svg/SVGLengthContext.cpp
Source/WebCore/svg/SVGLinearGradientElement.cpp
Source/WebCore/svg/SVGLocatable.cpp
Source/WebCore/svg/SVGMPathElement.cpp
Source/WebCore/svg/SVGPathElement.cpp
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGRadialGradientElement.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGTextContentElement.cpp
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/SVGVKernElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/svg/graphics/SVGImageCache.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/js/WebCoreTestSupport.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XPathFunctions.cpp
Source/WebCore/xml/XPathNodeSet.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
Source/WebKit/mac/WebView/WebRenderLayer.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/DOMCoreClasses.cpp
Source/WebKit/win/DOMHTMLClasses.cpp
Source/WebKit/win/WebFrame.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebRenderObject.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

index c4ecf86..379464e 100644 (file)
@@ -1,3 +1,20 @@
+2014-10-01  Christophe Dumez  <cdumez@apple.com>
+
+        Have is<>(T*) function do a null check on the pointer argument
+        https://bugs.webkit.org/show_bug.cgi?id=137333
+
+        Reviewed by Gavin Barraclough.
+
+        Have is<>(T*) function do a null check on the argument instead of a
+        simple assertion. This makes sense for 2 reasons:
+        1. It is more consistent with downcast<>(T*), which will succeed even
+           if the argument is a nullptr.
+        2. It simplifies the code a bit as it gets rid of a lot of explicit
+           null checks.
+
+        * wtf/TypeCasts.h:
+        (WTF::is):
+
 2014-10-02  Daniel Bates  <dabates@apple.com>
 
         Clean up: Move XPC forward declarations in JavaScriptCore to WTF SPI wrapper header
index 6f76c8c..3c20341 100644 (file)
@@ -60,9 +60,8 @@ inline bool is(ArgType& source)
 template <typename ExpectedType, typename ArgType>
 inline bool is(ArgType* source)
 {
-    ASSERT(source);
     static_assert(!std::is_base_of<ExpectedType, ArgType>::value, "Unnecessary type check");
-    return TypeCastTraits<const ExpectedType, const ArgType>::isOfType(*source);
+    return source && TypeCastTraits<const ExpectedType, const ArgType>::isOfType(*source);
 }
 
 // Safe downcasting functions.
index 05a6617..57dc600 100644 (file)
@@ -1,3 +1,865 @@
+2014-10-01  Christophe Dumez  <cdumez@apple.com>
+
+        Have is<>(T*) function do a null check on the pointer argument
+        https://bugs.webkit.org/show_bug.cgi?id=137333
+
+        Reviewed by Gavin Barraclough.
+
+        Have is<>(T*) function do a null check on the argument instead of a
+        simple assertion. This makes sense for 2 reasons:
+        1. It is more consistent with downcast<>(T*), which will succeed even
+           if the argument is a nullptr.
+        2. It simplifies the code a bit as it gets rid of a lot of explicit
+           null checks.
+
+        No new tests, no behavior change.
+
+        * Modules/indexeddb/IDBFactory.cpp:
+        * Modules/webaudio/OfflineAudioContext.cpp:
+        (WebCore::OfflineAudioContext::create):
+        * Modules/websockets/ThreadableWebSocketChannel.cpp:
+        (WebCore::ThreadableWebSocketChannel::create):
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect):
+        * Modules/websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::clientHandshakeMessage):
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::focusedUIElementForPage):
+        (WebCore::createFromRenderer):
+        (WebCore::AXObjectCache::getOrCreate):
+        (WebCore::AXObjectCache::handleLiveRegionCreated):
+        (WebCore::AXObjectCache::handleAttributeChanged):
+        (WebCore::AXObjectCache::labelChanged):
+        (WebCore::AXObjectCache::rootAXEditableElement):
+        (WebCore::isNodeAriaVisible):
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::isEnabled):
+        (WebCore::AccessibilityListBoxOption::isSelected):
+        (WebCore::AccessibilityListBoxOption::canSetSelectedAttribute):
+        (WebCore::AccessibilityListBoxOption::stringValue):
+        (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
+        * accessibility/AccessibilityMediaControls.cpp:
+        (WebCore::AccessibilityMediaTimeline::valueDescription):
+        * accessibility/AccessibilityMenuListPopup.cpp:
+        (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
+        (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
+        (WebCore::AccessibilityNodeObject::isNativeTextControl):
+        (WebCore::AccessibilityNodeObject::isNativeImage):
+        (WebCore::AccessibilityNodeObject::isInputImage):
+        (WebCore::AccessibilityNodeObject::isEnabled):
+        (WebCore::AccessibilityNodeObject::isPressed):
+        (WebCore::AccessibilityNodeObject::isHovered):
+        (WebCore::AccessibilityNodeObject::isReadOnly):
+        (WebCore::AccessibilityNodeObject::isRequired):
+        (WebCore::AccessibilityNodeObject::valueForRange):
+        (WebCore::AccessibilityNodeObject::maxValueForRange):
+        (WebCore::AccessibilityNodeObject::minValueForRange):
+        (WebCore::AccessibilityNodeObject::isControl):
+        (WebCore::AccessibilityNodeObject::anchorElement):
+        (WebCore::isNodeActionElement):
+        (WebCore::AccessibilityNodeObject::mouseButtonListener):
+        (WebCore::AccessibilityNodeObject::labelForElement):
+        (WebCore::AccessibilityNodeObject::titleElementText):
+        (WebCore::AccessibilityNodeObject::alternativeText):
+        (WebCore::AccessibilityNodeObject::visibleText):
+        (WebCore::AccessibilityNodeObject::accessibilityDescription):
+        (WebCore::AccessibilityNodeObject::helpText):
+        (WebCore::AccessibilityNodeObject::hierarchicalLevel):
+        (WebCore::AccessibilityNodeObject::textUnderElement):
+        (WebCore::AccessibilityNodeObject::title):
+        (WebCore::AccessibilityNodeObject::colorValue):
+        (WebCore::accessibleNameForNode):
+        (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::press):
+        (WebCore::AccessibilityObject::hasTagName):
+        (WebCore::AccessibilityObject::hasAttribute):
+        (WebCore::AccessibilityObject::element):
+        (WebCore::AccessibilityObject::classList):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::isFileUploadButton):
+        (WebCore::AccessibilityRenderObject::anchorElement):
+        (WebCore::AccessibilityRenderObject::helpText):
+        (WebCore::AccessibilityRenderObject::labelElementContainer):
+        (WebCore::AccessibilityRenderObject::internalLinkElement):
+        (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
+        (WebCore::AccessibilityRenderObject::titleUIElement):
+        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::accessKey):
+        (WebCore::AccessibilityRenderObject::url):
+        (WebCore::AccessibilityRenderObject::setElementAttributeValue):
+        (WebCore::AccessibilityRenderObject::setFocused):
+        (WebCore::AccessibilityRenderObject::setValue):
+        (WebCore::AccessibilityRenderObject::getDocumentLinks):
+        (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
+        (WebCore::AccessibilityRenderObject::accessibilityHitTest):
+        (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
+        (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
+        (WebCore::AccessibilityRenderObject::addTextFieldChildren):
+        (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
+        (WebCore::AccessibilityRenderObject::setAccessibleName):
+        (WebCore::AccessibilityRenderObject::stringValueForMSAA):
+        (WebCore::AccessibilityRenderObject::isLinked):
+        (WebCore::AccessibilityRenderObject::stringRoleForMSAA):
+        (WebCore::AccessibilityRenderObject::isMathElement):
+        * accessibility/AccessibilitySearchFieldButtons.cpp:
+        (WebCore::AccessibilitySearchFieldCancelButton::press):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::tableElement):
+        (WebCore::AccessibilityTable::isDataTable):
+        (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+        (WebCore::AccessibilityTable::title):
+        * accessibility/atk/AXObjectCacheAtk.cpp:
+        (WebCore::notifyChildrenSelectionChange):
+        * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
+        (webkitAccessibleTableGetCaption):
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetName):
+        (webkitAccessibleGetDescription):
+        (webkitAccessibleGetAttributes):
+        * bindings/gobject/WebKitDOMPrivate.cpp:
+        (WebKit::wrap):
+        * bindings/js/JSAudioContextCustom.cpp:
+        (WebCore::constructJSAudioContext):
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::toJSDOMGlobalObject):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::namedItemGetter):
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+        (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSErrorHandler.cpp:
+        (WebCore::JSErrorHandler::handleEvent):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::nameGetter):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::initializeJSFunction):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::isReachableFromDOM):
+        (WebCore::createWrapperInline):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::execute):
+        * bindings/js/ScriptState.cpp:
+        (WebCore::frameFromExecState):
+        * bindings/objc/DOM.mm:
+        (kitClass):
+        * css/CSSCursorImageValue.cpp:
+        (WebCore::resourceReferencedByCursorElement):
+        * css/CSSStyleSheet.cpp:
+        (WebCore::isAcceptableCSSStyleSheetParent):
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::checkOne):
+        * css/SelectorCheckerTestFunctions.h:
+        (WebCore::isAutofilled):
+        (WebCore::isDisabled):
+        (WebCore::isEnabled):
+        (WebCore::isChecked):
+        (WebCore::matchesLangPseudoClass):
+        (WebCore::matchesFutureCuePseudoClass):
+        (WebCore::matchesPastCuePseudoClass):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::State::initElement):
+        (WebCore::StyleResolver::locateCousinList):
+        (WebCore::elementHasDirectionAuto):
+        (WebCore::StyleResolver::canShareStyleWithElement):
+        (WebCore::StyleResolver::findSiblingForStyleSharing):
+        (WebCore::StyleResolver::adjustRenderStyle):
+        (WebCore::StyleResolver::useSVGZoomRulesForLength):
+        * css/StyleSheetList.cpp:
+        (WebCore::StyleSheetList::getNamedItem):
+        * dom/Attr.cpp:
+        (WebCore::Attr::style):
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::parserAppendData):
+        (WebCore::CharacterData::setDataAndUpdate):
+        * dom/ContainerNode.cpp:
+        (WebCore::checkAcceptChild):
+        (WebCore::ContainerNode::notifyChildRemoved):
+        * dom/ContainerNodeAlgorithms.cpp:
+        (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
+        (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
+        * dom/CurrentScriptIncrementer.h:
+        (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
+        * dom/DataTransfer.cpp:
+        (WebCore::DataTransfer::setDragImage):
+        * dom/Document.cpp:
+        (WebCore::Document::elementFromPoint):
+        (WebCore::Document::setTitle):
+        (WebCore::Document::iconURLs):
+        (WebCore::eventTargetElementForDocument):
+        (WebCore::Document::updateHoverActiveState):
+        * dom/DocumentStyleSheetCollection.cpp:
+        (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
+        * dom/Element.cpp:
+        (WebCore::Element::computeInheritedLanguage):
+        * dom/Element.h:
+        (WebCore::Node::parentElement):
+        * dom/ElementTraversal.h:
+        (WebCore::Traversal<Element>::nextTemplate):
+        (WebCore::ElementTraversal::previousIncludingPseudo):
+        (WebCore::ElementTraversal::nextIncludingPseudo):
+        (WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
+        (WebCore::ElementTraversal::pseudoAwarePreviousSibling):
+        * dom/EventDispatcher.cpp:
+        (WebCore::WindowEventContext::WindowEventContext):
+        (WebCore::EventDispatcher::dispatchEvent):
+        (WebCore::nodeOrHostIfPseudoElement):
+        (WebCore::EventPath::EventPath):
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::fireEventListeners):
+        * dom/KeyboardEvent.cpp:
+        (WebCore::findKeyboardEvent):
+        * dom/LiveNodeList.cpp:
+        (WebCore::LiveNodeList::namedItem):
+        * dom/MessagePort.cpp:
+        (WebCore::MessagePort::dispatchMessages):
+        * dom/MouseEvent.cpp:
+        (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
+        * dom/NamedNodeMap.cpp:
+        (WebCore::NamedNodeMap::setNamedItem):
+        * dom/Node.cpp:
+        (WebCore::Node::dumpStatistics):
+        (WebCore::Node::pseudoAwarePreviousSibling):
+        (WebCore::Node::pseudoAwareNextSibling):
+        (WebCore::Node::computedStyle):
+        (WebCore::Node::parentOrShadowHostElement):
+        (WebCore::Node::rootEditableElement):
+        (WebCore::Node::ancestorElement):
+        (WebCore::Node::compareDocumentPosition):
+        (WebCore::appendAttributeDesc):
+        (WebCore::Node::showNodePathForThis):
+        (WebCore::Node::enclosingLinkEventParentOrSelf):
+        (WebCore::Node::dispatchEvent):
+        (WebCore::Node::defaultEventHandler):
+        * dom/NodeRenderingTraversal.cpp:
+        (WebCore::NodeRenderingTraversal::nodeCanBeDistributed):
+        (WebCore::NodeRenderingTraversal::traverseParent):
+        * dom/NodeTraversal.cpp:
+        (WebCore::NodeTraversal::previousIncludingPseudo):
+        (WebCore::NodeTraversal::nextIncludingPseudo):
+        (WebCore::NodeTraversal::nextIncludingPseudoSkippingChildren):
+        * dom/Position.cpp:
+        (WebCore::Position::element):
+        (WebCore::endsOfNodeAreVisuallyDistinctPositions):
+        (WebCore::Position::isRenderedCharacter):
+        (WebCore::Position::leadingWhitespacePosition):
+        * dom/Range.cpp:
+        (WebCore::Range::insertNode):
+        (WebCore::Range::getBorderAndTextQuads):
+        * dom/ScriptElement.cpp:
+        (WebCore::toScriptElementIfPossible):
+        * dom/ShadowRoot.h:
+        (WebCore::Node::parentOrShadowHostNode):
+        * dom/Text.cpp:
+        (WebCore::earliestLogicallyAdjacentTextNode):
+        (WebCore::latestLogicallyAdjacentTextNode):
+        (WebCore::isSVGShadowText):
+        * dom/TextNodeTraversal.cpp:
+        (WebCore::TextNodeTraversal::contentsAsString):
+        * dom/TextNodeTraversal.h:
+        (WebCore::TextNodeTraversal::firstTextChildTemplate):
+        (WebCore::TextNodeTraversal::firstTextWithinTemplate):
+        (WebCore::TextNodeTraversal::traverseNextTextTemplate):
+        (WebCore::TextNodeTraversal::nextSibling):
+        * dom/TreeScopeAdopter.cpp:
+        (WebCore::TreeScopeAdopter::moveTreeToNewScope):
+        (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
+        * editing/ApplyBlockElementCommand.cpp:
+        (WebCore::isNewLineAtPosition):
+        (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::isLegacyAppleStyleSpan):
+        (WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
+        (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
+        (WebCore::isEmptyFontTag):
+        (WebCore::ApplyStyleCommand::applyBlockStyle):
+        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
+        (WebCore::dummySpanAncestorForNode):
+        (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
+        (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
+        (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
+        (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
+        (WebCore::ApplyStyleCommand::splitTextAtEnd):
+        (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
+        (WebCore::ApplyStyleCommand::shouldSplitTextElement):
+        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
+        (WebCore::ApplyStyleCommand::applyInlineStyleChange):
+        (WebCore::ApplyStyleCommand::joinChildTextNodes):
+        * editing/BreakBlockquoteCommand.cpp:
+        (WebCore::BreakBlockquoteCommand::doApply):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::isRemovableBlock):
+        (WebCore::CompositeEditCommand::insertNodeAt):
+        (WebCore::CompositeEditCommand::canRebalance):
+        (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
+        (WebCore::CompositeEditCommand::deleteInsignificantText):
+        (WebCore::CompositeEditCommand::removePlaceholderAt):
+        (WebCore::CompositeEditCommand::cleanupAfterDeletion):
+        (WebCore::CompositeEditCommand::moveParagraphs):
+        * editing/DeleteButtonController.cpp:
+        (WebCore::enclosingDeletableElement):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::handleGeneralDelete):
+        (WebCore::DeleteSelectionCommand::fixupWhitespace):
+        (WebCore::DeleteSelectionCommand::doApply):
+        * editing/EditingStyle.cpp:
+        (WebCore::EditingStyle::wrappingStyleForSerialization):
+        * editing/Editor.cpp:
+        (WebCore::imageElementFromImageDocument):
+        (WebCore::Editor::shouldInsertFragment):
+        (WebCore::Editor::setBaseWritingDirection):
+        (WebCore::Editor::setComposition):
+        (WebCore::Editor::isSpellCheckingEnabledFor):
+        (WebCore::Editor::applyEditingStyleToElement):
+        * editing/FormatBlockCommand.cpp:
+        (WebCore::isElementForFormatBlock):
+        * editing/FrameSelection.cpp:
+        (WebCore::removingNodeRemovesPosition):
+        (WebCore::CaretBase::paintCaret):
+        (WebCore::FrameSelection::debugRenderer):
+        (WebCore::FrameSelection::selectAll):
+        (WebCore::scanForForm):
+        * editing/InsertLineBreakCommand.cpp:
+        (WebCore::InsertLineBreakCommand::doApply):
+        * editing/InsertListCommand.cpp:
+        (WebCore::InsertListCommand::mergeWithNeighboringLists):
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::doApply):
+        * editing/InsertTextCommand.cpp:
+        (WebCore::InsertTextCommand::insertTab):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::haveSameTagName):
+        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
+        (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
+        (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
+        (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
+        (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
+        (WebCore::ReplaceSelectionCommand::insertAsListItems):
+        (WebCore::ReplaceSelectionCommand::performTrivialReplace):
+        * editing/SpellChecker.cpp:
+        (WebCore::SpellChecker::isCheckable):
+        * editing/SplitTextNodeContainingElementCommand.cpp:
+        (WebCore::SplitTextNodeContainingElementCommand::doApply):
+        * editing/TextIterator.cpp:
+        (WebCore::isRendererReplacedElement):
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::isInPasswordField):
+        * editing/VisibleUnits.cpp:
+        (WebCore::startPositionForLine):
+        (WebCore::endPositionForLine):
+        (WebCore::startOfParagraph):
+        (WebCore::endOfParagraph):
+        * editing/cocoa/HTMLConverter.mm:
+        (HTMLConverter::aggregatedAttributesForAncestors):
+        (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
+        (WebCore::editingAttributedStringFromRange):
+        * editing/htmlediting.cpp:
+        (WebCore::enclosingBlock):
+        (WebCore::enclosingElementWithTag):
+        (WebCore::enclosingAnchorElement):
+        (WebCore::enclosingList):
+        (WebCore::lineBreakExistsAtPosition):
+        (WebCore::areIdenticalElements):
+        (WebCore::isNonTableCellHTMLBlockElement):
+        (WebCore::deprecatedEnclosingBlockFlowElement):
+        * editing/ios/EditorIOS.mm:
+        (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::appendText):
+        (WebCore::ancestorToRetainStructureAndAppearanceForBlock):
+        (WebCore::isPlainTextMarkup):
+        * fileapi/FileReader.cpp:
+        (WebCore::FileReader::readAsArrayBuffer):
+        (WebCore::FileReader::readAsBinaryString):
+        (WebCore::FileReader::readAsText):
+        (WebCore::FileReader::readAsDataURL):
+        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
+        (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
+        * html/FormAssociatedElement.cpp:
+        (WebCore::FormAssociatedElement::findAssociatedForm):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::appendServerMapMousePosition):
+        (WebCore::HTMLAnchorElement::defaultEventHandler):
+        (WebCore::HTMLAnchorElement::eventType):
+        (WebCore::isEnterKeyKeydownEvent):
+        (WebCore::isLinkClick):
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::imageElement):
+        * html/HTMLBodyElement.cpp:
+        (WebCore::HTMLBodyElement::insertedInto):
+        * html/HTMLButtonElement.cpp:
+        (WebCore::HTMLButtonElement::defaultEventHandler):
+        * html/HTMLCollection.cpp:
+        (WebCore::HTMLCollection::namedItem):
+        (WebCore::HTMLCollection::updateNamedElementCache):
+        * 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::matchesReadWritePseudoClass):
+        (WebCore::mergeWithNextTextNode):
+        (WebCore::HTMLElement::setOuterHTML):
+        (WebCore::HTMLElement::setOuterText):
+        (WebCore::HTMLElement::insertAdjacentElement):
+        (WebCore::contextElementForInsertion):
+        (WebCore::HTMLElement::directionality):
+        (WebCore::HTMLElement::dirAttributeChanged):
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::rendererIsNeeded):
+        * html/HTMLFieldSetElement.cpp:
+        (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
+        (WebCore::HTMLFieldSetElement::disabledStateChanged):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
+        (WebCore::shouldAutofocus):
+        (WebCore::HTMLFormControlElement::enclosingFormControlElement):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::rendererIsNeeded):
+        (WebCore::HTMLFormElement::submitImplicitly):
+        (WebCore::submitElementFromEvent):
+        (WebCore::HTMLFormElement::validateInteractively):
+        (WebCore::HTMLFormElement::submit):
+        (WebCore::HTMLFormElement::reset):
+        (WebCore::HTMLFormElement::defaultButton):
+        (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
+        * html/HTMLFrameOwnerElement.cpp:
+        (WebCore::HTMLFrameOwnerElement::getSVGDocument):
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::defaultEventHandler):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::defaultEventHandler):
+        (WebCore::HTMLInputElement::dataList):
+        * html/HTMLLabelElement.cpp:
+        (WebCore::nodeAsSupportedLabelableElement):
+        * html/HTMLLegendElement.cpp:
+        (WebCore::HTMLLegendElement::virtualForm):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::parseAttribute):
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::hasFallbackContent):
+        (WebCore::HTMLObjectElement::updateDocNamedItem):
+        * html/HTMLOptGroupElement.cpp:
+        (WebCore::HTMLOptGroupElement::recalcSelectOptions):
+        (WebCore::HTMLOptGroupElement::ownerSelectElement):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::setText):
+        (WebCore::HTMLOptionElement::index):
+        (WebCore::HTMLOptionElement::ownerDataListElement):
+        (WebCore::HTMLOptionElement::ownerSelectElement):
+        (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
+        (WebCore::HTMLOptionElement::isDisabledFormControl):
+        (WebCore::HTMLOptionElement::collectOptionInnerText):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
+        (WebCore::HTMLPlugInImageElement::defaultEventHandler):
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::setText):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::nextValidIndex):
+        (WebCore::HTMLSelectElement::saveLastSelection):
+        (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
+        (WebCore::HTMLSelectElement::updateListBoxSelection):
+        (WebCore::HTMLSelectElement::listBoxOnChange):
+        (WebCore::HTMLSelectElement::recalcListItems):
+        (WebCore::HTMLSelectElement::selectedIndex):
+        (WebCore::HTMLSelectElement::selectOption):
+        (WebCore::HTMLSelectElement::optionToListIndex):
+        (WebCore::HTMLSelectElement::listToOptionIndex):
+        (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
+        (WebCore::HTMLSelectElement::saveFormControlState):
+        (WebCore::HTMLSelectElement::searchOptionsForValue):
+        (WebCore::HTMLSelectElement::restoreFormControlState):
+        (WebCore::HTMLSelectElement::appendFormData):
+        (WebCore::HTMLSelectElement::reset):
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+        (WebCore::HTMLSelectElement::updateSelectedState):
+        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
+        (WebCore::HTMLSelectElement::defaultEventHandler):
+        (WebCore::HTMLSelectElement::lastSelectedListIndex):
+        (WebCore::HTMLSelectElement::optionAtIndex):
+        (WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
+        (WebCore::HTMLSelectElement::length):
+        * html/HTMLSourceElement.cpp:
+        (WebCore::HTMLSourceElement::insertedInto):
+        (WebCore::HTMLSourceElement::removedFrom):
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::isClickableControl):
+        (WebCore::HTMLSummaryElement::defaultEventHandler):
+        * 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/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::defaultEventHandler):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::innerTextValue):
+        (WebCore::positionForIndex):
+        (WebCore::HTMLTextFormControlElement::indexForPosition):
+        (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
+        * html/HTMLTitleElement.cpp:
+        (WebCore::HTMLTitleElement::setText):
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::mediaElement):
+        * html/ImageDocument.cpp:
+        (WebCore::ImageEventListener::handleEvent):
+        * html/InputType.cpp:
+        (WebCore::InputType::shouldSubmitImplicitly):
+        * html/MediaDocument.cpp:
+        (WebCore::ancestorVideoElement):
+        (WebCore::MediaDocument::defaultEventHandler):
+        * html/RadioInputType.cpp:
+        (WebCore::RadioInputType::handleKeydownEvent):
+        (WebCore::RadioInputType::isKeyboardFocusable):
+        * html/TextFieldInputType.cpp:
+        (WebCore::TextFieldInputType::shouldSubmitImplicitly):
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::hasImpliedEndTag):
+        (WebCore::HTMLConstructionSite::attachLater):
+        (WebCore::HTMLConstructionSite::insertHTMLFormElement):
+        (WebCore::HTMLConstructionSite::insertTextNode):
+        (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
+        (WebCore::HTMLConstructionSite::findFosterSite):
+        * html/parser/HTMLElementStack.cpp:
+        (WebCore::HTMLNames::isScopeMarker):
+        (WebCore::HTMLNames::isTableScopeMarker):
+        (WebCore::HTMLNames::isSelectScopeMarker):
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+        (WebCore::HTMLTreeBuilder::processStartTag):
+        (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
+        (WebCore::HTMLTreeBuilder::processEndTag):
+        (WebCore::HTMLTreeBuilder::processCharacterBuffer):
+        * html/shadow/InsertionPoint.h:
+        (WebCore::isActiveInsertionPoint):
+        (WebCore::parentNodeForDistribution):
+        (WebCore::parentElementForDistribution):
+        * html/shadow/MediaControlElementTypes.cpp:
+        (WebCore::parentMediaElement):
+        (WebCore::mediaControlElementType):
+        (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::defaultEventHandler):
+        (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
+        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
+        (WebCore::MediaControlTimelineElement::defaultEventHandler):
+        * html/shadow/MediaControls.cpp:
+        (WebCore::MediaControls::containsRelatedTarget):
+        * html/shadow/MediaControlsApple.cpp:
+        (WebCore::MediaControlsAppleEventListener::handleEvent):
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::SliderThumbElement::defaultEventHandler):
+        * html/shadow/SpinButtonElement.cpp:
+        (WebCore::SpinButtonElement::defaultEventHandler):
+        (WebCore::SpinButtonElement::forwardEvent):
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
+        (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::copyWebVTTNodeToDOMTree):
+        (WebCore::VTTCue::markFutureAndPastNodes):
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::elementForId):
+        (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::unbind):
+        (WebCore::InspectorDOMAgent::assertDocument):
+        (WebCore::InspectorDOMAgent::assertElement):
+        (WebCore::InspectorDOMAgent::querySelector):
+        (WebCore::InspectorDOMAgent::querySelectorAll):
+        (WebCore::InspectorDOMAgent::setNodeName):
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+        (WebCore::InspectorDOMAgent::innerParentNode):
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::frameForScriptExecutionContext):
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
+        * inspector/InspectorNodeFinder.cpp:
+        (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
+        (WebCore::InspectorNodeFinder::searchUsingXPath):
+        (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::buildObjectForElementInfo):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyleSheet::inlineStyleSheetText):
+        * loader/FormSubmission.cpp:
+        (WebCore::FormSubmission::create):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::handleFallbackContent):
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::loadPlugin):
+        * loader/ThreadableLoader.cpp:
+        (WebCore::ThreadableLoader::create):
+        (WebCore::ThreadableLoader::loadResourceSynchronously):
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::removeRequestFromCache):
+        (WebCore::MemoryCache::removeRequestFromSessionCaches):
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::attributeChanged):
+        * mathml/MathMLSelectElement.cpp:
+        (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::setToolTip):
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::maybeCreateContextMenu):
+        (WebCore::ContextMenuController::populate):
+        * page/DOMTimer.cpp:
+        (WebCore::DOMTimer::install):
+        (WebCore::DOMTimer::fired):
+        * page/DragController.cpp:
+        (WebCore::elementUnderMouse):
+        (WebCore::DragController::operationForLoad):
+        (WebCore::DragController::canProcessDrag):
+        (WebCore::DragController::draggableElement):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::isSubmitImage):
+        (WebCore::targetIsFrame):
+        (WebCore::findDropZone):
+        (WebCore::EventHandler::updateDragAndDrop):
+        (WebCore::EventHandler::updateMouseEventTargetNode):
+        (WebCore::EventHandler::handleTextInputEvent):
+        * page/FocusController.cpp:
+        (WebCore::FocusNavigationScope::owner):
+        (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
+        (WebCore::FocusController::findFocusableElementAcrossFocusScope):
+        (WebCore::FocusController::findElementWithExactTabIndex):
+        (WebCore::nextElementWithGreaterTabIndex):
+        (WebCore::previousElementWithLowerTabIndex):
+        (WebCore::FocusController::nextFocusableElement):
+        (WebCore::FocusController::previousFocusableElement):
+        (WebCore::clearSelectionIfNeeded):
+        (WebCore::FocusController::advanceFocusDirectionally):
+        * page/Frame.cpp:
+        (WebCore::Frame::searchForLabelsBeforeElement):
+        (WebCore::Frame::setPageAndTextZoomFactors):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::init):
+        (WebCore::FrameView::scrollToAnchor):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::serializeFrame):
+        * page/SpatialNavigation.cpp:
+        (WebCore::FocusCandidate::FocusCandidate):
+        (WebCore::scrollInDirection):
+        (WebCore::scrollableEnclosingBoxOrParentFrameForNodeInDirection):
+        (WebCore::canScrollInDirection):
+        (WebCore::nodeRectInAbsoluteCoordinates):
+        (WebCore::areElementsOnSameLine):
+        * page/ios/FrameIOS.mm:
+        (WebCore::ancestorRespondingToClickEvents):
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::appendKeyValuePairItems):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::setInnerNode):
+        (WebCore::HitTestResult::setInnerNonSharedNode):
+        (WebCore::HitTestResult::title):
+        (WebCore::HitTestResult::innerTextIfTruncated):
+        (WebCore::HitTestResult::mediaSupportsFullscreen):
+        (WebCore::HitTestResult::enterFullscreenForVideo):
+        (WebCore::HitTestResult::mediaIsVideo):
+        (WebCore::HitTestResult::innerElement):
+        (WebCore::HitTestResult::innerNonSharedElement):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::resizeTextPermitted):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::sizesLogicalWidthToFitContent):
+        * rendering/RenderCounter.cpp:
+        (WebCore::planCounter):
+        * rendering/RenderDetailsMarker.cpp:
+        (WebCore::RenderDetailsMarker::isOpen):
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::uploadButton):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintAreaElementFocusRing):
+        (WebCore::RenderImage::paintIntoRect):
+        (WebCore::RenderImage::imageMap):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollRectToVisible):
+        (WebCore::RenderLayer::resize):
+        (WebCore::RenderLayer::updateSnapOffsets):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::isRestartedPlugin):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::updateFromElement):
+        (WebCore::RenderListBox::addFocusRingRects):
+        (WebCore::RenderListBox::paintItemForeground):
+        (WebCore::RenderListBox::paintItemBackground):
+        * rendering/RenderMarquee.cpp:
+        (WebCore::RenderMarquee::marqueeSpeed):
+        * rendering/RenderMenuList.cpp:
+        (WebCore::selectedOptionCount):
+        (RenderMenuList::updateOptionsWidth):
+        (RenderMenuList::setTextFromOption):
+        (RenderMenuList::itemText):
+        (RenderMenuList::itemIsEnabled):
+        (RenderMenuList::itemIsLabel):
+        (RenderMenuList::itemIsSelected):
+        * rendering/RenderMeter.cpp:
+        (WebCore::RenderMeter::meterElement):
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::isChildAllowed):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::addPDFURLRect):
+        (WebCore::RenderObject::shouldRespectImageOrientation):
+        (WebCore::RenderObject::updateDragState):
+        (WebCore::RenderObject::getUncachedPseudoStyle):
+        (WebCore::RenderObject::getTextDecorationColors):
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::progressElement):
+        * rendering/RenderSnapshottedPlugIn.cpp:
+        (WebCore::RenderSnapshottedPlugIn::handleEvent):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
+        (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::parseColSpanFromDOM):
+        (WebCore::RenderTableCell::parseRowSpanFromDOM):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::isEnabled):
+        (WebCore::RenderTheme::isFocused):
+        (WebCore::RenderTheme::isPressed):
+        (WebCore::RenderTheme::isSpinUpButtonPartPressed):
+        (WebCore::RenderTheme::isReadOnlyControl):
+        (WebCore::RenderTheme::isHovered):
+        (WebCore::RenderTheme::isSpinUpButtonPartHovered):
+        (WebCore::RenderTheme::paintSliderTicks):
+        * rendering/RenderThemeGtk.cpp:
+        (WebCore::getMediaElementFromRenderObject):
+        (WebCore::nodeHasClass):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::updatePressedState):
+        (WebCore::RenderThemeMac::paintSliderThumb):
+        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::isEmptyOrUnstyledAppleStyleSpan):
+        (WebCore::RenderTreeAsText::writeRenderObject):
+        * rendering/TextAutosizer.cpp:
+        (WebCore::TextAutosizer::isAutosizingContainer):
+        (WebCore::TextAutosizer::containerContainsOneOfTags):
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::isChildAllowed):
+        * rendering/svg/RenderSVGGradientStop.cpp:
+        (WebCore::RenderSVGGradientStop::gradientElement):
+        * rendering/svg/RenderSVGTransformableContainer.cpp:
+        (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
+        (WebCore::Style::attachChildren):
+        (WebCore::Style::attachDistributedChildren):
+        (WebCore::Style::detachDistributedChildren):
+        (WebCore::Style::detachChildren):
+        (WebCore::Style::resolveShadowTree):
+        (WebCore::Style::resolveTree):
+        * svg/SVGAElement.cpp:
+        (WebCore::SVGAElement::defaultEventHandler):
+        * svg/SVGAltGlyphElement.cpp:
+        (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
+        * svg/SVGAnimateMotionElement.cpp:
+        (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
+        * svg/SVGDocument.cpp:
+        (WebCore::SVGDocument::rootElement):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::isOutermostSVGSVGElement):
+        (WebCore::SVGElement::ownerSVGElement):
+        (WebCore::SVGElement::viewportElement):
+        * svg/SVGFontData.cpp:
+        (WebCore::SVGFontData::applySVGGlyphSelection):
+        * svg/SVGFontFaceElement.cpp:
+        (WebCore::SVGFontFaceElement::associatedFontElement):
+        (WebCore::SVGFontFaceElement::rebuildFontFace):
+        * svg/SVGFontFaceSrcElement.cpp:
+        (WebCore::SVGFontFaceSrcElement::childrenChanged):
+        * svg/SVGGlyphElement.cpp:
+        (WebCore::SVGGlyphElement::invalidateGlyphCache):
+        * svg/SVGHKernElement.cpp:
+        (WebCore::SVGHKernElement::insertedInto):
+        (WebCore::SVGHKernElement::removedFrom):
+        * svg/SVGLengthContext.cpp:
+        (WebCore::SVGLengthContext::determineViewport):
+        * svg/SVGLinearGradientElement.cpp:
+        (WebCore::SVGLinearGradientElement::collectGradientAttributes):
+        * svg/SVGLocatable.cpp:
+        (WebCore::isViewportElement):
+        (WebCore::SVGLocatable::getTransformToElement):
+        * svg/SVGMPathElement.cpp:
+        (WebCore::SVGMPathElement::pathElement):
+        (WebCore::SVGMPathElement::notifyParentOfPathChange):
+        * svg/SVGPathElement.cpp:
+        (WebCore::SVGPathElement::invalidateMPathDependencies):
+        * svg/SVGPatternElement.cpp:
+        (WebCore::SVGPatternElement::collectPatternAttributes):
+        * svg/SVGRadialGradientElement.cpp:
+        (WebCore::SVGRadialGradientElement::collectGradientAttributes):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::setupInitialView):
+        * svg/SVGTextContentElement.cpp:
+        (WebCore::SVGTextContentElement::elementFromRenderer):
+        * svg/SVGUseElement.cpp:
+        (WebCore::dumpInstanceTree):
+        (WebCore::SVGUseElement::toClipPath):
+        (WebCore::SVGUseElement::expandUseElementsInShadowTree):
+        (WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
+        * svg/SVGVKernElement.cpp:
+        (WebCore::SVGVKernElement::insertedInto):
+        (WebCore::SVGVKernElement::removedFrom):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::buildPendingResource):
+        * svg/graphics/SVGImageCache.cpp:
+        (WebCore::SVGImageCache::imageForRenderer):
+        * testing/Internals.cpp:
+        (WebCore::Internals::shadowRootType):
+        (WebCore::Internals::visiblePlaceholder):
+        (WebCore::Internals::selectColorInColorChooser):
+        (WebCore::Internals::wasLastChangeUserEdit):
+        (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
+        (WebCore::Internals::isSelectPopupVisible):
+        * testing/js/WebCoreTestSupport.cpp:
+        (WebCoreTestSupport::injectInternalsObject):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::open):
+        * xml/XPathFunctions.cpp:
+        (WebCore::XPath::expandedNameLocalPart):
+        (WebCore::XPath::FunLang::evaluate):
+        * xml/XPathNodeSet.cpp:
+        (WebCore::XPath::sortBlock):
+        (WebCore::XPath::NodeSet::sort):
+        (WebCore::XPath::findRootNode):
+        (WebCore::XPath::NodeSet::traversalSort):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::XMLDocumentParser):
+
 2014-10-02  Rik Cabanier  <cabanier@adobe.com>
 
         Clean up loops in CSSGradientValue.cpp
index 0128f50..0e46ac6 100644 (file)
@@ -68,8 +68,8 @@ IDBFactory::~IDBFactory()
 namespace {
 static bool isContextValid(ScriptExecutionContext* context)
 {
-    ASSERT(is<Document>(context) || context->isWorkerGlobalScope());
-    if (is<Document>(context)) {
+    ASSERT(is<Document>(*context) || context->isWorkerGlobalScope());
+    if (is<Document>(*context)) {
         Document& document = downcast<Document>(*context);
         return document.frame() && document.page() && (!document.page()->usesEphemeralSession() || SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document.securityOrigin()->protocol()));
     }
@@ -79,7 +79,7 @@ static bool isContextValid(ScriptExecutionContext* context)
 static String getIndexedDBDatabasePath(ScriptExecutionContext* context)
 {
     ASSERT(isContextValid(context));
-    if (is<Document>(context)) {
+    if (is<Document>(*context)) {
         Document& document = downcast<Document>(*context);
         return document.page()->group().groupSettings().indexedDBDatabasePath();
     }
index 839fa87..a272852 100644 (file)
@@ -55,7 +55,7 @@ PassRefPtr<ThreadableWebSocketChannel> ThreadableWebSocketChannel::create(Script
     ASSERT(context);
     ASSERT(client);
 
-    if (is<WorkerGlobalScope>(context)) {
+    if (is<WorkerGlobalScope>(*context)) {
         WorkerGlobalScope& workerGlobalScope = downcast<WorkerGlobalScope>(*context);
         WorkerRunLoop& runLoop = workerGlobalScope.thread().runLoop();
         StringBuilder mode;
index 98bdce2..fd47796 100644 (file)
@@ -239,7 +239,7 @@ void WebSocket::connect(const String& url, const Vector<String>& protocols, Exce
 
     // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved.
     bool shouldBypassMainWorldContentSecurityPolicy = false;
-    if (is<Document>(scriptExecutionContext())) {
+    if (is<Document>(*scriptExecutionContext())) {
         Document& document = downcast<Document>(*scriptExecutionContext());
         shouldBypassMainWorldContentSecurityPolicy = document.frame()->script().shouldBypassMainWorldContentSecurityPolicy();
     }
index f366a2d..c730461 100644 (file)
@@ -196,7 +196,7 @@ CString WebSocketHandshake::clientHandshakeMessage() const
         fields.append("Sec-WebSocket-Protocol: " + m_clientProtocol);
 
     URL url = httpURLForAuthenticationAndCookies();
-    if (is<Document>(m_context)) {
+    if (is<Document>(*m_context)) {
         Document& document = downcast<Document>(*m_context);
         String cookie = cookieRequestHeaderFieldValue(&document, url);
         if (!cookie.isEmpty())
index 6d2f32c..57ea06f 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 && is<HTMLAreaElement>(focusedElement))
+    if (is<HTMLAreaElement>(focusedElement))
         return focusedImageMapUIElement(downcast<HTMLAreaElement>(focusedElement));
 
     AccessibilityObject* obj = focusedDocument->axObjectCache()->getOrCreate(focusedElement ? static_cast<Node*>(focusedElement) : focusedDocument);
@@ -294,7 +294,7 @@ static PassRefPtr<AccessibilityObject> createFromRenderer(RenderObject* renderer
         return AccessibilitySVGRoot::create(renderer);
     
     // Search field buttons
-    if (node && is<Element>(node) && downcast<Element>(*node).isSearchFieldCancelButtonElement())
+    if (is<Element>(node) && downcast<Element>(*node).isSearchFieldCancelButtonElement())
         return AccessibilitySearchFieldCancelButton::create(renderer);
     
     if (renderer->isBoxModelObject()) {
@@ -386,7 +386,7 @@ AccessibilityObject* AXObjectCache::getOrCreate(Node* node)
 
     bool insideMeterElement = false;
 #if ENABLE(METER_ELEMENT)
-    insideMeterElement = is<HTMLMeterElement>(node->parentElement());
+    insideMeterElement = is<HTMLMeterElement>(*node->parentElement());
 #endif
     
     if (!inCanvasSubtree && !isHidden && !insideMeterElement)
@@ -653,7 +653,7 @@ void AXObjectCache::handleMenuOpened(Node* node)
     
 void AXObjectCache::handleLiveRegionCreated(Node* node)
 {
-    if (!node || !node->renderer() || !is<Element>(node))
+    if (!is<Element>(node) || !node->renderer())
         return;
     
     Element* element = downcast<Element>(node);
@@ -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 && is<HTMLLabelElement>(element))
+    else if (attrName == forAttr && is<HTMLLabelElement>(*element))
         labelChanged(element);
 
     if (!attrName.localName().string().startsWith("aria-"))
@@ -947,8 +947,8 @@ void AXObjectCache::handleAttributeChanged(const QualifiedName& attrName, Elemen
 
 void AXObjectCache::labelChanged(Element* element)
 {
-    ASSERT(is<HTMLLabelElement>(element));
-    HTMLElement* correspondingControl = downcast<HTMLLabelElement>(element)->control();
+    ASSERT(is<HTMLLabelElement>(*element));
+    HTMLElement* correspondingControl = downcast<HTMLLabelElement>(*element).control();
     textChanged(correspondingControl);
 }
 
@@ -1030,7 +1030,7 @@ void AXObjectCache::textMarkerDataForVisiblePosition(TextMarkerData& textMarkerD
 const Element* AXObjectCache::rootAXEditableElement(const Node* node)
 {
     const Element* result = node->rootEditableElement();
-    const Element* element = is<Element>(node) ? downcast<Element>(node) : node->parentElement();
+    const Element* element = is<Element>(*node) ? downcast<Element>(node) : node->parentElement();
 
     for (; element; element = element->parentElement()) {
         if (nodeIsTextControl(element))
@@ -1073,7 +1073,7 @@ bool isNodeAriaVisible(Node* node)
     // To determine if a node is ARIA visible, we need to check the parent hierarchy to see if anyone specifies
     // aria-hidden explicitly.
     for (Node* testNode = node; testNode; testNode = testNode->parentNode()) {
-        if (is<Element>(testNode)) {
+        if (is<Element>(*testNode)) {
             const AtomicString& ariaHiddenValue = downcast<Element>(*testNode).fastGetAttribute(aria_hiddenAttr);
             if (equalIgnoringCase(ariaHiddenValue, "false"))
                 return true;
index f03887c..dca0ea6 100644 (file)
@@ -61,9 +61,6 @@ PassRefPtr<AccessibilityListBoxOption> AccessibilityListBoxOption::create()
     
 bool AccessibilityListBoxOption::isEnabled() const
 {
-    if (!m_optionElement)
-        return false;
-    
     if (is<HTMLOptGroupElement>(m_optionElement))
         return false;
 
@@ -78,9 +75,6 @@ bool AccessibilityListBoxOption::isEnabled() const
     
 bool AccessibilityListBoxOption::isSelected() const
 {
-    if (!m_optionElement)
-        return false;
-
     if (!is<HTMLOptionElement>(m_optionElement))
         return false;
 
@@ -131,9 +125,6 @@ bool AccessibilityListBoxOption::computeAccessibilityIsIgnored() const
     
 bool AccessibilityListBoxOption::canSetSelectedAttribute() const
 {
-    if (!m_optionElement)
-        return false;
-    
     if (!is<HTMLOptionElement>(m_optionElement))
         return false;
     
@@ -156,10 +147,10 @@ String AccessibilityListBoxOption::stringValue() const
     if (!ariaLabel.isNull())
         return ariaLabel;
     
-    if (is<HTMLOptionElement>(m_optionElement))
+    if (is<HTMLOptionElement>(*m_optionElement))
         return downcast<HTMLOptionElement>(*m_optionElement).text();
     
-    if (is<HTMLOptGroupElement>(m_optionElement))
+    if (is<HTMLOptGroupElement>(*m_optionElement))
         return downcast<HTMLOptGroupElement>(*m_optionElement).groupLabelText();
     
     return String();
@@ -202,10 +193,10 @@ HTMLSelectElement* AccessibilityListBoxOption::listBoxOptionParentNode() const
     if (!m_optionElement)
         return nullptr;
 
-    if (is<HTMLOptionElement>(m_optionElement))
+    if (is<HTMLOptionElement>(*m_optionElement))
         return downcast<HTMLOptionElement>(*m_optionElement).ownerSelectElement();
 
-    if (is<HTMLOptGroupElement>(m_optionElement))
+    if (is<HTMLOptGroupElement>(*m_optionElement))
         return downcast<HTMLOptGroupElement>(*m_optionElement).ownerSelectElement();
 
     return nullptr;
index ee35efa..887bb99 100644 (file)
@@ -274,7 +274,7 @@ PassRefPtr<AccessibilityObject> AccessibilityMediaTimeline::create(RenderObject*
 String AccessibilityMediaTimeline::valueDescription() const
 {
     Node* node = m_renderer->node();
-    if (!is<HTMLInputElement>(node))
+    if (!is<HTMLInputElement>(*node))
         return String();
 
     float time = downcast<HTMLInputElement>(*node).value().toFloat();
index 350da0d..469afca 100644 (file)
@@ -70,7 +70,7 @@ bool AccessibilityMenuListPopup::computeAccessibilityIsIgnored() const
 
 AccessibilityMenuListOption* AccessibilityMenuListPopup::menuListOptionAccessibilityObject(HTMLElement* element) const
 {
-    if (!element || !is<HTMLOptionElement>(element) || !element->inRenderedDocument())
+    if (!is<HTMLOptionElement>(element) || !element->inRenderedDocument())
         return nullptr;
 
     AccessibilityObject* object = document()->axObjectCache()->getOrCreate(MenuListOptionRole);
index bdbe344..290e5be 100644 (file)
@@ -292,7 +292,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole()
         return StaticTextRole;
     if (node()->hasTagName(buttonTag))
         return buttonRoleType();
-    if (is<HTMLInputElement>(node())) {
+    if (is<HTMLInputElement>(*node())) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node());
         if (input.isCheckbox())
             return CheckBoxRole;
@@ -315,7 +315,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole()
         HTMLSelectElement& selectElement = downcast<HTMLSelectElement>(*node());
         return selectElement.multiple() ? ListBoxRole : PopUpButtonRole;
     }
-    if (is<HTMLTextAreaElement>(node()))
+    if (is<HTMLTextAreaElement>(*node()))
         return TextAreaRole;
     if (headingLevel())
         return HeadingRole;
@@ -323,9 +323,9 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole()
         return DivRole;
     if (node()->hasTagName(pTag))
         return ParagraphRole;
-    if (is<HTMLLabelElement>(node()))
+    if (is<HTMLLabelElement>(*node()))
         return LabelRole;
-    if (is<Element>(node()) && downcast<Element>(*node()).isFocusable())
+    if (is<Element>(*node()) && downcast<Element>(*node()).isFocusable())
         return GroupRole;
     
     return UnknownRole;
@@ -442,7 +442,7 @@ bool AccessibilityNodeObject::computeAccessibilityIsIgnored() const
 bool AccessibilityNodeObject::canvasHasFallbackContent() const
 {
     Node* node = this->node();
-    if (!node || !is<HTMLCanvasElement>(node))
+    if (!is<HTMLCanvasElement>(node))
         return false;
     HTMLCanvasElement& canvasElement = downcast<HTMLCanvasElement>(*node);
     // If it has any children that are elements, we'll assume it might be fallback
@@ -467,10 +467,10 @@ bool AccessibilityNodeObject::isNativeTextControl() const
     if (!node)
         return false;
 
-    if (is<HTMLTextAreaElement>(node))
+    if (is<HTMLTextAreaElement>(*node))
         return true;
 
-    if (is<HTMLInputElement>(node)) {
+    if (is<HTMLInputElement>(*node)) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         return input.isText() || input.isNumberField();
     }
@@ -514,13 +514,13 @@ bool AccessibilityNodeObject::isNativeImage() const
     if (!node)
         return false;
 
-    if (is<HTMLImageElement>(node))
+    if (is<HTMLImageElement>(*node))
         return true;
 
     if (node->hasTagName(appletTag) || node->hasTagName(embedTag) || node->hasTagName(objectTag))
         return true;
 
-    if (is<HTMLInputElement>(node)) {
+    if (is<HTMLInputElement>(*node)) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         return input.isImageButton();
     }
@@ -552,10 +552,7 @@ bool AccessibilityNodeObject::isPasswordField() const
 bool AccessibilityNodeObject::isInputImage() const
 {
     Node* node = this->node();
-    if (!node)
-        return false;
-    if (roleValue() == ButtonRole && is<HTMLInputElement>(node)) {
+    if (is<HTMLInputElement>(node) && roleValue() == ButtonRole) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         return input.isImageButton();
     }
@@ -643,7 +640,7 @@ bool AccessibilityNodeObject::isEnabled() const
         return false;
     
     Node* node = this->node();
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return true;
 
     return !downcast<Element>(*node).isDisabledFormControl();
@@ -678,7 +675,7 @@ bool AccessibilityNodeObject::isPressed() const
         return false;
     }
 
-    if (!is<Element>(node))
+    if (!is<Element>(*node))
         return false;
     return downcast<Element>(*node).active();
 }
@@ -717,9 +714,6 @@ bool AccessibilityNodeObject::isChecked() const
 bool AccessibilityNodeObject::isHovered() const
 {
     Node* node = this->node();
-    if (!node)
-        return false;
-
     return is<Element>(node) && downcast<Element>(*node).hovered();
 }
 
@@ -740,10 +734,10 @@ bool AccessibilityNodeObject::isReadOnly() const
     if (!node)
         return true;
 
-    if (is<HTMLTextAreaElement>(node))
-        return downcast<HTMLTextAreaElement>(node)->isReadOnly();
+    if (is<HTMLTextAreaElement>(*node))
+        return downcast<HTMLTextAreaElement>(*node).isReadOnly();
 
-    if (is<HTMLInputElement>(node)) {
+    if (is<HTMLInputElement>(*node)) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         if (input.isTextField())
             return input.isReadOnly();
@@ -762,8 +756,8 @@ bool AccessibilityNodeObject::isRequired() const
         return false;
 
     Node* n = this->node();
-    if (n && is<HTMLFormControlElement>(n))
-        return downcast<HTMLFormControlElement>(n)->isRequired();
+    if (is<HTMLFormControlElement>(n))
+        return downcast<HTMLFormControlElement>(*n).isRequired();
 
     return false;
 }
@@ -839,7 +833,7 @@ String AccessibilityNodeObject::valueDescription() const
 
 float AccessibilityNodeObject::valueForRange() const
 {
-    if (node() && is<HTMLInputElement>(node())) {
+    if (is<HTMLInputElement>(node())) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node());
         if (input.isRangeControl())
             return input.valueAsNumber();
@@ -853,7 +847,7 @@ float AccessibilityNodeObject::valueForRange() const
 
 float AccessibilityNodeObject::maxValueForRange() const
 {
-    if (node() && is<HTMLInputElement>(node())) {
+    if (is<HTMLInputElement>(node())) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node());
         if (input.isRangeControl())
             return input.maximum();
@@ -867,7 +861,7 @@ float AccessibilityNodeObject::maxValueForRange() const
 
 float AccessibilityNodeObject::minValueForRange() const
 {
-    if (node() && is<HTMLInputElement>(node())) {
+    if (is<HTMLInputElement>(node())) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node());
         if (input.isRangeControl())
             return input.minimum();
@@ -900,7 +894,7 @@ bool AccessibilityNodeObject::isControl() const
     if (!node)
         return false;
 
-    return is<HTMLFormControlElement>(node) || AccessibilityObject::isARIAControl(ariaRoleAttribute());
+    return is<HTMLFormControlElement>(*node) || AccessibilityObject::isARIAControl(ariaRoleAttribute());
 }
 
 bool AccessibilityNodeObject::isFieldset() const
@@ -965,7 +959,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 (is<HTMLAnchorElement>(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
+        if (is<HTMLAnchorElement>(*node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
             return downcast<Element>(node);
     }
 
@@ -974,7 +968,7 @@ Element* AccessibilityNodeObject::anchorElement() const
 
 static bool isNodeActionElement(Node* node)
 {
-    if (is<HTMLInputElement>(node)) {
+    if (is<HTMLInputElement>(*node)) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         if (!input.isDisabledFormControl() && (input.isRadioButton() || input.isCheckbox() || input.isTextButton() || input.isFileUpload() || input.isImageButton()))
             return true;
@@ -1046,7 +1040,7 @@ Element* AccessibilityNodeObject::mouseButtonListener(MouseButtonListenerResultF
 
     // check if our parent is a mouse button listener
     // FIXME: Do the continuation search like anchorElement does
-    for (auto& element : elementLineage(is<Element>(node) ? downcast<Element>(node) : node->parentElement())) {
+    for (auto& element : elementLineage(is<Element>(*node) ? downcast<Element>(node) : node->parentElement())) {
         // If we've reached the body and this is not a control element, do not expose press action for this element unless filter is IncludeBodyElement.
         // It can cause false positives, where every piece of text is labeled as accepting press actions.
         if (element.hasTagName(bodyTag) && isStaticText() && filter == ExcludeBodyElement)
@@ -1161,7 +1155,7 @@ bool AccessibilityNodeObject::isGenericFocusableElement() const
 
 HTMLLabelElement* AccessibilityNodeObject::labelForElement(Element* element) const
 {
-    if (!is<HTMLElement>(element) || !downcast<HTMLElement>(element)->isLabelable())
+    if (!is<HTMLElement>(*element) || !downcast<HTMLElement>(*element).isLabelable())
         return nullptr;
 
     const AtomicString& id = element->getIdAttribute();
@@ -1252,7 +1246,7 @@ void AccessibilityNodeObject::titleElementText(Vector<AccessibilityText>& textOr
     if (!node)
         return;
     
-    bool isInputTag = is<HTMLInputElement>(node);
+    bool isInputTag = is<HTMLInputElement>(*node);
     if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) {
         if (HTMLLabelElement* label = labelForElement(downcast<Element>(node))) {
             AccessibilityObject* labelObject = axObjectCache()->getOrCreate(label);
@@ -1306,7 +1300,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 (is<HTMLFieldSetElement>(node)) {
+    if (is<HTMLFieldSetElement>(*node)) {
         AccessibilityObject* object = axObjectCache()->getOrCreate(downcast<HTMLFieldSetElement>(*node).legend());
         if (object && !object->isHidden())
             textOrder.append(AccessibilityText(accessibleNameForNode(object->node()), AlternativeText));
@@ -1328,7 +1322,7 @@ void AccessibilityNodeObject::visibleText(Vector<AccessibilityText>& textOrder)
     if (!node)
         return;
     
-    bool isInputTag = is<HTMLInputElement>(node);
+    bool isInputTag = is<HTMLInputElement>(*node);
     if (isInputTag) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         if (input.isTextButton()) {
@@ -1503,7 +1497,7 @@ String AccessibilityNodeObject::accessibilityDescription() const
         return downcast<SVGElement>(*m_node).title();
     
 #if ENABLE(MATHML)
-    if (m_node && is<MathMLElement>(*m_node))
+    if (is<MathMLElement>(m_node))
         return getAttribute(MathMLNames::alttextAttr);
 #endif
 
@@ -1533,7 +1527,7 @@ String AccessibilityNodeObject::helpText() const
     
     String description = accessibilityDescription();
     for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
-        if (is<HTMLElement>(ancestor)) {
+        if (is<HTMLElement>(*ancestor)) {
             HTMLElement& element = downcast<HTMLElement>(*ancestor);
             const AtomicString& summary = element.getAttribute(summaryAttr);
             if (!summary.isEmpty())
@@ -1561,7 +1555,7 @@ String AccessibilityNodeObject::helpText() const
 unsigned AccessibilityNodeObject::hierarchicalLevel() const
 {
     Node* node = this->node();
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return 0;
     Element& element = downcast<Element>(*node);
     const AtomicString& ariaLevel = element.fastGetAttribute(aria_levelAttr);
@@ -1654,7 +1648,7 @@ static void appendNameToStringBuilder(StringBuilder& builder, const String& text
 String AccessibilityNodeObject::textUnderElement(AccessibilityTextUnderElementMode mode) const
 {
     Node* node = this->node();
-    if (node && is<Text>(node))
+    if (is<Text>(node))
         return downcast<Text>(*node).wholeText();
 
     // The render tree should be stable before going ahead. Otherwise, further uses of the
@@ -1698,7 +1692,7 @@ String AccessibilityNodeObject::title() const
     if (!node)
         return String();
 
-    bool isInputTag = is<HTMLInputElement>(node);
+    bool isInputTag = is<HTMLInputElement>(*node);
     if (isInputTag) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         if (input.isTextButton())
@@ -1824,7 +1818,7 @@ void AccessibilityNodeObject::colorValue(int& r, int& g, int& b) const
     if (!isColorWell())
         return;
 
-    if (!node() || !is<HTMLInputElement>(node()))
+    if (!is<HTMLInputElement>(node()))
         return;
 
     HTMLInputElement& input = downcast<HTMLInputElement>(*node());
@@ -1844,7 +1838,7 @@ void AccessibilityNodeObject::colorValue(int& r, int& g, int& b) const
 static String accessibleNameForNode(Node* node)
 {
     ASSERT(node);
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return String();
     
     Element& element = downcast<Element>(*node);
@@ -1865,7 +1859,7 @@ static String accessibleNameForNode(Node* node)
             return valueDescription;
     }
     
-    if (is<HTMLInputElement>(node))
+    if (is<HTMLInputElement>(*node))
         return downcast<HTMLInputElement>(*node).value();
     
     String text;
@@ -1941,9 +1935,6 @@ bool AccessibilityNodeObject::canSetFocusAttribute() const
     // NOTE: It would be more accurate to ask the document whether setFocusedElement() would
     // do anything. For example, setFocusedElement() will do nothing if the current focused
     // node will not relinquish the focus.
-    if (!node)
-        return false;
-
     if (!is<Element>(node))
         return false;
 
index 914dbdd..f6e9827 100644 (file)
@@ -851,7 +851,7 @@ bool AccessibilityObject::press()
         document->renderView()->hitTest(request, hitTestResult);
         if (hitTestResult.innerNode()) {
             Node* innerNode = hitTestResult.innerNode()->deprecatedShadowAncestorNode();
-            if (is<Element>(innerNode))
+            if (is<Element>(*innerNode))
                 hitTestElement = downcast<Element>(innerNode);
         }
     }
@@ -1759,15 +1759,12 @@ String AccessibilityObject::invalidStatus() const
 bool AccessibilityObject::hasTagName(const QualifiedName& tagName) const
 {
     Node* node = this->node();
-    return node && is<Element>(node) && downcast<Element>(*node).hasTagName(tagName);
+    return is<Element>(node) && downcast<Element>(*node).hasTagName(tagName);
 }
     
 bool AccessibilityObject::hasAttribute(const QualifiedName& attribute) const
 {
     Node* node = this->node();
-    if (!node)
-        return false;
-    
     if (!is<Element>(node))
         return false;
     
@@ -1966,7 +1963,7 @@ bool AccessibilityObject::hasHighlighting() const
 Element* AccessibilityObject::element() const
 {
     Node* node = this->node();
-    if (node && is<Element>(node))
+    if (is<Element>(node))
         return downcast<Element>(node);
     return nullptr;
 }
@@ -2114,7 +2111,7 @@ String AccessibilityObject::identifierAttribute() const
 void AccessibilityObject::classList(Vector<String>& classList) const
 {
     Node* node = this->node();
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return;
     
     Element* element = downcast<Element>(node);
index 98d587a..4505655 100644 (file)
@@ -523,7 +523,7 @@ bool AccessibilityRenderObject::isAttachment() const
 
 bool AccessibilityRenderObject::isFileUploadButton() const
 {
-    if (m_renderer && m_renderer->node() && is<HTMLInputElement>(m_renderer->node())) {
+    if (m_renderer && is<HTMLInputElement>(m_renderer->node())) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*m_renderer->node());
         return input.isFileUpload();
     }
@@ -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 (is<HTMLAnchorElement>(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
+        if (is<HTMLAnchorElement>(*node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
             return downcast<Element>(node);
     }
     
@@ -607,7 +607,7 @@ String AccessibilityRenderObject::helpText() const
     
     String description = accessibilityDescription();
     for (RenderObject* ancestor = m_renderer; ancestor; ancestor = ancestor->parent()) {
-        if (ancestor->node() && is<HTMLElement>(ancestor->node())) {
+        if (is<HTMLElement>(ancestor->node())) {
             HTMLElement& element = downcast<HTMLElement>(*ancestor->node());
             const AtomicString& summary = element.getAttribute(summaryAttr);
             if (!summary.isEmpty())
@@ -783,7 +783,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 (is<HTMLLabelElement>(parentNode))
+        if (is<HTMLLabelElement>(*parentNode))
             return downcast<HTMLLabelElement>(parentNode);
     }
     
@@ -911,9 +911,6 @@ IntPoint AccessibilityRenderObject::clickPoint()
 AccessibilityObject* AccessibilityRenderObject::internalLinkElement() const
 {
     Element* element = anchorElement();
-    if (!element)
-        return nullptr;
-    
     // Right now, we do not support ARIA links as internal link elements
     if (!is<HTMLAnchorElement>(element))
         return nullptr;
@@ -951,7 +948,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
         return;
     
     Node* node = m_renderer->node();
-    if (!node || !is<HTMLInputElement>(node))
+    if (!is<HTMLInputElement>(node))
         return;
     
     HTMLInputElement& input = downcast<HTMLInputElement>(*node);
@@ -969,7 +966,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
         unsigned length = list->length();
         for (unsigned i = 0; i < length; ++i) {
             Node* item = list->item(i);
-            if (is<HTMLInputElement>(item)) {
+            if (is<HTMLInputElement>(*item)) {
                 HTMLInputElement& associateElement = downcast<HTMLInputElement>(*item);
                 if (associateElement.isRadioButton() && associateElement.name() == input.name()) {
                     if (AccessibilityObject* object = axObjectCache()->getOrCreate(&associateElement))
@@ -1106,7 +1103,7 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const
         return axObjectCache()->getOrCreate(toRenderFieldset(m_renderer)->findLegend(RenderFieldset::IncludeFloatingOrOutOfFlow));
     
     Node* node = m_renderer->node();
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return nullptr;
     HTMLLabelElement* label = labelForElement(downcast<Element>(node));
     if (label && label->renderer())
@@ -1276,7 +1273,7 @@ bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
     
     // don't ignore labels, because they serve as TitleUIElements
     Node* node = m_renderer->node();
-    if (node && is<HTMLLabelElement>(node))
+    if (is<HTMLLabelElement>(node))
         return false;
     
     // Anything that is content editable should not be ignored.
@@ -1465,8 +1462,6 @@ String AccessibilityRenderObject::selectedText() const
 const AtomicString& AccessibilityRenderObject::accessKey() const
 {
     Node* node = m_renderer->node();
-    if (!node)
-        return nullAtom;
     if (!is<Element>(node))
         return nullAtom;
     return downcast<Element>(*node).getAttribute(accesskeyAttr);
@@ -1508,7 +1503,7 @@ void AccessibilityRenderObject::setSelectedTextRange(const PlainTextRange& range
 
 URL AccessibilityRenderObject::url() const
 {
-    if (isAnchor() && is<HTMLAnchorElement>(m_renderer->node())) {
+    if (isAnchor() && is<HTMLAnchorElement>(*m_renderer->node())) {
         if (HTMLAnchorElement* anchor = downcast<HTMLAnchorElement>(anchorElement()))
             return anchor->href();
     }
@@ -1516,7 +1511,7 @@ URL AccessibilityRenderObject::url() const
     if (isWebArea())
         return m_renderer->document().url();
     
-    if (isImage() && m_renderer->node() && is<HTMLImageElement>(m_renderer->node()))
+    if (isImage() && is<HTMLImageElement>(m_renderer->node()))
         return downcast<HTMLImageElement>(*m_renderer->node()).src();
     
     if (isInputImage())
@@ -1543,7 +1538,7 @@ void AccessibilityRenderObject::setElementAttributeValue(const QualifiedName& at
         return;
     
     Node* node = m_renderer->node();
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return;
     
     downcast<Element>(*node).setAttribute(attributeName, (value) ? "true" : "false");
@@ -1646,7 +1641,7 @@ void AccessibilityRenderObject::setFocused(bool on)
     Document* document = this->document();
     Node* node = this->node();
 
-    if (!on || !node || !is<Element>(node)) {
+    if (!on || !is<Element>(node)) {
         document->setFocusedElement(nullptr);
         return;
     }
@@ -1678,7 +1673,7 @@ void AccessibilityRenderObject::setSelectedRows(AccessibilityChildrenVector& sel
     
 void AccessibilityRenderObject::setValue(const String& string)
 {
-    if (!m_renderer || !m_renderer->node() || !is<Element>(m_renderer->node()))
+    if (!m_renderer || !is<Element>(m_renderer->node()))
         return;
     Element& element = downcast<Element>(*m_renderer->node());
 
@@ -1759,7 +1754,7 @@ void AccessibilityRenderObject::getDocumentLinks(AccessibilityChildrenVector& re
                 result.append(axobj);
         } else {
             Node* parent = curr->parentNode();
-            if (parent && is<HTMLAreaElement>(curr) && is<HTMLMapElement>(parent)) {
+            if (is<HTMLAreaElement>(*curr) && is<HTMLMapElement>(parent)) {
                 AccessibilityImageMapLink* areaObject = toAccessibilityImageMapLink(axObjectCache()->getOrCreate(ImageMapLinkRole));
                 HTMLMapElement& map = downcast<HTMLMapElement>(*parent);
                 areaObject->setHTMLAreaElement(downcast<HTMLAreaElement>(curr));
@@ -2158,7 +2153,7 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityImageMapHitTest(HTM
 
     AccessibilityObject* parent = nullptr;
     for (Element* mapParent = area->parentElement(); mapParent; mapParent = mapParent->parentElement()) {
-        if (is<HTMLMapElement>(mapParent)) {
+        if (is<HTMLMapElement>(*mapParent)) {
             parent = accessibilityParentForImageMap(downcast<HTMLMapElement>(mapParent));
             break;
         }
@@ -2207,11 +2202,12 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityHitTest(const IntPo
     if (!hitTestResult.innerNode())
         return nullptr;
     Node* node = hitTestResult.innerNode()->deprecatedShadowAncestorNode();
+    ASSERT(node);
 
-    if (is<HTMLAreaElement>(node))
+    if (is<HTMLAreaElement>(*node))
         return accessibilityImageMapHitTest(downcast<HTMLAreaElement>(node), point);
     
-    if (is<HTMLOptionElement>(node))
+    if (is<HTMLOptionElement>(*node))
         node = downcast<HTMLOptionElement>(*node).ownerSelectElement();
     
     RenderObject* obj = node->renderer();
@@ -2381,7 +2377,7 @@ AccessibilityObject* AccessibilityRenderObject::correspondingLabelForControlElem
         return nullptr;
 
     Node* node = m_renderer->node();
-    if (node && is<HTMLElement>(node)) {
+    if (is<HTMLElement>(node)) {
         if (HTMLLabelElement* label = labelForElement(downcast<HTMLElement>(node)))
             return axObjectCache()->getOrCreate(label);
     }
@@ -2404,7 +2400,7 @@ bool AccessibilityRenderObject::renderObjectIsObservable(RenderObject* renderer)
         return true;
 
     // Textboxes should send out notifications.
-    if (nodeHasRole(node, "textbox") || (is<Element>(node) && contentEditableAttributeIsEnabled(downcast<Element>(node))))
+    if (nodeHasRole(node, "textbox") || (is<Element>(*node) && contentEditableAttributeIsEnabled(downcast<Element>(node))))
         return true;
     
     return false;
@@ -2482,7 +2478,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (m_renderer->isText())
         return StaticTextRole;
     if (cssBox && cssBox->isImage()) {
-        if (node && is<HTMLInputElement>(node))
+        if (is<HTMLInputElement>(node))
             return ariaHasPopup() ? PopUpButtonRole : ButtonRole;
         if (isSVGImage())
             return SVGRootRole;
@@ -2501,7 +2497,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (cssBox && cssBox->isTextArea())
         return TextAreaRole;
 
-    if (node && is<HTMLInputElement>(node)) {
+    if (is<HTMLInputElement>(node)) {
         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
         if (input.isCheckbox())
             return CheckBoxRole;
@@ -2571,7 +2567,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (node && node->hasTagName(trTag))
         return RowRole;
 
-    if (node && is<HTMLTableElement>(node))
+    if (is<HTMLTableElement>(node))
         return TableRole;
 #endif
 
@@ -2585,7 +2581,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (node && node->hasTagName(pTag))
         return ParagraphRole;
 
-    if (node && is<HTMLLabelElement>(node))
+    if (is<HTMLLabelElement>(node))
         return LabelRole;
 
     if (node && node->hasTagName(dfnTag))
@@ -2594,7 +2590,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (node && node->hasTagName(divTag))
         return DivRole;
 
-    if (node && is<HTMLFormElement>(node))
+    if (is<HTMLFormElement>(node))
         return FormRole;
 
     if (node && node->hasTagName(articleTag))
@@ -2616,9 +2612,9 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
         return LandmarkContentInfoRole;
 
 #if ENABLE(VIDEO)
-    if (node && is<HTMLVideoElement>(node))
+    if (is<HTMLVideoElement>(node))
         return VideoRole;
-    if (node && is<HTMLAudioElement>(node))
+    if (is<HTMLAudioElement>(node))
         return AudioRole;
 #endif
     
@@ -2698,7 +2694,7 @@ bool AccessibilityRenderObject::inheritsPresentationalRole() const
             continue;
         
         Node* node = toAccessibilityRenderObject(parent)->node();
-        if (!node || !is<Element>(node))
+        if (!is<Element>(node))
             continue;
         
         // If native tag of the parent element matches an acceptable name, then return
@@ -2838,7 +2834,7 @@ void AccessibilityRenderObject::updateChildrenIfNecessary()
 void AccessibilityRenderObject::addTextFieldChildren()
 {
     Node* node = this->node();
-    if (!node || !is<HTMLInputElement>(node))
+    if (!is<HTMLInputElement>(node))
         return;
     
     HTMLInputElement& input = downcast<HTMLInputElement>(*node);
@@ -2883,7 +2879,7 @@ AccessibilitySVGRoot* AccessibilityRenderObject::remoteSVGRootElement() const
     Frame& frame = frameView->frame();
     
     Document* document = frame.document();
-    if (!document || !is<SVGDocument>(document))
+    if (!is<SVGDocument>(document))
         return nullptr;
     
     SVGSVGElement* rootElement = downcast<SVGDocument>(*document).rootElement();
@@ -3253,7 +3249,7 @@ void AccessibilityRenderObject::setAccessibleName(const AtomicString& name)
     else
         node = m_renderer->node();
 
-    if (node && is<Element>(node))
+    if (is<Element>(node))
         downcast<Element>(*node).setAttribute(aria_labelAttr, name);
 }
     
@@ -3271,7 +3267,7 @@ String AccessibilityRenderObject::stringValueForMSAA() const
 {
     if (isLinkable(*this)) {
         Element* anchor = anchorElement();
-        if (anchor && is<HTMLAnchorElement>(anchor))
+        if (is<HTMLAnchorElement>(anchor))
             return downcast<HTMLAnchorElement>(*anchor).href();
     }
 
@@ -3284,7 +3280,7 @@ bool AccessibilityRenderObject::isLinked() const
         return false;
 
     Element* anchor = anchorElement();
-    if (!anchor || !is<HTMLAnchorElement>(anchor))
+    if (!is<HTMLAnchorElement>(anchor))
         return false;
 
     return !downcast<HTMLAnchorElement>(*anchor).href().isEmpty();
@@ -3374,7 +3370,7 @@ String AccessibilityRenderObject::stringRoleForMSAA() const
         return String();
 
     Node* node = m_renderer->node();
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return String();
 
     Element& element = downcast<Element>(*node);
@@ -3489,11 +3485,10 @@ void AccessibilityRenderObject::scrollTo(const IntPoint& point) const
 #if ENABLE(MATHML)
 bool AccessibilityRenderObject::isMathElement() const
 {
-    Node* node = this->node();
-    if (!m_renderer || !node)
+    if (!m_renderer)
         return false;
     
-    return is<MathMLElement>(node);
+    return is<MathMLElement>(node());
 }
 
 bool AccessibilityRenderObject::isMathFraction() const
index 2c5c246..3d4e70c 100644 (file)
@@ -58,7 +58,7 @@ void AccessibilitySearchFieldCancelButton::accessibilityText(Vector<Accessibilit
 bool AccessibilitySearchFieldCancelButton::press()
 {
     Node* node = this->node();
-    if (!node || !is<Element>(node))
+    if (!is<Element>(node))
         return false;
     
     Element& element = downcast<Element>(*node);
index 828874f..d5b13e5 100644 (file)
@@ -96,7 +96,7 @@ HTMLTableElement* AccessibilityTable::tableElement() const
         return nullptr;
     
     RenderTable* table = toRenderTable(m_renderer);
-    if (table->element() && is<HTMLTableElement>(table->element()))
+    if (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 || !is<HTMLTableElement>(actualTable))
+    if (!is<HTMLTableElement>(actualTable))
         return nullptr;
     
     return downcast<HTMLTableElement>(actualTable);
@@ -218,7 +218,7 @@ bool AccessibilityTable::isDataTable() const
                 headersInFirstColumnCount++;
             
             // In this case, the developer explicitly assigned a "data" table attribute.
-            if (is<HTMLTableCellElement>(cellElement)) {
+            if (is<HTMLTableCellElement>(*cellElement)) {
                 HTMLTableCellElement& tableCellElement = downcast<HTMLTableCellElement>(*cellElement);
                 if (!tableCellElement.headers().isEmpty() || !tableCellElement.abbr().isEmpty()
                     || !tableCellElement.axis().isEmpty() || !tableCellElement.scope().isEmpty())
@@ -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 && is<HTMLTableElement>(tableNode);
+    return 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 && is<HTMLTableElement>(tableElement)) {
+    if (is<HTMLTableElement>(tableElement)) {
         if (HTMLTableCaptionElement* caption = downcast<HTMLTableElement>(*tableElement).caption())
             title = caption->innerText();
     }
index 20b1458..2d22100 100644 (file)
@@ -133,7 +133,7 @@ static void notifyChildrenSelectionChange(AccessibilityObject* object)
 
     // Only support HTML select elements so far (ARIA selectors not supported).
     Node* node = object->node();
-    if (!node || !is<HTMLSelectElement>(node))
+    if (!is<HTMLSelectElement>(node))
         return;
 
     // Emit signal from the listbox's point of view first.
index 3492b7e..025ef08 100644 (file)
@@ -244,7 +244,7 @@ static AtkObject* webkitAccessibleTableGetCaption(AtkTable* table)
     AccessibilityObject* accTable = core(table);
     if (accTable->isAccessibilityRenderObject()) {
         Node* node = accTable->node();
-        if (node && is<HTMLTableElement>(node)) {
+        if (is<HTMLTableElement>(node)) {
             HTMLTableCaptionElement* caption = downcast<HTMLTableElement>(*node).caption();
             if (caption)
                 return AccessibilityObject::firstAccessibleObjectFromNode(caption->renderer()->element())->wrapper();
index e1d2a82..cfc5025 100644 (file)
@@ -137,7 +137,7 @@ static const gchar* webkitAccessibleGetName(AtkObject* object)
 
     if (coreObject->isImage() || coreObject->isInputImage()) {
         Node* node = coreObject->node();
-        if (node && is<HTMLElement>(node)) {
+        if (is<HTMLElement>(node)) {
             // Get the attribute rather than altText String so as not to fall back on title.
             const AtomicString& alt = downcast<HTMLElement>(*node).getAttribute(HTMLNames::altAttr);
             if (!alt.isEmpty())
@@ -170,7 +170,7 @@ static const gchar* webkitAccessibleGetDescription(AtkObject* object)
     Node* node = nullptr;
     if (coreObject->isAccessibilityRenderObject())
         node = coreObject->node();
-    if (!node || !is<HTMLElement>(node) || coreObject->ariaRoleAttribute() != UnknownRole || coreObject->isImage())
+    if (!is<HTMLElement>(node) || coreObject->ariaRoleAttribute() != UnknownRole || coreObject->isImage())
         return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, accessibilityDescription(coreObject));
 
     // atk_table_get_summary returns an AtkObject. We have no summary object, so expose summary here.
@@ -506,7 +506,7 @@ static AtkAttributeSet* webkitAccessibleGetAttributes(AtkObject* object)
     // cannot be done from the UIProcess. Assistive technologies have no need
     // for this information.
     Node* node = coreObject->node();
-    if (node && is<Element>(node)) {
+    if (is<Element>(node)) {
         String id = downcast<Element>(*node).getIdAttribute().string();
         if (!id.isEmpty())
             attributeSet = addToAtkAttributeSet(attributeSet, "html-id", id.utf8().data());
index 08c5f02..80cc6d6 100644 (file)
@@ -84,7 +84,7 @@ WebKitDOMNode* wrap(Node* node)
 
     switch (node->nodeType()) {
     case Node::ELEMENT_NODE:
-        if (is<HTMLElement>(node))
+        if (is<HTMLElement>(*node))
             return WEBKIT_DOM_NODE(wrap(downcast<HTMLElement>(node)));
         return WEBKIT_DOM_NODE(wrapElement(downcast<Element>(node)));
     case Node::ATTRIBUTE_NODE:
@@ -100,7 +100,7 @@ WebKitDOMNode* wrap(Node* node)
     case Node::COMMENT_NODE:
         return WEBKIT_DOM_NODE(wrapComment(static_cast<Comment*>(node)));
     case Node::DOCUMENT_NODE:
-        if (is<HTMLDocument>(node))
+        if (is<HTMLDocument>(*node))
             return WEBKIT_DOM_NODE(wrapHTMLDocument(downcast<HTMLDocument>(node)));
         return WEBKIT_DOM_NODE(wrapDocument(downcast<Document>(node)));
     case Node::DOCUMENT_TYPE_NODE:
index 5c8412a..1a75d93 100644 (file)
@@ -53,7 +53,7 @@ EncodedJSValue JSC_HOST_CALL constructJSAudioContext(ExecState* exec)
     if (!scriptExecutionContext)
         return throwVMError(exec, createReferenceError(exec, "AudioContext constructor script execution context is unavailable"));
         
-    if (!is<Document>(scriptExecutionContext))
+    if (!is<Document>(*scriptExecutionContext))
         return throwVMError(exec, createReferenceError(exec, "AudioContext constructor called in a script execution context which is not a document"));
 
     Document& document = downcast<Document>(*scriptExecutionContext);
index d4edd69..d2b30e4 100644 (file)
@@ -105,10 +105,10 @@ JSDOMGlobalObject* toJSDOMGlobalObject(Document* document, JSC::ExecState* exec)
 
 JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext* scriptExecutionContext, JSC::ExecState* exec)
 {
-    if (is<Document>(scriptExecutionContext))
+    if (is<Document>(*scriptExecutionContext))
         return toJSDOMGlobalObject(downcast<Document>(scriptExecutionContext), exec);
 
-    if (is<WorkerGlobalScope>(scriptExecutionContext))
+    if (is<WorkerGlobalScope>(*scriptExecutionContext))
         return downcast<WorkerGlobalScope>(*scriptExecutionContext).script()->workerGlobalScopeWrapper();
 
     ASSERT_NOT_REACHED();
@@ -122,10 +122,10 @@ JSDOMGlobalObject* toJSDOMGlobalObject(Document* document, DOMWrapperWorld& worl
 
 JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext* scriptExecutionContext, DOMWrapperWorld& world)
 {
-    if (is<Document>(scriptExecutionContext))
+    if (is<Document>(*scriptExecutionContext))
         return toJSDOMGlobalObject(downcast<Document>(scriptExecutionContext), world);
 
-    if (is<WorkerGlobalScope>(scriptExecutionContext))
+    if (is<WorkerGlobalScope>(*scriptExecutionContext))
         return downcast<WorkerGlobalScope>(*scriptExecutionContext).script()->workerGlobalScopeWrapper();
 
     ASSERT_NOT_REACHED();
index 63958cc..ca89101 100644 (file)
@@ -79,7 +79,6 @@ static EncodedJSValue namedItemGetter(ExecState* exec, JSObject* slotBase, Encod
     Document* document = thisObj->impl().frame()->document();
 
     ASSERT(BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObj->impl()));
-    ASSERT(document);
     ASSERT(is<HTMLDocument>(document));
 
     AtomicStringImpl* atomicPropertyName = propertyName.publicName();
@@ -244,7 +243,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
 
     // Allow shortcuts like 'Image1' instead of document.images.Image1
     Document* document = thisObject->impl().frame()->document();
-    if (is<HTMLDocument>(document)) {
+    if (is<HTMLDocument>(*document)) {
         AtomicStringImpl* atomicPropertyName = propertyName.publicName();
         if (atomicPropertyName && downcast<HTMLDocument>(*document).hasWindowNamedItem(*atomicPropertyName)) {
             slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, namedItemGetter);
@@ -321,7 +320,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
 
     // Allow shortcuts like 'Image1' instead of document.images.Image1
     Document* document = thisObject->impl().frame()->document();
-    if (is<HTMLDocument>(document)) {
+    if (is<HTMLDocument>(*document)) {
         AtomicStringImpl* atomicPropertyName = propertyName.publicName();
         if (atomicPropertyName && downcast<HTMLDocument>(*document).hasWindowNamedItem(*atomicPropertyName)) {
             slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, namedItemGetter);
index ed85719..b4e5ab6 100644 (file)
@@ -56,9 +56,9 @@ JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Element* e
     ASSERT(!getCachedWrapper(globalObject->world(), element));
 
     JSDOMWrapper* wrapper;        
-    if (is<HTMLElement>(element))
+    if (is<HTMLElement>(*element))
         wrapper = createJSHTMLWrapper(globalObject, downcast<HTMLElement>(element));
-    else if (is<SVGElement>(element))
+    else if (is<SVGElement>(*element))
         wrapper = createJSSVGWrapper(globalObject, downcast<SVGElement>(element));
     else
         wrapper = CREATE_DOM_WRAPPER(globalObject, Element, element);
index 54be24b..c2ec578 100644 (file)
@@ -59,7 +59,7 @@ JSErrorHandler::~JSErrorHandler()
 void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
 {
 
-    if (!is<ErrorEvent>(event))
+    if (!is<ErrorEvent>(*event))
         return JSEventListener::handleEvent(scriptExecutionContext, event);
 
     ASSERT(scriptExecutionContext);
index 4ac5e19..e9c9c6e 100644 (file)
@@ -131,7 +131,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
 
         globalObject->setCurrentEvent(savedEvent);
 
-        if (is<WorkerGlobalScope>(scriptExecutionContext)) {
+        if (is<WorkerGlobalScope>(*scriptExecutionContext)) {
             bool terminatorCausedException = (exec->hadException() && isTerminatedExecutionException(exec->exception()));
             if (terminatorCausedException || (vm.watchdog && vm.watchdog->didFire()))
                 downcast<WorkerGlobalScope>(*scriptExecutionContext).script()->forbidExecution();
@@ -141,7 +141,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
             event->target()->uncaughtExceptionInEventHandler();
             reportException(exec, exception);
         } else {
-            if (!retval.isUndefinedOrNull() && is<BeforeUnloadEvent>(event))
+            if (!retval.isUndefinedOrNull() && is<BeforeUnloadEvent>(*event))
                 downcast<BeforeUnloadEvent>(*event).setReturnValue(retval.toString(exec)->value(exec));
             if (m_isAttribute) {
                 if (retval.isFalse())
index 5221e1d..9b1b576 100644 (file)
@@ -73,7 +73,7 @@ EncodedJSValue JSHTMLDocument::nameGetter(ExecState* exec, JSObject* slotBase, E
     }
 
     Element* element = document.documentNamedItem(*atomicPropertyName);
-    if (UNLIKELY(is<HTMLIFrameElement>(element))) {
+    if (UNLIKELY(is<HTMLIFrameElement>(*element))) {
         if (Frame* frame = downcast<HTMLIFrameElement>(*element).contentFrame())
             return JSValue::encode(toJS(exec, frame));
     }
index b2cc276..6dde510 100644 (file)
@@ -72,7 +72,6 @@ JSLazyEventListener::~JSLazyEventListener()
 
 JSObject* JSLazyEventListener::initializeJSFunction(ScriptExecutionContext* executionContext) const
 {
-    ASSERT(executionContext);
     ASSERT(is<Document>(executionContext));
     if (!executionContext)
         return nullptr;
index d6c3c9d..d4793ab 100644 (file)
@@ -97,7 +97,7 @@ static inline bool isObservable(JSNode* jsNode, Node* node)
 static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, SlotVisitor& visitor)
 {
     if (!node->inDocument()) {
-        if (is<Element>(node)) {
+        if (is<Element>(*node)) {
             auto& element = downcast<Element>(*node);
 
             // If a wrapper is the last reference to an image element
@@ -192,9 +192,9 @@ static ALWAYS_INLINE JSValue createWrapperInline(ExecState* exec, JSDOMGlobalObj
     JSDOMWrapper* wrapper;    
     switch (node->nodeType()) {
         case Node::ELEMENT_NODE:
-            if (is<HTMLElement>(node))
+            if (is<HTMLElement>(*node))
                 wrapper = createJSHTMLWrapper(globalObject, downcast<HTMLElement>(node));
-            else if (is<SVGElement>(node))
+            else if (is<SVGElement>(*node))
                 wrapper = createJSSVGWrapper(globalObject, downcast<SVGElement>(node));
             else
                 wrapper = CREATE_DOM_WRAPPER(globalObject, Element, node);
index a1b51aa..aba2cd3 100644 (file)
@@ -74,7 +74,7 @@ ScheduledAction::ScheduledAction(ExecState* exec, JSValue function, DOMWrapperWo
 
 void ScheduledAction::execute(ScriptExecutionContext* context)
 {
-    if (is<Document>(context))
+    if (is<Document>(*context))
         execute(downcast<Document>(context));
     else
         execute(downcast<WorkerGlobalScope>(context));
index 376cd25..732c7cc 100644 (file)
@@ -58,7 +58,7 @@ DOMWindow* domWindowFromExecState(JSC::ExecState* scriptState)
 Frame* frameFromExecState(JSC::ExecState* scriptState)
 {
     ScriptExecutionContext* context = scriptExecutionContextFromExecState(scriptState);
-    Document* document = context && is<Document>(context) ? downcast<Document>(context) : nullptr;
+    Document* document = is<Document>(context) ? downcast<Document>(context) : nullptr;
     return document ? document->frame() : nullptr;
 }
 
index d504a74..3372594 100644 (file)
@@ -301,7 +301,7 @@ Class kitClass(WebCore::Node* impl)
 {
     switch (impl->nodeType()) {
         case WebCore::Node::ELEMENT_NODE:
-            if (is<HTMLElement>(impl))
+            if (is<HTMLElement>(*impl))
                 return WebCore::elementClass(downcast<HTMLElement>(*impl).tagQName(), [DOMHTMLElement class]);
             return [DOMElement class];
         case WebCore::Node::ATTRIBUTE_NODE:
index 586b8fd..f58c920 100644 (file)
@@ -47,7 +47,7 @@ namespace WebCore {
 static inline SVGCursorElement* resourceReferencedByCursorElement(const String& url, Document& document)
 {
     Element* element = SVGURIReference::targetElementFromIRIString(url, document);
-    if (element && is<SVGCursorElement>(element))
+    if (is<SVGCursorElement>(element))
         return downcast<SVGCursorElement>(element);
 
     return nullptr;
index aad6e58..bd4a3ff 100644 (file)
@@ -68,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()
-        || is<HTMLLinkElement>(parentNode)
-        || is<HTMLStyleElement>(parentNode)
-        || is<SVGStyleElement>(parentNode)
+        || is<HTMLLinkElement>(*parentNode)
+        || is<HTMLStyleElement>(*parentNode)
+        || is<SVGStyleElement>(*parentNode)
         || parentNode->nodeType() == Node::PROCESSING_INSTRUCTION_NODE;
 }
 #endif
index 5387d4f..de7ac80 100644 (file)
@@ -556,11 +556,11 @@ bool SelectorChecker::checkOne(const CheckingContextWithStatus& context) const
             {
                 bool result = true;
                 for (Node* node = element->firstChild(); node; node = node->nextSibling()) {
-                    if (node->isElementNode()) {
+                    if (is<Element>(*node)) {
                         result = false;
                         break;
                     }
-                    if (is<Text>(node)) {
+                    if (is<Text>(*node)) {
                         Text& textNode = downcast<Text>(*node);
                         if (!textNode.data().isEmpty()) {
                             result = false;
index 6f418c3..afdad99 100644 (file)
@@ -42,7 +42,7 @@ namespace WebCore {
 
 ALWAYS_INLINE bool isAutofilled(const Element* element)
 {
-    if (is<HTMLFormControlElement>(element)) {
+    if (is<HTMLFormControlElement>(*element)) {
         if (const HTMLInputElement* inputElement = element->toInputElement())
             return inputElement->isAutofilled();
     }
@@ -56,13 +56,13 @@ ALWAYS_INLINE bool isDefaultButtonForForm(const Element* element)
 
 ALWAYS_INLINE bool isDisabled(const Element* element)
 {
-    return (is<HTMLFormControlElement>(element) || is<HTMLOptionElement>(element) || is<HTMLOptGroupElement>(element))
+    return (is<HTMLFormControlElement>(*element) || is<HTMLOptionElement>(*element) || is<HTMLOptGroupElement>(*element))
         && element->isDisabledFormControl();
 }
 
 ALWAYS_INLINE bool isEnabled(const Element* element)
 {
-    return (is<HTMLFormControlElement>(element) || is<HTMLOptionElement>(element) || is<HTMLOptGroupElement>(element))
+    return (is<HTMLFormControlElement>(*element) || is<HTMLOptionElement>(*element) || is<HTMLOptGroupElement>(*element))
         && !element->isDisabledFormControl();
 }
 
@@ -79,7 +79,7 @@ ALWAYS_INLINE bool isChecked(Element* element)
     const HTMLInputElement* inputElement = element->toInputElement();
     if (inputElement && inputElement->shouldAppearChecked() && !inputElement->shouldAppearIndeterminate())
         return true;
-    if (is<HTMLOptionElement>(element) && downcast<HTMLOptionElement>(*element).selected())
+    if (is<HTMLOptionElement>(*element) && downcast<HTMLOptionElement>(*element).selected())
         return true;
     return false;
 }
@@ -127,7 +127,7 @@ inline bool matchesLangPseudoClass(const Element* element, AtomicStringImpl* fil
 {
     AtomicString value;
 #if ENABLE(VIDEO_TRACK)
-    if (is<WebVTTElement>(element))
+    if (is<WebVTTElement>(*element))
         value = downcast<WebVTTElement>(*element).language();
     else
 #endif
@@ -304,12 +304,12 @@ ALWAYS_INLINE bool matchesFullScreenDocumentPseudoClass(const Element* element)
 #if ENABLE(VIDEO_TRACK)
 ALWAYS_INLINE bool matchesFutureCuePseudoClass(const Element* element)
 {
-    return is<WebVTTElement>(element) && !downcast<WebVTTElement>(*element).isPastNode();
+    return is<WebVTTElement>(*element) && !downcast<WebVTTElement>(*element).isPastNode();
 }
 
 ALWAYS_INLINE bool matchesPastCuePseudoClass(const Element* element)
 {
-    return is<WebVTTElement>(element) && downcast<WebVTTElement>(*element).isPastNode();
+    return is<WebVTTElement>(*element) && downcast<WebVTTElement>(*element).isPastNode();
 }
 #endif
 
index 078a5ca..2f2dfc6 100644 (file)
@@ -388,7 +388,7 @@ inline void StyleResolver::State::updateConversionData()
 inline void StyleResolver::State::initElement(Element* element)
 {
     m_element = element;
-    m_styledElement = element && is<StyledElement>(element) ? downcast<StyledElement>(element) : nullptr;
+    m_styledElement = element && is<StyledElement>(*element) ? downcast<StyledElement>(element) : nullptr;
     m_elementLinkState = element ? element->document().visitedLinkState().determineLinkState(*element) : NotInsideLink;
     updateConversionData();
 }
@@ -445,12 +445,12 @@ Node* StyleResolver::locateCousinList(Element* parent, unsigned& visitedNodeCoun
 {
     if (visitedNodeCount >= cStyleSearchThreshold * cStyleSearchLevelThreshold)
         return nullptr;
-    if (!parent || !is<StyledElement>(parent))
+    if (!is<StyledElement>(parent))
         return nullptr;
     StyledElement* styledParent = downcast<StyledElement>(parent);
     if (styledParent->inlineStyle())
         return nullptr;
-    if (is<SVGElement>(styledParent) && downcast<SVGElement>(*styledParent).animatedSMILStyleProperties())
+    if (is<SVGElement>(*styledParent) && downcast<SVGElement>(*styledParent).animatedSMILStyleProperties())
         return nullptr;
     if (styledParent->hasID() && m_ruleSets.features().idsInRules.contains(styledParent->idForStyleResolution().impl()))
         return nullptr;
@@ -467,7 +467,7 @@ Node* StyleResolver::locateCousinList(Element* parent, unsigned& visitedNodeCoun
         while (currentNode) {
             ++subcount;
             if (currentNode->renderStyle() == parentStyle && currentNode->lastChild()
-                && is<Element>(currentNode) && !parentElementPreventsSharing(downcast<Element>(currentNode))
+                && is<Element>(*currentNode) && !parentElementPreventsSharing(downcast<Element>(currentNode))
                 ) {
                 // Adjust for unused reserved tries.
                 visitedNodeCount -= cStyleSearchThreshold - subcount;
@@ -546,7 +546,7 @@ bool StyleResolver::canShareStyleWithControl(StyledElement* element) const
 static inline bool elementHasDirectionAuto(Element* element)
 {
     // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionAuto into StyleResolver.
-    return is<HTMLElement>(element) && downcast<HTMLElement>(*element).hasDirectionAuto();
+    return is<HTMLElement>(*element) && downcast<HTMLElement>(*element).hasDirectionAuto();
 }
 
 bool StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes(StyledElement* sharingCandidate) const
@@ -626,9 +626,9 @@ bool StyleResolver::canShareStyleWithElement(StyledElement* element) const
     if (element->hasID() && m_ruleSets.features().idsInRules.contains(element->idForStyleResolution().impl()))
         return false;
 
-    bool isControl = is<HTMLFormControlElement>(element);
+    bool isControl = is<HTMLFormControlElement>(*element);
 
-    if (isControl != is<HTMLFormControlElement>(state.element()))
+    if (isControl != is<HTMLFormControlElement>(*state.element()))
         return false;
 
     if (isControl && !canShareStyleWithControl(element))
@@ -650,7 +650,7 @@ bool StyleResolver::canShareStyleWithElement(StyledElement* element) const
 
 #if ENABLE(VIDEO_TRACK)
     // Deny sharing styles between WebVTT and non-WebVTT nodes.
-    if (is<WebVTTElement>(state.element()))
+    if (is<WebVTTElement>(*state.element()))
         return false;
 #endif
 
@@ -664,7 +664,7 @@ bool StyleResolver::canShareStyleWithElement(StyledElement* element) const
 inline StyledElement* StyleResolver::findSiblingForStyleSharing(Node* node, unsigned& count) const
 {
     for (; node; node = node->previousSibling()) {
-        if (!is<StyledElement>(node))
+        if (!is<StyledElement>(*node))
             continue;
         if (canShareStyleWithElement(downcast<StyledElement>(node)))
             break;
@@ -1167,7 +1167,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par
             if (e->hasTagName(tdTag)) {
                 style.setDisplay(TABLE_CELL);
                 style.setFloating(NoFloat);
-            } else if (is<HTMLTableElement>(e))
+            } else if (is<HTMLTableElement>(*e))
                 style.setDisplay(style.isDisplayInlineType() ? INLINE_TABLE : TABLE);
         }
 
@@ -1184,7 +1184,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 && is<HTMLTableElement>(e) && (style.textAlign() == WEBKIT_LEFT || style.textAlign() == WEBKIT_CENTER || style.textAlign() == WEBKIT_RIGHT))
+        if (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
@@ -1267,7 +1267,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par
         style.setZIndex(0);
 
     // Textarea considers overflow visible as auto.
-    if (e && is<HTMLTextAreaElement>(e)) {
+    if (is<HTMLTextAreaElement>(e)) {
         style.setOverflowX(style.overflowX() == OVISIBLE ? OAUTO : style.overflowX());
         style.setOverflowY(style.overflowY() == OVISIBLE ? OAUTO : style.overflowY());
     }
@@ -1332,10 +1332,10 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par
 
     // Important: Intrinsic margins get added to controls before the theme has adjusted the style, since the theme will
     // alter fonts and heights/widths.
-    if (e && is<HTMLFormControlElement>(e) && style.fontSize() >= 11) {
+    if (is<HTMLFormControlElement>(e) && style.fontSize() >= 11) {
         // Don't apply intrinsic margins to image buttons. The designer knows how big the images are,
         // so we have to treat all image buttons as though they were explicitly sized.
-        if (!is<HTMLInputElement>(e) || !downcast<HTMLInputElement>(*e).isImageButton())
+        if (!is<HTMLInputElement>(*e) || !downcast<HTMLInputElement>(*e).isImageButton())
             addIntrinsicMargins(style);
     }
 
@@ -1880,7 +1880,7 @@ bool StyleResolver::useSVGZoomRules()
 // Scale with/height properties on inline SVG root.
 bool StyleResolver::useSVGZoomRulesForLength()
 {
-    return m_state.element() && m_state.element()->isSVGElement() && !(is<SVGSVGElement>(m_state.element()) && m_state.element()->parentNode());
+    return is<SVGElement>(m_state.element()) && !(is<SVGSVGElement>(*m_state.element()) && m_state.element()->parentNode());
 }
 
 #if ENABLE(CSS_GRID_LAYOUT)
index e9016d9..c2b9f42 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 && is<HTMLStyleElement>(element))
+    if (is<HTMLStyleElement>(element))
         return downcast<HTMLStyleElement>(element);
     return nullptr;
 }
index 172fcc7..71da9c6 100644 (file)
@@ -188,7 +188,7 @@ bool Attr::isId() const
 CSSStyleDeclaration* Attr::style()
 {
     // This function only exists to support the Obj-C bindings.
-    if (!m_element || !is<StyledElement>(m_element))
+    if (!is<StyledElement>(m_element))
         return nullptr;
     m_style = MutableStyleProperties::create();
     downcast<StyledElement>(*m_element).collectStyleForPresentationAttribute(qualifiedName(), value(), *m_style);
index 31a5943..7170008 100644 (file)
@@ -87,8 +87,8 @@ unsigned CharacterData::parserAppendData(const String& string, unsigned offset,
     else
         m_data.append(string.characters16() + offset, characterLengthLimit);
 
-    ASSERT(!renderer() || is<Text>(this));
-    if (is<Text>(this))
+    ASSERT(!renderer() || is<Text>(*this));
+    if (is<Text>(*this))
         Style::updateTextRendererAfterContentChange(downcast<Text>(*this), oldLength, 0);
 
     document().incDOMTreeVersion();
@@ -194,11 +194,11 @@ void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfRep
     String oldData = m_data;
     m_data = newData;
 
-    ASSERT(!renderer() || is<Text>(this));
-    if (is<Text>(this))
+    ASSERT(!renderer() || is<Text>(*this));
+    if (is<Text>(*this))
         Style::updateTextRendererAfterContentChange(downcast<Text>(*this), offsetOfReplacedData, oldLength);
 
-    if (is<ProcessingInstruction>(this))
+    if (is<ProcessingInstruction>(*this))
         downcast<ProcessingInstruction>(*this).checkStyleSheet();
 
     if (document().frame())
index 10a23a5..8a4f3ab 100644 (file)
@@ -202,7 +202,7 @@ static inline ExceptionCode checkAcceptChild(ContainerNode* newParent, Node* new
     if (containsConsideringHostElements(newChild, newParent))
         return HIERARCHY_REQUEST_ERR;
 
-    if (oldChild && is<Document>(newParent)) {
+    if (oldChild && is<Document>(*newParent)) {
         if (!downcast<Document>(*newParent).canReplaceChild(newChild, oldChild))
             return HIERARCHY_REQUEST_ERR;
     } else if (!isChildTypeAllowed(newParent, newChild))
@@ -348,8 +348,8 @@ void ContainerNode::notifyChildRemoved(Node& child, Node* previousSibling, Node*
 {
     ChildChange change;
     change.type = is<Element>(child) ? ElementRemoved : is<Text>(child) ? TextRemoved : NonContentsChildChanged;
-    change.previousSiblingElement = (!previousSibling || is<Element>(previousSibling)) ? downcast<Element>(previousSibling) : ElementTraversal::previousSibling(previousSibling);
-    change.nextSiblingElement = (!nextSibling || is<Element>(nextSibling)) ? downcast<Element>(nextSibling) : ElementTraversal::nextSibling(nextSibling);
+    change.previousSiblingElement = (!previousSibling || is<Element>(*previousSibling)) ? downcast<Element>(previousSibling) : ElementTraversal::previousSibling(previousSibling);
+    change.nextSiblingElement = (!nextSibling || is<Element>(*nextSibling)) ? downcast<Element>(nextSibling) : ElementTraversal::nextSibling(nextSibling);
     change.source = source;
 
     childrenChanged(change);
index 031d3cd..37c9467 100644 (file)
@@ -52,7 +52,7 @@ void ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument(ContainerN
 void ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree(ContainerNode& node)
 {
     for (Node* child = node.firstChild(); child; child = child->nextSibling()) {
-        if (is<ContainerNode>(child))
+        if (is<ContainerNode>(*child))
             notifyNodeInsertedIntoTree(downcast<ContainerNode>(*child));
     }
 
@@ -86,7 +86,7 @@ void ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument(ContainerNode
 void ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree(ContainerNode& node)
 {
     for (Node* child = node.firstChild(); child; child = child->nextSibling()) {
-        if (is<ContainerNode>(child))
+        if (is<ContainerNode>(*child))
             notifyNodeRemovedFromTree(downcast<ContainerNode>(*child));
     }
 
index bd7de07..a3cf8f4 100644 (file)
@@ -39,7 +39,7 @@ class CurrentScriptIncrementer {
 public:
     CurrentScriptIncrementer(Document* document, Element* element)
         : m_document(document)
-        , m_isHTMLScriptElement(is<HTMLScriptElement>(element))
+        , m_isHTMLScriptElement(is<HTMLScriptElement>(*element))
     {
         if (m_isHTMLScriptElement)
             m_document->pushCurrentScript(downcast<HTMLScriptElement>(element));
index c783959..fe21aff 100644 (file)
@@ -254,7 +254,7 @@ void DataTransfer::setDragImage(Element* element, int x, int y)
         return;
 
     CachedImage* image = nullptr;
-    if (element && is<HTMLImageElement>(element) && !element->inDocument())
+    if (is<HTMLImageElement>(element) && !element->inDocument())
         image = downcast<HTMLImageElement>(*element).cachedImage();
 
     m_dragLocation = IntPoint(x, y);
index eacb07a..e39fc3a 100644 (file)
@@ -1415,7 +1415,7 @@ Element* Document::elementFromPoint(const LayoutPoint& clientPoint)
         return nullptr;
 
     Node* node = nodeFromPoint(clientPoint);
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = node->parentNode();
 
     if (node)
@@ -1552,7 +1552,7 @@ void Document::setTitle(const String& title)
     // The DOM API has no method of specifying direction, so assume LTR.
     updateTitle(StringWithDirection(title, LTR));
 
-    if (m_titleElement && is<HTMLTitleElement>(*m_titleElement))
+    if (is<HTMLTitleElement>(m_titleElement.get()))
         downcast<HTMLTitleElement>(*m_titleElement).setText(title);
 }
 
@@ -4663,7 +4663,7 @@ const Vector<IconURL>& Document::iconURLs(int iconTypesMask)
     unsigned int length = children->length();
     for (unsigned int i = 0; i < length; ++i) {
         Node* child = children->item(i);
-        if (!is<HTMLLinkElement>(child))
+        if (!is<HTMLLinkElement>(*child))
             continue;
         HTMLLinkElement& linkElement = downcast<HTMLLinkElement>(*child);
         if (!(linkElement.iconType() & iconTypesMask))
@@ -5918,9 +5918,9 @@ Element* eventTargetElementForDocument(Document* document)
     if (!document)
         return nullptr;
     Element* element = document->focusedElement();
-    if (!element && is<PluginDocument>(document))
+    if (!element && is<PluginDocument>(*document))
         element = downcast<PluginDocument>(*document).pluginElement();
-    if (!element && is<HTMLDocument>(document))
+    if (!element && is<HTMLDocument>(*document))
         element = document->body();
     if (!element)
         element = document->documentElement();
@@ -6084,7 +6084,7 @@ void Document::updateHoverActiveState(const HitTestRequest& request, Element* in
                 elementsToRemoveFromChain.append(element);
         }
         // Unset hovered nodes in sub frame documents if the old hovered node was a frame owner.
-        if (oldHoveredElement && is<HTMLFrameOwnerElement>(*oldHoveredElement)) {
+        if (is<HTMLFrameOwnerElement>(oldHoveredElement.get())) {
             if (Document* contentDocument = downcast<HTMLFrameOwnerElement>(*oldHoveredElement).contentDocument())
                 contentDocument->updateHoverActiveState(request, nullptr);
         }
index cda6c07..7a6dfb9 100644 (file)
@@ -266,7 +266,7 @@ void DocumentStyleSheetCollection::collectActiveStyleSheets(Vector<RefPtr<StyleS
 
     for (auto& node : m_styleSheetCandidateNodes) {
         StyleSheet* sheet = nullptr;
-        if (is<ProcessingInstruction>(node)) {
+        if (is<ProcessingInstruction>(*node)) {
             // Processing instruction (XML documents only).
             // We don't support linking to embedded CSS stylesheets, see <https://bugs.webkit.org/show_bug.cgi?id=49281> for discussion.
             ProcessingInstruction& pi = downcast<ProcessingInstruction>(*node);
index e9cbe07..c6e1fff 100644 (file)
@@ -2195,12 +2195,12 @@ AtomicString Element::computeInheritedLanguage() const
     // The language property is inherited, so we iterate over the parents to find the first language.
     const Node* currentNode = this;
     while ((currentNode = currentNode->parentNode())) {
-        if (is<Element>(currentNode)) {
+        if (is<Element>(*currentNode)) {
             if (const ElementData* elementData = downcast<Element>(*currentNode).elementData()) {
                 if (const Attribute* attribute = elementData->findLanguageAttribute())
                     return attribute->value();
             }
-        } else if (is<Document>(currentNode)) {
+        } else if (is<Document>(*currentNode)) {
             // checking the MIME content-language
             return downcast<Document>(*currentNode).contentLanguage();
         }
index 00f2bcb..9162394 100644 (file)
@@ -679,7 +679,7 @@ inline NamedNodeMap* Node::attributes() const
 inline Element* Node::parentElement() const
 {
     ContainerNode* parent = parentNode();
-    return parent && is<Element>(parent) ? downcast<Element>(parent) : nullptr;
+    return is<Element>(parent) ? downcast<Element>(parent) : nullptr;
 }
 
 inline bool Element::fastHasAttribute(const QualifiedName& name) const
index 02ffd33..c5c9994 100644 (file)
@@ -95,7 +95,7 @@ template <typename CurrentType>
 inline Element* Traversal<Element>::nextTemplate(CurrentType* current)
 {
     Node* node = NodeTraversal::next(current);
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = NodeTraversal::nextSkippingChildren(node);
     return downcast<Element>(node);
 }
@@ -105,7 +105,7 @@ template <typename CurrentType>
 inline Element* Traversal<Element>::nextTemplate(CurrentType* current, const Node* stayWithin)
 {
     Node* node = NodeTraversal::next(current, stayWithin);
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = NodeTraversal::nextSkippingChildren(node, stayWithin);
     return downcast<Element>(node);
 }
@@ -258,7 +258,7 @@ inline ElementType* Traversal<ElementType>::next(const Node* current, const Node
 inline Element* ElementTraversal::previousIncludingPseudo(const Node* current, const Node* stayWithin)
 {
     Node* node = NodeTraversal::previousIncludingPseudo(current, stayWithin);
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = NodeTraversal::previousIncludingPseudo(node, stayWithin);
     return downcast<Element>(node);
 }
@@ -266,7 +266,7 @@ inline Element* ElementTraversal::previousIncludingPseudo(const Node* current, c
 inline Element* ElementTraversal::nextIncludingPseudo(const Node* current, const Node* stayWithin)
 {
     Node* node = NodeTraversal::nextIncludingPseudo(current, stayWithin);
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = NodeTraversal::nextIncludingPseudo(node, stayWithin);
     return downcast<Element>(node);
 }
@@ -274,7 +274,7 @@ inline Element* ElementTraversal::nextIncludingPseudo(const Node* current, const
 inline Element* ElementTraversal::nextIncludingPseudoSkippingChildren(const Node* current, const Node* stayWithin)
 {
     Node* node = NodeTraversal::nextIncludingPseudoSkippingChildren(current, stayWithin);
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = NodeTraversal::nextIncludingPseudoSkippingChildren(node, stayWithin);
     return downcast<Element>(node);
 }
@@ -282,7 +282,7 @@ inline Element* ElementTraversal::nextIncludingPseudoSkippingChildren(const Node
 inline Element* ElementTraversal::pseudoAwarePreviousSibling(const Node* current)
 {
     Node* node = current->pseudoAwarePreviousSibling();
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = node->pseudoAwarePreviousSibling();
     return downcast<Element>(node);
 }
index f7798d3..d8ee19f 100644 (file)
@@ -60,7 +60,7 @@ private:
 WindowEventContext::WindowEventContext(PassRefPtr<Node> node, const EventContext* topEventContext)
 {
     Node* topLevelContainer = topEventContext ? topEventContext->node() : node.get();
-    if (!is<Document>(topLevelContainer))
+    if (!is<Document>(*topLevelContainer))
         return;
 
     m_window = downcast<Document>(*topLevelContainer).domWindow();
@@ -356,7 +356,7 @@ bool EventDispatcher::dispatchEvent(Node* origin, PassRefPtr<Event> prpEvent)
     WindowEventContext windowEventContext(node.get(), eventPath.lastContextIfExists());
 
     InputElementClickState clickHandlingState;
-    if (is<HTMLInputElement>(node.get()))
+    if (is<HTMLInputElement>(*node))
         downcast<HTMLInputElement>(*node).willDispatchEvent(*event, clickHandlingState);
 
     if (!event->propagationStopped() && !eventPath.isEmpty())
@@ -418,7 +418,7 @@ static inline bool shouldEventCrossShadowBoundary(Event& event, ShadowRoot& shad
 
 static Node* nodeOrHostIfPseudoElement(Node* node)
 {
-    return is<PseudoElement>(node) ? downcast<PseudoElement>(*node).hostElement() : node;
+    return is<PseudoElement>(*node) ? downcast<PseudoElement>(*node).hostElement() : node;
 }
 
 EventPath::EventPath(Node& targetNode, Event& event)
@@ -447,7 +447,7 @@ EventPath::EventPath(Node& targetNode, Event& event)
                 m_path.append(std::make_unique<EventContext>(node, &currentTarget, target));
             if (!inDocument)
                 return;
-            if (is<ShadowRoot>(node))
+            if (is<ShadowRoot>(*node))
                 break;
         }
         if (!node || !shouldEventCrossShadowBoundary(event, downcast<ShadowRoot>(*node), *target))
index 4837d86..989f502 100644 (file)
@@ -223,7 +223,7 @@ void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
     ScriptExecutionContext* context = scriptExecutionContext();
     Document* document = nullptr;
     InspectorInstrumentationCookie willDispatchEventCookie;
-    if (context && is<Document>(context)) {
+    if (is<Document>(context)) {
         document = downcast<Document>(context);
         willDispatchEventCookie = InspectorInstrumentation::willDispatchEvent(document, *event, size > 0);
     }
index b403140..64ceba2 100644 (file)
@@ -220,7 +220,7 @@ int KeyboardEvent::which() const
 KeyboardEvent* findKeyboardEvent(Event* event)
 {
     for (Event* e = event; e; e = e->underlyingEvent())
-        if (is<KeyboardEvent>(e))
+        if (is<KeyboardEvent>(*e))
             return downcast<KeyboardEvent>(e);
     return nullptr;
 }
index ee20e11..4bbafdf 100644 (file)
@@ -68,7 +68,7 @@ Node* LiveNodeList::namedItem(const AtomicString& elementId) const
     unsigned length = this->length();
     for (unsigned i = 0; i < length; i++) {
         Node* node = item(i);
-        if (!is<Element>(node))
+        if (!is<Element>(*node))
             continue;
         Element& element = downcast<Element>(*node);
         // FIXME: This should probably be using getIdAttribute instead of idForStyleResolution.
index 58beb7f..f88ae77 100644 (file)
@@ -157,7 +157,7 @@ void MessagePort::dispatchMessages()
     while (m_entangledChannel && m_entangledChannel->tryGetMessageFromRemote(message, channels)) {
 
         // close() in Worker onmessage handler should prevent next message from dispatching.
-        if (is<WorkerGlobalScope>(m_scriptExecutionContext) && downcast<WorkerGlobalScope>(*m_scriptExecutionContext).isClosing())
+        if (is<WorkerGlobalScope>(*m_scriptExecutionContext) && downcast<WorkerGlobalScope>(*m_scriptExecutionContext).isClosing())
             return;
 
         std::unique_ptr<MessagePortArray> ports = MessagePort::entanglePorts(*m_scriptExecutionContext, WTF::move(channels));
index 58d3d60..df94388 100644 (file)
@@ -276,7 +276,7 @@ SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP
     }
     setUnderlyingEvent(underlyingEvent);
 
-    if (this->underlyingEvent() && is<MouseEvent>(this->underlyingEvent())) {
+    if (is<MouseEvent>(this->underlyingEvent())) {
         MouseEvent& mouseEvent = downcast<MouseEvent>(*this->underlyingEvent());
         m_screenLocation = mouseEvent.screenLocation();
         initCoordinates(mouseEvent.clientLocation());
index aaea0ba..714ba17 100644 (file)
@@ -86,7 +86,7 @@ PassRefPtr<Node> NamedNodeMap::setNamedItem(Node* node, ExceptionCode& ec)
     }
 
     // Not mentioned in spec: throw a HIERARCHY_REQUEST_ERROR if the user passes in a non-attribute node
-    if (!is<Attr>(node)) {
+    if (!is<Attr>(*node)) {
         ec = HIERARCHY_REQUEST_ERR;
         return nullptr;
     }
index 56c76c0..af47164 100644 (file)
@@ -137,7 +137,7 @@ void Node::dumpStatistics()
 
         if (node->hasRareData()) {
             ++nodesWithRareData;
-            if (is<Element>(node)) {
+            if (is<Element>(*node)) {
                 ++elementsWithRareData;
                 if (downcast<Element>(*node).hasNamedNodeMap())
                     ++elementsWithNamedNodeMap;
@@ -872,7 +872,7 @@ bool Node::containsIncludingHostElements(const Node* node) const
 
 Node* Node::pseudoAwarePreviousSibling() const
 {
-    Element* parentOrHost = is<PseudoElement>(this) ? downcast<PseudoElement>(*this).hostElement() : parentElement();
+    Element* parentOrHost = is<PseudoElement>(*this) ? downcast<PseudoElement>(*this).hostElement() : parentElement();
     if (parentOrHost && !previousSibling()) {
         if (isAfterPseudoElement() && parentOrHost->lastChild())
             return parentOrHost->lastChild();
@@ -884,7 +884,7 @@ Node* Node::pseudoAwarePreviousSibling() const
 
 Node* Node::pseudoAwareNextSibling() const
 {
-    Element* parentOrHost = is<PseudoElement>(this) ? downcast<PseudoElement>(*this).hostElement() : parentElement();
+    Element* parentOrHost = is<PseudoElement>(*this) ? downcast<PseudoElement>(*this).hostElement() : parentElement();
     if (parentOrHost && !nextSibling()) {
         if (isBeforePseudoElement() && parentOrHost->firstChild())
             return parentOrHost->firstChild();
@@ -927,7 +927,7 @@ Node* Node::pseudoAwareLastChild() const
 RenderStyle* Node::computedStyle(PseudoId pseudoElementSpecifier)
 {
     for (Node* node = this; node; node = node->parentOrShadowHostNode()) {
-        if (is<Element>(node))
+        if (is<Element>(*node))
             return downcast<Element>(*node).computedStyle(pseudoElementSpecifier);
     }
     return nullptr;
@@ -1004,10 +1004,10 @@ Element* Node::parentOrShadowHostElement() const
     if (!parent)
         return nullptr;
 
-    if (is<ShadowRoot>(parent))
-        return downcast<ShadowRoot>(parent)->hostElement();
+    if (is<ShadowRoot>(*parent))
+        return downcast<ShadowRoot>(*parent).hostElement();
 
-    if (!is<Element>(parent))
+    if (!is<Element>(*parent))
         return nullptr;
 
     return downcast<Element>(parent);
@@ -1057,9 +1057,9 @@ Element* Node::rootEditableElement() const
 {
     Element* result = nullptr;
     for (Node* node = const_cast<Node*>(this); node && node->hasEditableStyle(); node = node->parentNode()) {
-        if (is<Element>(node))
+        if (is<Element>(*node))
             result = downcast<Element>(node);
-        if (is<HTMLBodyElement>(node))
+        if (is<HTMLBodyElement>(*node))
             break;
     }
     return result;
@@ -1384,7 +1384,7 @@ Element* Node::ancestorElement() const
 {
     // In theory, there can be EntityReference nodes between elements, but this is currently not supported.
     for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
-        if (is<Element>(ancestor))
+        if (is<Element>(*ancestor))
             return downcast<Element>(ancestor);
     }
     return nullptr;
@@ -1404,8 +1404,8 @@ unsigned short Node::compareDocumentPosition(Node* otherNode)
     if (otherNode == this)
         return DOCUMENT_POSITION_EQUIVALENT;
     
-    Attr* attr1 = is<Attr>(this) ? downcast<Attr>(this) : nullptr;
-    Attr* attr2 = is<Attr>(otherNode) ? downcast<Attr>(otherNode) : nullptr;
+    Attr* attr1 = is<Attr>(*this) ? downcast<Attr>(this) : nullptr;
+    Attr* attr2 = is<Attr>(*otherNode) ? downcast<Attr>(otherNode) : nullptr;
     
     Node* start1 = attr1 ? attr1->ownerElement() : this;
     Node* start2 = attr2 ? attr2->ownerElement() : otherNode;
@@ -1529,7 +1529,7 @@ FloatPoint Node::convertFromPage(const FloatPoint& p) const
 
 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder, const QualifiedName& name, const char* attrDesc)
 {
-    if (!is<Element>(node))
+    if (!is<Element>(*node))
         return;
 
     const AtomicString& attr = downcast<Element>(*node).getAttribute(name);
@@ -1572,7 +1572,7 @@ void Node::showNodePathForThis() const
     }
     for (unsigned index = chain.size(); index > 0; --index) {
         const Node* node = chain[index - 1];
-        if (is<ShadowRoot>(node)) {
+        if (is<ShadowRoot>(*node)) {
             int count = 0;
             for (const ShadowRoot* shadowRoot = downcast<ShadowRoot>(node); shadowRoot && shadowRoot != node; shadowRoot = shadowRoot->shadowRoot())
                 ++count;
@@ -1723,7 +1723,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() && !is<HTMLImageElement>(node))
+        if (node->isLink() && !is<HTMLImageElement>(*node))
             return downcast<Element>(node);
     }
 
@@ -2032,7 +2032,7 @@ void Node::dispatchScopedEvent(PassRefPtr<Event> event)
 bool Node::dispatchEvent(PassRefPtr<Event> event)
 {
 #if ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)
-    if (is<TouchEvent>(event.get()))
+    if (is<TouchEvent>(*event))
         return dispatchTouchEvent(adoptRef(downcast<TouchEvent>(event.leakRef())));
 #endif
     return EventDispatcher::dispatchEvent(this, event);
@@ -2100,12 +2100,12 @@ void Node::defaultEventHandler(Event* event)
         return;
     const AtomicString& eventType = event->type();
     if (eventType == eventNames().keydownEvent || eventType == eventNames().keypressEvent) {
-        if (is<KeyboardEvent>(event)) {
+        if (is<KeyboardEvent>(*event)) {
             if (Frame* frame = document().frame())
                 frame->eventHandler().defaultKeyboardEventHandler(downcast<KeyboardEvent>(event));
         }
     } else if (eventType == eventNames().clickEvent) {
-        int detail = is<UIEvent>(event) ? downcast<UIEvent>(*event).detail() : 0;
+        int detail = is<UIEvent>(*event) ? downcast<UIEvent>(*event).detail() : 0;
         if (dispatchDOMActivateEvent(detail, event))
             event->setDefaultHandled();
 #if ENABLE(CONTEXT_MENUS)
@@ -2115,12 +2115,12 @@ void Node::defaultEventHandler(Event* event)
                 page->contextMenuController().handleContextMenuEvent(event);
 #endif
     } else if (eventType == eventNames().textInputEvent) {
-        if (is<TextEvent>(event)) {
+        if (is<TextEvent>(*event)) {
             if (Frame* frame = document().frame())
                 frame->eventHandler().defaultTextInputEventHandler(downcast<TextEvent>(event));
         }
 #if ENABLE(PAN_SCROLLING)
-    } else if (eventType == eventNames().mousedownEvent && is<MouseEvent>(event)) {
+    } else if (eventType == eventNames().mousedownEvent && is<MouseEvent>(*event)) {
         if (downcast<MouseEvent>(*event).button() == MiddleButton) {
             if (enclosingLinkEventParentOrSelf())
                 return;
@@ -2135,7 +2135,7 @@ void Node::defaultEventHandler(Event* event)
             }
         }
 #endif
-    } else if ((eventType == eventNames().wheelEvent || eventType == eventNames().mousewheelEvent) && is<WheelEvent>(event)) {
+    } else if ((eventType == eventNames().wheelEvent || eventType == eventNames().mousewheelEvent) && is<WheelEvent>(*event)) {
 
         // If we don't have a renderer, send the wheel event to the first node we find with a renderer.
         // This is needed for <option> and <optgroup> elements so that <select>s get a wheel scroll.
@@ -2147,7 +2147,7 @@ void Node::defaultEventHandler(Event* event)
             if (Frame* frame = document().frame())
                 frame->eventHandler().defaultWheelEventHandler(startNode, downcast<WheelEvent>(event));
 #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS)
-    } else if (is<TouchEvent>(event) && eventNames().isTouchEventType(eventType)) {
+    } else if (is<TouchEvent>(*event) && eventNames().isTouchEventType(eventType)) {
         RenderObject* renderer = this->renderer();
         while (renderer && (!renderer->isBox() || !toRenderBox(renderer)->canBeScrolledAndHasScrollableArea()))
             renderer = renderer->parent();
index 82ec7db..d507bc1 100644 (file)
@@ -52,7 +52,7 @@ static inline bool nodeCanBeDistributed(const Node* node)
     if (parent->isShadowRoot())
         return false;
 
-    if (is<Element>(parent) && downcast<Element>(*parent).shadowRoot())
+    if (is<Element>(*parent) && downcast<Element>(*parent).shadowRoot())
         return true;
     
     return false;
@@ -132,10 +132,10 @@ static ContainerNode* traverseParent(const Node* node, ShadowRootCrossing shadow
     if (!parent)
         return nullptr;
 
-    if (is<ShadowRoot>(parent))
+    if (is<ShadowRoot>(*parent))
         return shadowRootCrossing == CrossShadowRoot ? downcast<ShadowRoot>(parent)->hostElement() : parent;
 
-    if (is<InsertionPoint>(parent)) {
+    if (is<InsertionPoint>(*parent)) {
         const InsertionPoint& insertionPoint = downcast<InsertionPoint>(*parent);
         if (insertionPoint.hasDistribution())
             return nullptr;
index fbfd7d8..85298b0 100644 (file)
@@ -41,7 +41,7 @@ Node* previousIncludingPseudo(const Node* current, const Node* stayWithin)
             previous = previous->pseudoAwareLastChild();
         return previous;
     }
-    return is<PseudoElement>(current) ? downcast<PseudoElement>(*current).hostElement() : current->parentNode();
+    return is<PseudoElement>(*current) ? downcast<PseudoElement>(*current).hostElement() : current->parentNode();
 }
 
 Node* nextIncludingPseudo(const Node* current, const Node* stayWithin)
@@ -53,7 +53,7 @@ Node* nextIncludingPseudo(const Node* current, const Node* stayWithin)
         return nullptr;
     if ((next = current->pseudoAwareNextSibling()))
         return next;
-    current = is<PseudoElement>(current) ? downcast<PseudoElement>(*current).hostElement() : current->parentNode();
+    current = is<PseudoElement>(*current) ? downcast<PseudoElement>(*current).hostElement() : current->parentNode();
     for (; current; current = current->parentNode()) {
         if (current == stayWithin)
             return nullptr;
@@ -70,7 +70,7 @@ Node* nextIncludingPseudoSkippingChildren(const Node* current, const Node* stayW
         return nullptr;
     if ((next = current->pseudoAwareNextSibling()))
         return next;
-    current = is<PseudoElement>(current) ? downcast<PseudoElement>(*current).hostElement() : current->parentNode();
+    current = is<PseudoElement>(*current) ? downcast<PseudoElement>(*current).hostElement() : current->parentNode();
     for (; current; current = current->parentNode()) {
         if (current == stayWithin)
             return nullptr;
index dc82190..4bba4d2 100644 (file)
@@ -291,7 +291,7 @@ Position::AnchorType Position::anchorTypeForLegacyEditingPosition(Node* anchorNo
 Element* Position::element() const
 {
     Node* node = anchorNode();
-    while (node && !is<Element>(node))
+    while (node && !is<Element>(*node))
         node = node->parentNode();
     return downcast<Element>(node);
 }
@@ -529,7 +529,7 @@ static bool endsOfNodeAreVisuallyDistinctPositions(Node* node)
         return true;
         
     // Don't include inline tables.
-    if (is<HTMLTableElement>(node))
+    if (is<HTMLTableElement>(*node))
         return false;
     
     // There is a VisiblePosition inside an empty inline-block container.
@@ -950,7 +950,7 @@ bool Position::isCandidate() const
 
 bool Position::isRenderedCharacter() const
 {
-    if (isNull() || !is<Text>(deprecatedNode()))
+    if (!is<Text>(deprecatedNode()))
         return false;
         
     RenderText* renderer = downcast<Text>(*deprecatedNode()).renderer();
@@ -1062,7 +1062,7 @@ Position Position::leadingWhitespacePosition(EAffinity affinity, bool considerNo
         return Position();
 
     Position prev = previousCharacterPosition(affinity);
-    if (prev != *this && inSameEnclosingBlockFlowElement(deprecatedNode(), prev.deprecatedNode()) && is<Text>(prev.deprecatedNode())) {
+    if (prev != *this && inSameEnclosingBlockFlowElement(deprecatedNode(), prev.deprecatedNode()) && is<Text>(*prev.deprecatedNode())) {
         String string = downcast<Text>(*prev.deprecatedNode()).data();
         UChar c = string[prev.deprecatedEditingOffset()];
         if (considerNonCollapsibleWhitespace ? (isSpaceOrNewline(c) || c == noBreakSpace) : deprecatedIsCollapsibleWhitespace(c))
index 27de7ef..ce32f69 100644 (file)
@@ -978,7 +978,7 @@ void Range::insertNode(PassRefPtr<Node> prpNewNode, ExceptionCode& ec)
     // does not allow children of the type of newNode or if newNode is an ancestor of the container.
 
     // an extra one here - if a text node is going to split, it must have a parent to insert into
-    bool startIsText = is<Text>(m_start.container());
+    bool startIsText = is<Text>(*m_start.container());
     if (startIsText && !m_start.container()->parentNode()) {
         ec = HIERARCHY_REQUEST_ERR;
         return;
@@ -2224,7 +2224,7 @@ void Range::getBorderAndTextQuads(Vector<FloatQuad>& quads) const
         selectedElementsSet.remove(parent);
 
     for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
-        if (is<Element>(node) && selectedElementsSet.contains(node) && !selectedElementsSet.contains(node->parentNode())) {
+        if (is<Element>(*node) && selectedElementsSet.contains(node) && !selectedElementsSet.contains(node->parentNode())) {
             if (RenderBoxModelObject* renderBoxModelObject = downcast<Element>(*node).renderBoxModelObject()) {
                 Vector<FloatQuad> elementQuads;
                 renderBoxModelObject->absoluteQuads(elementQuads);
@@ -2232,7 +2232,7 @@ void Range::getBorderAndTextQuads(Vector<FloatQuad>& quads) const
 
                 quads.appendVector(elementQuads);
             }
-        } else if (is<Text>(node)) {
+        } else if (is<Text>(*node)) {
             if (RenderObject* renderer = downcast<Text>(*node).renderer()) {
                 const RenderText& renderText = toRenderText(*renderer);
                 int startOffset = (node == startContainer) ? m_start.offset() : 0;
index e7a6716..db1cfb8 100644 (file)
@@ -382,10 +382,10 @@ String ScriptElement::scriptContent() const
 
 ScriptElement* toScriptElementIfPossible(Element* element)
 {
-    if (is<HTMLScriptElement>(element))
+    if (is<HTMLScriptElement>(*element))
         return downcast<HTMLScriptElement>(element);
 
-    if (is<SVGScriptElement>(element))
+    if (is<SVGScriptElement>(*element))
         return downcast<SVGScriptElement>(element);
 
     return nullptr;
index 1be757f..ad8a3ed 100644 (file)
@@ -105,7 +105,7 @@ inline ShadowRoot* Node::shadowRoot() const
 inline ContainerNode* Node::parentOrShadowHostNode() const
 {
     ASSERT(isMainThreadOrGCThread());
-    if (is<ShadowRoot>(this))
+    if (is<ShadowRoot>(*this))
         return downcast<ShadowRoot>(*this).hostElement();
     return parentNode();
 }
index 7d289b0..d54bdae 100644 (file)
@@ -94,7 +94,7 @@ static const Text* earliestLogicallyAdjacentTextNode(const Text* text)
 {
     const Node* node = text;
     while ((node = node->previousSibling())) {
-        if (!is<Text>(node))
+        if (!is<Text>(*node))
             break;
         text = downcast<Text>(node);
     }
@@ -105,7 +105,7 @@ static const Text* latestLogicallyAdjacentTextNode(const Text* text)
 {
     const Node* node = text;
     while ((node = node->nextSibling())) {
-        if (!is<Text>(node))
+        if (!is<Text>(*node))
             break;
         text = downcast<Text>(node);
     }
@@ -178,7 +178,8 @@ PassRefPtr<Node> Text::cloneNode(bool /*deep*/)
 static bool isSVGShadowText(Text* text)
 {
     Node* parentNode = text->parentNode();
-    return is<ShadowRoot>(parentNode) && downcast<ShadowRoot>(*parentNode).hostElement()->hasTagName(SVGNames::trefTag);
+    ASSERT(parentNode);
+    return is<ShadowRoot>(*parentNode) && downcast<ShadowRoot>(*parentNode).hostElement()->hasTagName(SVGNames::trefTag);
 }
 
 static bool isSVGText(Text* text)
index 9f07319..ae23b31 100644 (file)
@@ -47,9 +47,10 @@ String contentsAsString(const ContainerNode* root)
 
 String contentsAsString(const Node* root)
 {
-    if (is<Text>(root))
+    ASSERT(root);
+    if (is<Text>(*root))
         return downcast<Text>(*root).data();
-    if (is<ContainerNode>(root))
+    if (is<ContainerNode>(*root))
         return contentsAsString(downcast<ContainerNode>(root));
     return String();
 }
index b84a023..8bab7b1 100644 (file)
@@ -66,7 +66,7 @@ template <class NodeType>
 inline Text* firstTextChildTemplate(NodeType* current)
 {
     Node* node = current->firstChild();
-    while (node && !is<Text>(node))
+    while (node && !is<Text>(*node))
         node = node->nextSibling();
     return downcast<Text>(node);
 }
@@ -77,7 +77,7 @@ template <class NodeType>
 inline Text* firstTextWithinTemplate(NodeType* current)
 {
     Node* node = current->firstChild();
-    while (node && !is<Text>(node))
+    while (node && !is<Text>(*node))
         node = NodeTraversal::next(node, current);
     return downcast<Text>(node);
 }
@@ -88,7 +88,7 @@ template <class NodeType>
 inline Text* traverseNextTextTemplate(NodeType* current)
 {
     Node* node = NodeTraversal::next(current);
-    while (node && !is<Text>(node))
+    while (node && !is<Text>(*node))
         node = NodeTraversal::next(node);
     return downcast<Text>(node);
 }
@@ -99,7 +99,7 @@ template <class NodeType>
 inline Text* traverseNextTextTemplate(NodeType* current, const Node* stayWithin)
 {
     Node* node = NodeTraversal::next(current, stayWithin);
-    while (node && !is<Text>(node))
+    while (node && !is<Text>(*node))
         node = NodeTraversal::next(node, stayWithin);
     return downcast<Text>(node);
 }
@@ -109,7 +109,7 @@ inline Text* next(const Text* current, const Node* stayWithin) { return traverse
 inline Text* nextSibling(const Node* current)
 {
     Node* node = current->nextSibling();
-    while (node && !is<Text>(node))
+    while (node && !is<Text>(*node))
         node = node->nextSibling();
     return downcast<Text>(node);
 }
index 045e88e..0f17527 100644 (file)
@@ -60,7 +60,7 @@ void TreeScopeAdopter::moveTreeToNewScope(Node* root) const
                 rareData->nodeLists()->adoptTreeScope();
         }
 
-        if (!is<Element>(node))
+        if (!is<Element>(*node))
             continue;
 
         if (node->hasSyntheticAttrChildNodes()) {
@@ -124,7 +124,7 @@ inline void TreeScopeAdopter::moveNodeToNewDocument(Node* node, Document* oldDoc
     if (oldDocument)
         oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
 
-    if (is<ShadowRoot>(node))
+    if (is<ShadowRoot>(*node))
         downcast<ShadowRoot>(*node).setDocumentScope(newDocument);
 
 #ifndef NDEBUG
index a2cc5c9..f740ec3 100644 (file)
@@ -164,7 +164,7 @@ static bool isNewLineAtPosition(const Position& position)
 {
     Node* textNode = position.containerNode();
     int offset = position.offsetInContainerNode();
-    if (!textNode || !is<Text>(textNode) || offset < 0 || offset >= textNode->maxCharacterOffset())
+    if (!is<Text>(textNode) || offset < 0 || offset >= textNode->maxCharacterOffset())
         return false;
 
     ExceptionCode ec = 0;
@@ -267,18 +267,18 @@ VisiblePosition ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfN
     // Avoid this by splitting "\n"
     splitTextNode(text, 1);
 
-    if (text == start.containerNode() && text->previousSibling() && is<Text>(text->previousSibling())) {
+    if (text == start.containerNode() && is<Text>(text->previousSibling())) {
         ASSERT(start.offsetInContainerNode() < position.offsetInContainerNode());
         start = Position(downcast<Text>(text->previousSibling()), start.offsetInContainerNode());
     }
-    if (text == end.containerNode() && text->previousSibling() && is<Text>(text->previousSibling())) {
+    if (text == end.containerNode() && is<Text>(text->previousSibling())) {
         ASSERT(end.offsetInContainerNode() < position.offsetInContainerNode());
         end = Position(downcast<Text>(text->previousSibling()), end.offsetInContainerNode());
     }
     if (text == m_endOfLastParagraph.containerNode()) {
         if (m_endOfLastParagraph.offsetInContainerNode() < position.offsetInContainerNode()) {
             // We can only fix endOfLastParagraph if the previous node was still text and hasn't been modified by script.
-            if (is<Text>(text->previousSibling())
+            if (is<Text>(*text->previousSibling())
                 && static_cast<unsigned>(m_endOfLastParagraph.offsetInContainerNode()) <= downcast<Text>(text->previousSibling())->length())
                 m_endOfLastParagraph = Position(downcast<Text>(text->previousSibling()), m_endOfLastParagraph.offsetInContainerNode());
         } else
index 9427516..66beff4 100644 (file)
@@ -68,7 +68,7 @@ static String& styleSpanClassString()
 
 bool isLegacyAppleStyleSpan(const Node* node)
 {
-    if (!node || !is<HTMLSpanElement>(node))
+    if (!is<HTMLSpanElement>(node))
         return false;
 
     return downcast<HTMLSpanElement>(*node).fastGetAttribute(classAttr) == styleSpanClassString();
@@ -92,21 +92,21 @@ static bool hasNoAttributeOrOnlyStyleAttribute(const StyledElement* element, Sho
 
 bool isStyleSpanOrSpanWithOnlyStyleAttribute(const Element* element)
 {
-    if (!element || !is<HTMLSpanElement>(element))
+    if (!is<HTMLSpanElement>(element))
         return false;
     return hasNoAttributeOrOnlyStyleAttribute(downcast<HTMLSpanElement>(element), AllowNonEmptyStyleAttribute);
 }
 
 static inline bool isSpanWithoutAttributesOrUnstyledStyleSpan(const Element* element)
 {
-    if (!element || !is<HTMLSpanElement>(element))
+    if (!is<HTMLSpanElement>(element))
         return false;
     return hasNoAttributeOrOnlyStyleAttribute(downcast<HTMLSpanElement>(element), StyleAttributeShouldBeEmpty);
 }
 
 bool isEmptyFontTag(const Element* element, ShouldStyleAttributeBeEmpty shouldStyleAttributeBeEmpty)
 {
-    if (!element || !is<HTMLFontElement>(element))
+    if (!is<HTMLFontElement>(element))
         return false;
 
     return hasNoAttributeOrOnlyStyleAttribute(downcast<HTMLFontElement>(element), shouldStyleAttributeBeEmpty);
@@ -277,7 +277,7 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
                     block = newBlock;
             }
             ASSERT(!block || is<HTMLElement>(*block));
-            if (block && is<HTMLElement>(*block)) {
+            if (is<HTMLElement>(block.get())) {
                 removeCSSStyle(style, downcast<HTMLElement>(block.get()));
                 if (!m_removeOnly)
                     addBlockStyle(styleChange, downcast<HTMLElement>(block.get()));
@@ -377,7 +377,7 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style)
     Node* lastStyledNode = 0;
     for (Node* node = startNode; node != beyondEnd; node = NodeTraversal::next(node)) {
         RefPtr<HTMLElement> element;
-        if (is<HTMLElement>(node)) {
+        if (is<HTMLElement>(*node)) {
             // Only work on fully selected nodes.
             if (!nodeFullySelected(node, start, end))
                 continue;
@@ -420,7 +420,7 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style)
 
 static ContainerNode* dummySpanAncestorForNode(const Node* node)
 {
-    while (node && (!is<Element>(node) || !isStyleSpanOrSpanWithOnlyStyleAttribute(downcast<Element>(node))))
+    while (node && (!is<Element>(*node) || !isStyleSpanOrSpanWithOnlyStyleAttribute(downcast<Element>(node))))
         node = node->parentNode();
     
     return node ? node->parentNode() : nullptr;
@@ -473,7 +473,7 @@ HTMLElement* ApplyStyleCommand::splitAncestorsWithUnicodeBidi(Node* node, bool b
     WritingDirection highestAncestorDirection;
     if (allowedDirection != NaturalWritingDirection
         && highestAncestorUnicodeBidi != CSSValueBidiOverride
-        && is<HTMLElement>(highestAncestorWithUnicodeBidi)
+        && is<HTMLElement>(*highestAncestorWithUnicodeBidi)
         && EditingStyle::create(highestAncestorWithUnicodeBidi, EditingStyle::AllProperties)->textDirection(highestAncestorDirection)
         && highestAncestorDirection == allowedDirection) {
         if (!nextHighestAncestorWithUnicodeBidi)
@@ -505,7 +505,7 @@ void ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock(Node* node, Node* unsp
     Node* parent = nullptr;
     for (Node* ancestor = node->parentNode(); ancestor != block && ancestor != unsplitAncestor; ancestor = parent) {
         parent = ancestor->parentNode();
-        if (!is<StyledElement>(ancestor))
+        if (!is<StyledElement>(*ancestor))
             continue;
 
         StyledElement& element = downcast<StyledElement>(*ancestor);
@@ -980,7 +980,7 @@ HTMLElement* ApplyStyleCommand::highestAncestorWithConflictingInlineStyle(Editin
     Node* unsplittableElement = unsplittableElementForPosition(firstPositionInOrBeforeNode(node));
 
     for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
-        if (is<HTMLElement>(ancestor) && shouldRemoveInlineStyleFromElement(style, downcast<HTMLElement>(ancestor)))
+        if (is<HTMLElement>(*ancestor) && shouldRemoveInlineStyleFromElement(style, downcast<HTMLElement>(ancestor)))
             result = downcast<HTMLElement>(ancestor);
         // Should stop at the editable root (cannot cross editing boundary) and
         // also stop at the unsplittable element to be consistent with other UAs
@@ -997,18 +997,18 @@ void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, EditingStyle* sty
 
     node->document().updateStyleIfNeeded();
 
-    if (!style || style->isEmpty() || !node->renderer() || is<HTMLIFrameElement>(node))
+    if (!style || style->isEmpty() || !node->renderer() || is<HTMLIFrameElement>(*node))
         return;
 
     RefPtr<EditingStyle> newInlineStyle = style;
-    if (is<HTMLElement>(node) && downcast<HTMLElement>(node)->inlineStyle()) {
+    if (is<HTMLElement>(*node) && downcast<HTMLElement>(node)->inlineStyle()) {
         newInlineStyle = style->copy();
         newInlineStyle->mergeInlineStyleOfElement(downcast<HTMLElement>(node), EditingStyle::OverrideValues);
     }
 
     // Since addInlineStyleIfNeeded can't add styles to block-flow render objects, add style attribute instead.
     // FIXME: applyInlineStyleToRange should be used here instead.
-    if ((node->renderer()->isRenderBlockFlow() || node->hasChildNodes()) && is<HTMLElement>(node)) {
+    if ((node->renderer()->isRenderBlockFlow() || node->hasChildNodes()) && is<HTMLElement>(*node)) {
         setNodeAttribute(downcast<HTMLElement>(node), styleAttr, newInlineStyle->style()->asText());
         return;
     }
@@ -1208,7 +1208,7 @@ void ApplyStyleCommand::splitTextAtEnd(const Position& start, const Position& en
     splitTextNode(&text, end.offsetInContainerNode());
 
     Node* prevNode = text.previousSibling();
-    if (!prevNode || !is<Text>(prevNode))
+    if (!is<Text>(prevNode))
         return;
 
     Position newStart = shouldUpdateStart ? Position(downcast<Text>(prevNode), start.offsetInContainerNode()) : start;
@@ -1240,7 +1240,7 @@ void ApplyStyleCommand::splitTextElementAtEnd(const Position& start, const Posit
     if (!parentElement || !parentElement->previousSibling())
         return;
     Node* firstTextNode = parentElement->previousSibling()->lastChild();
-    if (!firstTextNode || !is<Text>(firstTextNode))
+    if (!is<Text>(firstTextNode))
         return;
 
     Position newStart = shouldUpdateStart ? Position(downcast<Text>(firstTextNode), start.offsetInContainerNode()) : start;
@@ -1249,7 +1249,7 @@ void ApplyStyleCommand::splitTextElementAtEnd(const Position& start, const Posit
 
 bool ApplyStyleCommand::shouldSplitTextElement(Element* element, EditingStyle* style)
 {
-    if (!element || !is<HTMLElement>(element))
+    if (!is<HTMLElement>(element))
         return false;
 
     return shouldRemoveInlineStyleFromElement(style, downcast<HTMLElement>(element));
@@ -1359,13 +1359,14 @@ void ApplyStyleCommand::surroundNodeRangeWithElement(PassRefPtr<Node> passedStar
 
     RefPtr<Node> nextSibling = element->nextSibling();
     RefPtr<Node> previousSibling = element->previousSibling();
-    if (nextSibling && is<Element>(*nextSibling) && nextSibling->hasEditableStyle()
+    if (is<Element>(nextSibling.get()) && nextSibling->hasEditableStyle()
         && areIdenticalElements(element.get(), downcast<Element>(nextSibling.get())))
         mergeIdenticalElements(element.get(), downcast<Element>(nextSibling.get()));
 
-    if (previousSibling && is<Element>(*previousSibling) && previousSibling->hasEditableStyle()) {
+    if (is<Element>(previousSibling.get()) && previousSibling->hasEditableStyle()) {
         Node* mergedElement = previousSibling->nextSibling();
-        if (is<Element>(mergedElement) && mergedElement->hasEditableStyle()
+        ASSERT(mergedElement);
+        if (is<Element>(*mergedElement) && mergedElement->hasEditableStyle()
             && areIdenticalElements(downcast<Element>(previousSibling.get()), downcast<Element>(mergedElement)))
             mergeIdenticalElements(downcast<Element>(previousSibling.get()), downcast<Element>(mergedElement));
     }
@@ -1431,10 +1432,10 @@ void ApplyStyleCommand::applyInlineStyleChange(PassRefPtr<Node> passedStart, Pas
     HTMLFontElement* fontContainer = nullptr;
     HTMLElement* styleContainer = nullptr;
     for (Node* container = startNode.get(); container && startNode == endNode; container = container->firstChild()) {
-        if (is<HTMLFontElement>(container))
+        if (is<HTMLFontElement>(*container))
             fontContainer = downcast<HTMLFontElement>(container);
-        bool styleContainerIsNotSpan = !styleContainer || !is<HTMLSpanElement>(styleContainer);
-        if (is<HTMLElement>(container) && (is<HTMLSpanElement>(container) || (styleContainerIsNotSpan && container->hasChildNodes())))
+        bool styleContainerIsNotSpan = !is<HTMLSpanElement>(styleContainer);
+        if (is<HTMLElement>(*container) && (is<HTMLSpanElement>(*container) || (styleContainerIsNotSpan && container->hasChildNodes())))
             styleContainer = downcast<HTMLElement>(container);
         if (!container->firstChild())
             break;
@@ -1528,7 +1529,7 @@ void ApplyStyleCommand::joinChildTextNodes(Node* node, const Position& start, co
     for (size_t i = 0; i < textNodes.size(); ++i) {
         Text* childText = textNodes[i].get();
         Node* next = childText->nextSibling();
-        if (!next || !is<Text>(next))
+        if (!is<Text>(next))
             continue;
     
         Text& nextText = downcast<Text>(*next);
index 55233c5..644d345 100644 (file)
@@ -104,9 +104,9 @@ void BreakBlockquoteCommand::doApply()
     
     // startNode is the first node that we need to move to the new blockquote.
     Node* startNode = pos.deprecatedNode();
-        
+    ASSERT(startNode);
     // Split at pos if in the middle of a text node.
-    if (is<Text>(startNode)) {
+    if (is<Text>(*startNode)) {
         Text& textNode = downcast<Text>(*startNode);
         if ((unsigned)pos.deprecatedEditingOffset() >= textNode.length()) {
             startNode = NodeTraversal::next(startNode);
index 21673cd..3464c27 100644 (file)
@@ -324,7 +324,8 @@ void CompositeEditCommand::insertLineBreak()
 
 bool CompositeEditCommand::isRemovableBlock(const Node* node)
 {
-    if (!is<HTMLDivElement>(node))
+    ASSERT(node);
+    if (!is<HTMLDivElement>(*node))
         return false;
 
     Node* parentNode = node->parentNode();
@@ -378,7 +379,7 @@ void CompositeEditCommand::insertNodeAt(PassRefPtr<Node> insertChild, const Posi
             appendNode(insertChild, downcast<ContainerNode>(refChild));
     } else if (caretMinOffset(refChild) >= offset)
         insertNodeBefore(insertChild, refChild);
-    else if (is<Text>(refChild) && caretMaxOffset(refChild) > offset) {
+    else if (is<Text>(*refChild) && caretMaxOffset(refChild) > offset) {
         splitTextNode(downcast<Text>(refChild), offset);
 
         // Mutation events (bug 22634) from the text node insertion may have removed the refChild
@@ -678,7 +679,7 @@ bool CompositeEditCommand::shouldRebalanceLeadingWhitespaceFor(const String& tex
 bool CompositeEditCommand::canRebalance(const Position& position) const
 {
     Node* node = position.containerNode();
-    if (position.anchorType() != Position::PositionIsOffsetInAnchor || !node || !is<Text>(node))
+    if (position.anchorType() != Position::PositionIsOffsetInAnchor || !is<Text>(node))
         return false;
 
     Text& textNode = downcast<Text>(*node);
@@ -750,7 +751,7 @@ void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(PassRefPtr<Text> p
 void CompositeEditCommand::prepareWhitespaceAtPositionForSplit(Position& position)
 {
     Node* node = position.deprecatedNode();
-    if (!node || !is<Text>(node))
+    if (!is<Text>(node))
         return;
     Text& textNode = downcast<Text>(*node);
     
@@ -769,9 +770,9 @@ void CompositeEditCommand::prepareWhitespaceAtPositionForSplit(Position& positio
     VisiblePosition previousVisiblePos(visiblePos.previous());
     Position previous(previousVisiblePos.deepEquivalent());
     
-    if (deprecatedIsCollapsibleWhitespace(previousVisiblePos.characterAfter()) && is<Text>(previous.deprecatedNode()) && !is<HTMLBRElement>(previous.deprecatedNode()))
+    if (deprecatedIsCollapsibleWhitespace(previousVisiblePos.characterAfter()) && is<Text>(*previous.deprecatedNode()) && !is<HTMLBRElement>(*previous.deprecatedNode()))
         replaceTextInNodePreservingMarkers(downcast<Text>(previous.deprecatedNode()), previous.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
-    if (deprecatedIsCollapsibleWhitespace(visiblePos.characterAfter()) && is<Text>(position.deprecatedNode()) && !is<HTMLBRElement>(position.deprecatedNode()))
+    if (deprecatedIsCollapsibleWhitespace(visiblePos.characterAfter()) && is<Text>(*position.deprecatedNode()) && !is<HTMLBRElement>(*position.deprecatedNode()))
         replaceTextInNodePreservingMarkers(downcast<Text>(position.deprecatedNode()), position.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
 }
 
@@ -877,7 +878,7 @@ void CompositeEditCommand::deleteInsignificantText(const Position& start, const
 
     Vector<RefPtr<Text>> nodes;
     for (Node* node = start.deprecatedNode(); node; node = NodeTraversal::next(node)) {
-        if (is<Text>(node))
+        if (is<Text>(*node))
             nodes.append(downcast<Text>(node));
         if (node == end.deprecatedNode())
             break;
@@ -951,7 +952,7 @@ void CompositeEditCommand::removePlaceholderAt(const Position& p)
     ASSERT(lineBreakExistsAtPosition(p));
     
     // We are certain that the position is at a line break, but it may be a br or a preserved newline.
-    if (is<HTMLBRElement>(p.anchorNode())) {
+    if (is<HTMLBRElement>(*p.anchorNode())) {
         removeNode(p.anchorNode());
         return;
     }
@@ -1120,8 +1121,9 @@ void CompositeEditCommand::cleanupAfterDeletion(VisiblePosition destination)
         // Note: We want the rightmost candidate.
         Position position = caretAfterDelete.deepEquivalent().downstream();
         Node* node = position.deprecatedNode();
+        ASSERT(node);
         // Normally deletion will leave a br as a placeholder.
-        if (is<HTMLBRElement>(node))
+        if (is<HTMLBRElement>(*node))
             removeNodeAndPruneAncestors(node);
         // If the selection to move was empty and in an empty block that 
         // doesn't require a placeholder to prop itself open (like a bordered
@@ -1347,9 +1349,9 @@ bool CompositeEditCommand::breakOutOfEmptyListItem()
         || listNode == emptyListItem->rootEditableElement())
         return false;
 
-    RefPtr<Element> newBlock = 0;
+    RefPtr<Element> newBlock;
     if (ContainerNode* blockEnclosingList = listNode->parentNode()) {
-        if (is<HTMLLIElement>(blockEnclosingList)) { // listNode is inside another list item
+        if (is<HTMLLIElement>(*blockEnclosingList)) { // listNode is inside another list item
             if (visiblePositionAfterNode(blockEnclosingList) == visiblePositionAfterNode(listNode.get())) {
                 // If listNode appears at the end of the outer list item, then move listNode outside of this list item
                 // e.g. <ul><li>hello <ul><li><br></li></ul> </li></ul> should become <ul><li>hello</li> <ul><li><br></li></ul> </ul> after this section
@@ -1436,7 +1438,7 @@ bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph()
     
     if (caretPos.deprecatedNode()->hasTagName(brTag))
         removeNodeAndPruneAncestors(caretPos.deprecatedNode());
-    else if (is<Text>(caretPos.deprecatedNode())) {
+    else if (is<Text>(*caretPos.deprecatedNode())) {
         ASSERT(caretPos.deprecatedEditingOffset() == 0);
         Text& textNode = downcast<Text>(*caretPos.deprecatedNode());
         ContainerNode* parentNode = textNode.parentNode();
@@ -1524,7 +1526,7 @@ PassRefPtr<Node> CompositeEditCommand::splitTreeToNode(Node* start, Node* end, b
 
     RefPtr<Node> endNode = end;
     for (node = start; node && node->parentNode() != endNode; node = node->parentNode()) {
-        if (!is<Element>(node->parentNode()))
+        if (!is<Element>(*node->parentNode()))
             break;
         // Do not split a node when doing so introduces an empty node.
         VisiblePosition positionInParent = firstPositionInNode(node->parentNode());
index 90a1efe..f7676e9 100644 (file)
@@ -156,7 +156,7 @@ static HTMLElement* enclosingDeletableElement(const VisibleSelection& selection)
         return nullptr;
 
     Node* element = enclosingNodeOfType(firstPositionInNode(container), &isDeletableElement);
-    return element && is<HTMLElement>(element) ? downcast<HTMLElement>(element) : nullptr;
+    return is<HTMLElement>(element) ? downcast<HTMLElement>(element) : nullptr;
 }
 
 void DeleteButtonController::respondToChangedSelection(const VisibleSelection& oldSelection)
index abc5336..eeca943 100644 (file)
@@ -459,14 +459,14 @@ 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 && canHaveChildrenForEditing(startNode) && !is<HTMLTableElement>(startNode)) {
+    if (startNode == m_startBlock && !startOffset && canHaveChildrenForEditing(startNode) && !is<HTMLTableElement>(*startNode)) {
         startOffset = 0;
         startNode = NodeTraversal::next(startNode);
         if (!startNode)
             return;
     }
 
-    if (startOffset >= caretMaxOffset(startNode) && is<Text>(startNode)) {
+    if (startOffset >= caretMaxOffset(startNode) && is<Text>(*startNode)) {
         Text& text = downcast<Text>(*startNode);
         if (text.length() > static_cast<unsigned>(caretMaxOffset(startNode)))
             deleteTextFromNode(&text, caretMaxOffset(startNode), text.length() - caretMaxOffset(startNode));
@@ -483,7 +483,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
 
     if (startNode == m_downstreamEnd.deprecatedNode()) {
         if (m_downstreamEnd.deprecatedEditingOffset() - startOffset > 0) {
-            if (is<Text>(startNode)) {
+            if (is<Text>(*startNode)) {
                 // in a text node that needs to be trimmed
                 Text& text = downcast<Text>(*startNode);
                 deleteTextFromNode(&text, startOffset, m_downstreamEnd.deprecatedEditingOffset() - startOffset);
@@ -503,7 +503,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
         RefPtr<Node> node(startNode);
         
         if (startOffset > 0) {
-            if (is<Text>(startNode)) {
+            if (is<Text>(*startNode)) {
                 // in a text node that needs to be trimmed
                 Text& text = downcast<Text>(*node);
                 deleteTextFromNode(&text, startOffset, text.length() - startOffset);
@@ -511,7 +511,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
             } else {
                 node = startNode->traverseToChildAt(startOffset);
             }
-        } else if (startNode == m_upstreamEnd.deprecatedNode() && is<Text>(startNode)) {
+        } else if (startNode == m_upstreamEnd.deprecatedNode() && is<Text>(*startNode)) {
             Text& text = downcast<Text>(*m_upstreamEnd.deprecatedNode());
             deleteTextFromNode(&text, 0, m_upstreamEnd.deprecatedEditingOffset());
         }
@@ -543,7 +543,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
                 // The node itself is fully selected, not just its contents.  Delete it.
                 removeNode(m_downstreamEnd.deprecatedNode());
             } else {
-                if (is<Text>(m_downstreamEnd.deprecatedNode())) {
+                if (is<Text>(*m_downstreamEnd.deprecatedNode())) {
                     // in a text node that needs to be trimmed
                     Text& text = downcast<Text>(*m_downstreamEnd.deprecatedNode());
                     if (m_downstreamEnd.deprecatedEditingOffset() > 0) {
@@ -576,12 +576,12 @@ void DeleteSelectionCommand::fixupWhitespace()
 {
     document().updateLayoutIgnorePendingStylesheets();
     // FIXME: isRenderedCharacter should be removed, and we should use VisiblePosition::characterAfter and VisiblePosition::characterBefore
-    if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter() && is<Text>(m_leadingWhitespace.deprecatedNode())) {
+    if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter() && is<Text>(*m_leadingWhitespace.deprecatedNode())) {
         Text& textNode = downcast<Text>(*m_leadingWhitespace.deprecatedNode());
         ASSERT(!textNode.renderer() || textNode.renderer()->style().collapseWhiteSpace());
         replaceTextInNodePreservingMarkers(&textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
     }
-    if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && is<Text>(m_trailingWhitespace.deprecatedNode())) {
+    if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && is<Text>(*m_trailingWhitespace.deprecatedNode())) {
         Text& textNode = downcast<Text>(*m_trailingWhitespace.deprecatedNode());
         ASSERT(!textNode.renderer() || textNode.renderer()->style().collapseWhiteSpace());
         replaceTextInNodePreservingMarkers(&textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
@@ -866,7 +866,7 @@ void DeleteSelectionCommand::doApply()
     bool shouldRebalaceWhiteSpace = true;
     if (!frame().editor().behavior().shouldRebalanceWhiteSpacesInSecureField()) {
         Node* node = m_endingPosition.deprecatedNode();
-        if (node && is<Text>(node)) {
+        if (is<Text>(node)) {
             Text& textNode = downcast<Text>(*node);
             if (textNode.length())
                 shouldRebalaceWhiteSpace = textNode.renderer()->style().textSecurity() == TSNONE;
index c09aca2..780d847 100644 (file)
@@ -1036,7 +1036,7 @@ PassRefPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization(Node* conte
 
     // When not annotating for interchange, we only preserve inline style declarations.
     for (Node* node = context; node && !node->isDocumentNode(); node = node->parentNode()) {
-        if (is<StyledElement>(node) && !isMailBlockquote(node)) {
+        if (is<StyledElement>(*node) && !isMailBlockquote(node)) {
             wrappingStyle->mergeInlineAndImplicitStyleOfElement(downcast<StyledElement>(node), EditingStyle::DoNotOverrideValues,
                 EditingStyle::EditingPropertiesInEffect);
         }
index e9cd6b8..5af4ffe 100644 (file)
@@ -328,8 +328,6 @@ static HTMLImageElement* imageElementFromImageDocument(Document& document)
         return nullptr;
     
     Node* node = body->firstChild();
-    if (!node)
-        return nullptr;
     if (!is<HTMLImageElement>(node))
         return nullptr;
     return downcast<HTMLImageElement>(node);
@@ -588,7 +586,7 @@ bool Editor::shouldInsertFragment(PassRefPtr<DocumentFragment> fragment, PassRef
     
     if (fragment) {
         Node* child = fragment->firstChild();
-        if (child && fragment->lastChild() == child && is<CharacterData>(child))
+        if (is<CharacterData>(child) && fragment->lastChild() == child)
             return client()->shouldInsertText(downcast<CharacterData>(*child).data(), replacingDOMRange.get(), givenAction);
     }
 
@@ -1660,7 +1658,7 @@ void Editor::setBaseWritingDirection(WritingDirection direction)
 #endif
         
     Element* focusedElement = document().focusedElement();
-    if (focusedElement && is<HTMLTextFormControlElement>(*focusedElement)) {
+    if (is<HTMLTextFormControlElement>(focusedElement)) {
         if (direction == NaturalWritingDirection)
             return;
         downcast<HTMLTextFormControlElement>(*focusedElement).setAttribute(dirAttr, direction == LeftToRightWritingDirection ? "ltr" : "rtl");
@@ -1865,7 +1863,7 @@ void Editor::setComposition(const String& text, const Vector<CompositionUnderlin
         Node* extentNode = extent.deprecatedNode();
         unsigned extentOffset = extent.deprecatedEditingOffset();
 
-        if (baseNode && baseNode == extentNode && is<Text>(baseNode) && baseOffset + text.length() == extentOffset) {
+        if (is<Text>(baseNode) && baseNode == extentNode && baseOffset + text.length() == extentOffset) {
             m_compositionNode = downcast<Text>(baseNode);
             m_compositionStart = baseOffset;
             m_compositionEnd = extentOffset;
@@ -2378,7 +2376,7 @@ bool Editor::isSpellCheckingEnabledFor(Node* node) const
 {
     if (!node)
         return false;
-    const Element* focusedElement = is<Element>(node) ? downcast<Element>(node) : node->parentElement();
+    const Element* focusedElement = is<Element>(*node) ? downcast<Element>(node) : node->parentElement();
     if (!focusedElement)
         return false;
     return focusedElement->isSpellCheckingEnabled();
@@ -3105,9 +3103,7 @@ void Editor::applyEditingStyleToBodyElement() const
 
 void Editor::applyEditingStyleToElement(Element* element) const
 {
-    if (!element)
-        return;
-    ASSERT(is<StyledElement>(element));
+    ASSERT(!element || is<StyledElement>(*element));
     if (!is<StyledElement>(element))
         return;
 
index 31745f9..f9d9b90 100644 (file)
@@ -43,7 +43,7 @@ static Node* enclosingBlockToSplitTreeTo(Node* startNode);
 static bool isElementForFormatBlock(const QualifiedName& tagName);
 static inline bool isElementForFormatBlock(Node* node)
 {
-    return is<Element>(node) && isElementForFormatBlock(downcast<Element>(*node).tagQName());
+    return is<Element>(*node) && isElementForFormatBlock(downcast<Element>(*node).tagQName());
 }
 
 FormatBlockCommand::FormatBlockCommand(Document& document, const QualifiedName& tagName)
index ba3be11..e824210 100644 (file)
@@ -398,7 +398,7 @@ static bool removingNodeRemovesPosition(Node* node, const Position& position)
     if (position.anchorNode() == node)
         return true;
 
-    if (!is<Element>(node))
+    if (!is<Element>(*node))
         return false;
 
     Element* element = downcast<Element>(node);
@@ -1491,7 +1491,7 @@ void CaretBase::paintCaret(Node* node, GraphicsContext* context, const LayoutPoi
 
     Color caretColor = Color::black;
     ColorSpace colorSpace = ColorSpaceDeviceRGB;
-    Element* element = is<Element>(node) ? downcast<Element>(node) : node->parentElement();
+    Element* element = is<Element>(*node) ? downcast<Element>(node) : node->parentElement();
     Element* rootEditableElement = node->rootEditableElement();
 
     if (element && element->renderer()) {
@@ -1522,9 +1522,9 @@ void CaretBase::paintCaret(Node* node, GraphicsContext* context, const LayoutPoi
 
 void FrameSelection::debugRenderer(RenderObject* renderer, bool selected) const
 {
-    if (is<Element>(renderer->node())) {
-        Element* element = downcast<Element>(renderer->node());
-        fprintf(stderr, "%s%s\n", selected ? "==> " : "    ", element->localName().string().utf8().data());
+    if (is<Element>(*renderer->node())) {
+        Element& element = downcast<Element>(*renderer->node());
+        fprintf(stderr, "%s%s\n", selected ? "==> " : "    ", element.localName().string().utf8().data());
     } else if (renderer->isText()) {
         RenderText* textRenderer = toRenderText(renderer);
         if (!textRenderer->textLength() || !textRenderer->firstTextBox()) {
@@ -1668,7 +1668,7 @@ void FrameSelection::selectAll()
     Document* document = m_frame->document();
 
     Element* focusedElement = document->focusedElement();
-    if (focusedElement && is<HTMLSelectElement>(focusedElement)) {
+    if (is<HTMLSelectElement>(focusedElement)) {
         HTMLSelectElement& selectElement = downcast<HTMLSelectElement>(*focusedElement);
         if (selectElement.canSelectAll()) {
             selectElement.selectAll();
@@ -1686,7 +1686,7 @@ void FrameSelection::selectAll()
             selectStartTarget = root.get();
     } else {
         if (m_selection.isNone() && focusedElement) {
-            if (is<HTMLTextFormControlElement>(focusedElement)) {
+            if (is<HTMLTextFormControlElement>(*focusedElement)) {
                 downcast<HTMLTextFormControlElement>(*focusedElement).select();
                 return;
             }
@@ -2022,8 +2022,8 @@ 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 (is<HTMLFormElement>(&element))
-            return downcast<HTMLFormElement>(&element);
+        if (is<HTMLFormElement>(element))
+            return &downcast<HTMLFormElement>(element);
         if (is<HTMLFormControlElement>(element))
             return downcast<HTMLFormControlElement>(element).form();
         if (is<HTMLFrameElementBase>(element)) {
index 4336c5c..6ee21d9 100644 (file)
@@ -115,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 = !is<HTMLHRElement>(pos.deprecatedNode()) && !is<HTMLTableElement>(pos.deprecatedNode());
+        bool needExtraLineBreak = !is<HTMLHRElement>(*pos.deprecatedNode()) && !is<HTMLTableElement>(*pos.deprecatedNode());
         
         insertNodeAt(nodeToInsert.get(), pos);
         
@@ -137,7 +137,7 @@ void InsertLineBreakCommand::doApply()
     } else if (pos.deprecatedEditingOffset() >= caretMaxOffset(pos.deprecatedNode()) || !pos.deprecatedNode()->isTextNode()) {
         insertNodeAt(nodeToInsert.get(), pos);
         setEndingSelection(VisibleSelection(positionInParentAfterNode(nodeToInsert.get()), DOWNSTREAM, endingSelection().isDirectional()));
-    } else if (is<Text>(pos.deprecatedNode())) {
+    } else if (is<Text>(*pos.deprecatedNode())) {
         // Split a text node
         Text& textNode = downcast<Text>(*pos.deprecatedNode());
         splitTextNode(&textNode, pos.deprecatedEditingOffset());
index 116e21d..58e5c71 100644 (file)
@@ -74,7 +74,7 @@ PassRefPtr<HTMLElement> InsertListCommand::mergeWithNeighboringLists(PassRefPtr<
     if (!list)
         return nullptr;
     Element* sibling = ElementTraversal::nextSibling(list.get());
-    if (!sibling || !is<HTMLElement>(sibling))
+    if (!is<HTMLElement>(sibling))
         return list.release();
 
     RefPtr<HTMLElement> nextList = downcast<HTMLElement>(sibling);
index e9fe5ad..606117b 100644 (file)
@@ -169,7 +169,7 @@ void InsertParagraphSeparatorCommand::doApply()
     if (!startBlock
         || !startBlock->nonShadowBoundaryParentNode()
         || isTableCell(startBlock.get())
-        || is<HTMLFormElement>(startBlock.get())
+        || is<HTMLFormElement>(*startBlock)
         // 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))) {
@@ -331,7 +331,7 @@ void InsertParagraphSeparatorCommand::doApply()
     Position leadingWhitespace = insertionPosition.leadingWhitespacePosition(VP_DEFAULT_AFFINITY);
     // FIXME: leadingWhitespacePosition is returning the position before preserved newlines for positions
     // after the preserved newline, causing the newline to be turned into a nbsp.
-    if (leadingWhitespace.isNotNull() && is<Text>(leadingWhitespace.deprecatedNode())) {
+    if (is<Text>(leadingWhitespace.deprecatedNode())) {
         Text& textNode = downcast<Text>(*leadingWhitespace.deprecatedNode());
         ASSERT(!textNode.renderer() || textNode.renderer()->style().collapseWhiteSpace());
         replaceTextInNodePreservingMarkers(&textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
@@ -339,7 +339,7 @@ void InsertParagraphSeparatorCommand::doApply()
     
     // Split at pos if in the middle of a text node.
     Position positionAfterSplit;
-    if (insertionPosition.anchorType() == Position::PositionIsOffsetInAnchor && is<Text>(insertionPosition.containerNode())) {
+    if (insertionPosition.anchorType() == Position::PositionIsOffsetInAnchor && is<Text>(*insertionPosition.containerNode())) {
         RefPtr<Text> textNode = downcast<Text>(insertionPosition.containerNode());
         bool atEnd = static_cast<unsigned>(insertionPosition.offsetInContainerNode()) >= textNode->length();
         if (insertionPosition.deprecatedEditingOffset() > 0 && !atEnd) {
@@ -399,7 +399,7 @@ void InsertParagraphSeparatorCommand::doApply()
             // Clear out all whitespace and insert one non-breaking space
             ASSERT(!positionAfterSplit.containerNode()->renderer() || positionAfterSplit.containerNode()->renderer()->style().collapseWhiteSpace());
             deleteInsignificantTextDownstream(positionAfterSplit);
-            if (is<Text>(positionAfterSplit.deprecatedNode()))
+            if (is<Text>(*positionAfterSplit.deprecatedNode()))
                 insertTextIntoNode(downcast<Text>(positionAfterSplit.containerNode()), 0, nonBreakingSpaceString());
         }
     }
index a701f89..bdd59a3 100644 (file)
@@ -250,7 +250,7 @@ Position InsertTextCommand::insertTab(const Position& pos)
     RefPtr<Element> spanNode = createTabSpanElement(document());
     
     // place it
-    if (!is<Text>(node)) {
+    if (!is<Text>(*node)) {
         insertNodeAt(spanNode.get(), insertPos);
     } else {
         RefPtr<Text> textNode = downcast<Text>(node);
index 155e17a..458363b 100644 (file)
@@ -448,7 +448,7 @@ static bool isHeaderElement(const Node* a)
 
 static bool haveSameTagName(Node* a, Node* b)
 {
-    return a && b && is<Element>(a) && is<Element>(b) && downcast<Element>(*a).tagName() == downcast<Element>(*b).tagName();
+    return is<Element>(a) && is<Element>(b) && downcast<Element>(*a).tagName() == downcast<Element>(*b).tagName();
 }
 
 bool ReplaceSelectionCommand::shouldMerge(const VisiblePosition& source, const VisiblePosition& destination)
@@ -488,7 +488,7 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert
         const StyleProperties* inlineStyle = element->inlineStyle();
         RefPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle);
         if (inlineStyle) {
-            if (is<HTMLElement>(element)) {
+            if (is<HTMLElement>(*element)) {
                 Vector<QualifiedName> attributes;
                 HTMLElement& htmlElement = downcast<HTMLElement>(*element);
 
@@ -683,7 +683,7 @@ void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
     document().updateLayoutIgnorePendingStylesheets();
 
     Node* lastLeafInserted = insertedNodes.lastLeafInserted();
-    if (lastLeafInserted && is<Text>(lastLeafInserted) && !hasRenderedText(downcast<Text>(*lastLeafInserted))
+    if (is<Text>(lastLeafInserted) && !hasRenderedText(downcast<Text>(*lastLeafInserted))
         && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
         && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) {
         insertedNodes.willRemoveNode(lastLeafInserted);
@@ -693,7 +693,7 @@ void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
     // We don't have to make sure that firstNodeInserted isn't inside a select or script element
     // because it is a top level node in the fragment and the user can't insert into those elements.
     Node* firstNodeInserted = insertedNodes.firstNodeInserted();
-    if (firstNodeInserted && is<Text>(firstNodeInserted) && !hasRenderedText(downcast<Text>(*firstNodeInserted))) {
+    if (is<Text>(firstNodeInserted) && !hasRenderedText(downcast<Text>(*firstNodeInserted))) {
         insertedNodes.willRemoveNode(firstNodeInserted);
         removeNode(firstNodeInserted);
     }
@@ -1273,7 +1273,7 @@ bool ReplaceSelectionCommand::shouldPerformSmartReplace() const
         return false;
 
     Element* textControl = enclosingTextFormControl(positionAtStartOfInsertedContent().deepEquivalent());
-    if (textControl && is<HTMLInputElement>(textControl) && downcast<HTMLInputElement>(*textControl).isPasswordField())
+    if (is<HTMLInputElement>(textControl) && downcast<HTMLInputElement>(*textControl).isPasswordField())
         return false; // Disable smart replace for password fields.
 
     return true;
@@ -1291,7 +1291,7 @@ void ReplaceSelectionCommand::addSpacesForSmartReplace()
 
     Position endUpstream = endOfInsertedContent.deepEquivalent().upstream();
     Node* endNode = endUpstream.computeNodeBeforePosition();
-    int endOffset = endNode && is<Text>(endNode) ? downcast<Text>(*endNode).length() : 0;
+    int endOffset = is<Text>(endNode) ? downcast<Text>(*endNode).length() : 0;
     if (endUpstream.anchorType() == Position::PositionIsOffsetInAnchor) {
         endNode = endUpstream.containerNode();
         endOffset = endUpstream.offsetInContainerNode();
@@ -1300,7 +1300,7 @@ void ReplaceSelectionCommand::addSpacesForSmartReplace()
     bool needsTrailingSpace = !isEndOfParagraph(endOfInsertedContent) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(endOfInsertedContent.characterAfter(), false);
     if (needsTrailingSpace && endNode) {
         bool collapseWhiteSpace = !endNode->renderer() || endNode->renderer()->style().collapseWhiteSpace();
-        if (is<Text>(endNode)) {
+        if (is<Text>(*endNode)) {
             insertTextIntoNode(downcast<Text>(endNode), endOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
             if (m_endOfInsertedContent.containerNode() == endNode)
                 m_endOfInsertedContent.moveToOffset(m_endOfInsertedContent.offsetInContainerNode() + 1);
@@ -1324,7 +1324,7 @@ void ReplaceSelectionCommand::addSpacesForSmartReplace()
     bool needsLeadingSpace = !isStartOfParagraph(startOfInsertedContent) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(startOfInsertedContent.previous().characterAfter(), true);
     if (needsLeadingSpace && startNode) {
         bool collapseWhiteSpace = !startNode->renderer() || startNode->renderer()->style().collapseWhiteSpace();
-        if (is<Text>(startNode)) {
+        if (is<Text>(*startNode)) {
             insertTextIntoNode(downcast<Text>(startNode), startOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
             if (m_endOfInsertedContent.containerNode() == startNode && m_endOfInsertedContent.offsetInContainerNode())
                 m_endOfInsertedContent.moveToOffset(m_endOfInsertedContent.offsetInContainerNode() + 1);
@@ -1375,22 +1375,22 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
     bool positionIsOffsetInAnchor = position.anchorType() == Position::PositionIsOffsetInAnchor;
     bool positionOnlyToBeUpdatedIsOffsetInAnchor = positionOnlyToBeUpdated.anchorType() == Position::PositionIsOffsetInAnchor;
     RefPtr<Text> text;
-    if (positionIsOffsetInAnchor && position.containerNode() && is<Text>(position.containerNode()))
+    if (positionIsOffsetInAnchor && is<Text>(position.containerNode()))
         text = downcast<Text>(position.containerNode());
     else {
         Node* before = position.computeNodeBeforePosition();
-        if (before && is<Text>(before))
+        if (is<Text>(before))
             text = downcast<Text>(before);
         else {
             Node* after = position.computeNodeAfterPosition();
-            if (after && is<Text>(after))
+            if (is<Text>(after))
                 text = downcast<Text>(after);
         }
     }
     if (!text)
         return;
 
-    if (text->previousSibling() && is<Text>(text->previousSibling())) {
+    if (is<Text>(text->previousSibling())) {
         RefPtr<Text> previous = downcast<Text>(text->previousSibling());
         insertTextIntoNode(text, 0, previous->data());
 
@@ -1409,7 +1409,7 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
 
         removeNode(previous);
     }
-    if (text->nextSibling() && is<Text>(text->nextSibling())) {
+    if (is<Text>(text->nextSibling())) {
         RefPtr<Text> next = downcast<Text>(text->nextSibling());
         unsigned originalLength = text->length();
         insertTextIntoNode(text, originalLength, next->data());
@@ -1449,7 +1449,7 @@ Node* ReplaceSelectionCommand::insertAsListItems(PassRefPtr<HTMLElement> prpList
     // list items and insert these nodes between them.
     if (isMiddle) {
         int textNodeOffset = insertPos.offsetInContainerNode();
-        if (is<Text>(insertPos.deprecatedNode()) && textNodeOffset > 0)
+        if (is<Text>(*insertPos.deprecatedNode()) && textNodeOffset > 0)
             splitTextNode(downcast<Text>(insertPos.deprecatedNode()), textNodeOffset);
         splitTreeToNode(insertPos.deprecatedNode(), lastNode, true);
     }
@@ -1488,7 +1488,7 @@ void ReplaceSelectionCommand::updateNodesInserted(Node *node)
 // split text nodes.
 bool ReplaceSelectionCommand::performTrivialReplace(const ReplacementFragment& fragment)
 {
-    if (!fragment.firstChild() || fragment.firstChild() != fragment.lastChild() || !is<Text>(fragment.firstChild()))
+    if (!is<Text>(fragment.firstChild()) || fragment.firstChild() != fragment.lastChild())
         return false;
 
     // FIXME: Would be nice to handle smart replace in the fast path.
index e95d854..07a23af 100644 (file)
@@ -151,7 +151,7 @@ bool SpellChecker::isCheckable(Range* range) const
     if (!range || !range->firstNode() || !range->firstNode()->renderer())
         return false;
     const Node* node = range->startContainer();
-    if (node && is<Element>(node) && !downcast<Element>(*node).isSpellCheckingEnabled())
+    if (is<Element>(node) && !downcast<Element>(*node).isSpellCheckingEnabled())
         return false;
     return true;
 }
index 8f7bdf5..5175e3a 100644 (file)
@@ -57,7 +57,7 @@ void SplitTextNodeContainingElementCommand::doApply()
     if (!parentRenderer || !parentRenderer->isInline()) {
         wrapContentsInDummySpan(parent);
         Node* firstChild = parent->firstChild();
-        if (!firstChild || !is<Element>(firstChild))
+        if (!is<Element>(firstChild))
             return;
         parent = downcast<Element>(firstChild);
     }
index a5d286c..8eb4f00 100644 (file)
@@ -255,7 +255,7 @@ bool isRendererReplacedElement(RenderObject* renderer)
     if (renderer->isImage() || renderer->isWidget() || renderer->isMedia())
         return true;
 
-    if (renderer->node() && is<Element>(renderer->node())) {
+    if (is<Element>(renderer->node())) {
         Element& element = downcast<Element>(*renderer->node());
         if (is<HTMLFormControlElement>(element) || is<HTMLLegendElement>(element) || is<HTMLMeterElement>(element) || is<HTMLProgressElement>(element))
             return true;
index 612080d..c99f5bf 100644 (file)
@@ -664,7 +664,7 @@ Node* VisibleSelection::nonBoundaryShadowTreeRootNode() const
 bool VisibleSelection::isInPasswordField() const
 {
     HTMLTextFormControlElement* textControl = enclosingTextFormControl(start());
-    return textControl && is<HTMLInputElement>(textControl) && downcast<HTMLInputElement>(*textControl).isPasswordField();
+    return is<HTMLInputElement>(textControl) && downcast<HTMLInputElement>(*textControl).isPasswordField();
 }
 
 #ifndef NDEBUG
index bdf1326..eb5de06 100644 (file)
@@ -767,7 +767,7 @@ static VisiblePosition startPositionForLine(const VisiblePosition& c, LineEndpoi
         }
     }
 
-    return is<Text>(startNode) ? Position(downcast<Text>(startNode), toInlineTextBox(startBox)->start())
+    return is<Text>(*startNode) ? Position(downcast<Text>(startNode), toInlineTextBox(startBox)->start())
         : positionBeforeNode(startNode);
 }
 
@@ -838,7 +838,7 @@ static VisiblePosition endPositionForLine(const VisiblePosition& c, LineEndpoint
     Position pos;
     if (endNode->hasTagName(brTag))
         pos = positionBeforeNode(endNode);
-    else if (endBox->isInlineTextBox() && is<Text>(endNode)) {
+    else if (endBox->isInlineTextBox() && is<Text>(*endNode)) {
         InlineTextBox* endTextBox = toInlineTextBox(endBox);
         int endOffset = endTextBox->start();
         if (!endTextBox->isLineBreak())
@@ -1143,7 +1143,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c, EditingBoundaryCrossi
             break;
 
         if (r->isText() && toRenderText(r)->hasRenderedText()) {
-            ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(n));
+            ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(*n));
             type = Position::PositionIsOffsetInAnchor;
             if (style.preserveNewline()) {
                 StringImpl& text = *toRenderText(r)->text();
@@ -1226,7 +1226,7 @@ VisiblePosition endOfParagraph(const VisiblePosition& c, EditingBoundaryCrossing
 
         // FIXME: We avoid returning a position where the renderer can't accept the caret.
         if (r->isText() && toRenderText(r)->hasRenderedText()) {
-            ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(n));
+            ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(*n));
             type = Position::PositionIsOffsetInAnchor;
             if (style.preserveNewline()) {
                 StringImpl& text = *toRenderText(r)->text();
index a7e0b47..0d5d3fe 100644 (file)
@@ -1357,7 +1357,7 @@ NSDictionary* HTMLConverter::attributesForElement(Element& element)
 NSDictionary* HTMLConverter::aggregatedAttributesForAncestors(CharacterData& node)
 {
     Node* ancestor = node.parentNode();
-    while (ancestor && !is<Element>(ancestor))
+    while (ancestor && !is<Element>(*ancestor))
         ancestor = ancestor->parentNode();
     if (!ancestor)
         return nullptr;
@@ -1374,7 +1374,7 @@ NSDictionary* HTMLConverter::aggregatedAttributesForElementAndItsAncestors(Eleme
     ASSERT(attributesForCurrentElement);
 
     Node* ancestor = element.parentNode();
-    while (ancestor && !is<Element>(ancestor))
+    while (ancestor && !is<Element>(*ancestor))
         ancestor = ancestor->parentNode();
 
     if (!ancestor) {
@@ -2571,7 +2571,7 @@ NSAttributedString *editingAttributedStringFromRange(Range& range)
         
         if (startContainer == endContainer && (startOffset == endOffset - 1)) {
             Node* node = startContainer->traverseToChildAt(startOffset);
-            if (node && is<HTMLImageElement>(node)) {
+            if (is<HTMLImageElement>(node)) {
                 NSFileWrapper* fileWrapper = fileWrapperForElement(downcast<HTMLImageElement>(node));
                 NSTextAttachment* attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper];
                 [string appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];
index ebf5b5c..163d10f 100644 (file)
@@ -316,7 +316,7 @@ bool isInline(const Node* node)
 Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
 {
     Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule);
-    return enclosingNode && is<Element>(enclosingNode) ? downcast<Element>(enclosingNode) : nullptr;
+    return is<Element>(enclosingNode) ? downcast<Element>(enclosingNode) : nullptr;
 }
 
 TextDirection directionOfEnclosingBlock(const Position& position)
@@ -550,7 +550,7 @@ Element* enclosingElementWithTag(const Position& position, const QualifiedName&
     for (Node* node = position.deprecatedNode(); node; node = node->parentNode()) {
         if (root && !node->hasEditableStyle())
             continue;
-        if (!is<Element>(node))
+        if (!is<Element>(*node))
             continue;
         if (downcast<Element>(*node).hasTagName(tagName))
             return downcast<Element>(node);
@@ -638,7 +638,7 @@ Element* enclosingAnchorElement(const Position& p)
         return nullptr;
 
     for (Node* node = p.deprecatedNode(); node; node = node->parentNode()) {
-        if (is<Element>(node) && node->isLink())
+        if (is<Element>(*node) && node->isLink())
             return downcast<Element>(node);
     }
     return nullptr;
@@ -652,7 +652,7 @@ HTMLElement* enclosingList(Node* node)
     Node* root = highestEditableRoot(firstPositionInOrBeforeNode(node));
     
     for (ContainerNode* ancestor = node->parentNode(); ancestor; ancestor = ancestor->parentNode()) {
-        if (is<HTMLUListElement>(ancestor) || is<HTMLOListElement>(ancestor))
+        if (is<HTMLUListElement>(*ancestor) || is<HTMLOListElement>(*ancestor))
             return downcast<HTMLElement>(ancestor);
         if (ancestor == root)
             return nullptr;
@@ -1055,7 +1055,7 @@ bool lineBreakExistsAtPosition(const Position& position)
     if (!position.anchorNode()->renderer())
         return false;
     
-    if (!is<Text>(position.anchorNode()) || !position.anchorNode()->renderer()->style().preserveNewline())
+    if (!is<Text>(*position.anchorNode()) || !position.anchorNode()->renderer()->style().preserveNewline())
         return false;
     
     Text& textNode = downcast<Text>(*position.anchorNode());
@@ -1184,15 +1184,15 @@ bool isRenderedAsNonInlineTableImageOrHR(const Node* node)
 
 bool areIdenticalElements(const Node* first, const Node* second)
 {
-    if (!is<Element>(first) || !is<Element>(second))
+    if (!is<Element>(*first) || !is<Element>(*second))
         return false;
 
-    const Element* firstElement = downcast<Element>(first);
-    const Element* secondElement = downcast<Element>(second);
-    if (!firstElement->hasTagName(secondElement->tagQName()))
+    const Element& firstElement = downcast<Element>(*first);
+    const Element& secondElement = downcast<Element>(*second);
+    if (!firstElement.hasTagName(secondElement.tagQName()))
         return false;
 
-    return firstElement->hasEquivalentAttributes(secondElement);
+    return firstElement.hasEquivalentAttributes(&secondElement);
 }
 
 bool isNonTableCellHTMLBlockElement(const Node* node)
@@ -1200,7 +1200,7 @@ bool isNonTableCellHTMLBlockElement(const Node* node)
     return node->hasTagName(listingTag)
         || node->hasTagName(olTag)
         || node->hasTagName(preTag)
-        || is<HTMLTableElement>(node)
+        || is<HTMLTableElement>(*node)
         || node->hasTagName(ulTag)
         || node->hasTagName(xmpTag)
         || node->hasTagName(h1Tag)
@@ -1251,7 +1251,7 @@ Element* deprecatedEnclosingBlockFlowElement(Node* node)
     if (isBlockFlowElement(node))
         return downcast<Element>(node);
     while ((node = node->parentNode())) {
-        if (isBlockFlowElement(node) || is<HTMLBodyElement>(node))
+        if (isBlockFlowElement(node) || is<HTMLBodyElement>(*node))
             return downcast<Element>(node);
     }
     return nullptr;
index d9233a2..c5e7fe4 100644 (file)
@@ -181,7 +181,7 @@ void Editor::setTextAlignmentForChangedBaseWritingDirection(WritingDirection dir
         return;
 
     Element* focusedElement = m_frame.document()->focusedElement();
-    if (focusedElement && (is<HTMLTextAreaElement>(focusedElement) || (is<HTMLInputElement>(focusedElement)
+    if (focusedElement && (is<HTMLTextAreaElement>(*focusedElement) || (is<HTMLInputElement>(*focusedElement)
         && (downcast<HTMLInputElement>(*focusedElement).isTextField()
             || downcast<HTMLInputElement>(*focusedElement).isSearchField())))) {
         if (direction == NaturalWritingDirection)
index 1b90be2..90f455b 100644 (file)
@@ -234,7 +234,7 @@ String StyledMarkupAccumulator::takeResults()
 
 void StyledMarkupAccumulator::appendText(StringBuilder& out, const Text& text)
 {    
-    const bool parentIsTextarea = text.parentElement() && is<HTMLTextAreaElement>(text.parentElement());
+    const bool parentIsTextarea = is<HTMLTextAreaElement>(text.parentElement());
     const bool wrappingSpan = shouldApplyWrappingStyle(text) && !parentIsTextarea;
     if (wrappingSpan) {
         RefPtr<EditingStyle> wrappingStyle = m_wrappingStyle->copy();
@@ -452,7 +452,7 @@ static Node* ancestorToRetainStructureAndAppearanceForBlock(Node* commonAncestor
 
     if (commonAncestorBlock->hasTagName(tbodyTag) || commonAncestorBlock->hasTagName(trTag)) {
         ContainerNode* table = commonAncestorBlock->parentNode();
-        while (table && !is<HTMLTableElement>(table))
+        while (table && !is<HTMLTableElement>(*table))
             table = table->parentNode();
 
         return table;
@@ -743,7 +743,8 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
 
 bool isPlainTextMarkup(Node* node)
 {
-    if (!is<HTMLDivElement>(node))
+    ASSERT(node);
+    if (!is<HTMLDivElement>(*node))
         return false;
 
     HTMLDivElement& element = downcast<HTMLDivElement>(*node);
index 613668b..c06c6ab 100644 (file)
@@ -81,7 +81,7 @@ void FileReader::readAsArrayBuffer(Blob* blob, ExceptionCode& ec)
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", blob->url().string().utf8().data(), is<File>(blob) ? downcast<File>(*blob).path().utf8().data() : "");
+    LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", blob->url().string().utf8().data(), is<File>(*blob) ? downcast<File>(*blob).path().utf8().data() : "");
 
     readInternal(blob, FileReaderLoader::ReadAsArrayBuffer, ec);
 }
@@ -91,7 +91,7 @@ void FileReader::readAsBinaryString(Blob* blob, ExceptionCode& ec)
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as binary: %s %s\n", blob->url().string().utf8().data(), is<File>(blob) ? downcast<File>(*blob).path().utf8().data() : "");
+    LOG(FileAPI, "FileReader: reading as binary: %s %s\n", blob->url().string().utf8().data(), is<File>(*blob) ? downcast<File>(*blob).path().utf8().data() : "");
 
     readInternal(blob, FileReaderLoader::ReadAsBinaryString, ec);
 }
@@ -101,7 +101,7 @@ void FileReader::readAsText(Blob* blob, const String& encoding, ExceptionCode& e
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as text: %s %s\n", blob->url().string().utf8().data(), is<File>(blob) ? downcast<File>(*blob).path().utf8().data() : "");
+    LOG(FileAPI, "FileReader: reading as text: %s %s\n", blob->url().string().utf8().data(), is<File>(*blob) ? downcast<File>(*blob).path().utf8().data() : "");
 
     m_encoding = encoding;
     readInternal(blob, FileReaderLoader::ReadAsText, ec);
@@ -117,7 +117,7 @@ void FileReader::readAsDataURL(Blob* blob, ExceptionCode& ec)
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", blob->url().string().utf8().data(), is<File>(blob) ? downcast<File>(*blob).path().utf8().data() : "");
+    LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", blob->url().string().utf8().data(), is<File>(*blob) ? downcast<File>(*blob).path().utf8().data() : "");
 
     readInternal(blob, FileReaderLoader::ReadAsDataURL, ec);
 }
index 3c749a4..6b2a8e3 100644 (file)
@@ -73,7 +73,7 @@ void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree()
 void BaseChooserOnlyDateAndTimeInputType::updateAppearance()
 {
     Node* node = element().userAgentShadowRoot()->firstChild();
-    if (!node || !is<HTMLElement>(node))
+    if (!is<HTMLElement>(node))
         return;
     String displayValue = visibleValue();
     if (displayValue.isEmpty()) {
index 9b0fdea..f3ba9e5 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 (!is<HTMLTableElement>(tableElement.get()))
+    else if (!is<HTMLTableElement>(*tableElement))
         LOG_ERROR("Element of id \"ftpDirectoryTable\" is not a table element");
     else 
         m_tableElement = downcast<HTMLTableElement>(tableElement.get());
index 7045a8f..92d3816 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 && is<HTMLFormElement>(newFormCandidate))
+        if (is<HTMLFormElement>(newFormCandidate))
             newForm = downcast<HTMLFormElement>(newFormCandidate);
         return newForm;
     }
index 915e2aa..462b228 100644 (file)
@@ -152,13 +152,14 @@ bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
 
 static void appendServerMapMousePosition(StringBuilder& url, Event* event)
 {
-    if (!is<MouseEvent>(event))
+    ASSERT(event);
+    if (!is<MouseEvent>(*event))
         return;
 
     ASSERT(event->target());
     Node* target = event->target()->toNode();
     ASSERT(target);
-    if (!is<HTMLImageElement>(target))
+    if (!is<HTMLImageElement>(*target))
         return;
 
     HTMLImageElement& imageElement = downcast<HTMLImageElement>(*target);
@@ -196,7 +197,7 @@ void HTMLAnchorElement::defaultEventHandler(Event* event)
         if (hasEditableStyle()) {
             // This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked
             // for the LiveWhenNotFocused editable link behavior
-            if (event->type() == eventNames().mousedownEvent && is<MouseEvent>(event) && downcast<MouseEvent>(*event).button() != RightButton && document().frame()) {
+            if (event->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() != RightButton && document().frame()) {
                 setRootEditableElementForSelectionOnMouseDown(document().frame()->selection().selection().rootEditableElement());
                 m_wasShiftKeyDownOnMouseDown = downcast<MouseEvent>(*event).shiftKey();
             } else if (event->type() == eventNames().mouseoverEvent) {
@@ -555,7 +556,8 @@ void HTMLAnchorElement::handleClick(Event* event)
 
 HTMLAnchorElement::EventType HTMLAnchorElement::eventType(Event* event)
 {
-    if (!is<MouseEvent>(event))
+    ASSERT(event);
+    if (!is<MouseEvent>(*event))
         return NonMouseEvent;
     return downcast<MouseEvent>(*event).shiftKey() ? MouseEventWithShiftKey : MouseEventWithoutShiftKey;
 }
@@ -592,12 +594,12 @@ bool HTMLAnchorElement::treatLinkAsLiveForEventType(EventType eventType) const
 
 bool isEnterKeyKeydownEvent(Event* event)
 {
-    return event->type() == eventNames().keydownEvent && is<KeyboardEvent>(event) && downcast<KeyboardEvent>(*event).keyIdentifier() == "Enter";
+    return event->type() == eventNames().keydownEvent && is<KeyboardEvent>(*event) && downcast<KeyboardEvent>(*event).keyIdentifier() == "Enter";
 }
 
 bool isLinkClick(Event* event)
 {
-    return event->type() == eventNames().clickEvent && (!is<MouseEvent>(event) || downcast<MouseEvent>(*event).button() != RightButton);
+    return event->type() == eventNames().clickEvent && (!is<MouseEvent>(*event) || downcast<MouseEvent>(*event).button() != RightButton);
 }
 
 bool shouldProhibitLinks(Element* element)
index b1153e7..20bef28 100644 (file)
@@ -182,7 +182,7 @@ Path HTMLAreaElement::getRegion(const LayoutSize& size) const
 HTMLImageElement* HTMLAreaElement::imageElement() const
 {
     Node* mapElement = parentNode();
-    if (!mapElement || !is<HTMLMapElement>(mapElement))
+    if (!is<HTMLMapElement>(mapElement))
         return nullptr;
     
     return downcast<HTMLMapElement>(*mapElement).imageElement();
index 009329e..613d8ce 100644 (file)
@@ -175,7 +175,7 @@ Node::InsertionNotificationRequest HTMLBodyElement::insertedInto(ContainerNode&
     // magically appear on the <body> of all documents embedded through <iframe> or <frame>.
     // FIXME: Perhaps this code should be in attach() instead of here.
     HTMLFrameOwnerElement* ownerElement = document().ownerElement();
-    if (ownerElement && is<HTMLFrameElementBase>(*ownerElement)) {
+    if (is<HTMLFrameElementBase>(ownerElement)) {
         HTMLFrameElementBase& ownerFrameElement = downcast<HTMLFrameElementBase>(*ownerElement);
         int marginWidth = ownerFrameElement.marginWidth();
         if (marginWidth != -1)
index 4529f8b..28db92f 100644 (file)
@@ -123,7 +123,7 @@ void HTMLButtonElement::defaultEventHandler(Event* event)
         }
     }
 
-    if (is<KeyboardEvent>(event)) {
+    if (is<KeyboardEvent>(*event)) {
         KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
         if (keyboardEvent.type() == eventNames().keydownEvent && keyboardEvent.keyIdentifier() == "U+0020") {
             setActive(true, true);
index 7ac8693..17a0cfb 100644 (file)
@@ -400,7 +400,7 @@ Node* HTMLCollection::namedItem(const AtomicString& name) const
         } else if (treeScope.hasElementWithName(*name.impl())) {
             if (!treeScope.containsMultipleElementsWithName(name)) {
                 candidate = treeScope.getElementByName(name);
-                if (candidate && type() == DocAll && (!is<HTMLElement>(candidate) || !nameShouldBeVisibleInDocumentAll(downcast<HTMLElement>(*candidate))))
+                if (candidate && type() == DocAll && (!is<HTMLElement>(*candidate) || !nameShouldBeVisibleInDocumentAll(downcast<HTMLElement>(*candidate))))
                     candidate = nullptr;
             }
         } else
@@ -443,7 +443,7 @@ void HTMLCollection::updateNamedElementCache() const
         const AtomicString& idAttrVal = element->getIdAttribute();
         if (!idAttrVal.isEmpty())
             cache->appendIdCache(idAttrVal, element);
-        if (!is<HTMLElement>(element))
+        if (!is<HTMLElement>(*element))
             continue;
         const AtomicString& nameAttrVal = element->getNameAttribute();
         if (!nameAttrVal.isEmpty() && idAttrVal != nameAttrVal && (type() != DocAll || nameShouldBeVisibleInDocumentAll(downcast<HTMLElement>(*element))))
index b2d6595..5837482 100644 (file)
@@ -139,7 +139,7 @@ void HTMLDocument::setDesignMode(const String& value)
 const AtomicString& HTMLDocument::bgColor() const
 {
     HTMLElement* bodyElement = body();
-    if (!bodyElement || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!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 || !is<HTMLBodyElement>(bodyElement))
+    if (!is<HTMLBodyElement>(bodyElement))
         return;
     return bodyElement->setAttribute(vlinkAttr, value);
 }
@@ -339,8 +339,7 @@ void HTMLDocument::clear()
 
 bool HTMLDocument::isFrameSet() const
 {
-    HTMLElement* bodyElement = body();
-    return bodyElement && is<HTMLFrameSetElement>(bodyElement);
+    return is<HTMLFrameSetElement>(body());
 }
 
 PassRefPtr<Document> HTMLDocument::cloneDocumentWithoutChildren() const
index 9ac413f..c7931ae 100644 (file)
@@ -364,7 +364,7 @@ bool HTMLElement::matchesReadWritePseudoClass() const
 {
     const Element* currentElement = this;
     do {
-        if (is<HTMLElement>(currentElement)) {
+        if (is<HTMLElement>(*currentElement)) {
             switch (contentEditableType(downcast<HTMLElement>(*currentElement))) {
             case ContentEditableType::True:
             case ContentEditableType::PlaintextOnly:
@@ -436,7 +436,7 @@ void HTMLElement::setInnerHTML(const String& html, Excepti