Let is<T>() accept RefPtrs
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Nov 2017 05:43:02 +0000 (05:43 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Nov 2017 05:43:02 +0000 (05:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178612
<rdar://problem/35102004>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Get rid of .get() for all is<T>() calls.

No changes in behaviors.

* bindings/js/JSElementCustom.cpp:
(WebCore::createNewElementWrapper):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* bindings/js/JSTextCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::loadSubimages):
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::matchingFaces):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapNinePieceImage):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::createGridTrackList):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueCursor):
(WebCore::StyleBuilderCustom::applyValueContent):
(WebCore::StyleBuilderCustom::applyValueWillChange):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::propertyAsColor const):
(WebCore::StyleProperties::propertyAsValueID const):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/TransformFunctions.cpp:
(WebCore::transformsForValue):
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::getViewportArgumentValue const):
* dom/Document.cpp:
(WebCore::Document::setBodyOrFrameset):
(WebCore::Document::setFocusedElement):
(WebCore::Document::updateHoverActiveState):
* dom/Element.cpp:
(WebCore::Element::setOuterHTML):
* dom/Range.cpp:
(WebCore::Range::insertNode):
* editing/ApplyStyleCommand.cpp:
(WebCore::toIdentifier):
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty):
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle const):
(WebCore::EditingStyle::extractFontSizeDelta):
(WebCore::EditingStyle::textDirection const):
(WebCore::textDecorationValueList):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::EditingStyle::legacyFontSize const):
(WebCore::EditingStyle::textDirectionForSelection):
(WebCore::StyleChange::StyleChange):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::findAssociatedForm):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::imageElement const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterText):
(WebCore::HTMLElement::dirAttributeChanged):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::dataList const):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isKeyboardFocusable const):
(WebCore::HTMLPlugInElement::isUserObservable const):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::selectOption):
* html/HTMLSummaryElement.cpp:
(WebCore::isClickableControl):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::isKeyboardFocusable const):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::attachLater):
(WebCore::HTMLConstructionSite::insertTextNode):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
* html/track/TextTrackList.cpp:
(TextTrackList::append):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeName):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
* page/FocusController.cpp:
(WebCore::shouldClearSelectionWhenChangingFocusedElement):
* page/FrameView.cpp:
(WebCore::FrameView::hasCustomScrollbars const):
* page/Page.cpp:
(WebCore::Page::pluginViews):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformPrepareForWheelEvents):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* testing/Internals.cpp:
(WebCore::deferredStyleRulesCountForList):
(WebCore::deferredGroupRulesCountForList):
(WebCore::deferredKeyframesRulesCountForList):

Source/WTF:

Add support for is<T>() for RefPtrs.

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

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

47 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/RefPtr.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSElementCustom.cpp
Source/WebCore/bindings/js/JSMediaStreamTrackCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSTextCustom.cpp
Source/WebCore/css/CSSFilterImageValue.cpp
Source/WebCore/css/CSSFontFaceSet.cpp
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSToStyleMap.cpp
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/StyleProperties.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/TransformFunctions.cpp
Source/WebCore/css/ViewportStyleResolver.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Range.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/HTMLAreaElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/RadioInputType.cpp
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/track/TextTrackList.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/PageScriptDebugServer.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/testing/Internals.cpp

index 71013f2..9814f7e 100644 (file)
@@ -1,3 +1,16 @@
+2017-11-01  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Let is<T>() accept RefPtrs
+        https://bugs.webkit.org/show_bug.cgi?id=178612
+        <rdar://problem/35102004>
+
+        Reviewed by Ryosuke Niwa.
+
+        Add support for is<T>() for RefPtrs.
+
+        * wtf/RefPtr.h:
+        (WTF::is):
+
 2017-11-01  Simon Fraser  <simon.fraser@apple.com>
 
         Misc display list and other cleanup
index 8d1415f..0482411 100644 (file)
@@ -238,6 +238,16 @@ template<typename T> inline RefPtr<T> makeRefPtr(T& reference)
     return &reference;
 }
 
+template<typename ExpectedType, typename ArgType> inline bool is(RefPtr<ArgType>& source)
+{
+    return is<ExpectedType>(source.get());
+}
+
+template<typename ExpectedType, typename ArgType> inline bool is(const RefPtr<ArgType>& source)
+{
+    return is<ExpectedType>(source.get());
+}
+
 } // namespace WTF
 
 using WTF::RefPtr;
index 3223382..30011c6 100644 (file)
@@ -1,3 +1,127 @@
+2017-11-01  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Let is<T>() accept RefPtrs
+        https://bugs.webkit.org/show_bug.cgi?id=178612
+        <rdar://problem/35102004>
+
+        Reviewed by Ryosuke Niwa.
+
+        Get rid of .get() for all is<T>() calls.
+
+        No changes in behaviors.
+
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::createNewElementWrapper):
+        * bindings/js/JSMediaStreamTrackCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::createWrapperInline):
+        * bindings/js/JSTextCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        * css/CSSFilterImageValue.cpp:
+        (WebCore::CSSFilterImageValue::loadSubimages):
+        * css/CSSFontFaceSet.cpp:
+        (WebCore::CSSFontFaceSet::matchingFaces):
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule):
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::mapNinePieceImage):
+        * css/FontFace.cpp:
+        (WebCore::FontFace::create):
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::createGridTrackList):
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueCursor):
+        (WebCore::StyleBuilderCustom::applyValueContent):
+        (WebCore::StyleBuilderCustom::applyValueWillChange):
+        * css/StyleProperties.cpp:
+        (WebCore::StyleProperties::propertyAsColor const):
+        (WebCore::StyleProperties::propertyAsValueID const):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::createFilterOperations):
+        * css/TransformFunctions.cpp:
+        (WebCore::transformsForValue):
+        * css/ViewportStyleResolver.cpp:
+        (WebCore::ViewportStyleResolver::getViewportArgumentValue const):
+        * dom/Document.cpp:
+        (WebCore::Document::setBodyOrFrameset):
+        (WebCore::Document::setFocusedElement):
+        (WebCore::Document::updateHoverActiveState):
+        * dom/Element.cpp:
+        (WebCore::Element::setOuterHTML):
+        * dom/Range.cpp:
+        (WebCore::Range::insertNode):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::toIdentifier):
+        (WebCore::ApplyStyleCommand::applyBlockStyle):
+        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
+        * editing/EditingStyle.cpp:
+        (WebCore::identifierForStyleProperty):
+        (WebCore::HTMLElementEquivalent::valueIsPresentInStyle const):
+        (WebCore::EditingStyle::extractFontSizeDelta):
+        (WebCore::EditingStyle::textDirection const):
+        (WebCore::textDecorationValueList):
+        (WebCore::EditingStyle::prepareToApplyAt):
+        (WebCore::EditingStyle::legacyFontSize const):
+        (WebCore::EditingStyle::textDirectionForSelection):
+        (WebCore::StyleChange::StyleChange):
+        (WebCore::StyleChange::extractTextStyles):
+        (WebCore::diffTextDecorations):
+        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
+        (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
+        * html/FormAssociatedElement.cpp:
+        (WebCore::FormAssociatedElement::findAssociatedForm):
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::imageElement const):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::setOuterText):
+        (WebCore::HTMLElement::dirAttributeChanged):
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::rendererIsNeeded):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::dataList const):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::setText):
+        (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
+        (WebCore::HTMLPlugInElement::isUserObservable const):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::selectOption):
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::isClickableControl):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
+        * html/RadioInputType.cpp:
+        (WebCore::RadioInputType::isKeyboardFocusable const):
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::attachLater):
+        (WebCore::HTMLConstructionSite::insertTextNode):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
+        * html/track/TextTrackList.cpp:
+        (TextTrackList::append):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::setNodeName):
+        * inspector/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::setJavaScriptPaused):
+        * page/FocusController.cpp:
+        (WebCore::shouldClearSelectionWhenChangingFocusedElement):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::hasCustomScrollbars const):
+        * page/Page.cpp:
+        (WebCore::Page::pluginViews):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::platformPrepareForWheelEvents):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        * testing/Internals.cpp:
+        (WebCore::deferredStyleRulesCountForList):
+        (WebCore::deferredGroupRulesCountForList):
+        (WebCore::deferredKeyframesRulesCountForList):
+
 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [curl] Fix build after r224299
