Changeset 224320 in webkit
- Timestamp:
- Nov 1, 2017 10:43:02 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r224312 r224320 1 2017-11-01 Jiewen Tan <jiewen_tan@apple.com> 2 3 Let is<T>() accept RefPtrs 4 https://bugs.webkit.org/show_bug.cgi?id=178612 5 <rdar://problem/35102004> 6 7 Reviewed by Ryosuke Niwa. 8 9 Add support for is<T>() for RefPtrs. 10 11 * wtf/RefPtr.h: 12 (WTF::is): 13 1 14 2017-11-01 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WTF/wtf/RefPtr.h
r222827 r224320 239 239 } 240 240 241 template<typename ExpectedType, typename ArgType> inline bool is(RefPtr<ArgType>& source) 242 { 243 return is<ExpectedType>(source.get()); 244 } 245 246 template<typename ExpectedType, typename ArgType> inline bool is(const RefPtr<ArgType>& source) 247 { 248 return is<ExpectedType>(source.get()); 249 } 250 241 251 } // namespace WTF 242 252 -
trunk/Source/WebCore/ChangeLog
r224319 r224320 1 2017-11-01 Jiewen Tan <jiewen_tan@apple.com> 2 3 Let is<T>() accept RefPtrs 4 https://bugs.webkit.org/show_bug.cgi?id=178612 5 <rdar://problem/35102004> 6 7 Reviewed by Ryosuke Niwa. 8 9 Get rid of .get() for all is<T>() calls. 10 11 No changes in behaviors. 12 13 * bindings/js/JSElementCustom.cpp: 14 (WebCore::createNewElementWrapper): 15 * bindings/js/JSMediaStreamTrackCustom.cpp: 16 (WebCore::toJSNewlyCreated): 17 * bindings/js/JSNodeCustom.cpp: 18 (WebCore::createWrapperInline): 19 * bindings/js/JSTextCustom.cpp: 20 (WebCore::toJSNewlyCreated): 21 * css/CSSFilterImageValue.cpp: 22 (WebCore::CSSFilterImageValue::loadSubimages): 23 * css/CSSFontFaceSet.cpp: 24 (WebCore::CSSFontFaceSet::matchingFaces): 25 * css/CSSFontSelector.cpp: 26 (WebCore::CSSFontSelector::addFontFaceRule): 27 * css/CSSToStyleMap.cpp: 28 (WebCore::CSSToStyleMap::mapNinePieceImage): 29 * css/FontFace.cpp: 30 (WebCore::FontFace::create): 31 * css/StyleBuilderConverter.h: 32 (WebCore::StyleBuilderConverter::createGridTrackList): 33 * css/StyleBuilderCustom.h: 34 (WebCore::StyleBuilderCustom::applyValueCursor): 35 (WebCore::StyleBuilderCustom::applyValueContent): 36 (WebCore::StyleBuilderCustom::applyValueWillChange): 37 * css/StyleProperties.cpp: 38 (WebCore::StyleProperties::propertyAsColor const): 39 (WebCore::StyleProperties::propertyAsValueID const): 40 * css/StyleResolver.cpp: 41 (WebCore::StyleResolver::createFilterOperations): 42 * css/TransformFunctions.cpp: 43 (WebCore::transformsForValue): 44 * css/ViewportStyleResolver.cpp: 45 (WebCore::ViewportStyleResolver::getViewportArgumentValue const): 46 * dom/Document.cpp: 47 (WebCore::Document::setBodyOrFrameset): 48 (WebCore::Document::setFocusedElement): 49 (WebCore::Document::updateHoverActiveState): 50 * dom/Element.cpp: 51 (WebCore::Element::setOuterHTML): 52 * dom/Range.cpp: 53 (WebCore::Range::insertNode): 54 * editing/ApplyStyleCommand.cpp: 55 (WebCore::toIdentifier): 56 (WebCore::ApplyStyleCommand::applyBlockStyle): 57 (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): 58 * editing/EditingStyle.cpp: 59 (WebCore::identifierForStyleProperty): 60 (WebCore::HTMLElementEquivalent::valueIsPresentInStyle const): 61 (WebCore::EditingStyle::extractFontSizeDelta): 62 (WebCore::EditingStyle::textDirection const): 63 (WebCore::textDecorationValueList): 64 (WebCore::EditingStyle::prepareToApplyAt): 65 (WebCore::EditingStyle::legacyFontSize const): 66 (WebCore::EditingStyle::textDirectionForSelection): 67 (WebCore::StyleChange::StyleChange): 68 (WebCore::StyleChange::extractTextStyles): 69 (WebCore::diffTextDecorations): 70 * html/BaseChooserOnlyDateAndTimeInputType.cpp: 71 (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance): 72 * html/FormAssociatedElement.cpp: 73 (WebCore::FormAssociatedElement::findAssociatedForm): 74 * html/HTMLAreaElement.cpp: 75 (WebCore::HTMLAreaElement::imageElement const): 76 * html/HTMLElement.cpp: 77 (WebCore::HTMLElement::setOuterText): 78 (WebCore::HTMLElement::dirAttributeChanged): 79 * html/HTMLEmbedElement.cpp: 80 (WebCore::HTMLEmbedElement::rendererIsNeeded): 81 * html/HTMLFormControlElement.cpp: 82 (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const): 83 * html/HTMLInputElement.cpp: 84 (WebCore::HTMLInputElement::dataList const): 85 * html/HTMLOptionElement.cpp: 86 (WebCore::HTMLOptionElement::setText): 87 (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const): 88 * html/HTMLPlugInElement.cpp: 89 (WebCore::HTMLPlugInElement::isKeyboardFocusable const): 90 (WebCore::HTMLPlugInElement::isUserObservable const): 91 * html/HTMLSelectElement.cpp: 92 (WebCore::HTMLSelectElement::selectOption): 93 * html/HTMLSummaryElement.cpp: 94 (WebCore::isClickableControl): 95 * html/HTMLTextFormControlElement.cpp: 96 (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const): 97 * html/RadioInputType.cpp: 98 (WebCore::RadioInputType::isKeyboardFocusable const): 99 * html/parser/HTMLConstructionSite.cpp: 100 (WebCore::HTMLConstructionSite::attachLater): 101 (WebCore::HTMLConstructionSite::insertTextNode): 102 * html/shadow/MediaControlElements.cpp: 103 (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): 104 * html/track/TextTrackList.cpp: 105 (TextTrackList::append): 106 * inspector/InspectorDOMAgent.cpp: 107 (WebCore::InspectorDOMAgent::setNodeName): 108 * inspector/PageScriptDebugServer.cpp: 109 (WebCore::PageScriptDebugServer::setJavaScriptPaused): 110 * page/FocusController.cpp: 111 (WebCore::shouldClearSelectionWhenChangingFocusedElement): 112 * page/FrameView.cpp: 113 (WebCore::FrameView::hasCustomScrollbars const): 114 * page/Page.cpp: 115 (WebCore::Page::pluginViews): 116 * page/mac/EventHandlerMac.mm: 117 (WebCore::EventHandler::platformPrepareForWheelEvents): 118 * rendering/RenderBoxModelObject.cpp: 119 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 120 * testing/Internals.cpp: 121 (WebCore::deferredStyleRulesCountForList): 122 (WebCore::deferredGroupRulesCountForList): 123 (WebCore::deferredKeyframesRulesCountForList): 124 1 125 2017-11-01 Fujii Hironori <Hironori.Fujii@sony.com> 2 126 -
trunk/Source/WebCore/bindings/js/JSElementCustom.cpp
r223476 r224320 50 50 static JSValue createNewElementWrapper(JSDOMGlobalObject* globalObject, Ref<Element>&& element) 51 51 { 52 if (is<HTMLElement>(element .get()))52 if (is<HTMLElement>(element)) 53 53 return createJSHTMLWrapper(globalObject, static_reference_cast<HTMLElement>(WTFMove(element))); 54 if (is<SVGElement>(element .get()))54 if (is<SVGElement>(element)) 55 55 return createJSSVGWrapper(globalObject, static_reference_cast<SVGElement>(WTFMove(element))); 56 56 return createWrapper<Element>(globalObject, WTFMove(element)); -
trunk/Source/WebCore/bindings/js/JSMediaStreamTrackCustom.cpp
r213598 r224320 36 36 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<MediaStreamTrack>&& object) 37 37 { 38 if (is<CanvasCaptureMediaStreamTrack>(object .get()))38 if (is<CanvasCaptureMediaStreamTrack>(object)) 39 39 return createWrapper<CanvasCaptureMediaStreamTrack>(globalObject, WTFMove(object)); 40 40 return createWrapper<MediaStreamTrack>(globalObject, WTFMove(object)); -
trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp
r223476 r224320 129 129 switch (node->nodeType()) { 130 130 case Node::ELEMENT_NODE: 131 if (is<HTMLElement>(node .get()))131 if (is<HTMLElement>(node)) 132 132 wrapper = createJSHTMLWrapper(globalObject, static_reference_cast<HTMLElement>(WTFMove(node))); 133 else if (is<SVGElement>(node .get()))133 else if (is<SVGElement>(node)) 134 134 wrapper = createJSSVGWrapper(globalObject, static_reference_cast<SVGElement>(WTFMove(node))); 135 135 else -
trunk/Source/WebCore/bindings/js/JSTextCustom.cpp
r205422 r224320 35 35 JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<Text>&& text) 36 36 { 37 if (is<CDATASection>(text .get()))37 if (is<CDATASection>(text)) 38 38 return createWrapper<CDATASection>(globalObject, WTFMove(text)); 39 39 return createWrapper<Text>(globalObject, WTFMove(text)); -
trunk/Source/WebCore/css/CSSFilterImageValue.cpp
r220073 r224320 96 96 97 97 for (auto& filterOperation : m_filterOperations.operations()) { 98 if (!is<ReferenceFilterOperation>(filterOperation .get()))98 if (!is<ReferenceFilterOperation>(filterOperation)) 99 99 continue; 100 100 auto& referenceFilterOperation = downcast<ReferenceFilterOperation>(*filterOperation); -
trunk/Source/WebCore/css/CSSFontFaceSet.cpp
r223600 r224320 339 339 340 340 auto family = style->getPropertyCSSValue(CSSPropertyFontFamily); 341 if (!is<CSSValueList>(family .get()))341 if (!is<CSSValueList>(family)) 342 342 return Exception { SyntaxError }; 343 343 CSSValueList& familyList = downcast<CSSValueList>(*family); -
trunk/Source/WebCore/css/CSSFontSelector.cpp
r223238 r224320 159 159 RefPtr<CSSValue> variantEastAsian = style.getPropertyCSSValue(CSSPropertyFontVariantEastAsian); 160 160 RefPtr<CSSValue> loadingBehavior = style.getPropertyCSSValue(CSSPropertyFontDisplay); 161 if (!is<CSSValueList>(fontFamily .get()) || !is<CSSValueList>(src.get()) || (unicodeRange && !is<CSSValueList>(*unicodeRange)))161 if (!is<CSSValueList>(fontFamily) || !is<CSSValueList>(src) || (unicodeRange && !is<CSSValueList>(*unicodeRange))) 162 162 return; 163 163 -
trunk/Source/WebCore/css/CSSToStyleMap.cpp
r218890 r224320 550 550 551 551 for (auto& current : borderImage) { 552 if (is<CSSImageValue>(current .get()) || is<CSSImageGeneratorValue>(current.get()) || is<CSSImageSetValue>(current.get()))552 if (is<CSSImageValue>(current) || is<CSSImageGeneratorValue>(current) || is<CSSImageSetValue>(current)) 553 553 image.setImage(styleImage(current.get())); 554 else if (is<CSSBorderImageSliceValue>(current .get()))554 else if (is<CSSBorderImageSliceValue>(current)) 555 555 mapNinePieceImageSlice(current, image); 556 else if (is<CSSValueList>(current .get())) {556 else if (is<CSSValueList>(current)) { 557 557 CSSValueList& slashList = downcast<CSSValueList>(current.get()); 558 558 // Map in the image slices. … … 567 567 if (slashList.item(2)) 568 568 image.setOutset(mapNinePieceImageQuad(*slashList.item(2))); 569 } else if (is<CSSPrimitiveValue>(current .get())) {569 } else if (is<CSSPrimitiveValue>(current)) { 570 570 // Set the appropriate rules for stretch/round/repeat of the slices. 571 571 mapNinePieceImageRepeat(current, image); -
trunk/Source/WebCore/css/FontFace.cpp
r222949 r224320 67 67 [&] (String& string) -> ExceptionOr<void> { 68 68 auto value = FontFace::parseString(string, CSSPropertySrc); 69 if (!is<CSSValueList>(value .get()))69 if (!is<CSSValueList>(value)) 70 70 return Exception { SyntaxError }; 71 71 CSSFontFace::appendSources(result->backing(), downcast<CSSValueList>(*value), &document, false); -
trunk/Source/WebCore/css/StyleBuilderConverter.h
r222259 r224320 910 910 unsigned currentNamedGridLine = 0; 911 911 for (auto& currentValue : downcast<CSSValueList>(value)) { 912 if (is<CSSGridLineNamesValue>(currentValue .get())) {912 if (is<CSSGridLineNamesValue>(currentValue)) { 913 913 createGridLineNamesList(currentValue.get(), currentNamedGridLine, tracksData.m_namedGridLines, tracksData.m_orderedNamedGridLines); 914 914 continue; … … 922 922 tracksData.m_autoRepeatType = autoRepeatID == CSSValueAutoFill ? AutoFill : AutoFit; 923 923 for (auto& autoRepeatValue : downcast<CSSValueList>(currentValue.get())) { 924 if (is<CSSGridLineNamesValue>(autoRepeatValue .get())) {924 if (is<CSSGridLineNamesValue>(autoRepeatValue)) { 925 925 createGridLineNamesList(autoRepeatValue.get(), autoRepeatIndex, tracksData.m_autoRepeatNamedGridLines, tracksData.m_autoRepeatOrderedNamedGridLines); 926 926 continue; -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r222588 r224320 1230 1230 auto& list = downcast<CSSValueList>(value); 1231 1231 for (auto& item : list) { 1232 if (is<CSSCursorImageValue>(item .get())) {1232 if (is<CSSCursorImageValue>(item)) { 1233 1233 auto& image = downcast<CSSCursorImageValue>(item.get()); 1234 1234 styleResolver.style()->addCursor(styleResolver.styleImage(image), image.hotSpot()); … … 1411 1411 bool didSet = false; 1412 1412 for (auto& item : downcast<CSSValueList>(value)) { 1413 if (is<CSSImageGeneratorValue>(item .get())) {1414 if (is<CSSGradientValue>(item .get()))1413 if (is<CSSImageGeneratorValue>(item)) { 1414 if (is<CSSGradientValue>(item)) 1415 1415 styleResolver.style()->setContent(StyleGeneratedImage::create(downcast<CSSGradientValue>(item.get()).gradientWithStylesResolved(styleResolver)), didSet); 1416 1416 else 1417 1417 styleResolver.style()->setContent(StyleGeneratedImage::create(downcast<CSSImageGeneratorValue>(item.get())), didSet); 1418 1418 didSet = true; 1419 } else if (is<CSSImageSetValue>(item .get())) {1419 } else if (is<CSSImageSetValue>(item)) { 1420 1420 styleResolver.style()->setContent(StyleCachedImage::create(item), didSet); 1421 1421 didSet = true; 1422 1422 } 1423 1423 1424 if (is<CSSImageValue>(item .get())) {1424 if (is<CSSImageValue>(item)) { 1425 1425 styleResolver.style()->setContent(StyleCachedImage::create(item), didSet); 1426 1426 didSet = true; … … 1428 1428 } 1429 1429 1430 if (!is<CSSPrimitiveValue>(item .get()))1430 if (!is<CSSPrimitiveValue>(item)) 1431 1431 continue; 1432 1432 … … 1860 1860 auto willChange = WillChangeData::create(); 1861 1861 for (auto& item : downcast<CSSValueList>(value)) { 1862 if (!is<CSSPrimitiveValue>(item .get()))1862 if (!is<CSSPrimitiveValue>(item)) 1863 1863 continue; 1864 1864 auto& primitiveValue = downcast<CSSPrimitiveValue>(item.get()); -
trunk/Source/WebCore/css/StyleProperties.cpp
r223728 r224320 242 242 { 243 243 auto colorValue = getPropertyCSSValue(property); 244 if (!is<CSSPrimitiveValue>(colorValue .get()))244 if (!is<CSSPrimitiveValue>(colorValue)) 245 245 return std::nullopt; 246 246 … … 252 252 { 253 253 auto cssValue = getPropertyCSSValue(property); 254 return is<CSSPrimitiveValue>(cssValue .get()) ? downcast<CSSPrimitiveValue>(*cssValue).valueID() : CSSValueInvalid;254 return is<CSSPrimitiveValue>(cssValue) ? downcast<CSSPrimitiveValue>(*cssValue).valueID() : CSSValueInvalid; 255 255 } 256 256 -
trunk/Source/WebCore/css/StyleResolver.cpp
r224213 r224320 1918 1918 for (auto& currentValue : downcast<CSSValueList>(inValue)) { 1919 1919 1920 if (is<CSSPrimitiveValue>(currentValue .get())) {1920 if (is<CSSPrimitiveValue>(currentValue)) { 1921 1921 auto& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get()); 1922 1922 if (!primitiveValue.isURI()) … … 1931 1931 } 1932 1932 1933 if (!is<CSSFunctionValue>(currentValue .get()))1933 if (!is<CSSFunctionValue>(currentValue)) 1934 1934 continue; 1935 1935 -
trunk/Source/WebCore/css/TransformFunctions.cpp
r218890 r224320 111 111 TransformOperations operations; 112 112 for (auto& currentValue : downcast<CSSValueList>(value)) { 113 if (!is<CSSFunctionValue>(currentValue .get()))113 if (!is<CSSFunctionValue>(currentValue)) 114 114 continue; 115 115 -
trunk/Source/WebCore/css/ViewportStyleResolver.cpp
r223728 r224320 105 105 106 106 RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); 107 if (!is<CSSPrimitiveValue>(value .get()))107 if (!is<CSSPrimitiveValue>(value)) 108 108 return defaultValue; 109 109 -
trunk/Source/WebCore/dom/Document.cpp
r224213 r224320 2646 2646 ExceptionOr<void> Document::setBodyOrFrameset(RefPtr<HTMLElement>&& newBody) 2647 2647 { 2648 if (!is<HTMLBodyElement>(newBody .get()) && !is<HTMLFrameSetElement>(newBody.get()))2648 if (!is<HTMLBodyElement>(newBody) && !is<HTMLFrameSetElement>(newBody)) 2649 2649 return Exception { HierarchyRequestError }; 2650 2650 … … 3845 3845 } 3846 3846 3847 if (is<HTMLInputElement>(oldFocusedElement .get())) {3847 if (is<HTMLInputElement>(oldFocusedElement)) { 3848 3848 // HTMLInputElement::didBlur just scrolls text fields back to the beginning. 3849 3849 // FIXME: This could be done asynchronusly. … … 6848 6848 } 6849 6849 // Unset hovered nodes in sub frame documents if the old hovered node was a frame owner. 6850 if (is<HTMLFrameOwnerElement>(oldHoveredElement .get())) {6850 if (is<HTMLFrameOwnerElement>(oldHoveredElement)) { 6851 6851 if (Document* contentDocument = downcast<HTMLFrameOwnerElement>(*oldHoveredElement).contentDocument()) 6852 6852 contentDocument->updateHoverActiveState(request, nullptr); -
trunk/Source/WebCore/dom/Element.cpp
r224316 r224320 2570 2570 2571 2571 RefPtr<Node> node = next ? next->previousSibling() : nullptr; 2572 if (is<Text>(node .get())) {2572 if (is<Text>(node)) { 2573 2573 auto result = mergeWithNextTextNode(downcast<Text>(*node)); 2574 2574 if (result.hasException()) 2575 2575 return result.releaseException(); 2576 2576 } 2577 if (is<Text>(prev .get())) {2577 if (is<Text>(prev)) { 2578 2578 auto result = mergeWithNextTextNode(downcast<Text>(*prev)); 2579 2579 if (result.hasException()) -
trunk/Source/WebCore/dom/Range.cpp
r220503 r224320 919 919 920 920 unsigned newOffset = referenceNode ? referenceNode->computeNodeIndex() : parent->countChildNodes(); 921 if (is<DocumentFragment>(node .get()))921 if (is<DocumentFragment>(node)) 922 922 newOffset += downcast<DocumentFragment>(node.get()).countChildNodes(); 923 923 else -
trunk/Source/WebCore/editing/ApplyStyleCommand.cpp
r223788 r224320 60 60 static int toIdentifier(RefPtr<CSSValue>&& value) 61 61 { 62 return is<CSSPrimitiveValue>(value .get()) ? downcast<CSSPrimitiveValue>(*value).valueID() : 0;62 return is<CSSPrimitiveValue>(value) ? downcast<CSSPrimitiveValue>(*value).valueID() : 0; 63 63 } 64 64 … … 271 271 } 272 272 ASSERT(!block || is<HTMLElement>(*block)); 273 if (is<HTMLElement>(block .get())) {273 if (is<HTMLElement>(block)) { 274 274 removeCSSStyle(style, downcast<HTMLElement>(*block)); 275 275 if (!m_removeOnly) … … 1357 1357 mergeIdenticalElements(element, downcast<Element>(*nextSibling)); 1358 1358 1359 if (is<Element>(previousSibling .get()) && previousSibling->hasEditableStyle()) {1359 if (is<Element>(previousSibling) && previousSibling->hasEditableStyle()) { 1360 1360 auto* mergedElement = previousSibling->nextSibling(); 1361 1361 ASSERT(mergedElement); -
trunk/Source/WebCore/editing/EditingStyle.cpp
r223728 r224320 144 144 { 145 145 RefPtr<CSSValue> value = extractPropertyValue(style, propertyID); 146 if (propertyID == CSSPropertyFontStyle && is<CSSFontStyleValue>(value .get()) && downcast<CSSFontStyleValue>(value.get())->isItalicOrOblique())146 if (propertyID == CSSPropertyFontStyle && is<CSSFontStyleValue>(value) && downcast<CSSFontStyleValue>(value.get())->isItalicOrOblique()) 147 147 return CSSValueItalic; 148 if (!is<CSSPrimitiveValue>(value .get()))148 if (!is<CSSPrimitiveValue>(value)) 149 149 return 0; 150 150 return downcast<CSSPrimitiveValue>(*value).valueID(); … … 199 199 { 200 200 RefPtr<CSSValue> value = style.m_mutableStyle->getPropertyCSSValue(m_propertyID); 201 return matches(element) && is<CSSPrimitiveValue>(value .get()) && downcast<CSSPrimitiveValue>(*value).valueID() == m_primitiveValue->valueID();201 return matches(element) && is<CSSPrimitiveValue>(value) && downcast<CSSPrimitiveValue>(*value).valueID() == m_primitiveValue->valueID(); 202 202 } 203 203 … … 238 238 if (!styleValue) 239 239 styleValue = style.m_mutableStyle->getPropertyCSSValue(CSSPropertyTextDecoration); 240 return is<CSSValueList>(styleValue .get()) && downcast<CSSValueList>(*styleValue).hasValue(m_primitiveValue.get());240 return is<CSSValueList>(styleValue) && downcast<CSSValueList>(*styleValue).hasValue(m_primitiveValue.get()); 241 241 } 242 242 … … 503 503 // Get the adjustment amount out of the style. 504 504 RefPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitFontSizeDelta); 505 if (!is<CSSPrimitiveValue>(value .get()))505 if (!is<CSSPrimitiveValue>(value)) 506 506 return; 507 507 … … 551 551 552 552 RefPtr<CSSValue> unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi); 553 if (!is<CSSPrimitiveValue>(unicodeBidi .get()))553 if (!is<CSSPrimitiveValue>(unicodeBidi)) 554 554 return false; 555 555 … … 557 557 if (unicodeBidiValue == CSSValueEmbed) { 558 558 RefPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection); 559 if (!is<CSSPrimitiveValue>(direction .get()))559 if (!is<CSSPrimitiveValue>(direction)) 560 560 return false; 561 561 … … 800 800 { 801 801 RefPtr<CSSValue> value = properties.getPropertyCSSValue(CSSPropertyTextDecoration); 802 if (!is<CSSValueList>(value .get()))802 if (!is<CSSValueList>(value)) 803 803 return nullptr; 804 804 return downcast<CSSValueList>(value.get()); … … 1090 1090 m_mutableStyle->removeProperty(CSSPropertyBackgroundColor); 1091 1091 1092 if (is<CSSPrimitiveValue>(unicodeBidi .get())) {1092 if (is<CSSPrimitiveValue>(unicodeBidi)) { 1093 1093 m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, static_cast<CSSValueID>(downcast<CSSPrimitiveValue>(*unicodeBidi).valueID())); 1094 if (is<CSSPrimitiveValue>(direction .get()))1094 if (is<CSSPrimitiveValue>(direction)) 1095 1095 m_mutableStyle->setProperty(CSSPropertyDirection, static_cast<CSSValueID>(downcast<CSSPrimitiveValue>(*direction).valueID())); 1096 1096 } … … 1407 1407 { 1408 1408 RefPtr<CSSValue> cssValue = m_mutableStyle->getPropertyCSSValue(CSSPropertyFontSize); 1409 if (!is<CSSPrimitiveValue>(cssValue .get()))1409 if (!is<CSSPrimitiveValue>(cssValue)) 1410 1410 return 0; 1411 1411 return legacyFontSizeFromCSSValue(document, downcast<CSSPrimitiveValue>(cssValue.get()), … … 1476 1476 1477 1477 RefPtr<CSSValue> unicodeBidi = ComputedStyleExtractor(n).propertyValue(CSSPropertyUnicodeBidi); 1478 if (!is<CSSPrimitiveValue>(unicodeBidi .get()))1478 if (!is<CSSPrimitiveValue>(unicodeBidi)) 1479 1479 continue; 1480 1480 … … 1505 1505 ComputedStyleExtractor computedStyle(node); 1506 1506 RefPtr<CSSValue> unicodeBidi = computedStyle.propertyValue(CSSPropertyUnicodeBidi); 1507 if (!is<CSSPrimitiveValue>(unicodeBidi .get()))1507 if (!is<CSSPrimitiveValue>(unicodeBidi)) 1508 1508 continue; 1509 1509 … … 1517 1517 ASSERT(unicodeBidiValue == CSSValueEmbed); 1518 1518 RefPtr<CSSValue> direction = computedStyle.propertyValue(CSSPropertyDirection); 1519 if (!is<CSSPrimitiveValue>(direction .get()))1519 if (!is<CSSPrimitiveValue>(direction)) 1520 1520 continue; 1521 1521 … … 1585 1585 if (shouldAddUnderline || shouldAddStrikeThrough) { 1586 1586 RefPtr<CSSValue> value = computedStyle.propertyValue(CSSPropertyWebkitTextDecorationsInEffect); 1587 if (!is<CSSValueList>(value .get()))1587 if (!is<CSSValueList>(value)) 1588 1588 value = computedStyle.propertyValue(CSSPropertyTextDecoration); 1589 1589 1590 1590 RefPtr<CSSValueList> valueList; 1591 if (is<CSSValueList>(value .get()))1591 if (is<CSSValueList>(value)) 1592 1592 valueList = downcast<CSSValueList>(value.get()); 1593 1593 … … 1668 1668 // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList. 1669 1669 RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(CSSPropertyTextDecoration); 1670 if (is<CSSValueList>(textDecoration .get())) {1670 if (is<CSSValueList>(textDecoration)) { 1671 1671 auto& cssValuePool = CSSValuePool::singleton(); 1672 1672 RefPtr<CSSPrimitiveValue> underline = cssValuePool.createIdentifierValue(CSSValueUnderline); … … 1719 1719 { 1720 1720 RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(propertID); 1721 if (!is<CSSValueList>(textDecoration .get()) || !is<CSSValueList>(refTextDecoration))1721 if (!is<CSSValueList>(textDecoration) || !is<CSSValueList>(refTextDecoration)) 1722 1722 return; 1723 1723 -
trunk/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
r223644 r224320 71 71 { 72 72 RefPtr<Node> node = element().userAgentShadowRoot()->firstChild(); 73 if (!is<HTMLElement>(node .get()))73 if (!is<HTMLElement>(node)) 74 74 return; 75 75 String displayValue = visibleValue(); -
trunk/Source/WebCore/html/FormAssociatedElement.cpp
r223802 r224320 109 109 // treeScope().getElementById() over the given element. 110 110 RefPtr<Element> newFormCandidate = element->treeScope().getElementById(formId); 111 if (is<HTMLFormElement>(newFormCandidate .get()))111 if (is<HTMLFormElement>(newFormCandidate)) 112 112 return downcast<HTMLFormElement>(newFormCandidate.get()); 113 113 return nullptr; -
trunk/Source/WebCore/html/HTMLAreaElement.cpp
r223644 r224320 189 189 { 190 190 RefPtr<Node> mapElement = parentNode(); 191 if (!is<HTMLMapElement>(mapElement .get()))191 if (!is<HTMLMapElement>(mapElement)) 192 192 return nullptr; 193 193 -
trunk/Source/WebCore/html/HTMLElement.cpp
r224213 r224320 562 562 563 563 RefPtr<Node> node = next ? next->previousSibling() : nullptr; 564 if (is<Text>(node .get())) {564 if (is<Text>(node)) { 565 565 auto result = mergeWithNextTextNode(downcast<Text>(*node)); 566 566 if (result.hasException()) 567 567 return result.releaseException(); 568 568 } 569 if (is<Text>(prev .get())) {569 if (is<Text>(prev)) { 570 570 auto result = mergeWithNextTextNode(downcast<Text>(*prev)); 571 571 if (result.hasException()) … … 841 841 RefPtr<Element> parent = parentElement(); 842 842 843 if (is<HTMLElement>(parent .get()) && parent->selfOrAncestorHasDirAutoAttribute())843 if (is<HTMLElement>(parent) && parent->selfOrAncestorHasDirAutoAttribute()) 844 844 downcast<HTMLElement>(*parent).adjustDirectionalityIfNeededAfterChildAttributeChanged(this); 845 845 -
trunk/Source/WebCore/html/HTMLEmbedElement.cpp
r224150 r224320 201 201 // should be ignored and not get a renderer. 202 202 RefPtr<ContainerNode> parent = parentNode(); 203 if (is<HTMLObjectElement>(parent .get())) {203 if (is<HTMLObjectElement>(parent)) { 204 204 if (!parent->renderer()) 205 205 return false; -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r224150 r224320 125 125 if (is<HTMLFieldSetElement>(*ancestor) && ancestor->hasAttributeWithoutSynchronization(disabledAttr)) { 126 126 HTMLFieldSetElement& fieldSetAncestor = downcast<HTMLFieldSetElement>(*ancestor); 127 bool isInFirstLegend = is<HTMLLegendElement>(previousAncestor .get()) && previousAncestor == fieldSetAncestor.legend();127 bool isInFirstLegend = is<HTMLLegendElement>(previousAncestor) && previousAncestor == fieldSetAncestor.legend(); 128 128 return !isInFirstLegend; 129 129 } -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r224316 r224320 1598 1598 1599 1599 RefPtr<Element> element = treeScope().getElementById(attributeWithoutSynchronization(listAttr)); 1600 if (!is<HTMLDataListElement>(element .get())1600 if (!is<HTMLDataListElement>(element)) 1601 1601 return nullptr; 1602 1602 -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r223802 r224320 121 121 // Handle the common special case where there's exactly 1 child node, and it's a text node. 122 122 RefPtr<Node> child = firstChild(); 123 if (is<Text>(child .get()) && !child->nextSibling())123 if (is<Text>(child) && !child->nextSibling()) 124 124 downcast<Text>(*child).setData(text); 125 125 else { … … 302 302 { 303 303 RefPtr<ContainerNode> parent = parentNode(); 304 if (is<HTMLOptGroupElement>(parent .get()))304 if (is<HTMLOptGroupElement>(parent)) 305 305 return " " + displayLabel(); 306 306 return displayLabel(); -
trunk/Source/WebCore/html/HTMLPlugInElement.cpp
r224316 r224320 228 228 229 229 RefPtr<Widget> widget = pluginWidget(); 230 if (!is<PluginViewBase>(widget .get()))230 if (!is<PluginViewBase>(widget)) 231 231 return false; 232 232 … … 243 243 // No widget - can't be anything to see or hear here. 244 244 RefPtr<Widget> widget = pluginWidget(PluginLoadingPolicy::DoNotLoad); 245 if (!is<PluginViewBase>(widget .get()))245 if (!is<PluginViewBase>(widget)) 246 246 return false; 247 247 -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r223802 r224320 866 866 deselectItemsWithoutValidation(element.get()); 867 867 868 if (is<HTMLOptionElement>(element .get())) {868 if (is<HTMLOptionElement>(element)) { 869 869 if (m_activeSelectionAnchorIndex < 0 || shouldDeselect) 870 870 setActiveSelectionAnchorIndex(listIndex); -
trunk/Source/WebCore/html/HTMLSummaryElement.cpp
r224316 r224320 101 101 return true; 102 102 RefPtr<Element> host = element.shadowHost(); 103 return host && is<HTMLFormControlElement>(host .get());103 return host && is<HTMLFormControlElement>(host); 104 104 } 105 105 -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r224296 r224320 799 799 if (const StyleProperties* properties = innerText->presentationAttributeStyle()) { 800 800 RefPtr<CSSValue> value = properties->getPropertyCSSValue(CSSPropertyWebkitUserModify); 801 if (is<CSSPrimitiveValue>(value .get()))801 if (is<CSSPrimitiveValue>(value)) 802 802 textBlockStyle.setUserModify(downcast<CSSPrimitiveValue>(*value)); 803 803 } -
trunk/Source/WebCore/html/RadioInputType.cpp
r223644 r224320 122 122 // skip any other elements in the group. 123 123 RefPtr<Element> currentFocusedNode = element().document().focusedElement(); 124 if (is<HTMLInputElement>(currentFocusedNode .get())) {124 if (is<HTMLInputElement>(currentFocusedNode)) { 125 125 HTMLInputElement& focusedInput = downcast<HTMLInputElement>(*currentFocusedNode); 126 126 if (focusedInput.isRadioButton() && focusedInput.form() == element().form() && focusedInput.name() == element().name()) -
trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp
r224213 r224320 191 191 void HTMLConstructionSite::attachLater(ContainerNode& parent, Ref<Node>&& child, bool selfClosing) 192 192 { 193 ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is<Element>(child .get()) || !isScriptElement(downcast<Element>(child.get())));193 ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is<Element>(child) || !isScriptElement(downcast<Element>(child.get()))); 194 194 ASSERT(pluginContentIsAllowed(m_parserContentPolicy) || !child->isPluginElement()); 195 195 … … 585 585 586 586 RefPtr<Node> previousChild = task.nextChild ? task.nextChild->previousSibling() : task.parent->lastChild(); 587 if (is<Text>(previousChild .get())) {587 if (is<Text>(previousChild)) { 588 588 // FIXME: We're only supposed to append to this text node if it 589 589 // was the last text node inserted by the parser. -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r223644 r224320 690 690 if (event.type() == eventNames().clickEvent) { 691 691 RefPtr<Node> target = event.target()->toNode(); 692 if (!is<Element>(target .get()))692 if (!is<Element>(target)) 693 693 return; 694 694 -
trunk/Source/WebCore/html/track/TextTrackList.cpp
r210828 r224320 188 188 if (track->trackType() == TextTrack::AddTrack) 189 189 m_addTrackTracks.append(track.ptr()); 190 else if (is<LoadableTextTrack>(track .get())) {190 else if (is<LoadableTextTrack>(track)) { 191 191 // Insert tracks added for <track> element in tree order. 192 192 size_t index = downcast<LoadableTextTrack>(track.get()).trackElementIndex(); -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r224074 r224320 737 737 738 738 RefPtr<Node> oldNode = nodeForId(nodeId); 739 if (!is<Element>(oldNode .get()))739 if (!is<Element>(oldNode)) 740 740 return; 741 741 -
trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp
r223476 r224320 172 172 if (auto* view = frame.view()) { 173 173 for (auto& child : view->children()) { 174 if (!is<PluginViewBase>(child .get()))174 if (!is<PluginViewBase>(child)) 175 175 continue; 176 176 downcast<PluginViewBase>(child.get()).setJavaScriptPaused(paused); -
trunk/Source/WebCore/page/FocusController.cpp
r217441 r224320 775 775 // FIXME: These additional checks should not be necessary. We should consider generally keeping the selection whenever the 776 776 // focused element is blurred, with no new element taking focus. 777 if (!oldFocusedElement->isRootEditableElement() && !is<HTMLInputElement>(oldFocusedElement .get()) && !is<HTMLTextAreaElement>(oldFocusedElement.get()))777 if (!oldFocusedElement->isRootEditableElement() && !is<HTMLInputElement>(oldFocusedElement) && !is<HTMLTextAreaElement>(oldFocusedElement)) 778 778 return true; 779 779 -
trunk/Source/WebCore/page/FrameView.cpp
r224198 r224320 3769 3769 { 3770 3770 for (auto& widget : children()) { 3771 if (is<FrameView>(widget .get())) {3771 if (is<FrameView>(widget)) { 3772 3772 if (downcast<FrameView>(widget.get()).hasCustomScrollbars()) 3773 3773 return true; 3774 } else if (is<Scrollbar>(widget .get())) {3774 } else if (is<Scrollbar>(widget)) { 3775 3775 if (downcast<Scrollbar>(widget.get()).isCustomScrollbar()) 3776 3776 return true; -
trunk/Source/WebCore/page/Page.cpp
r224150 r224320 1405 1405 break; 1406 1406 for (auto& widget : view->children()) { 1407 if (is<PluginViewBase>(widget .get()))1407 if (is<PluginViewBase>(widget)) 1408 1408 views.append(downcast<PluginViewBase>(widget.get())); 1409 1409 } -
trunk/Source/WebCore/page/mac/EventHandlerMac.mm
r222898 r224320 934 934 } else { 935 935 scrollableContainer = findEnclosingScrollableContainer(wheelEventTarget.get(), wheelEvent.deltaX(), wheelEvent.deltaY()); 936 if (scrollableContainer && !is<HTMLIFrameElement>(wheelEventTarget .get()))936 if (scrollableContainer && !is<HTMLIFrameElement>(wheelEventTarget)) 937 937 scrollableArea = scrollableAreaForContainerNode(*scrollableContainer); 938 938 else { -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r224279 r224320 912 912 context.setDrawLuminanceMask(bgLayer.maskSourceType() == MaskLuminance); 913 913 914 if (is<BitmapImage>(image .get()))914 if (is<BitmapImage>(image)) 915 915 downcast<BitmapImage>(*image).updateFromSettings(settings()); 916 916 -
trunk/Source/WebCore/testing/Internals.cpp
r224309 r224320 1034 1034 unsigned count = 0; 1035 1035 for (auto rule : childRules) { 1036 if (is<StyleRule>(rule .get())) {1036 if (is<StyleRule>(rule)) { 1037 1037 auto* cssRule = downcast<StyleRule>(rule.get()); 1038 1038 if (!cssRule->propertiesWithoutDeferredParsing()) … … 1042 1042 1043 1043 StyleRuleGroup* groupRule = nullptr; 1044 if (is<StyleRuleMedia>(rule .get()))1044 if (is<StyleRuleMedia>(rule)) 1045 1045 groupRule = downcast<StyleRuleMedia>(rule.get()); 1046 else if (is<StyleRuleSupports>(rule .get()))1046 else if (is<StyleRuleSupports>(rule)) 1047 1047 groupRule = downcast<StyleRuleSupports>(rule.get()); 1048 1048 if (!groupRule) … … 1069 1069 for (auto rule : childRules) { 1070 1070 StyleRuleGroup* groupRule = nullptr; 1071 if (is<StyleRuleMedia>(rule .get()))1071 if (is<StyleRuleMedia>(rule)) 1072 1072 groupRule = downcast<StyleRuleMedia>(rule.get()); 1073 else if (is<StyleRuleSupports>(rule .get()))1073 else if (is<StyleRuleSupports>(rule)) 1074 1074 groupRule = downcast<StyleRuleSupports>(rule.get()); 1075 1075 if (!groupRule) … … 1094 1094 unsigned count = 0; 1095 1095 for (auto rule : childRules) { 1096 if (is<StyleRuleKeyframes>(rule .get())) {1096 if (is<StyleRuleKeyframes>(rule)) { 1097 1097 auto* cssRule = downcast<StyleRuleKeyframes>(rule.get()); 1098 1098 if (!cssRule->keyframesWithoutDeferredParsing()) … … 1102 1102 1103 1103 StyleRuleGroup* groupRule = nullptr; 1104 if (is<StyleRuleMedia>(rule .get()))1104 if (is<StyleRuleMedia>(rule)) 1105 1105 groupRule = downcast<StyleRuleMedia>(rule.get()); 1106 else if (is<StyleRuleSupports>(rule .get()))1106 else if (is<StyleRuleSupports>(rule)) 1107 1107 groupRule = downcast<StyleRuleSupports>(rule.get()); 1108 1108 if (!groupRule)
Note: See TracChangeset
for help on using the changeset viewer.