index 5855320..a90dcd9 100644 (file)
@@ -49,9 +49,9 @@ using namespace HTMLNames;
 
 static JSValue createNewElementWrapper(JSDOMGlobalObject* globalObject, Ref<Element>&& element)
 {
-    if (is<HTMLElement>(element.get()))
+    if (is<HTMLElement>(element))
         return createJSHTMLWrapper(globalObject, static_reference_cast<HTMLElement>(WTFMove(element)));
-    if (is<SVGElement>(element.get()))
+    if (is<SVGElement>(element))
         return createJSSVGWrapper(globalObject, static_reference_cast<SVGElement>(WTFMove(element)));
     return createWrapper<Element>(globalObject, WTFMove(element));
 }
index 4c0faaf..15687be 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 
 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<MediaStreamTrack>&& object)
 {
-    if (is<CanvasCaptureMediaStreamTrack>(object.get()))
+    if (is<CanvasCaptureMediaStreamTrack>(object))
         return createWrapper<CanvasCaptureMediaStreamTrack>(globalObject, WTFMove(object));
     return createWrapper<MediaStreamTrack>(globalObject, WTFMove(object));
 }
index 6036052..9f36e74 100644 (file)
@@ -128,9 +128,9 @@ static ALWAYS_INLINE JSValue createWrapperInline(ExecState* exec, JSDOMGlobalObj
     JSDOMObject* wrapper;    
     switch (node->nodeType()) {
         case Node::ELEMENT_NODE:
-            if (is<HTMLElement>(node.get()))
+            if (is<HTMLElement>(node))
                 wrapper = createJSHTMLWrapper(globalObject, static_reference_cast<HTMLElement>(WTFMove(node)));
-            else if (is<SVGElement>(node.get()))
+            else if (is<SVGElement>(node))
                 wrapper = createJSSVGWrapper(globalObject, static_reference_cast<SVGElement>(WTFMove(node)));
             else
                 wrapper = createWrapper<Element>(globalObject, WTFMove(node));
index 8343e50..1213d15 100644 (file)
@@ -34,7 +34,7 @@ using namespace JSC;
 
 JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<Text>&& text)
 {
-    if (is<CDATASection>(text.get()))
+    if (is<CDATASection>(text))
         return createWrapper<CDATASection>(globalObject, WTFMove(text));
     return createWrapper<Text>(globalObject, WTFMove(text));
 }
index a8b0b14..eaab703 100644 (file)
@@ -95,7 +95,7 @@ void CSSFilterImageValue::loadSubimages(CachedResourceLoader& cachedResourceLoad
     }
 
     for (auto& filterOperation : m_filterOperations.operations()) {
-        if (!is<ReferenceFilterOperation>(filterOperation.get()))
+        if (!is<ReferenceFilterOperation>(filterOperation))
             continue;
         auto& referenceFilterOperation = downcast<ReferenceFilterOperation>(*filterOperation);
         referenceFilterOperation.loadExternalDocumentIfNeeded(cachedResourceLoader, options);
index 63b348b..984a1e0 100644 (file)
@@ -338,7 +338,7 @@ ExceptionOr<Vector<std::reference_wrapper<CSSFontFace>>> CSSFontFaceSet::matchin
     FontSelectionRequest request = computeFontSelectionRequest(style.get());
 
     auto family = style->getPropertyCSSValue(CSSPropertyFontFamily);
-    if (!is<CSSValueList>(family.get()))
+    if (!is<CSSValueList>(family))
         return Exception { SyntaxError };
     CSSValueList& familyList = downcast<CSSValueList>(*family);
 
index 3856968..f6cd535 100644 (file)
@@ -158,7 +158,7 @@ void CSSFontSelector::addFontFaceRule(StyleRuleFontFace& fontFaceRule, bool isIn
     RefPtr<CSSValue> variantAlternates = style.getPropertyCSSValue(CSSPropertyFontVariantAlternates);
     RefPtr<CSSValue> variantEastAsian = style.getPropertyCSSValue(CSSPropertyFontVariantEastAsian);
     RefPtr<CSSValue> loadingBehavior = style.getPropertyCSSValue(CSSPropertyFontDisplay);
-    if (!is<CSSValueList>(fontFamily.get()) || !is<CSSValueList>(src.get()) || (unicodeRange && !is<CSSValueList>(*unicodeRange)))
+    if (!is<CSSValueList>(fontFamily) || !is<CSSValueList>(src) || (unicodeRange && !is<CSSValueList>(*unicodeRange)))
         return;
 
     CSSValueList& familyList = downcast<CSSValueList>(*fontFamily);
index 0b5f4c2..f9e4589 100644 (file)
@@ -549,11 +549,11 @@ void CSSToStyleMap::mapNinePieceImage(CSSPropertyID property, CSSValue* value, N
     CSSValueList& borderImage = downcast<CSSValueList>(*value);
 
     for (auto& current : borderImage) {
-        if (is<CSSImageValue>(current.get()) || is<CSSImageGeneratorValue>(current.get()) || is<CSSImageSetValue>(current.get()))
+        if (is<CSSImageValue>(current) || is<CSSImageGeneratorValue>(current) || is<CSSImageSetValue>(current))
             image.setImage(styleImage(current.get()));
-        else if (is<CSSBorderImageSliceValue>(current.get()))
+        else if (is<CSSBorderImageSliceValue>(current))
             mapNinePieceImageSlice(current, image);
-        else if (is<CSSValueList>(current.get())) {
+        else if (is<CSSValueList>(current)) {
             CSSValueList& slashList = downcast<CSSValueList>(current.get());
             // Map in the image slices.
             if (is<CSSBorderImageSliceValue>(slashList.item(0)))
@@ -566,7 +566,7 @@ void CSSToStyleMap::mapNinePieceImage(CSSPropertyID property, CSSValue* value, N
             // Map in the outset.
             if (slashList.item(2))
                 image.setOutset(mapNinePieceImageQuad(*slashList.item(2)));
-        } else if (is<CSSPrimitiveValue>(current.get())) {
+        } else if (is<CSSPrimitiveValue>(current)) {
             // Set the appropriate rules for stretch/round/repeat of the slices.
             mapNinePieceImageRepeat(current, image);
         }
index 1f0b012..2b97ab9 100644 (file)
@@ -66,7 +66,7 @@ ExceptionOr<Ref<FontFace>> FontFace::create(Document& document, const String& fa
     auto sourceConversionResult = WTF::switchOn(source,
         [&] (String& string) -> ExceptionOr<void> {
             auto value = FontFace::parseString(string, CSSPropertySrc);
-            if (!is<CSSValueList>(value.get()))
+            if (!is<CSSValueList>(value))
                 return Exception { SyntaxError };
             CSSFontFace::appendSources(result->backing(), downcast<CSSValueList>(*value), &document, false);
             return { };
index 152901b..f102386 100644 (file)
@@ -909,7 +909,7 @@ inline bool StyleBuilderConverter::createGridTrackList(const CSSValue& value, Tr
 
     unsigned currentNamedGridLine = 0;
     for (auto& currentValue : downcast<CSSValueList>(value)) {
-        if (is<CSSGridLineNamesValue>(currentValue.get())) {
+        if (is<CSSGridLineNamesValue>(currentValue)) {
             createGridLineNamesList(currentValue.get(), currentNamedGridLine, tracksData.m_namedGridLines, tracksData.m_orderedNamedGridLines);
             continue;
         }
@@ -921,7 +921,7 @@ inline bool StyleBuilderConverter::createGridTrackList(const CSSValue& value, Tr
             ASSERT(autoRepeatID == CSSValueAutoFill || autoRepeatID == CSSValueAutoFit);
             tracksData.m_autoRepeatType = autoRepeatID == CSSValueAutoFill ? AutoFill : AutoFit;
             for (auto& autoRepeatValue : downcast<CSSValueList>(currentValue.get())) {
-                if (is<CSSGridLineNamesValue>(autoRepeatValue.get())) {
+                if (is<CSSGridLineNamesValue>(autoRepeatValue)) {
                     createGridLineNamesList(autoRepeatValue.get(), autoRepeatIndex, tracksData.m_autoRepeatNamedGridLines, tracksData.m_autoRepeatOrderedNamedGridLines);
                     continue;
                 }
index 51a5aa1..337a3bd 100644 (file)
@@ -1229,7 +1229,7 @@ inline void StyleBuilderCustom::applyValueCursor(StyleResolver& styleResolver, C
     styleResolver.style()->setCursor(CursorAuto);
     auto& list = downcast<CSSValueList>(value);
     for (auto& item : list) {
-        if (is<CSSCursorImageValue>(item.get())) {
+        if (is<CSSCursorImageValue>(item)) {
             auto& image = downcast<CSSCursorImageValue>(item.get());
             styleResolver.style()->addCursor(styleResolver.styleImage(image), image.hotSpot());
             continue;
@@ -1410,24 +1410,24 @@ inline void StyleBuilderCustom::applyValueContent(StyleResolver& styleResolver,
 
     bool didSet = false;
     for (auto& item : downcast<CSSValueList>(value)) {
-        if (is<CSSImageGeneratorValue>(item.get())) {
-            if (is<CSSGradientValue>(item.get()))
+        if (is<CSSImageGeneratorValue>(item)) {
+            if (is<CSSGradientValue>(item))
                 styleResolver.style()->setContent(StyleGeneratedImage::create(downcast<CSSGradientValue>(item.get()).gradientWithStylesResolved(styleResolver)), didSet);
             else
                 styleResolver.style()->setContent(StyleGeneratedImage::create(downcast<CSSImageGeneratorValue>(item.get())), didSet);
             didSet = true;
-        } else if (is<CSSImageSetValue>(item.get())) {
+        } else if (is<CSSImageSetValue>(item)) {
             styleResolver.style()->setContent(StyleCachedImage::create(item), didSet);
             didSet = true;
         }
 
-        if (is<CSSImageValue>(item.get())) {
+        if (is<CSSImageValue>(item)) {
             styleResolver.style()->setContent(StyleCachedImage::create(item), didSet);
             didSet = true;
             continue;
         }
 
-        if (!is<CSSPrimitiveValue>(item.get()))
+        if (!is<CSSPrimitiveValue>(item))
             continue;
 
         auto& contentValue = downcast<CSSPrimitiveValue>(item.get());
@@ -1859,7 +1859,7 @@ inline void StyleBuilderCustom::applyValueWillChange(StyleResolver& styleResolve
 
     auto willChange = WillChangeData::create();
     for (auto& item : downcast<CSSValueList>(value)) {
-        if (!is<CSSPrimitiveValue>(item.get()))
+        if (!is<CSSPrimitiveValue>(item))
             continue;
         auto& primitiveValue = downcast<CSSPrimitiveValue>(item.get());
         switch (primitiveValue.valueID()) {
index 63191ed..1a0b1f6 100644 (file)
@@ -241,7 +241,7 @@ String StyleProperties::getPropertyValue(CSSPropertyID propertyID) const
 std::optional<Color> StyleProperties::propertyAsColor(CSSPropertyID property) const
 {
     auto colorValue = getPropertyCSSValue(property);
-    if (!is<CSSPrimitiveValue>(colorValue.get()))
+    if (!is<CSSPrimitiveValue>(colorValue))
         return std::nullopt;
 
     auto& primitiveColor = downcast<CSSPrimitiveValue>(*colorValue);
@@ -251,7 +251,7 @@ std::optional<Color> StyleProperties::propertyAsColor(CSSPropertyID property) co
 CSSValueID StyleProperties::propertyAsValueID(CSSPropertyID property) const
 {
     auto cssValue = getPropertyCSSValue(property);
-    return is<CSSPrimitiveValue>(cssValue.get()) ? downcast<CSSPrimitiveValue>(*cssValue).valueID() : CSSValueInvalid;
+    return is<CSSPrimitiveValue>(cssValue) ? downcast<CSSPrimitiveValue>(*cssValue).valueID() : CSSValueInvalid;
 }
 
 String StyleProperties::getCustomPropertyValue(const String& propertyName) const
index 8b3360c..6de802c 100644 (file)
@@ -1917,7 +1917,7 @@ bool StyleResolver::createFilterOperations(const CSSValue& inValue, FilterOperat
     FilterOperations operations;
     for (auto& currentValue : downcast<CSSValueList>(inValue)) {
 
-        if (is<CSSPrimitiveValue>(currentValue.get())) {
+        if (is<CSSPrimitiveValue>(currentValue)) {
             auto& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get());
             if (!primitiveValue.isURI())
                 continue;
@@ -1930,7 +1930,7 @@ bool StyleResolver::createFilterOperations(const CSSValue& inValue, FilterOperat
             continue;
         }
 
-        if (!is<CSSFunctionValue>(currentValue.get()))
+        if (!is<CSSFunctionValue>(currentValue))
             continue;
 
         auto& filterValue = downcast<CSSFunctionValue>(currentValue.get());
index bbae0d8..1001365 100644 (file)
@@ -110,7 +110,7 @@ bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData&
 
     TransformOperations operations;
     for (auto& currentValue : downcast<CSSValueList>(value)) {
-        if (!is<CSSFunctionValue>(currentValue.get()))
+        if (!is<CSSFunctionValue>(currentValue))
             continue;
 
         auto& transformValue = downcast<CSSFunctionValue>(currentValue.get());
index 719f0da..1245c8f 100644 (file)
@@ -104,7 +104,7 @@ float ViewportStyleResolver::getViewportArgumentValue(CSSPropertyID id) const
         defaultValue = 1;
 
     RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id);
-    if (!is<CSSPrimitiveValue>(value.get()))
+    if (!is<CSSPrimitiveValue>(value))
         return defaultValue;
 
     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
index 1f338ef..b2c94a5 100644 (file)
@@ -2645,7 +2645,7 @@ HTMLElement* Document::bodyOrFrameset() const
 
 ExceptionOr<void> Document::setBodyOrFrameset(RefPtr<HTMLElement>&& newBody)
 {
-    if (!is<HTMLBodyElement>(newBody.get()) && !is<HTMLFrameSetElement>(newBody.get()))
+    if (!is<HTMLBodyElement>(newBody) && !is<HTMLFrameSetElement>(newBody))
         return Exception { HierarchyRequestError };
 
     auto* currentBody = bodyOrFrameset();
@@ -3844,7 +3844,7 @@ bool Document::setFocusedElement(Element* element, FocusDirection direction, Foc
                 view()->setFocus(false);
         }
 
-        if (is<HTMLInputElement>(oldFocusedElement.get())) {
+        if (is<HTMLInputElement>(oldFocusedElement)) {
             // HTMLInputElement::didBlur just scrolls text fields back to the beginning.
             // FIXME: This could be done asynchronusly.
             // Updating style may dispatch events due to PostResolutionCallback
@@ -6847,7 +6847,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 (is<HTMLFrameOwnerElement>(oldHoveredElement.get())) {
+        if (is<HTMLFrameOwnerElement>(oldHoveredElement)) {
             if (Document* contentDocument = downcast<HTMLFrameOwnerElement>(*oldHoveredElement).contentDocument())
                 contentDocument->updateHoverActiveState(request, nullptr);
         }
index 3cc494c..48d49cc 100644 (file)
@@ -2569,12 +2569,12 @@ ExceptionOr<void> Element::setOuterHTML(const String& html)
         return replaceResult.releaseException();
 
     RefPtr<Node> node = next ? next->previousSibling() : nullptr;
-    if (is<Text>(node.get())) {
+    if (is<Text>(node)) {
         auto result = mergeWithNextTextNode(downcast<Text>(*node));
         if (result.hasException())
             return result.releaseException();
     }
-    if (is<Text>(prev.get())) {
+    if (is<Text>(prev)) {
         auto result = mergeWithNextTextNode(downcast<Text>(*prev));
         if (result.hasException())
             return result.releaseException();
index 5dae063..866c290 100644 (file)
@@ -918,7 +918,7 @@ ExceptionOr<void> Range::insertNode(Ref<Node>&& node)
         return removeResult.releaseException();
 
     unsigned newOffset = referenceNode ? referenceNode->computeNodeIndex() : parent->countChildNodes();
-    if (is<DocumentFragment>(node.get()))
+    if (is<DocumentFragment>(node))
         newOffset += downcast<DocumentFragment>(node.get()).countChildNodes();
     else
         ++newOffset;
index e492657..69d8af2 100644 (file)
@@ -59,7 +59,7 @@ using namespace HTMLNames;
 
 static int toIdentifier(RefPtr<CSSValue>&& value)
 {
-    return is<CSSPrimitiveValue>(value.get()) ? downcast<CSSPrimitiveValue>(*value).valueID() : 0;
+    return is<CSSPrimitiveValue>(value) ? downcast<CSSPrimitiveValue>(*value).valueID() : 0;
 }
 
 static String& styleSpanClassString()
@@ -270,7 +270,7 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle& style)
                     block = newBlock;
             }
             ASSERT(!block || is<HTMLElement>(*block));
-            if (is<HTMLElement>(block.get())) {
+            if (is<HTMLElement>(block)) {
                 removeCSSStyle(style, downcast<HTMLElement>(*block));
                 if (!m_removeOnly)
                     addBlockStyle(styleChange, downcast<HTMLElement>(*block));
@@ -1356,7 +1356,7 @@ void ApplyStyleCommand::surroundNodeRangeWithElement(Node& startNode, Node& endN
     if (nextSibling && nextSibling->hasEditableStyle() && areIdenticalElements(element, *nextSibling))
         mergeIdenticalElements(element, downcast<Element>(*nextSibling));
 
-    if (is<Element>(previousSibling.get()) && previousSibling->hasEditableStyle()) {
+    if (is<Element>(previousSibling) && previousSibling->hasEditableStyle()) {
         auto* mergedElement = previousSibling->nextSibling();
         ASSERT(mergedElement);
         if (mergedElement->hasEditableStyle() && areIdenticalElements(*previousSibling, *mergedElement))
index 224e811..ee4eda5 100644 (file)
@@ -143,9 +143,9 @@ template<typename T>
 int identifierForStyleProperty(T& style, CSSPropertyID propertyID)
 {
     RefPtr<CSSValue> value = extractPropertyValue(style, propertyID);
-    if (propertyID == CSSPropertyFontStyle && is<CSSFontStyleValue>(value.get()) && downcast<CSSFontStyleValue>(value.get())->isItalicOrOblique())
+    if (propertyID == CSSPropertyFontStyle && is<CSSFontStyleValue>(value) && downcast<CSSFontStyleValue>(value.get())->isItalicOrOblique())
         return CSSValueItalic;
-    if (!is<CSSPrimitiveValue>(value.get()))
+    if (!is<CSSPrimitiveValue>(value))
         return 0;
     return downcast<CSSPrimitiveValue>(*value).valueID();
 }
@@ -198,7 +198,7 @@ HTMLElementEquivalent::HTMLElementEquivalent(CSSPropertyID id, CSSValueID primit
 bool HTMLElementEquivalent::valueIsPresentInStyle(Element& element, const EditingStyle& style) const
 {
     RefPtr<CSSValue> value = style.m_mutableStyle->getPropertyCSSValue(m_propertyID);
-    return matches(element) && is<CSSPrimitiveValue>(value.get()) && downcast<CSSPrimitiveValue>(*value).valueID() == m_primitiveValue->valueID();
+    return matches(element) && is<CSSPrimitiveValue>(value) && downcast<CSSPrimitiveValue>(*value).valueID() == m_primitiveValue->valueID();
 }
 
 void HTMLElementEquivalent::addToStyle(Element*, EditingStyle* style) const
@@ -237,7 +237,7 @@ public:
         RefPtr<CSSValue> styleValue = style.m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
         if (!styleValue)
             styleValue = style.m_mutableStyle->getPropertyCSSValue(CSSPropertyTextDecoration);
-        return is<CSSValueList>(styleValue.get()) && downcast<CSSValueList>(*styleValue).hasValue(m_primitiveValue.get());
+        return is<CSSValueList>(styleValue) && downcast<CSSValueList>(*styleValue).hasValue(m_primitiveValue.get());
     }
 
 private:
@@ -502,7 +502,7 @@ void EditingStyle::extractFontSizeDelta()
 
     // Get the adjustment amount out of the style.
     RefPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitFontSizeDelta);
-    if (!is<CSSPrimitiveValue>(value.get()))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
@@ -550,13 +550,13 @@ bool EditingStyle::textDirection(WritingDirection& writingDirection) const
         return false;
 
     RefPtr<CSSValue> unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi);
-    if (!is<CSSPrimitiveValue>(unicodeBidi.get()))
+    if (!is<CSSPrimitiveValue>(unicodeBidi))
         return false;
 
     CSSValueID unicodeBidiValue = downcast<CSSPrimitiveValue>(*unicodeBidi).valueID();
     if (unicodeBidiValue == CSSValueEmbed) {
         RefPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection);
-        if (!is<CSSPrimitiveValue>(direction.get()))
+        if (!is<CSSPrimitiveValue>(direction))
             return false;
 
         writingDirection = downcast<CSSPrimitiveValue>(*direction).valueID() == CSSValueLtr ? LeftToRightWritingDirection : RightToLeftWritingDirection;
@@ -799,7 +799,7 @@ TriState EditingStyle::triStateOfStyle(const VisibleSelection& selection) const
 static RefPtr<CSSValueList> textDecorationValueList(const StyleProperties& properties)
 {
     RefPtr<CSSValue> value = properties.getPropertyCSSValue(CSSPropertyTextDecoration);
-    if (!is<CSSValueList>(value.get()))
+    if (!is<CSSValueList>(value))
         return nullptr;
     return downcast<CSSValueList>(value.get());
 }
@@ -1089,9 +1089,9 @@ void EditingStyle::prepareToApplyAt(const Position& position, ShouldPreserveWrit
         || cssValueToColor(m_mutableStyle->getPropertyCSSValue(CSSPropertyBackgroundColor).get()) == rgbaBackgroundColorInEffect(position.containerNode()))
         m_mutableStyle->removeProperty(CSSPropertyBackgroundColor);
 
-    if (is<CSSPrimitiveValue>(unicodeBidi.get())) {
+    if (is<CSSPrimitiveValue>(unicodeBidi)) {
         m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, static_cast<CSSValueID>(downcast<CSSPrimitiveValue>(*unicodeBidi).valueID()));
-        if (is<CSSPrimitiveValue>(direction.get()))
+        if (is<CSSPrimitiveValue>(direction))
             m_mutableStyle->setProperty(CSSPropertyDirection, static_cast<CSSValueID>(downcast<CSSPrimitiveValue>(*direction).valueID()));
     }
 }
@@ -1406,7 +1406,7 @@ bool EditingStyle::isFloating()
 int EditingStyle::legacyFontSize(Document* document) const
 {
     RefPtr<CSSValue> cssValue = m_mutableStyle->getPropertyCSSValue(CSSPropertyFontSize);
-    if (!is<CSSPrimitiveValue>(cssValue.get()))
+    if (!is<CSSPrimitiveValue>(cssValue))
         return 0;
     return legacyFontSizeFromCSSValue(document, downcast<CSSPrimitiveValue>(cssValue.get()),
         m_shouldUseFixedDefaultFontSize, AlwaysUseLegacyFontSize);
@@ -1475,7 +1475,7 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
                 continue;
 
             RefPtr<CSSValue> unicodeBidi = ComputedStyleExtractor(n).propertyValue(CSSPropertyUnicodeBidi);
-            if (!is<CSSPrimitiveValue>(unicodeBidi.get()))
+            if (!is<CSSPrimitiveValue>(unicodeBidi))
                 continue;
 
             CSSValueID unicodeBidiValue = downcast<CSSPrimitiveValue>(*unicodeBidi).valueID();
@@ -1504,7 +1504,7 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
 
         ComputedStyleExtractor computedStyle(node);
         RefPtr<CSSValue> unicodeBidi = computedStyle.propertyValue(CSSPropertyUnicodeBidi);
-        if (!is<CSSPrimitiveValue>(unicodeBidi.get()))
+        if (!is<CSSPrimitiveValue>(unicodeBidi))
             continue;
 
         CSSValueID unicodeBidiValue = downcast<CSSPrimitiveValue>(*unicodeBidi).valueID();
@@ -1516,7 +1516,7 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
 
         ASSERT(unicodeBidiValue == CSSValueEmbed);
         RefPtr<CSSValue> direction = computedStyle.propertyValue(CSSPropertyDirection);
-        if (!is<CSSPrimitiveValue>(direction.get()))
+        if (!is<CSSPrimitiveValue>(direction))
             continue;
 
         CSSValueID directionValue = downcast<CSSPrimitiveValue>(*direction).valueID();
@@ -1584,11 +1584,11 @@ StyleChange::StyleChange(EditingStyle* style, const Position& position)
     bool shouldAddStrikeThrough = style->strikeThroughChange() == TextDecorationChange::Add;
     if (shouldAddUnderline || shouldAddStrikeThrough) {
         RefPtr<CSSValue> value = computedStyle.propertyValue(CSSPropertyWebkitTextDecorationsInEffect);
-        if (!is<CSSValueList>(value.get()))
+        if (!is<CSSValueList>(value))
             value = computedStyle.propertyValue(CSSPropertyTextDecoration);
 
         RefPtr<CSSValueList> valueList;
-        if (is<CSSValueList>(value.get()))
+        if (is<CSSValueList>(value))
             valueList = downcast<CSSValueList>(value.get());
 
         auto& cssValuePool = CSSValuePool::singleton();
@@ -1667,7 +1667,7 @@ void StyleChange::extractTextStyles(Document* document, MutableStyleProperties&
     // Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
     // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
     RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(CSSPropertyTextDecoration);
-    if (is<CSSValueList>(textDecoration.get())) {
+    if (is<CSSValueList>(textDecoration)) {
         auto& cssValuePool = CSSValuePool::singleton();
         RefPtr<CSSPrimitiveValue> underline = cssValuePool.createIdentifierValue(CSSValueUnderline);
         RefPtr<CSSPrimitiveValue> lineThrough = cssValuePool.createIdentifierValue(CSSValueLineThrough);
@@ -1718,7 +1718,7 @@ void StyleChange::extractTextStyles(Document* document, MutableStyleProperties&
 static void diffTextDecorations(MutableStyleProperties& style, CSSPropertyID propertID, CSSValue* refTextDecoration)
 {
     RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(propertID);
-    if (!is<CSSValueList>(textDecoration.get()) || !is<CSSValueList>(refTextDecoration))
+    if (!is<CSSValueList>(textDecoration) || !is<CSSValueList>(refTextDecoration))
         return;
 
     RefPtr<CSSValueList> newTextDecoration = downcast<CSSValueList>(*textDecoration).copy();
index 4e39c6f..24b4be0 100644 (file)
@@ -70,7 +70,7 @@ void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree()
 void BaseChooserOnlyDateAndTimeInputType::updateAppearance()
 {
     RefPtr<Node> node = element().userAgentShadowRoot()->firstChild();
-    if (!is<HTMLElement>(node.get()))
+    if (!is<HTMLElement>(node))
         return;
     String displayValue = visibleValue();
     if (displayValue.isEmpty()) {
index 0007066..6238989 100644 (file)
@@ -108,7 +108,7 @@ HTMLFormElement* FormAssociatedElement::findAssociatedForm(const HTMLElement* el
         // the value of form attribute, so we put the result of
         // treeScope().getElementById() over the given element.
         RefPtr<Element> newFormCandidate = element->treeScope().getElementById(formId);
-        if (is<HTMLFormElement>(newFormCandidate.get()))
+        if (is<HTMLFormElement>(newFormCandidate))
             return downcast<HTMLFormElement>(newFormCandidate.get());
         return nullptr;
     }
index d89210e..d8e2011 100644 (file)
@@ -188,7 +188,7 @@ Path HTMLAreaElement::getRegion(const LayoutSize& size) const
 HTMLImageElement* HTMLAreaElement::imageElement() const
 {
     RefPtr<Node> mapElement = parentNode();
-    if (!is<HTMLMapElement>(mapElement.get()))
+    if (!is<HTMLMapElement>(mapElement))
         return nullptr;
     
     return downcast<HTMLMapElement>(*mapElement).imageElement();
index a4d431e..2795496 100644 (file)
@@ -561,12 +561,12 @@ ExceptionOr<void> HTMLElement::setOuterText(const String& text)
         return replaceResult.releaseException();
 
     RefPtr<Node> node = next ? next->previousSibling() : nullptr;
-    if (is<Text>(node.get())) {
+    if (is<Text>(node)) {
         auto result = mergeWithNextTextNode(downcast<Text>(*node));
         if (result.hasException())
             return result.releaseException();
     }
-    if (is<Text>(prev.get())) {
+    if (is<Text>(prev)) {
         auto result = mergeWithNextTextNode(downcast<Text>(*prev));
         if (result.hasException())
             return result.releaseException();
@@ -840,7 +840,7 @@ void HTMLElement::dirAttributeChanged(const AtomicString& value)
 {
     RefPtr<Element> parent = parentElement();
 
-    if (is<HTMLElement>(parent.get()) && parent->selfOrAncestorHasDirAutoAttribute())
+    if (is<HTMLElement>(parent) && parent->selfOrAncestorHasDirAutoAttribute())
         downcast<HTMLElement>(*parent).adjustDirectionalityIfNeededAfterChildAttributeChanged(this);
 
     if (equalLettersIgnoringASCIICase(value, "auto"))
index 248f24c..301d69f 100644 (file)
@@ -200,7 +200,7 @@ bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle& style)
     // If my parent is an <object> and is not set to use fallback content, I
     // should be ignored and not get a renderer.
     RefPtr<ContainerNode> parent = parentNode();
-    if (is<HTMLObjectElement>(parent.get())) {
+    if (is<HTMLObjectElement>(parent)) {
         if (!parent->renderer())
             return false;
         if (!downcast<HTMLObjectElement>(*parent).useFallbackContent()) {
index eafdcef..ff8b981 100644 (file)
@@ -124,7 +124,7 @@ bool HTMLFormControlElement::computeIsDisabledByFieldsetAncestor() const
     for (RefPtr<Element> ancestor = parentElement(); ancestor; ancestor = ancestor->parentElement()) {
         if (is<HTMLFieldSetElement>(*ancestor) && ancestor->hasAttributeWithoutSynchronization(disabledAttr)) {
             HTMLFieldSetElement& fieldSetAncestor = downcast<HTMLFieldSetElement>(*ancestor);
-            bool isInFirstLegend = is<HTMLLegendElement>(previousAncestor.get()) && previousAncestor == fieldSetAncestor.legend();
+            bool isInFirstLegend = is<HTMLLegendElement>(previousAncestor) && previousAncestor == fieldSetAncestor.legend();
             return !isInFirstLegend;
         }
         previousAncestor = ancestor;
index a8577a1..4e2bf3c 100644 (file)
@@ -1597,7 +1597,7 @@ HTMLDataListElement* HTMLInputElement::dataList() const
         return nullptr;
 
     RefPtr<Element> element = treeScope().getElementById(attributeWithoutSynchronization(listAttr));
-    if (!is<HTMLDataListElement>(element.get())
+    if (!is<HTMLDataListElement>(element))
         return nullptr;
 
     return downcast<HTMLDataListElement>(element.get());
index ad7ebf8..03ff08d 100644 (file)
@@ -120,7 +120,7 @@ void HTMLOptionElement::setText(const String &text)
 
     // Handle the common special case where there's exactly 1 child node, and it's a text node.
     RefPtr<Node> child = firstChild();
-    if (is<Text>(child.get()) && !child->nextSibling())
+    if (is<Text>(child) && !child->nextSibling())
         downcast<Text>(*child).setData(text);
     else {
         removeChildren();
@@ -301,7 +301,7 @@ void HTMLOptionElement::willResetComputedStyle()
 String HTMLOptionElement::textIndentedToRespectGroupLabel() const
 {
     RefPtr<ContainerNode> parent = parentNode();
-    if (is<HTMLOptGroupElement>(parent.get()))
+    if (is<HTMLOptGroupElement>(parent))
         return "    " + displayLabel();
     return displayLabel();
 }
index 2c1c274..6eff80f 100644 (file)
@@ -227,7 +227,7 @@ bool HTMLPlugInElement::isKeyboardFocusable(KeyboardEvent&) const
         return false;
 
     RefPtr<Widget> widget = pluginWidget();
-    if (!is<PluginViewBase>(widget.get()))
+    if (!is<PluginViewBase>(widget))
         return false;
 
     return downcast<PluginViewBase>(*widget).supportsKeyboardFocus();
@@ -242,7 +242,7 @@ bool HTMLPlugInElement::isUserObservable() const
 {
     // No widget - can't be anything to see or hear here.
     RefPtr<Widget> widget = pluginWidget(PluginLoadingPolicy::DoNotLoad);
-    if (!is<PluginViewBase>(widget.get()))
+    if (!is<PluginViewBase>(widget))
         return false;
 
     PluginViewBase& pluginView = downcast<PluginViewBase>(*widget);
index 6b3aaa9..eec14fc 100644 (file)
@@ -865,7 +865,7 @@ void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags)
     if (shouldDeselect)
         deselectItemsWithoutValidation(element.get());
 
-    if (is<HTMLOptionElement>(element.get())) {
+    if (is<HTMLOptionElement>(element)) {
         if (m_activeSelectionAnchorIndex < 0 || shouldDeselect)
             setActiveSelectionAnchorIndex(listIndex);
         if (m_activeSelectionEndIndex < 0 || shouldDeselect)
index 1271026..6866096 100644 (file)
@@ -100,7 +100,7 @@ static bool isClickableControl(Node* node)
     if (is<HTMLFormControlElement>(element))
         return true;
     RefPtr<Element> host = element.shadowHost();
-    return host && is<HTMLFormControlElement>(host.get());
+    return host && is<HTMLFormControlElement>(host);
 }
 
 bool HTMLSummaryElement::supportsFocus() const
index 24a3fb4..e2cbde0 100644 (file)
@@ -798,7 +798,7 @@ void HTMLTextFormControlElement::adjustInnerTextStyle(const RenderStyle& parentS
     if (auto innerText = innerTextElement()) {
         if (const StyleProperties* properties = innerText->presentationAttributeStyle()) {
             RefPtr<CSSValue> value = properties->getPropertyCSSValue(CSSPropertyWebkitUserModify);
-            if (is<CSSPrimitiveValue>(value.get()))
+            if (is<CSSPrimitiveValue>(value))
                 textBlockStyle.setUserModify(downcast<CSSPrimitiveValue>(*value));
         }
     }
index 013f4c9..861b425 100644 (file)
@@ -121,7 +121,7 @@ bool RadioInputType::isKeyboardFocusable(KeyboardEvent& event) const
     // Never allow keyboard tabbing to leave you in the same radio group.  Always
     // skip any other elements in the group.
     RefPtr<Element> currentFocusedNode = element().document().focusedElement();
-    if (is<HTMLInputElement>(currentFocusedNode.get())) {
+    if (is<HTMLInputElement>(currentFocusedNode)) {
         HTMLInputElement& focusedInput = downcast<HTMLInputElement>(*currentFocusedNode);
         if (focusedInput.isRadioButton() && focusedInput.form() == element().form() && focusedInput.name() == element().name())
             return false;
index 57f74de..4b9bf2d 100644 (file)
@@ -190,7 +190,7 @@ static inline void executeTask(HTMLConstructionSiteTask& task)
 
 void HTMLConstructionSite::attachLater(ContainerNode& parent, Ref<Node>&& child, bool selfClosing)
 {
-    ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is<Element>(child.get()) || !isScriptElement(downcast<Element>(child.get())));
+    ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is<Element>(child) || !isScriptElement(downcast<Element>(child.get())));
     ASSERT(pluginContentIsAllowed(m_parserContentPolicy) || !child->isPluginElement());
 
     if (shouldFosterParent()) {
@@ -584,7 +584,7 @@ void HTMLConstructionSite::insertTextNode(const String& characters, WhitespaceMo
     // for performance, see <https://bugs.webkit.org/show_bug.cgi?id=55898>.
 
     RefPtr<Node> previousChild = task.nextChild ? task.nextChild->previousSibling() : task.parent->lastChild();
-    if (is<Text>(previousChild.get())) {
+    if (is<Text>(previousChild)) {
         // FIXME: We're only supposed to append to this text node if it
         // was the last text node inserted by the parser.
         currentPosition = downcast<Text>(*previousChild).parserAppendData(characters, 0, lengthLimit);
index 187b783..dc68bfd 100644 (file)
@@ -689,7 +689,7 @@ void MediaControlClosedCaptionsTrackListElement::defaultEventHandler(Event& even
 #if ENABLE(VIDEO_TRACK)
     if (event.type() == eventNames().clickEvent) {
         RefPtr<Node> target = event.target()->toNode();
-        if (!is<Element>(target.get()))
+        if (!is<Element>(target))
             return;
 
         // When we created the elements in the track list, we gave them a custom
index 32f6bca..aa964f2 100644 (file)
@@ -187,7 +187,7 @@ void TextTrackList::append(Ref<TextTrack>&& track)
 {
     if (track->trackType() == TextTrack::AddTrack)
         m_addTrackTracks.append(track.ptr());
-    else if (is<LoadableTextTrack>(track.get())) {
+    else if (is<LoadableTextTrack>(track)) {
         // Insert tracks added for <track> element in tree order.
         size_t index = downcast<LoadableTextTrack>(track.get()).trackElementIndex();
         m_elementTracks.insert(index, track.ptr());
index 9fe906e..f9d7dbf 100644 (file)
@@ -736,7 +736,7 @@ void InspectorDOMAgent::setNodeName(ErrorString& errorString, int nodeId, const
     *newId = 0;
 
     RefPtr<Node> oldNode = nodeForId(nodeId);
-    if (!is<Element>(oldNode.get()))
+    if (!is<Element>(oldNode))
         return;
 
     auto createElementResult = oldNode->document().createElementForBindings(tagName);
index 29d4e66..e118def 100644 (file)
@@ -171,7 +171,7 @@ void PageScriptDebugServer::setJavaScriptPaused(Frame& frame, bool paused)
 
     if (auto* view = frame.view()) {
         for (auto& child : view->children()) {
-            if (!is<PluginViewBase>(child.get()))
+            if (!is<PluginViewBase>(child))
                 continue;
             downcast<PluginViewBase>(child.get()).setJavaScriptPaused(paused);
         }
index 158487c..bc1818f 100644 (file)
@@ -774,7 +774,7 @@ static bool shouldClearSelectionWhenChangingFocusedElement(const Page& page, Ref
 
     // FIXME: These additional checks should not be necessary. We should consider generally keeping the selection whenever the
     // focused element is blurred, with no new element taking focus.
-    if (!oldFocusedElement->isRootEditableElement() && !is<HTMLInputElement>(oldFocusedElement.get()) && !is<HTMLTextAreaElement>(oldFocusedElement.get()))
+    if (!oldFocusedElement->isRootEditableElement() && !is<HTMLInputElement>(oldFocusedElement) && !is<HTMLTextAreaElement>(oldFocusedElement))
         return true;
 
     for (auto ancestor = page.mainFrame().eventHandler().draggedElement(); ancestor; ancestor = ancestor->parentOrShadowHostElement()) {
index df87344..61ef59a 100644 (file)
@@ -3768,10 +3768,10 @@ Color FrameView::documentBackgroundColor() const
 bool FrameView::hasCustomScrollbars() const
 {
     for (auto& widget : children()) {
-        if (is<FrameView>(widget.get())) {
+        if (is<FrameView>(widget)) {
             if (downcast<FrameView>(widget.get()).hasCustomScrollbars())
                 return true;
-        } else if (is<Scrollbar>(widget.get())) {
+        } else if (is<Scrollbar>(widget)) {
             if (downcast<Scrollbar>(widget.get()).isCustomScrollbar())
                 return true;
         }
index ca369be..1781992 100644 (file)
@@ -1404,7 +1404,7 @@ Vector<Ref<PluginViewBase>> Page::pluginViews()
         if (!view)
             break;
         for (auto& widget : view->children()) {
-            if (is<PluginViewBase>(widget.get()))
+            if (is<PluginViewBase>(widget))
                 views.append(downcast<PluginViewBase>(widget.get()));
         }
     }
index e41b671..1731c65 100644 (file)
@@ -933,7 +933,7 @@ void EventHandler::platformPrepareForWheelEvents(const PlatformWheelEvent& wheel
             scrollableArea = scrollableAreaForEventTarget(wheelEventTarget.get());
         } else {
             scrollableContainer = findEnclosingScrollableContainer(wheelEventTarget.get(), wheelEvent.deltaX(), wheelEvent.deltaY());
-            if (scrollableContainer && !is<HTMLIFrameElement>(wheelEventTarget.get()))
+            if (scrollableContainer && !is<HTMLIFrameElement>(wheelEventTarget))
                 scrollableArea = scrollableAreaForContainerNode(*scrollableContainer);
             else {
                 scrollableContainer = view->frame().document()->bodyOrFrameset();
index cc65754..d2e27d8 100644 (file)
@@ -911,7 +911,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
             auto compositeOp = op == CompositeSourceOver ? bgLayer.composite() : op;
             context.setDrawLuminanceMask(bgLayer.maskSourceType() == MaskLuminance);
 
-            if (is<BitmapImage>(image.get()))
+            if (is<BitmapImage>(image))
                 downcast<BitmapImage>(*image).updateFromSettings(settings());
 
             auto interpolation = chooseInterpolationQuality(context, *image, &bgLayer, geometry.tileSize());
index 0885f1a..557c929 100644 (file)
@@ -1033,7 +1033,7 @@ static unsigned deferredStyleRulesCountForList(const Vector<RefPtr<StyleRuleBase
 {
     unsigned count = 0;
     for (auto rule : childRules) {
-        if (is<StyleRule>(rule.get())) {
+        if (is<StyleRule>(rule)) {
             auto* cssRule = downcast<StyleRule>(rule.get());
             if (!cssRule->propertiesWithoutDeferredParsing())
                 count++;
@@ -1041,9 +1041,9 @@ static unsigned deferredStyleRulesCountForList(const Vector<RefPtr<StyleRuleBase
         }
 
         StyleRuleGroup* groupRule = nullptr;
-        if (is<StyleRuleMedia>(rule.get()))
+        if (is<StyleRuleMedia>(rule))
             groupRule = downcast<StyleRuleMedia>(rule.get());
-        else if (is<StyleRuleSupports>(rule.get()))
+        else if (is<StyleRuleSupports>(rule))
             groupRule = downcast<StyleRuleSupports>(rule.get());
         if (!groupRule)
             continue;
@@ -1068,9 +1068,9 @@ static unsigned deferredGroupRulesCountForList(const Vector<RefPtr<StyleRuleBase
     unsigned count = 0;
     for (auto rule : childRules) {
         StyleRuleGroup* groupRule = nullptr;
-        if (is<StyleRuleMedia>(rule.get()))
+        if (is<StyleRuleMedia>(rule))
             groupRule = downcast<StyleRuleMedia>(rule.get());
-        else if (is<StyleRuleSupports>(rule.get()))
+        else if (is<StyleRuleSupports>(rule))
             groupRule = downcast<StyleRuleSupports>(rule.get());
         if (!groupRule)
             continue;
@@ -1093,7 +1093,7 @@ static unsigned deferredKeyframesRulesCountForList(const Vector<RefPtr<StyleRule
 {
     unsigned count = 0;
     for (auto rule : childRules) {
-        if (is<StyleRuleKeyframes>(rule.get())) {
+        if (is<StyleRuleKeyframes>(rule)) {
             auto* cssRule = downcast<StyleRuleKeyframes>(rule.get());
             if (!cssRule->keyframesWithoutDeferredParsing())
                 count++;
@@ -1101,9 +1101,9 @@ static unsigned deferredKeyframesRulesCountForList(const Vector<RefPtr<StyleRule
         }
 
         StyleRuleGroup* groupRule = nullptr;
-        if (is<StyleRuleMedia>(rule.get()))
+        if (is<StyleRuleMedia>(rule))
             groupRule = downcast<StyleRuleMedia>(rule.get());
-        else if (is<StyleRuleSupports>(rule.get()))
+        else if (is<StyleRuleSupports>(rule))
             groupRule = downcast<StyleRuleSupports>(rule.get());
         if (!groupRule)
             continue;