Remove PassRefPtr from more of "platform"
https://bugs.webkit.org/show_bug.cgi?id=166809
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/JSInjectedScriptHost.h:
(Inspector::JSInjectedScriptHost::impl): Simplified code since we don't need a
const_cast here any more.
* runtime/PrivateName.h:
(JSC::PrivateName::uid): Ditto.
Source/WebCore:
* CMakeLists.txt: Removed DeviceMotionClientMock.cpp.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
Added now-needed include.
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
Pass a reference instead of a pointer.
* Modules/speech/SpeechSynthesisUtterance.h: Tweaks, msade a few things
more private and final.
* bindings/js/JSDOMConvert.h:
(WebCore::Detail::getPtrOrRef): Removed no-longer-needed const_cast.
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::wrapped): Ditto.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::~ScriptModuleLoader): Ditto.
* css/BasicShapeFunctions.cpp:
(WebCore::convertToLengthSize): Updated for LengthSize struct.
(WebCore::convertToCenterCoordinate): Ditto.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createPositionListForLayer): Take a reference.
(WebCore::getBorderRadiusCornerValues): Updated for LengthSize struct.
(WebCore::getBorderRadiusCornerValue): Ditto.
(WebCore::getBorderRadiusShorthandValue): Ditto.
(WebCore::fillSizeToCSSValue): Ditto.
(WebCore::ComputedStyleExtractor::propertyValue): Updated many properties
since the layer properties now return references rather than pointers.
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::CachedGeneratedImage::image): Removed
no-longer-needed const_cast.
* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::item): Ditto.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::init): Updated for LengthSize struct.
* css/CSSStyleRule.h: Removed no-longer-needed const_cast.
* css/CSSToStyleMap.cpp:
(WebCore::convertToLengthSize): Updated for LengthSize struct.
* css/FontFace.cpp:
(WebCore::FontFace::family): Removed no-longer-needed const_cast.
(WebCore::FontFace::style): Ditto.
(WebCore::FontFace::weight): Ditto.
(WebCore::FontFace::unicodeRange): Ditto.
(WebCore::FontFace::variant): Ditto.
(WebCore::FontFace::featureSettings): Ditto.
* css/LengthFunctions.cpp:
(WebCore::sizeForLengthSize): Added.
(WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
* css/LengthFunctions.h: Added sizeForLengthSize.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::paintOrder): Cut down on creation of unused objects.
We now create only what we actually use.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertRadius): Updated for
LengthSize struct.
(WebCore::StyleBuilderConverter::convertShapeValue): Pass references
when creating ShapeValue.
* css/StyleBuilderCustom.h:
(WebCore::forwardInheritedValue): Added. This set of overloaded
functions allows us to use move semantics for some types, but copy
them when inheriting. Doing it with special cases here allows us to
resolve this without adding overloads someone might be tempted to
call outside the style builder, and without adding special cases to
the JSON file for each property.
(WebCore::StyleBuilderCustom::applyValueWebkitDashboardRegion):
Add WTFMove as needed to work with rvalue references.
(WebCore::StyleBuilderCustom::applyValueSize): Ditto.
(WebCore::StyleBuilderCustom::applyInheritTextIndent): Ditto.
(WebCore::StyleBuilderCustom::applyValueTextIndent): Ditto.
(WebCore::StyleBuilderCustom::applyInheritLineHeight): Ditto.
(WebCore::StyleBuilderCustom::applyValueLineHeight): Ditto.
(WebCore::StyleBuilderCustom::applyInheritClip): Ditto.
(WebCore::StyleBuilderCustom::applyValueClip): Ditto.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::cacheBorderAndBackground): Use
references instead of pointers.
(WebCore::StyleResolver::applyMatchedProperties): Ditto.
(WebCore::StyleResolver::applyProperty): Update for changes to the
custom property data in RenderStyle.
* css/makeprop.pl: Use auto quite a bit more in the generated code.
Updated special cases for layers to expect references. Added a WTFMove
so we can get move semantics for converted values that come out in
an optional. Added call to forwardInheritedValue (see above).
* dom/Document.cpp:
(WebCore::Document::pageSizeAndMarginsInPixels): Use auto and update
since LengthSize is a struct.
* dom/EventPath.cpp:
(WebCore::EventPath::computePathUnclosedToTarget): Use auto.
* dom/LiveNodeList.h:
(WebCore::LiveNodeList::ownerNode): Removed no-longer-needed const_cast.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source): Removed unneeded static_cast.
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector): Tweaked formatting.
* dom/Range.h:
(WebCore::Range::ownerDocument): Removed no-longer-needed const_cast.
* dom/RegisteredEventListener.h:
(WebCore::RegisteredEventListener::callback): Ditto.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::~ScriptRunner): Ditto.
* html/HTMLCollection.h:
(WebCore::HTMLCollection::ownerNode): Ditto.
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::node): Ditto.
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused): Cut down on the number
of different functions here. Also use reference rather than pointer.
* inspector/PageScriptDebugServer.h: Updated for above change.
* loader/HistoryController.cpp:
(WebCore::HistoryController::recursiveSetProvisionalItem): Removed
no-longer-needed const_cast.
(WebCore::HistoryController::recursiveGoToItem): Ditto.
* page/Frame.cpp:
(WebCore::Frame::ownerRenderer): Use auto. Let the is<> function do null
checking for us.
(WebCore::Frame::frameForWidget): Take a reference rather than a pointer.
* page/Frame.h: Updated for the above.
* page/FrameView.cpp:
(WebCore::FrameView::invalidateRect): Use Chrome directly instead of using
HostWindow. HostWindow is an abstraction for the platform layer, and there
is no good reason to use it here.
(WebCore::FrameView::scheduleAnimation): Ditto.
(WebCore::FrameView::graphicsLayerForPlatformWidget): Updated to use reference
when calling RenderWidget::find.
(WebCore::FrameView::scrollContentsFastPath): Use Chrome instead of HostWindow.
(WebCore::FrameView::hostWindow): Use early return.
(WebCore::FrameView::updateScrollCorner): Removed unneeded call through to base
class function, which was empty.
(WebCore::FrameView::hasCustomScrollbars): Updated since the children set now
contains Ref rather than RefPtr.
(WebCore::FrameView::parentFrameView): Use early return.
(WebCore::FrameView::updateWidgetPositions): Use reference instead of pointer.
* page/FrameView.h: Use final instead of override. Remove now-unneeded const_cast.
* page/Page.cpp:
(WebCore::Page::pluginViews): Updated since the children set now contains
Ref rather than RefPtr.
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Updated for LengthSize struct.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::fireAnimationEventsIfNeeded): Updated for changes to
the types in animation function members.
(WebCore::AnimationBase::timeToNextService): Ditto.
(WebCore::AnimationBase::progress): Ditto.
(WebCore::AnimationBase::getElapsedTime): Ditto.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Updated for LengthSize struct.
(WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Updated since we now
use rvalue references and move semantics when setting length properties.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame): Tweaked to
use auto, pass references.
* platform/KeyedCoding.h: Return RefPtr instead of PassRefPtr.
* platform/LengthBox.h: Added a constructor that moves the lengths in, rather
than always copying them.
* platform/LengthSize.cpp:
(WebCore::operator<<): Updated since LengthSize is a struct.
* platform/LengthSize.h: Turned LengthSize into a struct and removed all the
getter and setter code.
* platform/PlatformSpeechSynthesis.h: Removed. Unused.
* platform/PlatformSpeechSynthesisUtterance.cpp:
(WebCore::PlatformSpeechSynthesisUtterance::create): Return Ref rather than PassRefPtr.
(WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance): Take
a reference. Initialize data members in class definition.
* platform/PlatformSpeechSynthesisUtterance.h: Updated for the above.
* platform/PlatformSpeechSynthesisVoice.cpp:
(WebCore::PlatformSpeechSynthesisVoice::create): Return Ref rather than PassRefPtr.
* platform/PlatformSpeechSynthesisVoice.h: Updated for the above.
* platform/ScrollView.cpp:
(WebCore::ScrollView::addChild): Take a reference rather than a PassRefPtr.
(WebCore::ScrollView::setHasScrollbarInternal): Updated for change to addChild
(WebCore::ScrollView::scrollContentsFastPath): Deleted. This was never called,
so made it pure virtual.
(WebCore::ScrollView::frameRectsChanged): Use a modern for loop.
(WebCore::ScrollView::clipRectChanged): Ditto.
(WebCore::ScrollView::updateScrollCorner): Deleted. This was empty so made it pure
virtual and changed FrameView to not call it.
(WebCore::ScrollView::setParentVisible): Use a modern for loop.
(WebCore::ScrollView::show): Ditto.
(WebCore::ScrollView::hide): Ditto.
* platform/ScrollView.h: Changed the children set to contain Ref instead of RefPtr.
Changed functions that were never overridden to either be final or non-virtual,
Changed functions that were never called to be pure virtual.
* platform/Theme.h:
(WebCore::Theme::minimumControlSize): Updated for LengthSize struct.
* platform/animation/Animation.h: Changed timingFunction and trigger to return
raw pointers instead of PassRefPtr. Changed setTimingFunction and setTrigger to
take RefPtr&& and Ref&& instead of PassRefPtr. CHanged initialTimingfunction and
initialTrigger to return Ref.
* platform/animation/AnimationList.cpp: Removed redundant check in FILL_UNSET_PROPERTY.
(WebCore::AnimationList::AnimationList): Use modern for loop, reserveInitialCapacity,
and uncheckedAppend.
* platform/animation/AnimationList.h: Changed append to take Ref&& instead of PassRefPtr.
changed vecto to contain Ref instead of RefPtr. Added move constructor and assignment
operator.
* platform/animation/AnimationTrigger.h:
(WebCore::AutoAnimationTrigger::clone): Return Ref instead of PassRefPtr.
(WebCore::AutoAnimationTrigger::create): Ditto.
(WebCore::AutoAnimationTrigger::clone): Ditto.
(WebCore::ScrollAnimationTrigger::create): Ditto.
(WebCore::ScrollAnimationTrigger::clone): Ditto.
* platform/animation/TimingFunction.h:
(WebCore::LinearTimingFunction::create): Return Ref instead of PassRefPtr.
(WebCore::CubicBezierTimingFunction::create): Ditto.
(WebCore::CubicBezierTimingFunction::defaultTimingFunction): Return a reference
instead of a pointer.
(WebCore::CubicBezierTimingFunction::createReversed): Return Ref instead of PassRefPtr.
(WebCore::CubicBezierTimingFunction::clone): Ditto.
(WebCore::StepsTimingFunction::create): Ditto.
(WebCore::StepsTimingFunction::clone): Ditto.
(WebCore::SpringTimingFunction::create): Ditto.
(WebCore::SpringTimingFunction::clone): Ditto.
* platform/audio/AudioBus.h:
(WebCore::AudioBus::channel): Removed no-longer-needed const_cast.
* platform/cf/KeyedEncoderCF.cpp:
(WebCore::KeyedEncoderCF::finishEncoding): Return RefPtr instead of PassRefPtr.
* platform/cf/KeyedEncoderCF.h: Use final instead of override. Made even more
private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
* platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed include of PassRefPtr.h.
* platform/glib/KeyedEncoderGlib.cpp:
(WebCore::KeyedEncoderGlib::finishEncoding): Return RefPtr instead of PassRefPtr.
* platform/glib/KeyedEncoderGlib.h: Use final instead of override. Made even more
private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::outsetSizeForBlur): Simplified, removing unnecessary floating point math.
(WebCore::FilterOperations::FilterOperations): Deleted. Let the compiler generate this.
(WebCore::FilterOperations::operator=): Deleted. Let the compiler generate this.
(WebCore::FilterOperations::operator==): Streamlined.
(WebCore::FilterOperations::operationsMatch): Ditto.
(WebCore::FilterOperations::hasReferenceFilter): Ditto.
(WebCore::FilterOperations::hasOutsets): Ditto.
(WebCore::FilterOperations::outsets): Ditto.
(WebCore::FilterOperations::hasFilterThatAffectsOpacity): Ditto.
(WebCore::FilterOperations::hasFilterThatMovesPixels): Ditto.
* platform/graphics/filters/FilterOperations.h: Updated for above changes.
* platform/graphics/FontCache.h: Removed included of PassRefPtr.h.
* platform/graphics/FontPlatformData.h: Tweaked formatting. Removed nesting
from #if since our formatting makes it hard to see nesting. Let the compiler
generate the default move and copy constructors and assignemnt operators except
in the USE(FREETYPE) case.
* platform/graphics/GraphicsLayer.h:
(WebCore::AnimationValue::AnimationValue): Updated since clone now returns a Ref
rather than a RefPtr.
(WebCore::FloatAnimationValue::FloatAnimationValue): Deleted. Let the compiler
generate the copy constructor without defining it explicitly.
(WebCore::TransformAnimationValue::TransformAnimationValue): Use a modern for
loop, reserveInitialCapacity, and unchecked append. Also tell the compiler to
generate the move constructor, since the special work is only needed for the
copy constructor.
(WebCore::FilterAnimationValue::FilterAnimationValue): Ditto.
(WebCore::KeyframeValueList::KeyframeValueList): Ditto.
* platform/graphics/LegacyCDMSession.h: Removed include of PassRefPtr.h.
* platform/graphics/PathUtilities.cpp:
(WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline): Updated
for LengthSize struct.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF): Take a reference.
Don't bother setting m_client since we never use it.
(WebCore::CDMSessionAVFoundationCF::generateKeyRequest): Clean up code a bit
by using auto a lot more.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Added include
that is now needed since it was removed from the base class. Tidied the class
up a bit, marking it final, making everything private, taking a reference, and
removing an unused data member, m_client.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createSession): Pass a reference.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
added include of WTFString.h, now needed because of removing an unneeded
include from another header file.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated): Updated since trigger
is a raw pointer now.
(WebCore::GraphicsLayerCA::timingFunctionForAnimationValue): Updated to
return a reference rather than a pointer.
(WebCore::GraphicsLayerCA::setAnimationEndpoints): Updated for the above change.
(WebCore::GraphicsLayerCA::setAnimationKeyframes): Ditto.
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints): Ditto.
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes): Ditto.
(WebCore::GraphicsLayerCA::setFilterAnimationEndpoints): Ditto.
(WebCore::GraphicsLayerCA::setFilterAnimationKeyframes): Ditto.
* platform/graphics/ca/GraphicsLayerCA.h: Ditto.
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(-[WebSpeechSynthesisWrapper speakUtterance:]): CHanged argument to be a
RefPtr&& instead of a PassRefPtr.
* platform/mac/ThemeMac.mm:
(WebCore::sizeFromNSControlSize): Updated for LenghtSize struct.
(WebCore::checkboxSize): Ditto.
(WebCore::radioSize): Ditto.
(WebCore::ThemeMac::controlSize): Ditto.
(WebCore::ThemeMac::minimumControlSize): Ditto.
* platform/mac/WidgetMac.mm:
(WebCore::Widget::setFocus): Updated to pass a reference.
* platform/mock/DeviceMotionClientMock.cpp: Removed. Unused.
* platform/mock/DeviceMotionClientMock.h: Removed. Unused.
* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor): Return a Ref instead of a PassRefPtr.
(WebCore::loadSharedCursor): Ditto.
(WebCore::loadCursorByName): Ditto.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::output): Removed a no-longer-needed const_cast.
(WebCore::FilterEffectRenderer::outputRect): Ditto.
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::chooseInterpolationQuality): Tweaked formatting.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintFillLayers): Updated to take a reference. Also
used a vector to iterate the linked list in reverse order instead of recursion.
(WebCore::InlineFlowBox::paintFillLayer): Take a reference.
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineFlowBox.h: Updated for the above.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers): Use auto a bit.
(WebCore::RenderBox::getBackgroundPaintedExtent): Use reference for the layers.
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect): Ditto.
(WebCore::RenderBox::backgroundHasOpaqueTopLayer): Ditto.
(WebCore::RenderBox::paintMaskImages): Ditto.
(WebCore::RenderBox::maskClipRect): Ditto.
(WebCore::RenderBox::paintFillLayers): Ditto.
(WebCore::RenderBox::paintFillLayer): Ditto.
(WebCore::layersUseImage): Ditto.
(WebCore::RenderBox::repaintLayerRectsForImage): Ditto.
* rendering/RenderBox.h: Updated for the above.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Use reference for
the layers.
(WebCore::RenderBoxModelObject::calculateFillTileSize): Ditto.
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ditto.
(WebCore::RenderBoxModelObject::getGeometryForBackgroundImage): Ditto.
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground): Ditto.
* rendering/RenderBoxModelObject.h: Updated for the above.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement): Use references for the layers.
(WebCore::RenderElement::adjustStyleDifference): Ditto.
(WebCore::RenderElement::updateFillImages): Ditto.
(WebCore::RenderElement::setStyle): Use RenderStyle::replace to replace the
old style with the new style, and get the old one out at the same time.
(WebCore::RenderElement::styleDidChange): Use references for the layers.
(WebCore::mustRepaintFillLayers): Ditto.
(WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto.
* rendering/RenderElement.h: Updated for the above.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
Refactor so we don't need so many functions in RenderStyle.
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle): Ditto.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar): Pass widget as reference to addChild.
Also did a few other tweaks and used more specific types.
* rendering/RenderLayerBacking.cpp:
(WebCore::canCreateTiledImage): Updated since layers are references.
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): Ditto.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar): Pass widget as reference to addChild.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell): Updated to use
references for layers.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle): Use WTFMove to pass a LengthBox.
(WebCore::RenderTheme::isControlStyled): Updated since LengthSize is a struct,
more WTFMove, change since layers are ferences.
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::adjustSizeConstraints): Update for Length and
LengthSize changes.
(WebCore::RenderThemeEfl::paintThemePart): Use reference instead of pointer.
(WebCore::RenderThemeEfl::applyPartDescriptionFallback): Update for Length and
LengthSize changes.
(WebCore::RenderThemeEfl::applyPartDescription): Ditto.
(WebCore::RenderThemeEfl::adjustCheckboxStyle): Ditto.
(WebCore::RenderThemeEfl::adjustRadioStyle): Ditto.
* rendering/RenderThemeGtk.cpp:
(WebCore::borderRadiiFromStyle): Update for Length and LengthSize changes.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustCheckboxStyle): Update for Length and
LengthSize changes.
(WebCore::RenderThemeIOS::isControlStyled): Ditto.
(WebCore::RenderThemeIOS::adjustRadioStyle): Ditto.
(WebCore::RenderThemeIOS::adjustRoundBorderRadius): Ditto.
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Ditto.
(WebCore::RenderThemeIOS::adjustSliderTrackStyle): Ditto.
(WebCore::RenderThemeIOS::adjustSliderThumbSize): Ditto.
* rendering/RenderWidget.cpp:
(WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): Use move
insteead of swap and modern for loop instead of iterators.
(WebCore::moveWidgetToParentSoon): Take a reference instead of a pointer.
(WebCore::RenderWidget::setWidget): Update for above change.
(WebCore::RenderWidget::find): Take a reference instead of a pointer.
* rendering/RenderWidget.h: Updated for above changes.
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::reset): Updated since Length is passed as
rvalue reference now.
* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::getMathMLStyle): Updated since mathMLStyle returns
a reference.
(WebCore::MathMLStyle::resolveMathMLStyleTree): Ditto.
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::mathMLStyle): Removed no-longer needed const_cast,
changed to return a reference rather than a pointer.
(WebCore::RenderMathMLTable::mathMLStyle): Ditto.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::fractionParameters): Updated since mathMLStyle
returns a reference.
(WebCore::RenderMathMLFraction::stackParameters): Ditto.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::isLargeOperatorInDisplayStyle): Ditto.
(WebCore::RenderMathMLOperator::shouldMoveLimits): Ditto.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::verticalParameters): Ditto.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
* rendering/style/BasicShapes.cpp:
(WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
* rendering/style/BorderData.h:
(WebCore::BorderData::BorderData): Ditto.
(WebCore::BorderData::hasBorderRadius): Ditto.
* rendering/style/ContentData.cpp:
(WebCore::ContentData::clone): Updated member names.
* rendering/style/ContentData.h: Ditto.
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::computeSlices): Use initializer lists so we get
move optimization without requiring explicit WTFMove.
* rendering/style/DataRef.h:
(WebCore::DataRef::DataRef): Removed no-longer needed const_cast.
(WebCore::DataRef::replace): Added. This function is like Ref::replace, and
can be used to put a new value in and get an old value out without running into
the rule Ref has about not being reused once it becomes null because of being
moved out of. This function is a lot like std::exchange.
(WebCore::DataRef::operator const T&): Added operator so we can use these
as references without any function call in read-only contexts.
(WebCore::DataRef::get): Changed to return a reference rather than pointer.
(WebCore::DataRef::access): Ditto.
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeValue::timingFunction): Updated since timingFunction
returns a raw pointer.
(WebCore::KeyframeList::~KeyframeList): Removed unneeded call to clear,
which does things that are redundant since we are about to destroy all the
data members.
(WebCore::KeyframeList::operator==): Tweaked codign style a bit.
* rendering/style/NinePieceImage.h: Updated most functions in this class
for the changes to DataRef.
* rendering/style/RenderStyle.cpp: Updated nearly every function in this
class for the changes to DataRef, to eliminate the peculiar naming and use
our standard data member naming, m_memberName in a class, and memberName in a
struct or struct-like class for publicly accessible members, to pass, take,
and return more references and rvalue references, and to use modern for loops.
Other changes listed below function by function.
(WebCore::RenderStyle::defaultStyle): Use NeverDestroyed instead of allocating
on the heap.
(WebCore::RenderStyle::RenderStyle): Added a new constructor that performs
the replace operation, using a combination of DataRef::replace and std::exchange.
(WebCore::RenderStyle::replace): Added. Calls the above constructor.
(WebCore::RenderStyle::setScrollSnapType): Use SET_NESTED_VAR so we get equality
checks on this property, for the normal efficiency benefit.
(WebCore::RenderStyle::setDashboardRegion): Moved this here from the header.
(WebCore::RenderStyle::appendContent): Deleted.
(WebCore::RenderStyle::setContent): Refactored this set of functions to simplify.
* rendering/style/RenderStyle.h: Updated most functions as mentioned above.
Also updated macros to use the do/while(0) technique. Removed the long list of
friend classes with the elaborate comments; turned out none needed friendship
despite the comments. Made more things private. Moved large functions out of the
class definition.
(WebCore::RenderStyle::getTextShadowExtent): Deleted.
(WebCore::RenderStyle::getTextShadowHorizontalExtent): Deleted.
(WebCore::RenderStyle::getTextShadowVerticalExtent): Deleted.
(WebCore::RenderStyle::aspectRatio): Deleted.
(WebCore::RenderStyle::alignContentPosition): Deleted.
(WebCore::RenderStyle::alignContentDistribution): Deleted.
(WebCore::RenderStyle::alignContentOverflowAlignment): Deleted.
(WebCore::RenderStyle::alignItemsPosition): Deleted.
(WebCore::RenderStyle::alignItemsOverflowAlignment): Deleted.
(WebCore::RenderStyle::alignSelfPosition): Deleted.
(WebCore::RenderStyle::alignSelfOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyContentPosition): Deleted.
(WebCore::RenderStyle::justifyContentDistribution): Deleted.
(WebCore::RenderStyle::justifyContentOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyItemsPosition): Deleted.
(WebCore::RenderStyle::justifyItemsOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyItemsPositionType): Deleted.
(WebCore::RenderStyle::justifySelfPosition): Deleted.
(WebCore::RenderStyle::justifySelfOverflowAlignment): Deleted.
(WebCore::RenderStyle::setAlignContentPosition): Deleted.
(WebCore::RenderStyle::setAlignContentOverflow): Deleted.
(WebCore::RenderStyle::setAlignContentDistribution): Deleted.
(WebCore::RenderStyle::setAlignItemsOverflow): Deleted.
(WebCore::RenderStyle::setAlignSelfOverflow): Deleted.
(WebCore::RenderStyle::setJustifyContentOverflow): Deleted.
(WebCore::RenderStyle::setJustifyContentDistribution): Deleted.
(WebCore::RenderStyle::setJustifyItemsPosition): Deleted.
(WebCore::RenderStyle::setJustifyItemsOverflow): Deleted.
(WebCore::RenderStyle::setJustifyItemsPositionType): Deleted.
(WebCore::RenderStyle::setJustifySelfPosition): Deleted.
(WebCore::RenderStyle::setJustifySelfOverflow): Deleted.
(WebCore::RenderStyle::noninheritedFlagsMemoryOffset): Deleted.
* rendering/style/SVGRenderStyle.cpp: Similar changes to RenderStyle.cpp above.
* rendering/style/SVGRenderStyle.h: Ditto.
* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::create): Take a Ref&& instead of a RefPtr.
(WebCore::ShapeValue::ShapeValue): Ditto.
* rendering/style/StyleBackgroundData.cpp: Update data member names.
* rendering/style/StyleBackgroundData.h: Ditto; make them public and remove the
getter functions.
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue): Removed no-longer-needed const_cast.
* rendering/style/StyleCustomPropertyData.h: Update data member names.
(WebCore::StyleCustomPropertyData::operator==): Removed unnecessary reference
count churn.
(WebCore::StyleCustomPropertyData::setCustomPropertyValue): Take an rvalue
reference.
(WebCore::StyleCustomPropertyData::getCustomPropertyValue): Deleted.
(WebCore::StyleCustomPropertyData::values): Deleted.
(WebCore::StyleCustomPropertyData::hasCustomProperty): Deleted.
(WebCore::StyleCustomPropertyData::containsVariables): Deleted.
(WebCore::StyleCustomPropertyData::setContainsVariables): Deleted.
* rendering/style/StyleFilterData.cpp: Update data member names.
* rendering/style/StyleFilterData.h: Ditto.
* rendering/style/StyleFlexibleBoxData.cpp: Ditto.
* rendering/style/StyleFlexibleBoxData.h: Ditto.
* rendering/style/StyleGridData.cpp: Ditto.
* rendering/style/StyleGridData.h: Ditto.
* rendering/style/StyleGridItemData.cpp: Ditto.
* rendering/style/StyleGridItemData.h: Ditto.
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::cssValue): Removed no-longer-needed const_cast.
(WebCore::StyleGeneratedImage::imageSize): Ditto.
(WebCore::StyleGeneratedImage::image): Ditto.
* rendering/style/StyleInheritedData.cpp: Update data member names.
* rendering/style/StyleInheritedData.h: Ditto.
* rendering/style/StyleRareInheritedData.cpp: Ditto.
* rendering/style/StyleRareInheritedData.h: Ditto.
* rendering/style/StyleMultiColData.cpp: Ditto.
* rendering/style/StyleMultiColData.h: Ditto.
* rendering/style/StyleRareNonInheritedData.cpp: Ditto.
* rendering/style/StyleRareNonInheritedData.h: Ditto.
* rendering/style/StyleTransformData.cpp: Ditto.
* rendering/style/StyleTransformData.h: Ditto.
* rendering/style/StyleVisualData.cpp: Ditto.
* rendering/style/StyleVisualData.h: Ditto.
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingResources): Update since layers are references.
Source/WebKit/mac:
* WebCoreSupport/WebFrameLoaderClient.mm:
(NetscapePluginWidget::handleEvent): Pass a reference.
* WebView/WebView.mm:
(-[WebView _addScrollerDashboardRegionsForFrameView:dashboardRegions:]):
Updated since the children set now contains Ref instead of RefPtr.
Source/WebKit2:
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
returns a raw pointer.
(IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
setters now takes an rvalue reference.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.
Source/WTF:
* wtf/Ref.h: Changed the template so that a const Ref<T> does not prohibit non-const
use of T. We can still use const Ref<const T> to express that. The earlier design
was intentional, but was not consistent with either actual references or with
other smart pointer classes like RefPtr. One way to see how much better this is,
is to see all the many, many cases where we have const_cast just to work around
this. I searched for those and included fixes for many in this patch.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@210758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index e824299..5508ab2 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2017-01-11 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr from more of "platform"
+ https://bugs.webkit.org/show_bug.cgi?id=166809
+
+ Reviewed by Sam Weinig.
+
+ * inspector/JSInjectedScriptHost.h:
+ (Inspector::JSInjectedScriptHost::impl): Simplified code since we don't need a
+ const_cast here any more.
+ * runtime/PrivateName.h:
+ (JSC::PrivateName::uid): Ditto.
+
2017-01-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210735.
diff --git a/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h b/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h
index 1bd4d77..ede7543 100644
--- a/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h
+++ b/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h
@@ -53,7 +53,7 @@
static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
static void destroy(JSC::JSCell*);
- InjectedScriptHost& impl() const { return const_cast<InjectedScriptHost&>(m_wrapped.get()); }
+ InjectedScriptHost& impl() const { return m_wrapped; }
// Attributes.
JSC::JSValue evaluate(JSC::ExecState*) const;
diff --git a/Source/JavaScriptCore/runtime/PrivateName.h b/Source/JavaScriptCore/runtime/PrivateName.h
index 4b86dec..ea43ff1 100644
--- a/Source/JavaScriptCore/runtime/PrivateName.h
+++ b/Source/JavaScriptCore/runtime/PrivateName.h
@@ -54,7 +54,7 @@
PrivateName(PrivateName&&) = default;
- SymbolImpl& uid() const { return const_cast<SymbolImpl&>(m_uid.get()); }
+ SymbolImpl& uid() const { return m_uid; }
bool operator==(const PrivateName& other) const { return &uid() == &other.uid(); }
bool operator!=(const PrivateName& other) const { return &uid() != &other.uid(); }
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 9aac4e6..c4cb32e 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,17 @@
+2017-01-11 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr from more of "platform"
+ https://bugs.webkit.org/show_bug.cgi?id=166809
+
+ Reviewed by Sam Weinig.
+
+ * wtf/Ref.h: Changed the template so that a const Ref<T> does not prohibit non-const
+ use of T. We can still use const Ref<const T> to express that. The earlier design
+ was intentional, but was not consistent with either actual references or with
+ other smart pointer classes like RefPtr. One way to see how much better this is,
+ is to see all the many, many cases where we have const_cast just to work around
+ this. I searched for those and included fixes for many in this patch.
+
2017-01-12 Chris Dumez <cdumez@apple.com>
[iOS] Implement support for KeyboardEvent.code
diff --git a/Source/WTF/wtf/Ref.h b/Source/WTF/wtf/Ref.h
index 47e5fa0..e955352 100644
--- a/Source/WTF/wtf/Ref.h
+++ b/Source/WTF/wtf/Ref.h
@@ -133,17 +133,10 @@
ASSERT(m_ptr);
}
- const T* operator->() const { ASSERT(m_ptr); return m_ptr; }
- T* operator->() { ASSERT(m_ptr); return m_ptr; }
-
- const T* ptr() const { ASSERT(m_ptr); return m_ptr; }
- T* ptr() { ASSERT(m_ptr); return m_ptr; }
-
- const T& get() const { ASSERT(m_ptr); return *m_ptr; }
- T& get() { ASSERT(m_ptr); return *m_ptr; }
-
- operator T&() { ASSERT(m_ptr); return *m_ptr; }
- operator const T&() const { ASSERT(m_ptr); return *m_ptr; }
+ T* operator->() const { ASSERT(m_ptr); return m_ptr; }
+ T* ptr() const { ASSERT(m_ptr); return m_ptr; }
+ T& get() const { ASSERT(m_ptr); return *m_ptr; }
+ operator T&() const { ASSERT(m_ptr); return *m_ptr; }
template<typename U> Ref<T> replace(Ref<U>&&) WARN_UNUSED_RETURN;
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index f56d746..aca870f 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -2271,7 +2271,6 @@
platform/mediastream/RealtimeMediaSourceSettings.cpp
platform/mediastream/SDPProcessorScriptResource.cpp
- platform/mock/DeviceMotionClientMock.cpp
platform/mock/DeviceOrientationClientMock.cpp
platform/mock/GeolocationClientMock.cpp
platform/mock/MockMediaEndpoint.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 6848066..36c5660 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,645 @@
+2017-01-11 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr from more of "platform"
+ https://bugs.webkit.org/show_bug.cgi?id=166809
+
+ Reviewed by Sam Weinig.
+
+ * CMakeLists.txt: Removed DeviceMotionClientMock.cpp.
+
+ * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
+ Added now-needed include.
+
+ * Modules/speech/SpeechSynthesisUtterance.cpp:
+ (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
+ Pass a reference instead of a pointer.
+
+ * Modules/speech/SpeechSynthesisUtterance.h: Tweaks, msade a few things
+ more private and final.
+
+ * bindings/js/JSDOMConvert.h:
+ (WebCore::Detail::getPtrOrRef): Removed no-longer-needed const_cast.
+ * bindings/js/JSDOMWrapper.h:
+ (WebCore::JSDOMWrapper::wrapped): Ditto.
+ * bindings/js/ScriptModuleLoader.cpp:
+ (WebCore::ScriptModuleLoader::~ScriptModuleLoader): Ditto.
+
+ * css/BasicShapeFunctions.cpp:
+ (WebCore::convertToLengthSize): Updated for LengthSize struct.
+ (WebCore::convertToCenterCoordinate): Ditto.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::createPositionListForLayer): Take a reference.
+ (WebCore::getBorderRadiusCornerValues): Updated for LengthSize struct.
+ (WebCore::getBorderRadiusCornerValue): Ditto.
+ (WebCore::getBorderRadiusShorthandValue): Ditto.
+ (WebCore::fillSizeToCSSValue): Ditto.
+ (WebCore::ComputedStyleExtractor::propertyValue): Updated many properties
+ since the layer properties now return references rather than pointers.
+
+ * css/CSSImageGeneratorValue.cpp:
+ (WebCore::CSSImageGeneratorValue::CachedGeneratedImage::image): Removed
+ no-longer-needed const_cast.
+ * css/CSSKeyframesRule.cpp:
+ (WebCore::CSSKeyframesRule::item): Ditto.
+
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::init): Updated for LengthSize struct.
+
+ * css/CSSStyleRule.h: Removed no-longer-needed const_cast.
+
+ * css/CSSToStyleMap.cpp:
+ (WebCore::convertToLengthSize): Updated for LengthSize struct.
+
+ * css/FontFace.cpp:
+ (WebCore::FontFace::family): Removed no-longer-needed const_cast.
+ (WebCore::FontFace::style): Ditto.
+ (WebCore::FontFace::weight): Ditto.
+ (WebCore::FontFace::unicodeRange): Ditto.
+ (WebCore::FontFace::variant): Ditto.
+ (WebCore::FontFace::featureSettings): Ditto.
+
+ * css/LengthFunctions.cpp:
+ (WebCore::sizeForLengthSize): Added.
+ (WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
+ * css/LengthFunctions.h: Added sizeForLengthSize.
+
+ * css/SVGCSSComputedStyleDeclaration.cpp:
+ (WebCore::paintOrder): Cut down on creation of unused objects.
+ We now create only what we actually use.
+
+ * css/StyleBuilderConverter.h:
+ (WebCore::StyleBuilderConverter::convertRadius): Updated for
+ LengthSize struct.
+ (WebCore::StyleBuilderConverter::convertShapeValue): Pass references
+ when creating ShapeValue.
+
+ * css/StyleBuilderCustom.h:
+ (WebCore::forwardInheritedValue): Added. This set of overloaded
+ functions allows us to use move semantics for some types, but copy
+ them when inheriting. Doing it with special cases here allows us to
+ resolve this without adding overloads someone might be tempted to
+ call outside the style builder, and without adding special cases to
+ the JSON file for each property.
+ (WebCore::StyleBuilderCustom::applyValueWebkitDashboardRegion):
+ Add WTFMove as needed to work with rvalue references.
+ (WebCore::StyleBuilderCustom::applyValueSize): Ditto.
+ (WebCore::StyleBuilderCustom::applyInheritTextIndent): Ditto.
+ (WebCore::StyleBuilderCustom::applyValueTextIndent): Ditto.
+ (WebCore::StyleBuilderCustom::applyInheritLineHeight): Ditto.
+ (WebCore::StyleBuilderCustom::applyValueLineHeight): Ditto.
+ (WebCore::StyleBuilderCustom::applyInheritClip): Ditto.
+ (WebCore::StyleBuilderCustom::applyValueClip): Ditto.
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::State::cacheBorderAndBackground): Use
+ references instead of pointers.
+ (WebCore::StyleResolver::applyMatchedProperties): Ditto.
+ (WebCore::StyleResolver::applyProperty): Update for changes to the
+ custom property data in RenderStyle.
+
+ * css/makeprop.pl: Use auto quite a bit more in the generated code.
+ Updated special cases for layers to expect references. Added a WTFMove
+ so we can get move semantics for converted values that come out in
+ an optional. Added call to forwardInheritedValue (see above).
+
+ * dom/Document.cpp:
+ (WebCore::Document::pageSizeAndMarginsInPixels): Use auto and update
+ since LengthSize is a struct.
+
+ * dom/EventPath.cpp:
+ (WebCore::EventPath::computePathUnclosedToTarget): Use auto.
+
+ * dom/LiveNodeList.h:
+ (WebCore::LiveNodeList::ownerNode): Removed no-longer-needed const_cast.
+
+ * dom/MessageEvent.cpp:
+ (WebCore::MessageEvent::source): Removed unneeded static_cast.
+
+ * dom/Node.cpp:
+ (WebCore::nodeSetPreTransformedFromNodeOrStringVector): Tweaked formatting.
+
+ * dom/Range.h:
+ (WebCore::Range::ownerDocument): Removed no-longer-needed const_cast.
+ * dom/RegisteredEventListener.h:
+ (WebCore::RegisteredEventListener::callback): Ditto.
+ * dom/ScriptRunner.cpp:
+ (WebCore::ScriptRunner::~ScriptRunner): Ditto.
+ * html/HTMLCollection.h:
+ (WebCore::HTMLCollection::ownerNode): Ditto.
+ * html/parser/HTMLStackItem.h:
+ (WebCore::HTMLStackItem::node): Ditto.
+
+ * inspector/PageScriptDebugServer.cpp:
+ (WebCore::PageScriptDebugServer::setJavaScriptPaused): Cut down on the number
+ of different functions here. Also use reference rather than pointer.
+ * inspector/PageScriptDebugServer.h: Updated for above change.
+
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::recursiveSetProvisionalItem): Removed
+ no-longer-needed const_cast.
+ (WebCore::HistoryController::recursiveGoToItem): Ditto.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::ownerRenderer): Use auto. Let the is<> function do null
+ checking for us.
+ (WebCore::Frame::frameForWidget): Take a reference rather than a pointer.
+ * page/Frame.h: Updated for the above.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::invalidateRect): Use Chrome directly instead of using
+ HostWindow. HostWindow is an abstraction for the platform layer, and there
+ is no good reason to use it here.
+ (WebCore::FrameView::scheduleAnimation): Ditto.
+ (WebCore::FrameView::graphicsLayerForPlatformWidget): Updated to use reference
+ when calling RenderWidget::find.
+ (WebCore::FrameView::scrollContentsFastPath): Use Chrome instead of HostWindow.
+ (WebCore::FrameView::hostWindow): Use early return.
+ (WebCore::FrameView::updateScrollCorner): Removed unneeded call through to base
+ class function, which was empty.
+ (WebCore::FrameView::hasCustomScrollbars): Updated since the children set now
+ contains Ref rather than RefPtr.
+ (WebCore::FrameView::parentFrameView): Use early return.
+ (WebCore::FrameView::updateWidgetPositions): Use reference instead of pointer.
+ * page/FrameView.h: Use final instead of override. Remove now-unneeded const_cast.
+
+ * page/Page.cpp:
+ (WebCore::Page::pluginViews): Updated since the children set now contains
+ Ref rather than RefPtr.
+
+ * page/PrintContext.cpp:
+ (WebCore::PrintContext::pageProperty): Updated for LengthSize struct.
+
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Updated for changes to
+ the types in animation function members.
+ (WebCore::AnimationBase::timeToNextService): Ditto.
+ (WebCore::AnimationBase::progress): Ditto.
+ (WebCore::AnimationBase::getElapsedTime): Ditto.
+
+ * page/animation/CSSPropertyAnimation.cpp:
+ (WebCore::blendFunc): Updated for LengthSize struct.
+ (WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Updated since we now
+ use rvalue references and move semantics when setting length properties.
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame): Tweaked to
+ use auto, pass references.
+
+ * platform/KeyedCoding.h: Return RefPtr instead of PassRefPtr.
+
+ * platform/LengthBox.h: Added a constructor that moves the lengths in, rather
+ than always copying them.
+
+ * platform/LengthSize.cpp:
+ (WebCore::operator<<): Updated since LengthSize is a struct.
+ * platform/LengthSize.h: Turned LengthSize into a struct and removed all the
+ getter and setter code.
+
+ * platform/PlatformSpeechSynthesis.h: Removed. Unused.
+
+ * platform/PlatformSpeechSynthesisUtterance.cpp:
+ (WebCore::PlatformSpeechSynthesisUtterance::create): Return Ref rather than PassRefPtr.
+ (WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance): Take
+ a reference. Initialize data members in class definition.
+ * platform/PlatformSpeechSynthesisUtterance.h: Updated for the above.
+
+ * platform/PlatformSpeechSynthesisVoice.cpp:
+ (WebCore::PlatformSpeechSynthesisVoice::create): Return Ref rather than PassRefPtr.
+ * platform/PlatformSpeechSynthesisVoice.h: Updated for the above.
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::addChild): Take a reference rather than a PassRefPtr.
+ (WebCore::ScrollView::setHasScrollbarInternal): Updated for change to addChild
+ (WebCore::ScrollView::scrollContentsFastPath): Deleted. This was never called,
+ so made it pure virtual.
+ (WebCore::ScrollView::frameRectsChanged): Use a modern for loop.
+ (WebCore::ScrollView::clipRectChanged): Ditto.
+ (WebCore::ScrollView::updateScrollCorner): Deleted. This was empty so made it pure
+ virtual and changed FrameView to not call it.
+ (WebCore::ScrollView::setParentVisible): Use a modern for loop.
+ (WebCore::ScrollView::show): Ditto.
+ (WebCore::ScrollView::hide): Ditto.
+ * platform/ScrollView.h: Changed the children set to contain Ref instead of RefPtr.
+ Changed functions that were never overridden to either be final or non-virtual,
+ Changed functions that were never called to be pure virtual.
+
+ * platform/Theme.h:
+ (WebCore::Theme::minimumControlSize): Updated for LengthSize struct.
+
+ * platform/animation/Animation.h: Changed timingFunction and trigger to return
+ raw pointers instead of PassRefPtr. Changed setTimingFunction and setTrigger to
+ take RefPtr&& and Ref&& instead of PassRefPtr. CHanged initialTimingfunction and
+ initialTrigger to return Ref.
+
+ * platform/animation/AnimationList.cpp: Removed redundant check in FILL_UNSET_PROPERTY.
+ (WebCore::AnimationList::AnimationList): Use modern for loop, reserveInitialCapacity,
+ and uncheckedAppend.
+ * platform/animation/AnimationList.h: Changed append to take Ref&& instead of PassRefPtr.
+ changed vecto to contain Ref instead of RefPtr. Added move constructor and assignment
+ operator.
+
+ * platform/animation/AnimationTrigger.h:
+ (WebCore::AutoAnimationTrigger::clone): Return Ref instead of PassRefPtr.
+ (WebCore::AutoAnimationTrigger::create): Ditto.
+ (WebCore::AutoAnimationTrigger::clone): Ditto.
+ (WebCore::ScrollAnimationTrigger::create): Ditto.
+ (WebCore::ScrollAnimationTrigger::clone): Ditto.
+
+ * platform/animation/TimingFunction.h:
+ (WebCore::LinearTimingFunction::create): Return Ref instead of PassRefPtr.
+ (WebCore::CubicBezierTimingFunction::create): Ditto.
+ (WebCore::CubicBezierTimingFunction::defaultTimingFunction): Return a reference
+ instead of a pointer.
+ (WebCore::CubicBezierTimingFunction::createReversed): Return Ref instead of PassRefPtr.
+ (WebCore::CubicBezierTimingFunction::clone): Ditto.
+ (WebCore::StepsTimingFunction::create): Ditto.
+ (WebCore::StepsTimingFunction::clone): Ditto.
+ (WebCore::SpringTimingFunction::create): Ditto.
+ (WebCore::SpringTimingFunction::clone): Ditto.
+
+ * platform/audio/AudioBus.h:
+ (WebCore::AudioBus::channel): Removed no-longer-needed const_cast.
+
+ * platform/cf/KeyedEncoderCF.cpp:
+ (WebCore::KeyedEncoderCF::finishEncoding): Return RefPtr instead of PassRefPtr.
+ * platform/cf/KeyedEncoderCF.h: Use final instead of override. Made even more
+ private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
+
+ * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed include of PassRefPtr.h.
+
+ * platform/glib/KeyedEncoderGlib.cpp:
+ (WebCore::KeyedEncoderGlib::finishEncoding): Return RefPtr instead of PassRefPtr.
+ * platform/glib/KeyedEncoderGlib.h: Use final instead of override. Made even more
+ private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
+
+ * platform/graphics/filters/FilterOperations.cpp:
+ (WebCore::outsetSizeForBlur): Simplified, removing unnecessary floating point math.
+ (WebCore::FilterOperations::FilterOperations): Deleted. Let the compiler generate this.
+ (WebCore::FilterOperations::operator=): Deleted. Let the compiler generate this.
+ (WebCore::FilterOperations::operator==): Streamlined.
+ (WebCore::FilterOperations::operationsMatch): Ditto.
+ (WebCore::FilterOperations::hasReferenceFilter): Ditto.
+ (WebCore::FilterOperations::hasOutsets): Ditto.
+ (WebCore::FilterOperations::outsets): Ditto.
+ (WebCore::FilterOperations::hasFilterThatAffectsOpacity): Ditto.
+ (WebCore::FilterOperations::hasFilterThatMovesPixels): Ditto.
+ * platform/graphics/filters/FilterOperations.h: Updated for above changes.
+
+ * platform/graphics/FontCache.h: Removed included of PassRefPtr.h.
+
+ * platform/graphics/FontPlatformData.h: Tweaked formatting. Removed nesting
+ from #if since our formatting makes it hard to see nesting. Let the compiler
+ generate the default move and copy constructors and assignemnt operators except
+ in the USE(FREETYPE) case.
+
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::AnimationValue::AnimationValue): Updated since clone now returns a Ref
+ rather than a RefPtr.
+ (WebCore::FloatAnimationValue::FloatAnimationValue): Deleted. Let the compiler
+ generate the copy constructor without defining it explicitly.
+ (WebCore::TransformAnimationValue::TransformAnimationValue): Use a modern for
+ loop, reserveInitialCapacity, and unchecked append. Also tell the compiler to
+ generate the move constructor, since the special work is only needed for the
+ copy constructor.
+ (WebCore::FilterAnimationValue::FilterAnimationValue): Ditto.
+ (WebCore::KeyframeValueList::KeyframeValueList): Ditto.
+
+ * platform/graphics/LegacyCDMSession.h: Removed include of PassRefPtr.h.
+
+ * platform/graphics/PathUtilities.cpp:
+ (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline): Updated
+ for LengthSize struct.
+
+ * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
+ (WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF): Take a reference.
+ Don't bother setting m_client since we never use it.
+ (WebCore::CDMSessionAVFoundationCF::generateKeyRequest): Clean up code a bit
+ by using auto a lot more.
+ * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Added include
+ that is now needed since it was removed from the base class. Tidied the class
+ up a bit, marking it final, making everything private, taking a reference, and
+ removing an unused data member, m_client.
+
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundationCF::createSession): Pass a reference.
+
+ * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
+ added include of WTFString.h, now needed because of removing an unneeded
+ include from another header file.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::animationCanBeAccelerated): Updated since trigger
+ is a raw pointer now.
+ (WebCore::GraphicsLayerCA::timingFunctionForAnimationValue): Updated to
+ return a reference rather than a pointer.
+ (WebCore::GraphicsLayerCA::setAnimationEndpoints): Updated for the above change.
+ (WebCore::GraphicsLayerCA::setAnimationKeyframes): Ditto.
+ (WebCore::GraphicsLayerCA::setTransformAnimationEndpoints): Ditto.
+ (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes): Ditto.
+ (WebCore::GraphicsLayerCA::setFilterAnimationEndpoints): Ditto.
+ (WebCore::GraphicsLayerCA::setFilterAnimationKeyframes): Ditto.
+ * platform/graphics/ca/GraphicsLayerCA.h: Ditto.
+
+ * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+ (-[WebSpeechSynthesisWrapper speakUtterance:]): CHanged argument to be a
+ RefPtr&& instead of a PassRefPtr.
+
+ * platform/mac/ThemeMac.mm:
+ (WebCore::sizeFromNSControlSize): Updated for LenghtSize struct.
+ (WebCore::checkboxSize): Ditto.
+ (WebCore::radioSize): Ditto.
+ (WebCore::ThemeMac::controlSize): Ditto.
+ (WebCore::ThemeMac::minimumControlSize): Ditto.
+
+ * platform/mac/WidgetMac.mm:
+ (WebCore::Widget::setFocus): Updated to pass a reference.
+
+ * platform/mock/DeviceMotionClientMock.cpp: Removed. Unused.
+ * platform/mock/DeviceMotionClientMock.h: Removed. Unused.
+
+ * platform/win/CursorWin.cpp:
+ (WebCore::createSharedCursor): Return a Ref instead of a PassRefPtr.
+ (WebCore::loadSharedCursor): Ditto.
+ (WebCore::loadCursorByName): Ditto.
+
+ * rendering/FilterEffectRenderer.cpp:
+ (WebCore::FilterEffectRenderer::output): Removed a no-longer-needed const_cast.
+ (WebCore::FilterEffectRenderer::outputRect): Ditto.
+
+ * rendering/ImageQualityController.cpp:
+ (WebCore::ImageQualityController::chooseInterpolationQuality): Tweaked formatting.
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintFillLayers): Updated to take a reference. Also
+ used a vector to iterate the linked list in reverse order instead of recursion.
+ (WebCore::InlineFlowBox::paintFillLayer): Take a reference.
+ (WebCore::InlineFlowBox::paintMask):
+ * rendering/InlineFlowBox.h: Updated for the above.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::paintRootBoxFillLayers): Use auto a bit.
+ (WebCore::RenderBox::getBackgroundPaintedExtent): Use reference for the layers.
+ (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect): Ditto.
+ (WebCore::RenderBox::backgroundHasOpaqueTopLayer): Ditto.
+ (WebCore::RenderBox::paintMaskImages): Ditto.
+ (WebCore::RenderBox::maskClipRect): Ditto.
+ (WebCore::RenderBox::paintFillLayers): Ditto.
+ (WebCore::RenderBox::paintFillLayer): Ditto.
+ (WebCore::layersUseImage): Ditto.
+ (WebCore::RenderBox::repaintLayerRectsForImage): Ditto.
+ * rendering/RenderBox.h: Updated for the above.
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended): Use reference for
+ the layers.
+ (WebCore::RenderBoxModelObject::calculateFillTileSize): Ditto.
+ (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ditto.
+ (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage): Ditto.
+ (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground): Ditto.
+ * rendering/RenderBoxModelObject.h: Updated for the above.
+
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::~RenderElement): Use references for the layers.
+ (WebCore::RenderElement::adjustStyleDifference): Ditto.
+ (WebCore::RenderElement::updateFillImages): Ditto.
+ (WebCore::RenderElement::setStyle): Use RenderStyle::replace to replace the
+ old style with the new style, and get the old one out at the same time.
+ (WebCore::RenderElement::styleDidChange): Use references for the layers.
+ (WebCore::mustRepaintFillLayers): Ditto.
+ (WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto.
+ * rendering/RenderElement.h: Updated for the above.
+
+ * rendering/RenderGrid.cpp:
+ (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
+ Refactor so we don't need so many functions in RenderStyle.
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::adjustInnerStyle): Ditto.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::createScrollbar): Pass widget as reference to addChild.
+ Also did a few other tweaks and used more specific types.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::canCreateTiledImage): Updated since layers are references.
+ (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): Ditto.
+
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::createScrollbar): Pass widget as reference to addChild.
+
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::paintBackgroundsBehindCell): Updated to use
+ references for layers.
+
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::adjustStyle): Use WTFMove to pass a LengthBox.
+ (WebCore::RenderTheme::isControlStyled): Updated since LengthSize is a struct,
+ more WTFMove, change since layers are ferences.
+
+ * rendering/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::adjustSizeConstraints): Update for Length and
+ LengthSize changes.
+ (WebCore::RenderThemeEfl::paintThemePart): Use reference instead of pointer.
+ (WebCore::RenderThemeEfl::applyPartDescriptionFallback): Update for Length and
+ LengthSize changes.
+ (WebCore::RenderThemeEfl::applyPartDescription): Ditto.
+ (WebCore::RenderThemeEfl::adjustCheckboxStyle): Ditto.
+ (WebCore::RenderThemeEfl::adjustRadioStyle): Ditto.
+
+ * rendering/RenderThemeGtk.cpp:
+ (WebCore::borderRadiiFromStyle): Update for Length and LengthSize changes.
+
+ * rendering/RenderThemeIOS.mm:
+ (WebCore::RenderThemeIOS::adjustCheckboxStyle): Update for Length and
+ LengthSize changes.
+ (WebCore::RenderThemeIOS::isControlStyled): Ditto.
+ (WebCore::RenderThemeIOS::adjustRadioStyle): Ditto.
+ (WebCore::RenderThemeIOS::adjustRoundBorderRadius): Ditto.
+ (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Ditto.
+ (WebCore::RenderThemeIOS::adjustSliderTrackStyle): Ditto.
+ (WebCore::RenderThemeIOS::adjustSliderThumbSize): Ditto.
+
+ * rendering/RenderWidget.cpp:
+ (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): Use move
+ insteead of swap and modern for loop instead of iterators.
+ (WebCore::moveWidgetToParentSoon): Take a reference instead of a pointer.
+ (WebCore::RenderWidget::setWidget): Update for above change.
+ (WebCore::RenderWidget::find): Take a reference instead of a pointer.
+ * rendering/RenderWidget.h: Updated for above changes.
+
+ * rendering/TextAutoSizing.cpp:
+ (WebCore::TextAutoSizingValue::reset): Updated since Length is passed as
+ rvalue reference now.
+
+ * rendering/mathml/MathMLStyle.cpp:
+ (WebCore::MathMLStyle::getMathMLStyle): Updated since mathMLStyle returns
+ a reference.
+ (WebCore::MathMLStyle::resolveMathMLStyleTree): Ditto.
+
+ * rendering/mathml/RenderMathMLBlock.h:
+ (WebCore::RenderMathMLBlock::mathMLStyle): Removed no-longer needed const_cast,
+ changed to return a reference rather than a pointer.
+ (WebCore::RenderMathMLTable::mathMLStyle): Ditto.
+
+ * rendering/mathml/RenderMathMLFraction.cpp:
+ (WebCore::RenderMathMLFraction::fractionParameters): Updated since mathMLStyle
+ returns a reference.
+ (WebCore::RenderMathMLFraction::stackParameters): Ditto.
+ * rendering/mathml/RenderMathMLOperator.h:
+ (WebCore::RenderMathMLOperator::isLargeOperatorInDisplayStyle): Ditto.
+ (WebCore::RenderMathMLOperator::shouldMoveLimits): Ditto.
+ * rendering/mathml/RenderMathMLRoot.cpp:
+ (WebCore::RenderMathMLRoot::verticalParameters): Ditto.
+ * rendering/mathml/RenderMathMLToken.cpp:
+ (WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
+
+ * rendering/style/BasicShapes.cpp:
+ (WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
+ * rendering/style/BorderData.h:
+ (WebCore::BorderData::BorderData): Ditto.
+ (WebCore::BorderData::hasBorderRadius): Ditto.
+
+ * rendering/style/ContentData.cpp:
+ (WebCore::ContentData::clone): Updated member names.
+ * rendering/style/ContentData.h: Ditto.
+
+ * rendering/style/NinePieceImage.cpp:
+ (WebCore::NinePieceImage::computeSlices): Use initializer lists so we get
+ move optimization without requiring explicit WTFMove.
+
+ * rendering/style/DataRef.h:
+ (WebCore::DataRef::DataRef): Removed no-longer needed const_cast.
+ (WebCore::DataRef::replace): Added. This function is like Ref::replace, and
+ can be used to put a new value in and get an old value out without running into
+ the rule Ref has about not being reused once it becomes null because of being
+ moved out of. This function is a lot like std::exchange.
+ (WebCore::DataRef::operator const T&): Added operator so we can use these
+ as references without any function call in read-only contexts.
+ (WebCore::DataRef::get): Changed to return a reference rather than pointer.
+ (WebCore::DataRef::access): Ditto.
+
+ * rendering/style/KeyframeList.cpp:
+ (WebCore::KeyframeValue::timingFunction): Updated since timingFunction
+ returns a raw pointer.
+ (WebCore::KeyframeList::~KeyframeList): Removed unneeded call to clear,
+ which does things that are redundant since we are about to destroy all the
+ data members.
+ (WebCore::KeyframeList::operator==): Tweaked codign style a bit.
+
+ * rendering/style/NinePieceImage.h: Updated most functions in this class
+ for the changes to DataRef.
+
+ * rendering/style/RenderStyle.cpp: Updated nearly every function in this
+ class for the changes to DataRef, to eliminate the peculiar naming and use
+ our standard data member naming, m_memberName in a class, and memberName in a
+ struct or struct-like class for publicly accessible members, to pass, take,
+ and return more references and rvalue references, and to use modern for loops.
+ Other changes listed below function by function.
+ (WebCore::RenderStyle::defaultStyle): Use NeverDestroyed instead of allocating
+ on the heap.
+ (WebCore::RenderStyle::RenderStyle): Added a new constructor that performs
+ the replace operation, using a combination of DataRef::replace and std::exchange.
+ (WebCore::RenderStyle::replace): Added. Calls the above constructor.
+ (WebCore::RenderStyle::setScrollSnapType): Use SET_NESTED_VAR so we get equality
+ checks on this property, for the normal efficiency benefit.
+ (WebCore::RenderStyle::setDashboardRegion): Moved this here from the header.
+ (WebCore::RenderStyle::appendContent): Deleted.
+ (WebCore::RenderStyle::setContent): Refactored this set of functions to simplify.
+
+ * rendering/style/RenderStyle.h: Updated most functions as mentioned above.
+ Also updated macros to use the do/while(0) technique. Removed the long list of
+ friend classes with the elaborate comments; turned out none needed friendship
+ despite the comments. Made more things private. Moved large functions out of the
+ class definition.
+ (WebCore::RenderStyle::getTextShadowExtent): Deleted.
+ (WebCore::RenderStyle::getTextShadowHorizontalExtent): Deleted.
+ (WebCore::RenderStyle::getTextShadowVerticalExtent): Deleted.
+ (WebCore::RenderStyle::aspectRatio): Deleted.
+ (WebCore::RenderStyle::alignContentPosition): Deleted.
+ (WebCore::RenderStyle::alignContentDistribution): Deleted.
+ (WebCore::RenderStyle::alignContentOverflowAlignment): Deleted.
+ (WebCore::RenderStyle::alignItemsPosition): Deleted.
+ (WebCore::RenderStyle::alignItemsOverflowAlignment): Deleted.
+ (WebCore::RenderStyle::alignSelfPosition): Deleted.
+ (WebCore::RenderStyle::alignSelfOverflowAlignment): Deleted.
+ (WebCore::RenderStyle::justifyContentPosition): Deleted.
+ (WebCore::RenderStyle::justifyContentDistribution): Deleted.
+ (WebCore::RenderStyle::justifyContentOverflowAlignment): Deleted.
+ (WebCore::RenderStyle::justifyItemsPosition): Deleted.
+ (WebCore::RenderStyle::justifyItemsOverflowAlignment): Deleted.
+ (WebCore::RenderStyle::justifyItemsPositionType): Deleted.
+ (WebCore::RenderStyle::justifySelfPosition): Deleted.
+ (WebCore::RenderStyle::justifySelfOverflowAlignment): Deleted.
+ (WebCore::RenderStyle::setAlignContentPosition): Deleted.
+ (WebCore::RenderStyle::setAlignContentOverflow): Deleted.
+ (WebCore::RenderStyle::setAlignContentDistribution): Deleted.
+ (WebCore::RenderStyle::setAlignItemsOverflow): Deleted.
+ (WebCore::RenderStyle::setAlignSelfOverflow): Deleted.
+ (WebCore::RenderStyle::setJustifyContentOverflow): Deleted.
+ (WebCore::RenderStyle::setJustifyContentDistribution): Deleted.
+ (WebCore::RenderStyle::setJustifyItemsPosition): Deleted.
+ (WebCore::RenderStyle::setJustifyItemsOverflow): Deleted.
+ (WebCore::RenderStyle::setJustifyItemsPositionType): Deleted.
+ (WebCore::RenderStyle::setJustifySelfPosition): Deleted.
+ (WebCore::RenderStyle::setJustifySelfOverflow): Deleted.
+ (WebCore::RenderStyle::noninheritedFlagsMemoryOffset): Deleted.
+
+ * rendering/style/SVGRenderStyle.cpp: Similar changes to RenderStyle.cpp above.
+ * rendering/style/SVGRenderStyle.h: Ditto.
+
+ * rendering/style/ShapeValue.h:
+ (WebCore::ShapeValue::create): Take a Ref&& instead of a RefPtr.
+ (WebCore::ShapeValue::ShapeValue): Ditto.
+
+ * rendering/style/StyleBackgroundData.cpp: Update data member names.
+ * rendering/style/StyleBackgroundData.h: Ditto; make them public and remove the
+ getter functions.
+
+ * rendering/style/StyleCachedImage.cpp:
+ (WebCore::StyleCachedImage::cssValue): Removed no-longer-needed const_cast.
+
+ * rendering/style/StyleCustomPropertyData.h: Update data member names.
+ (WebCore::StyleCustomPropertyData::operator==): Removed unnecessary reference
+ count churn.
+ (WebCore::StyleCustomPropertyData::setCustomPropertyValue): Take an rvalue
+ reference.
+ (WebCore::StyleCustomPropertyData::getCustomPropertyValue): Deleted.
+ (WebCore::StyleCustomPropertyData::values): Deleted.
+ (WebCore::StyleCustomPropertyData::hasCustomProperty): Deleted.
+ (WebCore::StyleCustomPropertyData::containsVariables): Deleted.
+ (WebCore::StyleCustomPropertyData::setContainsVariables): Deleted.
+
+ * rendering/style/StyleFilterData.cpp: Update data member names.
+ * rendering/style/StyleFilterData.h: Ditto.
+ * rendering/style/StyleFlexibleBoxData.cpp: Ditto.
+ * rendering/style/StyleFlexibleBoxData.h: Ditto.
+ * rendering/style/StyleGridData.cpp: Ditto.
+ * rendering/style/StyleGridData.h: Ditto.
+ * rendering/style/StyleGridItemData.cpp: Ditto.
+ * rendering/style/StyleGridItemData.h: Ditto.
+
+ * rendering/style/StyleGeneratedImage.cpp:
+ (WebCore::StyleGeneratedImage::cssValue): Removed no-longer-needed const_cast.
+ (WebCore::StyleGeneratedImage::imageSize): Ditto.
+ (WebCore::StyleGeneratedImage::image): Ditto.
+
+ * rendering/style/StyleInheritedData.cpp: Update data member names.
+ * rendering/style/StyleInheritedData.h: Ditto.
+ * rendering/style/StyleRareInheritedData.cpp: Ditto.
+ * rendering/style/StyleRareInheritedData.h: Ditto.
+ * rendering/style/StyleMultiColData.cpp: Ditto.
+ * rendering/style/StyleMultiColData.h: Ditto.
+ * rendering/style/StyleRareNonInheritedData.cpp: Ditto.
+ * rendering/style/StyleRareNonInheritedData.h: Ditto.
+ * rendering/style/StyleTransformData.cpp: Ditto.
+ * rendering/style/StyleTransformData.h: Ditto.
+ * rendering/style/StyleVisualData.cpp: Ditto.
+ * rendering/style/StyleVisualData.h: Ditto.
+
+ * style/StylePendingResources.cpp:
+ (WebCore::Style::loadPendingResources): Update since layers are references.
+
+
2017-01-13 Chris Dumez <cdumez@apple.com>
[WK2] Add diagnostic logging to measure WebGL usage
@@ -2718,7 +3360,6 @@
this new class to handle the settings of the audio elements. The
class initializes the settings and the supportedSettings.
-
2017-01-08 Konstantin Tokarev <annulen@yandex.ru>
Introduce CPU(X86_SSE2) instead of various SSE2 checks
diff --git a/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h b/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h
index 0bb46eb..e1e735a 100644
--- a/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h
+++ b/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h
@@ -27,6 +27,7 @@
#include "LegacyCDMSession.h"
#include <wtf/HashMap.h>
+#include <wtf/text/WTFString.h>
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp
index d8bc7a55..6746f4e 100644
--- a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp
+++ b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp
@@ -37,7 +37,7 @@
SpeechSynthesisUtterance::SpeechSynthesisUtterance(ScriptExecutionContext& context, const String& text)
: ContextDestructionObserver(&context)
- , m_platformUtterance(PlatformSpeechSynthesisUtterance::create(this))
+ , m_platformUtterance(PlatformSpeechSynthesisUtterance::create(*this))
{
m_platformUtterance->setText(text);
}
diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h
index 5f141975..b5cb520 100644
--- a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h
+++ b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h
@@ -39,7 +39,7 @@
public:
static Ref<SpeechSynthesisUtterance> create(ScriptExecutionContext&, const String&);
- ~SpeechSynthesisUtterance();
+ virtual ~SpeechSynthesisUtterance();
const String& text() const { return m_platformUtterance->text(); }
void setText(const String& text) { m_platformUtterance->setText(text); }
@@ -62,21 +62,21 @@
double startTime() const { return m_platformUtterance->startTime(); }
void setStartTime(double startTime) { m_platformUtterance->setStartTime(startTime); }
- using RefCounted<SpeechSynthesisUtterance>::ref;
- using RefCounted<SpeechSynthesisUtterance>::deref;
-
- ScriptExecutionContext* scriptExecutionContext() const override { return ContextDestructionObserver::scriptExecutionContext(); }
+ using RefCounted::ref;
+ using RefCounted::deref;
PlatformSpeechSynthesisUtterance* platformUtterance() const { return m_platformUtterance.get(); }
private:
SpeechSynthesisUtterance(ScriptExecutionContext&, const String&);
+
+ ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); }
+ EventTargetInterface eventTargetInterface() const final { return SpeechSynthesisUtteranceEventTargetInterfaceType; }
+ void refEventTarget() final { ref(); }
+ void derefEventTarget() final { deref(); }
+
RefPtr<PlatformSpeechSynthesisUtterance> m_platformUtterance;
RefPtr<SpeechSynthesisVoice> m_voice;
-
- EventTargetInterface eventTargetInterface() const override { return SpeechSynthesisUtteranceEventTargetInterfaceType; }
- void refEventTarget() override { ref(); }
- void derefEventTarget() override { deref(); }
};
} // namespace WebCore
diff --git a/Source/WebCore/bindings/js/JSDOMConvert.h b/Source/WebCore/bindings/js/JSDOMConvert.h
index 2307e57..960fcf5 100644
--- a/Source/WebCore/bindings/js/JSDOMConvert.h
+++ b/Source/WebCore/bindings/js/JSDOMConvert.h
@@ -450,8 +450,8 @@
template <typename T> inline T* getPtrOrRef(const T* p) { return const_cast<T*>(p); }
template <typename T> inline T& getPtrOrRef(const T& p) { return const_cast<T&>(p); }
-template <typename T> inline T* getPtrOrRef(const RefPtr<T>& p) { return const_cast<T*>(p.get()); }
-template <typename T> inline T& getPtrOrRef(const Ref<T>& p) { return const_cast<T&>(p.get()); }
+template <typename T> inline T* getPtrOrRef(const RefPtr<T>& p) { return p.get(); }
+template <typename T> inline T& getPtrOrRef(const Ref<T>& p) { return p.get(); }
}
diff --git a/Source/WebCore/bindings/js/JSDOMWrapper.h b/Source/WebCore/bindings/js/JSDOMWrapper.h
index 38529bb..6f37462 100644
--- a/Source/WebCore/bindings/js/JSDOMWrapper.h
+++ b/Source/WebCore/bindings/js/JSDOMWrapper.h
@@ -79,7 +79,7 @@
typedef ImplementationClass DOMWrapped;
static constexpr bool isDOMWrapper = true;
- ImplementationClass& wrapped() const { return const_cast<ImplementationClass&>(m_wrapped.get()); }
+ ImplementationClass& wrapped() const { return m_wrapped; }
static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSDOMWrapper<ImplementationClass>, m_wrapped); }
protected:
diff --git a/Source/WebCore/bindings/js/ScriptModuleLoader.cpp b/Source/WebCore/bindings/js/ScriptModuleLoader.cpp
index 62a8967..f4006fc 100644
--- a/Source/WebCore/bindings/js/ScriptModuleLoader.cpp
+++ b/Source/WebCore/bindings/js/ScriptModuleLoader.cpp
@@ -53,10 +53,9 @@
ScriptModuleLoader::~ScriptModuleLoader()
{
for (auto& loader : m_loaders)
- const_cast<CachedModuleScriptLoader&>(loader.get()).clearClient();
+ loader->clearClient();
}
-
static bool isRootModule(JSC::JSValue importerModuleKey)
{
return importerModuleKey.isSymbol() || importerModuleKey.isUndefined();
diff --git a/Source/WebCore/css/BasicShapeFunctions.cpp b/Source/WebCore/css/BasicShapeFunctions.cpp
index 08864fa..5f225f7 100644
--- a/Source/WebCore/css/BasicShapeFunctions.cpp
+++ b/Source/WebCore/css/BasicShapeFunctions.cpp
@@ -144,18 +144,16 @@
static LengthSize convertToLengthSize(const CSSToLengthConversionData& conversionData, const CSSPrimitiveValue* value)
{
if (!value)
- return LengthSize(Length(0, Fixed), Length(0, Fixed));
+ return { { 0, Fixed }, { 0, Fixed } };
- Pair* pair = value->pairValue();
- return LengthSize(convertToLength(conversionData, pair->first()), convertToLength(conversionData, pair->second()));
+ auto& pair = *value->pairValue();
+ return { convertToLength(conversionData, pair.first()), convertToLength(conversionData, pair.second()) };
}
static BasicShapeCenterCoordinate convertToCenterCoordinate(const CSSToLengthConversionData& conversionData, CSSPrimitiveValue* value)
{
- BasicShapeCenterCoordinate::Direction direction;
- Length offset = Length(0, Fixed);
-
CSSValueID keyword = CSSValueTop;
+ Length offset { 0, Fixed };
if (!value)
keyword = CSSValueCenter;
else if (value->isValueID())
@@ -166,6 +164,7 @@
} else
offset = convertToLength(conversionData, value);
+ BasicShapeCenterCoordinate::Direction direction;
switch (keyword) {
case CSSValueTop:
case CSSValueLeft:
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 2fbe9c1..fdd294c 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
- * Copyright (C) 2004-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
* Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
* Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
* Copyright (C) 2011 Sencha, Inc. All rights reserved.
@@ -606,11 +606,10 @@
static Ref<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& image)
{
auto& cssValuePool = CSSValuePool::singleton();
- RefPtr<CSSPrimitiveValue> horizontalRepeat = cssValuePool.createIdentifierValue(valueForRepeatRule(image.horizontalRule()));
-
+ auto horizontalRepeat = cssValuePool.createIdentifierValue(valueForRepeatRule(image.horizontalRule()));
RefPtr<CSSPrimitiveValue> verticalRepeat;
if (image.horizontalRule() == image.verticalRule())
- verticalRepeat = horizontalRepeat;
+ verticalRepeat = horizontalRepeat.copyRef();
else
verticalRepeat = cssValuePool.createIdentifierValue(valueForRepeatRule(image.verticalRule()));
return cssValuePool.createValue(Pair::create(WTFMove(horizontalRepeat), WTFMove(verticalRepeat)));
@@ -688,20 +687,20 @@
return CSSReflectValue::create(direction.releaseNonNull(), offset.releaseNonNull(), valueForNinePieceImage(reflection->mask()));
}
-static Ref<CSSValueList> createPositionListForLayer(CSSPropertyID propertyID, const FillLayer* layer, const RenderStyle& style)
+static Ref<CSSValueList> createPositionListForLayer(CSSPropertyID propertyID, const FillLayer& layer, const RenderStyle& style)
{
- auto positionList = CSSValueList::createSpaceSeparated();
- if (layer->isBackgroundXOriginSet()) {
+ auto list = CSSValueList::createSpaceSeparated();
+ if (layer.isBackgroundXOriginSet()) {
ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || propertyID == CSSPropertyWebkitMaskPosition);
- positionList.get().append(CSSValuePool::singleton().createValue(layer->backgroundXOrigin()));
+ list->append(CSSValuePool::singleton().createValue(layer.backgroundXOrigin()));
}
- positionList.get().append(zoomAdjustedPixelValueForLength(layer->xPosition(), style));
- if (layer->isBackgroundYOriginSet()) {
+ list->append(zoomAdjustedPixelValueForLength(layer.xPosition(), style));
+ if (layer.isBackgroundYOriginSet()) {
ASSERT(propertyID == CSSPropertyBackgroundPosition || propertyID == CSSPropertyWebkitMaskPosition);
- positionList.get().append(CSSValuePool::singleton().createValue(layer->backgroundYOrigin()));
+ list->append(CSSValuePool::singleton().createValue(layer.backgroundYOrigin()));
}
- positionList.get().append(zoomAdjustedPixelValueForLength(layer->yPosition(), style));
- return positionList;
+ list->append(zoomAdjustedPixelValueForLength(layer.yPosition(), style));
+ return list;
}
static RefPtr<CSSValue> positionOffsetValue(const RenderStyle& style, CSSPropertyID propertyID)
@@ -765,39 +764,38 @@
return zoomAdjustedPixelValue(valueForLength(length, 0), style);
}
-static Ref<CSSValueList> getBorderRadiusCornerValues(const LengthSize& radius, const RenderStyle& style)
+static Ref<CSSValueList> borderRadiusCornerValues(const LengthSize& radius, const RenderStyle& style)
{
auto list = CSSValueList::createSpaceSeparated();
- list.get().append(percentageOrZoomAdjustedValue(radius.width(), style));
- list.get().append(percentageOrZoomAdjustedValue(radius.height(), style));
+ list->append(percentageOrZoomAdjustedValue(radius.width, style));
+ list->append(percentageOrZoomAdjustedValue(radius.height, style));
return list;
}
-static Ref<CSSValue> getBorderRadiusCornerValue(const LengthSize& radius, const RenderStyle& style)
+static Ref<CSSValue> borderRadiusCornerValue(const LengthSize& radius, const RenderStyle& style)
{
- if (radius.width() == radius.height())
- return percentageOrZoomAdjustedValue(radius.width(), style);
-
- return getBorderRadiusCornerValues(radius, style);
+ if (radius.width == radius.height)
+ return percentageOrZoomAdjustedValue(radius.width, style);
+ return borderRadiusCornerValues(radius, style);
}
-static Ref<CSSValueList> getBorderRadiusShorthandValue(const RenderStyle& style)
+static Ref<CSSValueList> borderRadiusShorthandValue(const RenderStyle& style)
{
auto list = CSSValueList::createSlashSeparated();
- bool showHorizontalBottomLeft = style.borderTopRightRadius().width() != style.borderBottomLeftRadius().width();
- bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBottomRightRadius().width() != style.borderTopLeftRadius().width());
- bool showHorizontalTopRight = showHorizontalBottomRight || (style.borderTopRightRadius().width() != style.borderTopLeftRadius().width());
+ bool showHorizontalBottomLeft = style.borderTopRightRadius().width != style.borderBottomLeftRadius().width;
+ bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBottomRightRadius().width != style.borderTopLeftRadius().width);
+ bool showHorizontalTopRight = showHorizontalBottomRight || (style.borderTopRightRadius().width != style.borderTopLeftRadius().width);
- bool showVerticalBottomLeft = style.borderTopRightRadius().height() != style.borderBottomLeftRadius().height();
- bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottomRightRadius().height() != style.borderTopLeftRadius().height());
- bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRightRadius().height() != style.borderTopLeftRadius().height());
+ bool showVerticalBottomLeft = style.borderTopRightRadius().height != style.borderBottomLeftRadius().height;
+ bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottomRightRadius().height != style.borderTopLeftRadius().height);
+ bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRightRadius().height != style.borderTopLeftRadius().height);
- RefPtr<CSSValueList> topLeftRadius = getBorderRadiusCornerValues(style.borderTopLeftRadius(), style);
- RefPtr<CSSValueList> topRightRadius = getBorderRadiusCornerValues(style.borderTopRightRadius(), style);
- RefPtr<CSSValueList> bottomRightRadius = getBorderRadiusCornerValues(style.borderBottomRightRadius(), style);
- RefPtr<CSSValueList> bottomLeftRadius = getBorderRadiusCornerValues(style.borderBottomLeftRadius(), style);
+ auto topLeftRadius = borderRadiusCornerValues(style.borderTopLeftRadius(), style);
+ auto topRightRadius = borderRadiusCornerValues(style.borderTopRightRadius(), style);
+ auto bottomRightRadius = borderRadiusCornerValues(style.borderBottomRightRadius(), style);
+ auto bottomLeftRadius = borderRadiusCornerValues(style.borderBottomLeftRadius(), style);
- RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated();
+ auto horizontalRadii = CSSValueList::createSpaceSeparated();
horizontalRadii->append(*topLeftRadius->item(0));
if (showHorizontalTopRight)
horizontalRadii->append(*topRightRadius->item(0));
@@ -806,9 +804,9 @@
if (showHorizontalBottomLeft)
horizontalRadii->append(*bottomLeftRadius->item(0));
- list.get().append(horizontalRadii.releaseNonNull());
+ list->append(WTFMove(horizontalRadii));
- RefPtr<CSSValueList> verticalRadiiList = CSSValueList::createSpaceSeparated();
+ auto verticalRadiiList = CSSValueList::createSpaceSeparated();
verticalRadiiList->append(*topLeftRadius->item(1));
if (showVerticalTopRight)
verticalRadiiList->append(*topRightRadius->item(1));
@@ -817,8 +815,8 @@
if (showVerticalBottomLeft)
verticalRadiiList->append(*bottomLeftRadius->item(1));
- if (!verticalRadiiList->equals(downcast<CSSValueList>(*list.get().item(0))))
- list.get().append(verticalRadiiList.releaseNonNull());
+ if (!verticalRadiiList->equals(downcast<CSSValueList>(*list->item(0))))
+ list->append(WTFMove(verticalRadiiList));
return list;
}
@@ -887,7 +885,7 @@
// FIXME: Need to print out individual functions (https://bugs.webkit.org/show_bug.cgi?id=23924)
auto list = CSSValueList::createSpaceSeparated();
- list.get().append(matrixTransformValue(transform, style));
+ list->append(matrixTransformValue(transform, style));
return WTFMove(list);
}
@@ -934,7 +932,7 @@
if (filterOperation.type() == FilterOperation::REFERENCE) {
ReferenceFilterOperation& referenceOperation = downcast<ReferenceFilterOperation>(filterOperation);
- list.get().append(cssValuePool.createValue(referenceOperation.url(), CSSPrimitiveValue::CSS_URI));
+ list->append(cssValuePool.createValue(referenceOperation.url(), CSSPrimitiveValue::CSS_URI));
} else {
RefPtr<CSSFunctionValue> filterValue;
switch (filterOperation.type()) {
@@ -996,7 +994,7 @@
filterValue = CSSFunctionValue::create(CSSValueInvalid);
break;
}
- list.get().append(filterValue.releaseNonNull());
+ list->append(filterValue.releaseNonNull());
}
}
return WTFMove(list);
@@ -1166,7 +1164,7 @@
} else {
for (unsigned i = 0; i < trackSizes.size(); ++i) {
addValuesForNamedGridLinesAtIndex(collector, i, list.get());
- list.get().append(specifiedValueForGridTrackSize(trackSizes[i], style));
+ list->append(specifiedValueForGridTrackSize(trackSizes[i], style));
}
insertionIndex = trackSizes.size();
}
@@ -1187,13 +1185,13 @@
auto list = CSSValueList::createSpaceSeparated();
if (position.isSpan()) {
- list.get().append(cssValuePool.createIdentifierValue(CSSValueSpan));
- list.get().append(cssValuePool.createValue(position.spanPosition(), CSSPrimitiveValue::CSS_NUMBER));
+ list->append(cssValuePool.createIdentifierValue(CSSValueSpan));
+ list->append(cssValuePool.createValue(position.spanPosition(), CSSPrimitiveValue::CSS_NUMBER));
} else
- list.get().append(cssValuePool.createValue(position.integerPosition(), CSSPrimitiveValue::CSS_NUMBER));
+ list->append(cssValuePool.createValue(position.integerPosition(), CSSPrimitiveValue::CSS_NUMBER));
if (!position.namedGridLine().isNull())
- list.get().append(cssValuePool.createValue(position.namedGridLine(), CSSPrimitiveValue::CSS_STRING));
+ list->append(cssValuePool.createValue(position.namedGridLine(), CSSPrimitiveValue::CSS_STRING));
return WTFMove(list);
}
#endif
@@ -1207,14 +1205,14 @@
return CSSValuePool::singleton().createValue(getPropertyNameString(animation.property()), CSSPrimitiveValue::CSS_STRING);
}
-static Ref<CSSValueList> getTransitionPropertyValue(const AnimationList* animList)
+static Ref<CSSValueList> transitionPropertyValue(const AnimationList* animationList)
{
auto list = CSSValueList::createCommaSeparated();
- if (animList) {
- for (size_t i = 0; i < animList->size(); ++i)
- list.get().append(createTransitionPropertyValue(animList->animation(i)));
+ if (animationList) {
+ for (size_t i = 0; i < animationList->size(); ++i)
+ list->append(createTransitionPropertyValue(animationList->animation(i)));
} else
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueAll));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueAll));
return list;
}
@@ -1242,7 +1240,7 @@
#endif
-static Ref<CSSValue> getWillChangePropertyValue(const WillChangeData* willChangeData)
+static Ref<CSSValue> willChangePropertyValue(const WillChangeData* willChangeData)
{
auto& cssValuePool = CSSValuePool::singleton();
if (!willChangeData || !willChangeData->numFeatures())
@@ -1253,13 +1251,13 @@
WillChangeData::FeaturePropertyPair feature = willChangeData->featureAt(i);
switch (feature.first) {
case WillChangeData::ScrollPosition:
- list.get().append(cssValuePool.createIdentifierValue(CSSValueScrollPosition));
+ list->append(cssValuePool.createIdentifierValue(CSSValueScrollPosition));
break;
case WillChangeData::Contents:
- list.get().append(cssValuePool.createIdentifierValue(CSSValueContents));
+ list->append(cssValuePool.createIdentifierValue(CSSValueContents));
break;
case WillChangeData::Property:
- list.get().append(cssValuePool.createIdentifierValue(feature.second));
+ list->append(cssValuePool.createIdentifierValue(feature.second));
break;
case WillChangeData::Invalid:
ASSERT_NOT_REACHED();
@@ -1456,39 +1454,39 @@
return WTFMove(valueList);
}
-static Ref<CSSValueList> getDelayValue(const AnimationList* animList)
+static Ref<CSSValueList> delayValue(const AnimationList* animationList)
{
auto& cssValuePool = CSSValuePool::singleton();
auto list = CSSValueList::createCommaSeparated();
- if (animList) {
- for (size_t i = 0; i < animList->size(); ++i)
- list.get().append(cssValuePool.createValue(animList->animation(i).delay(), CSSPrimitiveValue::CSS_S));
+ if (animationList) {
+ for (size_t i = 0; i < animationList->size(); ++i)
+ list->append(cssValuePool.createValue(animationList->animation(i).delay(), CSSPrimitiveValue::CSS_S));
} else {
// Note that initialAnimationDelay() is used for both transitions and animations
- list.get().append(cssValuePool.createValue(Animation::initialDelay(), CSSPrimitiveValue::CSS_S));
+ list->append(cssValuePool.createValue(Animation::initialDelay(), CSSPrimitiveValue::CSS_S));
}
return list;
}
-static Ref<CSSValueList> getDurationValue(const AnimationList* animList)
+static Ref<CSSValueList> durationValue(const AnimationList* animationList)
{
auto& cssValuePool = CSSValuePool::singleton();
auto list = CSSValueList::createCommaSeparated();
- if (animList) {
- for (size_t i = 0; i < animList->size(); ++i)
- list.get().append(cssValuePool.createValue(animList->animation(i).duration(), CSSPrimitiveValue::CSS_S));
+ if (animationList) {
+ for (size_t i = 0; i < animationList->size(); ++i)
+ list->append(cssValuePool.createValue(animationList->animation(i).duration(), CSSPrimitiveValue::CSS_S));
} else {
// Note that initialAnimationDuration() is used for both transitions and animations
- list.get().append(cssValuePool.createValue(Animation::initialDuration(), CSSPrimitiveValue::CSS_S));
+ list->append(cssValuePool.createValue(Animation::initialDuration(), CSSPrimitiveValue::CSS_S));
}
return list;
}
-static Ref<CSSValue> createTimingFunctionValue(const TimingFunction* timingFunction)
+static Ref<CSSValue> createTimingFunctionValue(const TimingFunction& timingFunction)
{
- switch (timingFunction->type()) {
+ switch (timingFunction.type()) {
case TimingFunction::CubicBezierFunction: {
- auto& function = *static_cast<const CubicBezierTimingFunction*>(timingFunction);
+ auto& function = static_cast<const CubicBezierTimingFunction&>(timingFunction);
if (function.timingFunctionPreset() != CubicBezierTimingFunction::Custom) {
CSSValueID valueId = CSSValueInvalid;
switch (function.timingFunctionPreset()) {
@@ -1511,59 +1509,60 @@
return CSSCubicBezierTimingFunctionValue::create(function.x1(), function.y1(), function.x2(), function.y2());
}
case TimingFunction::StepsFunction: {
- auto& function = *static_cast<const StepsTimingFunction*>(timingFunction);
+ auto& function = static_cast<const StepsTimingFunction&>(timingFunction);
return CSSStepsTimingFunctionValue::create(function.numberOfSteps(), function.stepAtStart());
}
case TimingFunction::SpringFunction: {
- auto& function = *static_cast<const SpringTimingFunction*>(timingFunction);
+ auto& function = static_cast<const SpringTimingFunction&>(timingFunction);
return CSSSpringTimingFunctionValue::create(function.mass(), function.stiffness(), function.damping(), function.initialVelocity());
}
default:
- ASSERT(timingFunction->type() == TimingFunction::LinearFunction);
+ ASSERT(timingFunction.type() == TimingFunction::LinearFunction);
return CSSValuePool::singleton().createIdentifierValue(CSSValueLinear);
}
}
-static Ref<CSSValueList> getTimingFunctionValue(const AnimationList* animList)
+static Ref<CSSValueList> timingFunctionValue(const AnimationList* animationList)
{
auto list = CSSValueList::createCommaSeparated();
- if (animList) {
- for (size_t i = 0; i < animList->size(); ++i)
- list.get().append(createTimingFunctionValue(animList->animation(i).timingFunction().get()));
+ if (animationList) {
+ for (size_t i = 0; i < animationList->size(); ++i)
+ list->append(createTimingFunctionValue(*animationList->animation(i).timingFunction()));
} else
// Note that initialAnimationTimingFunction() is used for both transitions and animations
- list.get().append(createTimingFunctionValue(Animation::initialTimingFunction().get()));
+ list->append(createTimingFunctionValue(Animation::initialTimingFunction()));
return list;
}
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
-static Ref<CSSValue> createAnimationTriggerValue(const AnimationTrigger* trigger, const RenderStyle& style)
+
+static Ref<CSSValue> createAnimationTriggerValue(const AnimationTrigger& trigger, const RenderStyle& style)
{
- switch (trigger->type()) {
+ switch (trigger.type()) {
case AnimationTrigger::AnimationTriggerType::ScrollAnimationTriggerType: {
- auto& scrollAnimationTrigger = downcast<ScrollAnimationTrigger>(*trigger);
+ auto& scrollAnimationTrigger = downcast<ScrollAnimationTrigger>(trigger);
if (scrollAnimationTrigger.endValue().isAuto())
return CSSAnimationTriggerScrollValue::create(zoomAdjustedPixelValueForLength(scrollAnimationTrigger.startValue(), style));
return CSSAnimationTriggerScrollValue::create(zoomAdjustedPixelValueForLength(scrollAnimationTrigger.startValue(), style),
zoomAdjustedPixelValueForLength(scrollAnimationTrigger.endValue(), style));
}
default:
- ASSERT(trigger->type() == AnimationTrigger::AnimationTriggerType::AutoAnimationTriggerType);
+ ASSERT(trigger.type() == AnimationTrigger::AnimationTriggerType::AutoAnimationTriggerType);
return CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
}
}
-static Ref<CSSValueList> getAnimationTriggerValue(const AnimationList* animList, const RenderStyle& style)
+static Ref<CSSValueList> animationTriggerValue(const AnimationList* animationList, const RenderStyle& style)
{
auto list = CSSValueList::createCommaSeparated();
- if (animList) {
- for (size_t i = 0; i < animList->size(); ++i)
- list.get().append(createAnimationTriggerValue(animList->animation(i).trigger().get(), style));
+ if (animationList) {
+ for (size_t i = 0; i < animationList->size(); ++i)
+ list->append(createAnimationTriggerValue(*animationList->animation(i).trigger(), style));
} else
- list.get().append(createAnimationTriggerValue(Animation::initialTrigger().get(), style));
-
+ list->append(createAnimationTriggerValue(Animation::initialTrigger().get(), style));
return list;
}
+
#endif
static Ref<CSSValue> createLineBoxContainValue(unsigned lineBoxContain)
@@ -1700,7 +1699,7 @@
{
auto& cssValuePool = CSSValuePool::singleton();
// Blink value is ignored.
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
if (textDecoration & TextDecorationUnderline)
list->append(cssValuePool.createIdentifierValue(CSSValueUnderline));
if (textDecoration & TextDecorationOverline)
@@ -1714,7 +1713,7 @@
if (!list->length())
return cssValuePool.createIdentifierValue(CSSValueNone);
- return list.releaseNonNull();
+ return WTFMove(list);
}
static Ref<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorationStyle textDecorationStyle)
@@ -1758,7 +1757,7 @@
ASSERT(!((textEmphasisPosition & TextEmphasisPositionOver) && (textEmphasisPosition & TextEmphasisPositionUnder)));
ASSERT(!((textEmphasisPosition & TextEmphasisPositionLeft) && (textEmphasisPosition & TextEmphasisPositionRight)));
auto& cssValuePool = CSSValuePool::singleton();
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
if (textEmphasisPosition & TextEmphasisPositionOver)
list->append(cssValuePool.createIdentifierValue(CSSValueOver));
if (textEmphasisPosition & TextEmphasisPositionUnder)
@@ -1767,16 +1766,15 @@
list->append(cssValuePool.createIdentifierValue(CSSValueLeft));
if (textEmphasisPosition & TextEmphasisPositionRight)
list->append(cssValuePool.createIdentifierValue(CSSValueRight));
-
if (!list->length())
return cssValuePool.createIdentifierValue(CSSValueNone);
- return list.releaseNonNull();
+ return WTFMove(list);
}
static Ref<CSSValue> hangingPunctuationToCSSValue(HangingPunctuation hangingPunctuation)
{
auto& cssValuePool = CSSValuePool::singleton();
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
if (hangingPunctuation & FirstHangingPunctuation)
list->append(cssValuePool.createIdentifierValue(CSSValueFirst));
if (hangingPunctuation & AllowEndHangingPunctuation)
@@ -1787,7 +1785,7 @@
list->append(cssValuePool.createIdentifierValue(CSSValueLast));
if (!list->length())
return cssValuePool.createIdentifierValue(CSSValueNone);
- return list.releaseNonNull();
+ return WTFMove(list);
}
static Ref<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat)
@@ -1803,8 +1801,8 @@
return cssValuePool.createIdentifierValue(CSSValueRepeatY);
auto list = CSSValueList::createSpaceSeparated();
- list.get().append(cssValuePool.createValue(xRepeat));
- list.get().append(cssValuePool.createValue(yRepeat));
+ list->append(cssValuePool.createValue(xRepeat));
+ list->append(cssValuePool.createValue(yRepeat));
return WTFMove(list);
}
@@ -1827,40 +1825,40 @@
if (fillSize.type == Cover)
return CSSValuePool::singleton().createIdentifierValue(CSSValueCover);
- if (fillSize.size.height().isAuto())
- return zoomAdjustedPixelValueForLength(fillSize.size.width(), style);
+ if (fillSize.size.height.isAuto())
+ return zoomAdjustedPixelValueForLength(fillSize.size.width, style);
auto list = CSSValueList::createSpaceSeparated();
- list.get().append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style));
- list.get().append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style));
+ list->append(zoomAdjustedPixelValueForLength(fillSize.size.width, style));
+ list->append(zoomAdjustedPixelValueForLength(fillSize.size.height, style));
return WTFMove(list);
}
-static Ref<CSSValue> altTextToCSSValue(const RenderStyle* style)
+static Ref<CSSValue> altTextToCSSValue(const RenderStyle& style)
{
- return CSSValuePool::singleton().createValue(style->contentAltText(), CSSPrimitiveValue::CSS_STRING);
+ return CSSValuePool::singleton().createValue(style.contentAltText(), CSSPrimitiveValue::CSS_STRING);
}
-static Ref<CSSValueList> contentToCSSValue(const RenderStyle* style)
+static Ref<CSSValueList> contentToCSSValue(const RenderStyle& style)
{
auto& cssValuePool = CSSValuePool::singleton();
auto list = CSSValueList::createSpaceSeparated();
- for (const ContentData* contentData = style->contentData(); contentData; contentData = contentData->next()) {
+ for (auto* contentData = style.contentData(); contentData; contentData = contentData->next()) {
if (is<CounterContentData>(*contentData))
- list.get().append(cssValuePool.createValue(downcast<CounterContentData>(*contentData).counter().identifier(), CSSPrimitiveValue::CSS_COUNTER_NAME));
+ list->append(cssValuePool.createValue(downcast<CounterContentData>(*contentData).counter().identifier(), CSSPrimitiveValue::CSS_COUNTER_NAME));
else if (is<ImageContentData>(*contentData))
- list.get().append(downcast<ImageContentData>(*contentData).image().cssValue());
+ list->append(downcast<ImageContentData>(*contentData).image().cssValue());
else if (is<TextContentData>(*contentData))
- list.get().append(cssValuePool.createValue(downcast<TextContentData>(*contentData).text(), CSSPrimitiveValue::CSS_STRING));
+ list->append(cssValuePool.createValue(downcast<TextContentData>(*contentData).text(), CSSPrimitiveValue::CSS_STRING));
}
- if (style->hasFlowFrom())
- list.get().append(cssValuePool.createValue(style->regionThread(), CSSPrimitiveValue::CSS_STRING));
+ if (style.hasFlowFrom())
+ list->append(cssValuePool.createValue(style.regionThread(), CSSPrimitiveValue::CSS_STRING));
return list;
}
-static Ref<CSSValue> counterToCSSValue(const RenderStyle* style, CSSPropertyID propertyID)
+static Ref<CSSValue> counterToCSSValue(const RenderStyle& style, CSSPropertyID propertyID)
{
- const CounterDirectiveMap* map = style->counterDirectives();
+ auto* map = style.counterDirectives();
if (!map)
return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
@@ -1883,14 +1881,21 @@
LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", getPropertyName(propertyID));
}
-static Ref<CSSValueList> fontFamilyFromStyle(const RenderStyle* style)
+static Ref<CSSValueList> fontFamilyListFromStyle(const RenderStyle& style)
{
auto list = CSSValueList::createCommaSeparated();
- for (unsigned i = 0; i < style->fontCascade().familyCount(); ++i)
- list.get().append(valueForFamily(style->fontCascade().familyAt(i)));
+ for (unsigned i = 0; i < style.fontCascade().familyCount(); ++i)
+ list->append(valueForFamily(style.fontCascade().familyAt(i)));
return list;
}
+static Ref<CSSValue> fontFamilyFromStyle(const RenderStyle& style)
+{
+ if (style.fontCascade().familyCount() == 1)
+ return valueForFamily(style.fontCascade().familyAt(0));
+ return fontFamilyListFromStyle(style);
+}
+
static Ref<CSSPrimitiveValue> lineHeightFromStyle(const RenderStyle& style)
{
Length length = style.lineHeight();
@@ -1911,203 +1916,203 @@
return zoomAdjustedPixelValue(style.fontDescription().computedSize(), style);
}
-static Ref<CSSPrimitiveValue> fontStyleFromStyle(const RenderStyle* style)
+static Ref<CSSPrimitiveValue> fontStyleFromStyle(const RenderStyle& style)
{
- if (style->fontDescription().italic())
+ if (style.fontDescription().italic())
return CSSValuePool::singleton().createIdentifierValue(CSSValueItalic);
return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
}
-static Ref<CSSValue> fontVariantFromStyle(const RenderStyle* style)
+static Ref<CSSValue> fontVariantFromStyle(const RenderStyle& style)
{
- if (style->fontDescription().variantSettings().isAllNormal())
+ if (style.fontDescription().variantSettings().isAllNormal())
return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
auto list = CSSValueList::createSpaceSeparated();
- switch (style->fontDescription().variantCommonLigatures()) {
+ switch (style.fontDescription().variantCommonLigatures()) {
case FontVariantLigatures::Normal:
break;
case FontVariantLigatures::Yes:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueCommonLigatures));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueCommonLigatures));
break;
case FontVariantLigatures::No:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoCommonLigatures));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoCommonLigatures));
break;
}
- switch (style->fontDescription().variantDiscretionaryLigatures()) {
+ switch (style.fontDescription().variantDiscretionaryLigatures()) {
case FontVariantLigatures::Normal:
break;
case FontVariantLigatures::Yes:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiscretionaryLigatures));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiscretionaryLigatures));
break;
case FontVariantLigatures::No:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoDiscretionaryLigatures));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoDiscretionaryLigatures));
break;
}
- switch (style->fontDescription().variantHistoricalLigatures()) {
+ switch (style.fontDescription().variantHistoricalLigatures()) {
case FontVariantLigatures::Normal:
break;
case FontVariantLigatures::Yes:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalLigatures));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalLigatures));
break;
case FontVariantLigatures::No:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoHistoricalLigatures));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoHistoricalLigatures));
break;
}
- switch (style->fontDescription().variantContextualAlternates()) {
+ switch (style.fontDescription().variantContextualAlternates()) {
case FontVariantLigatures::Normal:
break;
case FontVariantLigatures::Yes:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueContextual));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueContextual));
break;
case FontVariantLigatures::No:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoContextual));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoContextual));
break;
}
- switch (style->fontDescription().variantPosition()) {
+ switch (style.fontDescription().variantPosition()) {
case FontVariantPosition::Normal:
break;
case FontVariantPosition::Subscript:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSub));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueSub));
break;
case FontVariantPosition::Superscript:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSuper));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueSuper));
break;
}
- switch (style->fontDescription().variantCaps()) {
+ switch (style.fontDescription().variantCaps()) {
case FontVariantCaps::Normal:
break;
case FontVariantCaps::Small:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSmallCaps));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueSmallCaps));
break;
case FontVariantCaps::AllSmall:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllSmallCaps));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllSmallCaps));
break;
case FontVariantCaps::Petite:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValuePetiteCaps));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValuePetiteCaps));
break;
case FontVariantCaps::AllPetite:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllPetiteCaps));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllPetiteCaps));
break;
case FontVariantCaps::Unicase:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueUnicase));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueUnicase));
break;
case FontVariantCaps::Titling:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTitlingCaps));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueTitlingCaps));
break;
}
- switch (style->fontDescription().variantNumericFigure()) {
+ switch (style.fontDescription().variantNumericFigure()) {
case FontVariantNumericFigure::Normal:
break;
case FontVariantNumericFigure::LiningNumbers:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueLiningNums));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueLiningNums));
break;
case FontVariantNumericFigure::OldStyleNumbers:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueOldstyleNums));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueOldstyleNums));
break;
}
- switch (style->fontDescription().variantNumericSpacing()) {
+ switch (style.fontDescription().variantNumericSpacing()) {
case FontVariantNumericSpacing::Normal:
break;
case FontVariantNumericSpacing::ProportionalNumbers:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalNums));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalNums));
break;
case FontVariantNumericSpacing::TabularNumbers:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTabularNums));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueTabularNums));
break;
}
- switch (style->fontDescription().variantNumericFraction()) {
+ switch (style.fontDescription().variantNumericFraction()) {
case FontVariantNumericFraction::Normal:
break;
case FontVariantNumericFraction::DiagonalFractions:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiagonalFractions));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiagonalFractions));
break;
case FontVariantNumericFraction::StackedFractions:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueStackedFractions));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueStackedFractions));
break;
}
- switch (style->fontDescription().variantNumericOrdinal()) {
+ switch (style.fontDescription().variantNumericOrdinal()) {
case FontVariantNumericOrdinal::Normal:
break;
case FontVariantNumericOrdinal::Yes:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueOrdinal));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueOrdinal));
break;
}
- switch (style->fontDescription().variantNumericSlashedZero()) {
+ switch (style.fontDescription().variantNumericSlashedZero()) {
case FontVariantNumericSlashedZero::Normal:
break;
case FontVariantNumericSlashedZero::Yes:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSlashedZero));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueSlashedZero));
break;
}
- switch (style->fontDescription().variantAlternates()) {
+ switch (style.fontDescription().variantAlternates()) {
case FontVariantAlternates::Normal:
break;
case FontVariantAlternates::HistoricalForms:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalForms));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalForms));
break;
}
- switch (style->fontDescription().variantEastAsianVariant()) {
+ switch (style.fontDescription().variantEastAsianVariant()) {
case FontVariantEastAsianVariant::Normal:
break;
case FontVariantEastAsianVariant::Jis78:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis78));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis78));
break;
case FontVariantEastAsianVariant::Jis83:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis83));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis83));
break;
case FontVariantEastAsianVariant::Jis90:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis90));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis90));
break;
case FontVariantEastAsianVariant::Jis04:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis04));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis04));
break;
case FontVariantEastAsianVariant::Simplified:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSimplified));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueSimplified));
break;
case FontVariantEastAsianVariant::Traditional:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTraditional));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueTraditional));
break;
}
- switch (style->fontDescription().variantEastAsianWidth()) {
+ switch (style.fontDescription().variantEastAsianWidth()) {
case FontVariantEastAsianWidth::Normal:
break;
case FontVariantEastAsianWidth::Full:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueFullWidth));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueFullWidth));
break;
case FontVariantEastAsianWidth::Proportional:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalWidth));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalWidth));
break;
}
- switch (style->fontDescription().variantEastAsianRuby()) {
+ switch (style.fontDescription().variantEastAsianRuby()) {
case FontVariantEastAsianRuby::Normal:
break;
case FontVariantEastAsianRuby::Yes:
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueRuby));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueRuby));
break;
}
return WTFMove(list);
}
-static Ref<CSSPrimitiveValue> fontWeightFromStyle(const RenderStyle* style)
+static Ref<CSSPrimitiveValue> fontWeightFromStyle(const RenderStyle& style)
{
- switch (style->fontDescription().weight()) {
+ switch (style.fontDescription().weight()) {
case FontWeight100:
return CSSValuePool::singleton().createIdentifierValue(CSSValue100);
case FontWeight200:
@@ -2138,19 +2143,19 @@
auto list = CSSValueList::createSpaceSeparated();
if (style.fontDescription().fontSynthesis() & FontSynthesisStyle)
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueStyle));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueStyle));
if (style.fontDescription().fontSynthesis() & FontSynthesisWeight)
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueWeight));
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueWeight));
if (style.fontDescription().fontSynthesis() & FontSynthesisSmallCaps)
- list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSmallCaps));
- return Ref<CSSValue>(list.get());
+ list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueSmallCaps));
+ return WTFMove(list);
}
typedef const Length& (RenderStyle::*RenderStyleLengthGetter)() const;
typedef LayoutUnit (RenderBoxModelObject::*RenderBoxComputedCSSValueGetter)() const;
template<RenderStyleLengthGetter lengthGetter, RenderBoxComputedCSSValueGetter computedCSSValueGetter>
-inline RefPtr<CSSValue> zoomAdjustedPaddingOrMarginPixelValue(const RenderStyle& style, RenderObject* renderer)
+static RefPtr<CSSValue> zoomAdjustedPaddingOrMarginPixelValue(const RenderStyle& style, RenderObject* renderer)
{
Length unzoomzedLength = (style.*lengthGetter)();
if (!is<RenderBox>(renderer) || unzoomzedLength.isFixed())
@@ -2159,11 +2164,9 @@
}
template<RenderStyleLengthGetter lengthGetter>
-inline bool paddingOrMarginIsRendererDependent(const RenderStyle* style, RenderObject* renderer)
+static bool paddingOrMarginIsRendererDependent(const RenderStyle* style, RenderObject* renderer)
{
- if (!renderer || !renderer->isBox())
- return false;
- return !(style && (style->*lengthGetter)().isFixed());
+ return renderer && style && renderer->isBox() && !(style->*lengthGetter)().isFixed();
}
static CSSValueID convertToPageBreak(BreakBetween value)
@@ -2445,11 +2448,11 @@
auto& cssValuePool = CSSValuePool::singleton();
auto result = CSSValueList::createSpaceSeparated();
if (data.positionType() == LegacyPosition)
- result.get().append(cssValuePool.createIdentifierValue(CSSValueLegacy));
- result.get().append(cssValuePool.createValue(data.position()));
+ result->append(cssValuePool.createIdentifierValue(CSSValueLegacy));
+ result->append(cssValuePool.createValue(data.position()));
if (data.position() >= ItemPositionCenter && data.overflow() != OverflowAlignmentDefault)
- result.get().append(cssValuePool.createValue(data.overflow()));
- ASSERT(result.get().length() <= 2);
+ result->append(cssValuePool.createValue(data.overflow()));
+ ASSERT(result->length() <= 2);
return result;
}
@@ -2458,21 +2461,21 @@
auto& cssValuePool = CSSValuePool::singleton();
auto result = CSSValueList::createSpaceSeparated();
if (data.distribution() != ContentDistributionDefault)
- result.get().append(cssValuePool.createValue(data.distribution()));
+ result->append(cssValuePool.createValue(data.distribution()));
if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) {
bool gridEnabled = false;
#if ENABLE(CSS_GRID_LAYOUT)
gridEnabled = RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled();
#endif
if (data.position() != ContentPositionNormal || gridEnabled)
- result.get().append(cssValuePool.createValue(data.position()));
+ result->append(cssValuePool.createValue(data.position()));
else
- result.get().append(cssValuePool.createIdentifierValue(normalBehaviorValueID));
+ result->append(cssValuePool.createIdentifierValue(normalBehaviorValueID));
}
if ((data.position() >= ContentPositionCenter || data.distribution() != ContentDistributionDefault) && data.overflow() != OverflowAlignmentDefault)
- result.get().append(cssValuePool.createValue(data.overflow()));
- ASSERT(result.get().length() > 0);
- ASSERT(result.get().length() <= 3);
+ result->append(cssValuePool.createValue(data.overflow()));
+ ASSERT(result->length() > 0);
+ ASSERT(result->length() <= 3);
return result;
}
@@ -2494,10 +2497,10 @@
std::unique_ptr<RenderStyle> ownedStyle;
auto* style = computeRenderStyleForProperty(*styledElement, m_pseudoElementSpecifier, CSSPropertyCustom, ownedStyle);
- if (!style || !style->hasCustomProperty(propertyName))
+ if (!style)
return nullptr;
- return style->getCustomPropertyValue(propertyName);
+ return style->customProperties().get(propertyName);
}
String ComputedStyleExtractor::customPropertyText(const String& propertyName)
@@ -2560,88 +2563,69 @@
return cssValuePool.createColorValue(m_allowVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor) : style->backgroundColor());
case CSSPropertyBackgroundImage:
case CSSPropertyWebkitMaskImage: {
- const FillLayer* layers = propertyID == CSSPropertyWebkitMaskImage ? style->maskLayers() : style->backgroundLayers();
- if (!layers)
- return cssValuePool.createIdentifierValue(CSSValueNone);
-
- if (!layers->next()) {
- if (layers->image())
- return layers->image()->cssValue();
-
+ auto& layers = propertyID == CSSPropertyWebkitMaskImage ? style->maskLayers() : style->backgroundLayers();
+ if (!layers.next()) {
+ if (layers.image())
+ return layers.image()->cssValue();
return cssValuePool.createIdentifierValue(CSSValueNone);
}
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next()) {
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next()) {
if (currLayer->image())
list->append(currLayer->image()->cssValue());
else
list->append(cssValuePool.createIdentifierValue(CSSValueNone));
}
- return list;
+ return WTFMove(list);
}
case CSSPropertyBackgroundSize:
case CSSPropertyWebkitBackgroundSize:
case CSSPropertyWebkitMaskSize: {
- const FillLayer* layers = propertyID == CSSPropertyWebkitMaskSize ? style->maskLayers() : style->backgroundLayers();
- if (!layers->next())
- return fillSizeToCSSValue(layers->size(), *style);
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto& layers = propertyID == CSSPropertyWebkitMaskSize ? style->maskLayers() : style->backgroundLayers();
+ if (!layers.next())
+ return fillSizeToCSSValue(layers.size(), *style);
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(fillSizeToCSSValue(currLayer->size(), *style));
-
- return list;
+ return WTFMove(list);
}
case CSSPropertyBackgroundRepeat:
case CSSPropertyWebkitMaskRepeat: {
- const FillLayer* layers = propertyID == CSSPropertyWebkitMaskRepeat ? style->maskLayers() : style->backgroundLayers();
- if (!layers->next())
- return fillRepeatToCSSValue(layers->repeatX(), layers->repeatY());
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto& layers = propertyID == CSSPropertyWebkitMaskRepeat ? style->maskLayers() : style->backgroundLayers();
+ if (!layers.next())
+ return fillRepeatToCSSValue(layers.repeatX(), layers.repeatY());
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(fillRepeatToCSSValue(currLayer->repeatX(), currLayer->repeatY()));
-
- return list;
+ return WTFMove(list);
}
case CSSPropertyWebkitMaskSourceType: {
- const FillLayer* layers = style->maskLayers();
-
- if (!layers)
- return cssValuePool.createIdentifierValue(CSSValueNone);
-
- if (!layers->next())
- return fillSourceTypeToCSSValue(layers->maskSourceType());
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto& layers = style->maskLayers();
+ if (!layers.next())
+ return fillSourceTypeToCSSValue(layers.maskSourceType());
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(fillSourceTypeToCSSValue(currLayer->maskSourceType()));
-
- return list;
+ return WTFMove(list);
}
case CSSPropertyWebkitBackgroundComposite:
case CSSPropertyWebkitMaskComposite: {
- const FillLayer* layers = propertyID == CSSPropertyWebkitMaskComposite ? style->maskLayers() : style->backgroundLayers();
- if (!layers->next())
- return cssValuePool.createValue(layers->composite());
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto& layers = propertyID == CSSPropertyWebkitMaskComposite ? style->maskLayers() : style->backgroundLayers();
+ if (!layers.next())
+ return cssValuePool.createValue(layers.composite());
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(cssValuePool.createValue(currLayer->composite()));
-
- return list;
+ return WTFMove(list);
}
case CSSPropertyBackgroundAttachment: {
- const FillLayer* layers = style->backgroundLayers();
- if (!layers->next())
- return cssValuePool.createValue(layers->attachment());
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto& layers = style->backgroundLayers();
+ if (!layers.next())
+ return cssValuePool.createValue(layers.attachment());
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(cssValuePool.createValue(currLayer->attachment()));
-
- return list;
+ return WTFMove(list);
}
case CSSPropertyBackgroundClip:
case CSSPropertyBackgroundOrigin:
@@ -2649,65 +2633,59 @@
case CSSPropertyWebkitBackgroundOrigin:
case CSSPropertyWebkitMaskClip:
case CSSPropertyWebkitMaskOrigin: {
- const FillLayer* layers = (propertyID == CSSPropertyWebkitMaskClip || propertyID == CSSPropertyWebkitMaskOrigin) ? style->maskLayers() : style->backgroundLayers();
+ auto& layers = (propertyID == CSSPropertyWebkitMaskClip || propertyID == CSSPropertyWebkitMaskOrigin) ? style->maskLayers() : style->backgroundLayers();
bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == CSSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip;
- if (!layers->next()) {
- EFillBox box = isClip ? layers->clip() : layers->origin();
- return cssValuePool.createValue(box);
- }
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next()) {
- EFillBox box = isClip ? currLayer->clip() : currLayer->origin();
- list->append(cssValuePool.createValue(box));
- }
-
- return list;
+ if (!layers.next())
+ return cssValuePool.createValue(isClip ? layers.clip() : layers.origin());
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
+ list->append(cssValuePool.createValue(isClip ? currLayer->clip() : currLayer->origin()));
+ return WTFMove(list);
}
case CSSPropertyBackgroundPosition:
case CSSPropertyWebkitMaskPosition: {
- const FillLayer* layers = propertyID == CSSPropertyWebkitMaskPosition ? style->maskLayers() : style->backgroundLayers();
- if (!layers->next())
+ auto& layers = propertyID == CSSPropertyWebkitMaskPosition ? style->maskLayers() : style->backgroundLayers();
+ if (!layers.next())
return createPositionListForLayer(propertyID, layers, *style);
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
- list->append(createPositionListForLayer(propertyID, currLayer, *style));
- return list;
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
+ list->append(createPositionListForLayer(propertyID, *currLayer, *style));
+ return WTFMove(list);
}
case CSSPropertyBackgroundPositionX:
case CSSPropertyWebkitMaskPositionX: {
- const FillLayer* layers = propertyID == CSSPropertyWebkitMaskPositionX ? style->maskLayers() : style->backgroundLayers();
- if (!layers->next())
- return cssValuePool.createValue(layers->xPosition());
+ auto& layers = propertyID == CSSPropertyWebkitMaskPositionX ? style->maskLayers() : style->backgroundLayers();
+ if (!layers.next())
+ return cssValuePool.createValue(layers.xPosition());
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(cssValuePool.createValue(currLayer->xPosition()));
- return list;
+ return WTFMove(list);
}
case CSSPropertyBackgroundPositionY:
case CSSPropertyWebkitMaskPositionY: {
- const FillLayer* layers = propertyID == CSSPropertyWebkitMaskPositionY ? style->maskLayers() : style->backgroundLayers();
- if (!layers->next())
- return cssValuePool.createValue(layers->yPosition());
+ auto& layers = propertyID == CSSPropertyWebkitMaskPositionY ? style->maskLayers() : style->backgroundLayers();
+ if (!layers.next())
+ return cssValuePool.createValue(layers.yPosition());
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(cssValuePool.createValue(currLayer->yPosition()));
- return list;
+ return WTFMove(list);
}
case CSSPropertyBorderCollapse:
if (style->borderCollapse())
return cssValuePool.createIdentifierValue(CSSValueCollapse);
return cssValuePool.createIdentifierValue(CSSValueSeparate);
case CSSPropertyBorderSpacing: {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
list->append(zoomAdjustedPixelValue(style->horizontalBorderSpacing(), *style));
list->append(zoomAdjustedPixelValue(style->verticalBorderSpacing(), *style));
- return list;
+ return WTFMove(list);
}
case CSSPropertyWebkitBorderHorizontalSpacing:
return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), *style);
@@ -2822,7 +2800,7 @@
#endif
case CSSPropertyCursor: {
RefPtr<CSSValueList> list;
- CursorList* cursors = style->cursors();
+ auto* cursors = style->cursors();
if (cursors && cursors->size() > 0) {
list = CSSValueList::createCommaSeparated();
for (unsigned i = 0; i < cursors->size(); ++i)
@@ -2881,59 +2859,53 @@
return cssValuePool.createIdentifierValue(CSSValueNone);
return cssValuePool.createValue(style->floating());
case CSSPropertyFont: {
- RefPtr<CSSFontValue> computedFont = CSSFontValue::create();
- computedFont->style = fontStyleFromStyle(style);
+ auto computedFont = CSSFontValue::create();
+ computedFont->style = fontStyleFromStyle(*style);
if (style->fontDescription().variantCaps() == FontVariantCaps::Small)
computedFont->variant = CSSValuePool::singleton().createIdentifierValue(CSSValueSmallCaps);
else
computedFont->variant = CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
- computedFont->weight = fontWeightFromStyle(style);
+ computedFont->weight = fontWeightFromStyle(*style);
computedFont->size = fontSizeFromStyle(*style);
computedFont->lineHeight = lineHeightFromStyle(*style);
- computedFont->family = fontFamilyFromStyle(style);
- return computedFont;
+ computedFont->family = fontFamilyListFromStyle(*style);
+ return WTFMove(computedFont);
}
- case CSSPropertyFontFamily: {
- RefPtr<CSSValueList> fontFamilyList = fontFamilyFromStyle(style);
- // If there's only a single family, return that as a CSSPrimitiveValue.
- // NOTE: Gecko always returns this as a comma-separated CSSPrimitiveValue string.
- if (fontFamilyList->length() == 1)
- return fontFamilyList->item(0);
- return fontFamilyList;
- }
+ case CSSPropertyFontFamily:
+ return fontFamilyFromStyle(*style);
case CSSPropertyFontSize:
return fontSizeFromStyle(*style);
case CSSPropertyFontStyle:
- return fontStyleFromStyle(style);
+ return fontStyleFromStyle(*style);
case CSSPropertyFontVariant:
- return fontVariantFromStyle(style);
+ return fontVariantFromStyle(*style);
case CSSPropertyFontWeight:
- return fontWeightFromStyle(style);
+ return fontWeightFromStyle(*style);
case CSSPropertyFontSynthesis:
return fontSynthesisFromStyle(*style);
case CSSPropertyFontFeatureSettings: {
const FontFeatureSettings& featureSettings = style->fontDescription().featureSettings();
if (!featureSettings.size())
return cssValuePool.createIdentifierValue(CSSValueNormal);
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ auto list = CSSValueList::createCommaSeparated();
for (auto& feature : featureSettings)
list->append(CSSFontFeatureValue::create(FontTag(feature.tag()), feature.value()));
- return list;
+ return WTFMove(list);
}
#if ENABLE(VARIATION_FONTS)
case CSSPropertyFontVariationSettings: {
const FontVariationSettings& variationSettings = style->fontDescription().variationSettings();
if (variationSettings.isEmpty())
return cssValuePool.createIdentifierValue(CSSValueNormal);
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ auto list = CSSValueList::createCommaSeparated();
for (auto& feature : variationSettings)
list->append(CSSFontVariationValue::create(feature.tag(), feature.value()));
- return list;
+ return WTFMove(list);
}
#endif
#if ENABLE(CSS_GRID_LAYOUT)
case CSSPropertyGridAutoFlow: {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
ASSERT(style->isGridAutoFlowDirectionRow() || style->isGridAutoFlowDirectionColumn());
if (style->isGridAutoFlowDirectionRow())
list->append(cssValuePool.createIdentifierValue(CSSValueRow));
@@ -2943,7 +2915,7 @@
if (style->isGridAutoFlowAlgorithmDense())
list->append(cssValuePool.createIdentifierValue(CSSValueDense));
- return list;
+ return WTFMove(list);
}
// Specs mention that getComputedStyle() should return the used value of the property instead of the computed
@@ -2979,13 +2951,11 @@
return getCSSPropertyValuesForGridShorthand(gridColumnShorthand());
case CSSPropertyGridRow:
return getCSSPropertyValuesForGridShorthand(gridRowShorthand());
-
case CSSPropertyGridTemplateAreas:
if (!style->namedGridAreaRowCount()) {
ASSERT(!style->namedGridAreaColumnCount());
return cssValuePool.createIdentifierValue(CSSValueNone);
}
-
return CSSGridTemplateAreasValue::create(style->namedGridArea(), style->namedGridAreaRowCount(), style->namedGridAreaColumnCount());
case CSSPropertyGridColumnGap:
return zoomAdjustedPixelValueForLength(style->gridColumnGap(), *style);
@@ -3120,10 +3090,10 @@
case CSSPropertyObjectFit:
return cssValuePool.createValue(style->objectFit());
case CSSPropertyObjectPosition: {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
list->append(zoomAdjustedPixelValueForLength(style->objectPosition().x(), *style));
list->append(zoomAdjustedPixelValueForLength(style->objectPosition().y(), *style));
- return list;
+ return WTFMove(list);
}
case CSSPropertyOpacity:
return cssValuePool.createValue(style->opacity(), CSSPrimitiveValue::CSS_NUMBER);
@@ -3224,31 +3194,30 @@
case TextEmphasisMarkCircle:
case TextEmphasisMarkDoubleCircle:
case TextEmphasisMarkTriangle:
- case TextEmphasisMarkSesame: {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ case TextEmphasisMarkSesame:
+ auto list = CSSValueList::createSpaceSeparated();
list->append(cssValuePool.createValue(style->textEmphasisFill()));
list->append(cssValuePool.createValue(style->textEmphasisMark()));
- return list;
- }
+ return WTFMove(list);
}
case CSSPropertyTextIndent: {
// If CSS3_TEXT is disabled or text-indent has only one value(<length> | <percentage>),
// getPropertyCSSValue() returns CSSValue.
- RefPtr<CSSValue> textIndent = zoomAdjustedPixelValueForLength(style->textIndent(), *style);
+ auto textIndent = zoomAdjustedPixelValueForLength(style->textIndent(), *style);
#if ENABLE(CSS3_TEXT)
// If CSS3_TEXT is enabled and text-indent has -webkit-each-line or -webkit-hanging,
// getPropertyCSSValue() returns CSSValueList.
if (style->textIndentLine() == TextIndentEachLine || style->textIndentType() == TextIndentHanging) {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- list->append(textIndent.releaseNonNull());
+ auto list = CSSValueList::createSpaceSeparated();
+ list->append(WTFMove(textIndent));
if (style->textIndentLine() == TextIndentEachLine)
list->append(cssValuePool.createIdentifierValue(CSSValueWebkitEachLine));
if (style->textIndentType() == TextIndentHanging)
list->append(cssValuePool.createIdentifierValue(CSSValueWebkitHanging));
- return list;
+ return WTFMove(list);
}
#endif
- return textIndent;
+ return WTFMove(textIndent);
}
case CSSPropertyTextShadow:
return valueForShadow(style->textShadow(), propertyID, *style);
@@ -3321,8 +3290,7 @@
}
return zoomAdjustedPixelValueForLength(style->width(), *style);
case CSSPropertyWillChange:
- return getWillChangePropertyValue(style->willChange());
- break;
+ return willChangePropertyValue(style->willChange());
case CSSPropertyWordBreak:
return cssValuePool.createValue(style->wordBreak());
case CSSPropertyWordSpacing:
@@ -3394,9 +3362,9 @@
}
#endif
case CSSPropertyAnimationDelay:
- return getDelayValue(style->animations());
+ return delayValue(style->animations());
case CSSPropertyAnimationDirection: {
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ auto list = CSSValueList::createCommaSeparated();
const AnimationList* t = style->animations();
if (t) {
for (size_t i = 0; i < t->size(); ++i) {
@@ -3417,12 +3385,12 @@
}
} else
list->append(cssValuePool.createIdentifierValue(CSSValueNormal));
- return list;
+ return WTFMove(list);
}
case CSSPropertyAnimationDuration:
- return getDurationValue(style->animations());
+ return durationValue(style->animations());
case CSSPropertyAnimationFillMode: {
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ auto list = CSSValueList::createCommaSeparated();
const AnimationList* t = style->animations();
if (t) {
for (size_t i = 0; i < t->size(); ++i) {
@@ -3443,10 +3411,10 @@
}
} else
list->append(cssValuePool.createIdentifierValue(CSSValueNone));
- return list;
+ return WTFMove(list);
}
case CSSPropertyAnimationIterationCount: {
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ auto list = CSSValueList::createCommaSeparated();
const AnimationList* t = style->animations();
if (t) {
for (size_t i = 0; i < t->size(); ++i) {
@@ -3458,20 +3426,20 @@
}
} else
list->append(cssValuePool.createValue(Animation::initialIterationCount(), CSSPrimitiveValue::CSS_NUMBER));
- return list;
+ return WTFMove(list);
}
case CSSPropertyAnimationName: {
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ auto list = CSSValueList::createCommaSeparated();
const AnimationList* t = style->animations();
if (t) {
for (size_t i = 0; i < t->size(); ++i)
list->append(cssValuePool.createValue(t->animation(i).name(), CSSPrimitiveValue::CSS_STRING));
} else
list->append(cssValuePool.createIdentifierValue(CSSValueNone));
- return list;
+ return WTFMove(list);
}
case CSSPropertyAnimationPlayState: {
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ auto list = CSSValueList::createCommaSeparated();
const AnimationList* t = style->animations();
if (t) {
for (size_t i = 0; i < t->size(); ++i) {
@@ -3483,13 +3451,13 @@
}
} else
list->append(cssValuePool.createIdentifierValue(CSSValueRunning));
- return list;
+ return WTFMove(list);
}
case CSSPropertyAnimationTimingFunction:
- return getTimingFunctionValue(style->animations());
+ return timingFunctionValue(style->animations());
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
case CSSPropertyWebkitAnimationTrigger:
- return getAnimationTriggerValue(style->animations(), *style);
+ return animationTriggerValue(style->animations(), *style);
#endif
case CSSPropertyWebkitAppearance:
return cssValuePool.createValue(style->appearance());
@@ -3531,8 +3499,8 @@
// Not a real style property -- used by the editing engine -- so has no computed value.
break;
case CSSPropertyWebkitInitialLetter: {
- Ref<CSSPrimitiveValue> drop = !style->initialLetterDrop() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style->initialLetterDrop(), CSSPrimitiveValue::CSS_NUMBER);
- Ref<CSSPrimitiveValue> size = !style->initialLetterHeight() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style->initialLetterHeight(), CSSPrimitiveValue::CSS_NUMBER);
+ auto drop = !style->initialLetterDrop() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style->initialLetterDrop(), CSSPrimitiveValue::CSS_NUMBER);
+ auto size = !style->initialLetterHeight() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style->initialLetterHeight(), CSSPrimitiveValue::CSS_NUMBER);
return cssValuePool.createValue(Pair::create(WTFMove(drop), WTFMove(size)));
}
case CSSPropertyWebkitMarginBottomCollapse:
@@ -3552,7 +3520,7 @@
return cssValuePool.createIdentifierValue(CSSValueNone);
return zoomAdjustedPixelValue(style->perspective(), *style);
case CSSPropertyPerspectiveOrigin: {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
if (renderer) {
LayoutRect box;
if (is<RenderBox>(*renderer))
@@ -3566,7 +3534,7 @@
list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginY(), *style));
}
- return list;
+ return WTFMove(list);
}
case CSSPropertyWebkitRtlOrdering:
return cssValuePool.createIdentifierValue(style->rtlOrdering() ? CSSValueVisual : CSSValueLogical);
@@ -3585,13 +3553,13 @@
case CSSPropertyWebkitUserSelect:
return cssValuePool.createValue(style->userSelect());
case CSSPropertyBorderBottomLeftRadius:
- return getBorderRadiusCornerValue(style->borderBottomLeftRadius(), *style);
+ return borderRadiusCornerValue(style->borderBottomLeftRadius(), *style);
case CSSPropertyBorderBottomRightRadius:
- return getBorderRadiusCornerValue(style->borderBottomRightRadius(), *style);
+ return borderRadiusCornerValue(style->borderBottomRightRadius(), *style);
case CSSPropertyBorderTopLeftRadius:
- return getBorderRadiusCornerValue(style->borderTopLeftRadius(), *style);
+ return borderRadiusCornerValue(style->borderTopLeftRadius(), *style);
case CSSPropertyBorderTopRightRadius:
- return getBorderRadiusCornerValue(style->borderTopRightRadius(), *style);
+ return borderRadiusCornerValue(style->borderTopRightRadius(), *style);
case CSSPropertyClip: {
if (!style->hasClip())
return cssValuePool.createIdentifierValue(CSSValueAuto);
@@ -3607,7 +3575,7 @@
case CSSPropertyTransform:
return computedTransform(renderer, *style);
case CSSPropertyTransformOrigin: {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
if (renderer) {
LayoutRect box;
if (is<RenderBox>(*renderer))
@@ -3623,42 +3591,41 @@
if (style->transformOriginZ() != 0)
list->append(zoomAdjustedPixelValue(style->transformOriginZ(), *style));
}
- return list;
+ return WTFMove(list);
}
case CSSPropertyTransformStyle:
case CSSPropertyWebkitTransformStyle:
return cssValuePool.createIdentifierValue((style->transformStyle3D() == TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat);
case CSSPropertyTransitionDelay:
- return getDelayValue(style->transitions());
+ return delayValue(style->transitions());
case CSSPropertyTransitionDuration:
- return getDurationValue(style->transitions());
+ return durationValue(style->transitions());
case CSSPropertyTransitionProperty:
- return getTransitionPropertyValue(style->transitions());
+ return transitionPropertyValue(style->transitions());
case CSSPropertyTransitionTimingFunction:
- return getTimingFunctionValue(style->transitions());
+ return timingFunctionValue(style->transitions());
case CSSPropertyTransition: {
- const AnimationList* animList = style->transitions();
- if (animList) {
- RefPtr<CSSValueList> transitionsList = CSSValueList::createCommaSeparated();
- for (size_t i = 0; i < animList->size(); ++i) {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- const Animation& animation = animList->animation(i);
+ if (auto* animationList = style->transitions()) {
+ auto transitionsList = CSSValueList::createCommaSeparated();
+ for (size_t i = 0; i < animationList->size(); ++i) {
+ auto list = CSSValueList::createSpaceSeparated();
+ auto& animation = animationList->animation(i);
list->append(createTransitionPropertyValue(animation));
list->append(cssValuePool.createValue(animation.duration(), CSSPrimitiveValue::CSS_S));
- list->append(createTimingFunctionValue(animation.timingFunction().get()));
+ list->append(createTimingFunctionValue(*animation.timingFunction()));
list->append(cssValuePool.createValue(animation.delay(), CSSPrimitiveValue::CSS_S));
- transitionsList->append(list.releaseNonNull());
+ transitionsList->append(WTFMove(list));
}
- return transitionsList;
+ return WTFMove(transitionsList);
}
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
// transition-property default value.
list->append(cssValuePool.createIdentifierValue(CSSValueAll));
list->append(cssValuePool.createValue(Animation::initialDuration(), CSSPrimitiveValue::CSS_S));
- list->append(createTimingFunctionValue(Animation::initialTimingFunction().get()));
+ list->append(createTimingFunctionValue(Animation::initialTimingFunction()));
list->append(cssValuePool.createValue(Animation::initialDelay(), CSSPrimitiveValue::CSS_S));
- return list;
+ return WTFMove(list);
}
case CSSPropertyPointerEvents:
return cssValuePool.createValue(style->pointerEvents());
@@ -3679,33 +3646,29 @@
case CSSPropertyWebkitLineBoxContain:
return createLineBoxContainValue(style->lineBoxContain());
case CSSPropertyAlt:
- return altTextToCSSValue(style);
+ return altTextToCSSValue(*style);
case CSSPropertyContent:
- return contentToCSSValue(style);
+ return contentToCSSValue(*style);
case CSSPropertyCounterIncrement:
- return counterToCSSValue(style, propertyID);
+ return counterToCSSValue(*style, propertyID);
case CSSPropertyCounterReset:
- return counterToCSSValue(style, propertyID);
+ return counterToCSSValue(*style, propertyID);
case CSSPropertyWebkitClipPath: {
- ClipPathOperation* operation = style->clipPath();
+ auto* operation = style->clipPath();
if (!operation)
return cssValuePool.createIdentifierValue(CSSValueNone);
- if (is<ReferenceClipPathOperation>(*operation)) {
- const auto& referenceOperation = downcast<ReferenceClipPathOperation>(*operation);
- return CSSPrimitiveValue::create(referenceOperation.url(), CSSPrimitiveValue::CSS_URI);
- }
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ if (is<ReferenceClipPathOperation>(*operation))
+ return CSSPrimitiveValue::create(downcast<ReferenceClipPathOperation>(*operation).url(), CSSPrimitiveValue::CSS_URI);
+ auto list = CSSValueList::createSpaceSeparated();
if (is<ShapeClipPathOperation>(*operation)) {
- const auto& shapeOperation = downcast<ShapeClipPathOperation>(*operation);
+ auto& shapeOperation = downcast<ShapeClipPathOperation>(*operation);
list->append(valueForBasicShape(*style, shapeOperation.basicShape()));
if (shapeOperation.referenceBox() != BoxMissing)
list->append(cssValuePool.createValue(shapeOperation.referenceBox()));
}
- if (is<BoxClipPathOperation>(*operation)) {
- const auto& boxOperation = downcast<BoxClipPathOperation>(*operation);
- list->append(cssValuePool.createValue(boxOperation.referenceBox()));
- }
- return list;
+ if (is<BoxClipPathOperation>(*operation))
+ list->append(cssValuePool.createValue(downcast<BoxClipPathOperation>(*operation).referenceBox()));
+ return WTFMove(list);
}
#if ENABLE(CSS_REGIONS)
case CSSPropertyWebkitFlowInto:
@@ -3738,20 +3701,18 @@
return cssValuePool.createValue(style->isolation());
#endif
case CSSPropertyBackgroundBlendMode: {
- const FillLayer* layers = style->backgroundLayers();
- if (!layers->next())
- return cssValuePool.createValue(layers->blendMode());
-
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+ auto& layers = style->backgroundLayers();
+ if (!layers.next())
+ return cssValuePool.createValue(layers.blendMode());
+ auto list = CSSValueList::createCommaSeparated();
+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
list->append(cssValuePool.createValue(currLayer->blendMode()));
-
- return list;
+ return WTFMove(list);
}
case CSSPropertyBackground:
return getBackgroundShorthandValue();
case CSSPropertyBorder: {
- RefPtr<CSSValue> value = propertyValue(CSSPropertyBorderTop, DoNotUpdateLayout);
+ auto value = propertyValue(CSSPropertyBorderTop, DoNotUpdateLayout);
const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
for (auto& property : properties) {
if (!compareCSSValuePtr<CSSValue>(value, propertyValue(property, DoNotUpdateLayout)))
@@ -3768,7 +3729,7 @@
case CSSPropertyBorderImage:
return valueForNinePieceImage(style->borderImage());
case CSSPropertyBorderRadius:
- return getBorderRadiusShorthandValue(*style);
+ return borderRadiusShorthandValue(*style);
case CSSPropertyBorderRight:
return getCSSPropertyValuesForShorthandProperties(borderRightShorthand());
case CSSPropertyBorderStyle:
@@ -3998,7 +3959,7 @@
String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) const
{
- RefPtr<CSSValue> value = getPropertyCSSValue(propertyID);
+ auto value = getPropertyCSSValue(propertyID);
if (!value)
return emptyString(); // FIXME: Should this be null instead, as it is in StyleProperties::getPropertyValue?
return value->cssText();
@@ -4063,22 +4024,21 @@
RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand& shorthand)
{
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- for (size_t i = 0; i < shorthand.length(); ++i) {
- RefPtr<CSSValue> value = propertyValue(shorthand.properties()[i], DoNotUpdateLayout);
- list->append(value.releaseNonNull());
- }
- return list;
+ auto list = CSSValueList::createSpaceSeparated();
+ for (size_t i = 0; i < shorthand.length(); ++i)
+ list->append(propertyValue(shorthand.properties()[i], DoNotUpdateLayout).releaseNonNull());
+ return WTFMove(list);
}
RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand& shorthand)
{
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ auto list = CSSValueList::createSpaceSeparated();
+
// Assume the properties are in the usual order top, right, bottom, left.
- RefPtr<CSSValue> topValue = propertyValue(shorthand.properties()[0], DoNotUpdateLayout);
- RefPtr<CSSValue> rightValue = propertyValue(shorthand.properties()[1], DoNotUpdateLayout);
- RefPtr<CSSValue> bottomValue = propertyValue(shorthand.properties()[2], DoNotUpdateLayout);
- RefPtr<CSSValue> leftValue = propertyValue(shorthand.properties()[3], DoNotUpdateLayout);
+ auto topValue = propertyValue(shorthand.properties()[0], DoNotUpdateLayout);
+ auto rightValue = propertyValue(shorthand.properties()[1], DoNotUpdateLayout);
+ auto bottomValue = propertyValue(shorthand.properties()[2], DoNotUpdateLayout);
+ auto leftValue = propertyValue(shorthand.properties()[3], DoNotUpdateLayout);
// All 4 properties must be specified.
if (!topValue || !rightValue || !bottomValue || !leftValue)
@@ -4096,17 +4056,15 @@
if (showLeft)
list->append(leftValue.releaseNonNull());
- return list;
+ return WTFMove(list);
}
RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand& shorthand)
{
- RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
- for (size_t i = 0; i < shorthand.length(); ++i) {
- RefPtr<CSSValue> value = propertyValue(shorthand.properties()[i], DoNotUpdateLayout);
- list->append(value.releaseNonNull());
- }
- return list;
+ auto list = CSSValueList::createSlashSeparated();
+ for (size_t i = 0; i < shorthand.length(); ++i)
+ list->append(propertyValue(shorthand.properties()[i], DoNotUpdateLayout).releaseNonNull());
+ return WTFMove(list);
}
Ref<MutableStyleProperties> ComputedStyleExtractor::copyPropertiesInSet(const CSSPropertyID* set, unsigned length)
@@ -4114,8 +4072,7 @@
Vector<CSSProperty, 256> list;
list.reserveInitialCapacity(length);
for (unsigned i = 0; i < length; ++i) {
- auto value = propertyValue(set[i]);
- if (value)
+ if (auto value = propertyValue(set[i]))
list.append(CSSProperty(set[i], WTFMove(value), false));
}
return MutableStyleProperties::create(list.data(), list.size());
@@ -4138,7 +4095,7 @@
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return nullptr;
- RefPtr<CSSValue> value = getPropertyCSSValue(propertyID);
+ auto value = getPropertyCSSValue(propertyID);
if (!value)
return nullptr;
return value->createDeprecatedCSSOMWrapper();
diff --git a/Source/WebCore/css/CSSImageGeneratorValue.cpp b/Source/WebCore/css/CSSImageGeneratorValue.cpp
index c8b6155..3c7c299 100644
--- a/Source/WebCore/css/CSSImageGeneratorValue.cpp
+++ b/Source/WebCore/css/CSSImageGeneratorValue.cpp
@@ -45,7 +45,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
CachedGeneratedImage(CSSImageGeneratorValue&, FloatSize, GeneratedImage&);
- GeneratedImage& image() const { return const_cast<GeneratedImage&>(m_image.get()); }
+ GeneratedImage& image() const { return m_image; }
void puntEvictionTimer() { m_evictionTimer.restart(); }
private:
diff --git a/Source/WebCore/css/CSSKeyframesRule.cpp b/Source/WebCore/css/CSSKeyframesRule.cpp
index 0642b87..09e7ad3 100644
--- a/Source/WebCore/css/CSSKeyframesRule.cpp
+++ b/Source/WebCore/css/CSSKeyframesRule.cpp
@@ -211,12 +211,10 @@
{
if (index >= length())
return nullptr;
-
ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size());
- RefPtr<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index];
+ auto& rule = m_childRuleCSSOMWrappers[index];
if (!rule)
- rule = adoptRef(new CSSKeyframeRule(const_cast<StyleRuleKeyframe&>(m_keyframesRule->keyframes()[index].get()), const_cast<CSSKeyframesRule*>(this)));
-
+ rule = adoptRef(*new CSSKeyframeRule(m_keyframesRule->keyframes()[index], const_cast<CSSKeyframesRule*>(this)));
return rule.get();
}
diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp
index 20c56e6..482fd3d 100644
--- a/Source/WebCore/css/CSSPrimitiveValue.cpp
+++ b/Source/WebCore/css/CSSPrimitiveValue.cpp
@@ -427,7 +427,7 @@
{
m_primitiveUnitType = CSS_PAIR;
m_hasCachedCSSText = false;
- m_value.pair = &Pair::create(create(lengthSize.width(), style), create(lengthSize.height(), style)).leakRef();
+ m_value.pair = &Pair::create(create(lengthSize.width, style), create(lengthSize.height, style)).leakRef();
}
void CSSPrimitiveValue::init(Ref<Counter>&& counter)
diff --git a/Source/WebCore/css/CSSStyleRule.h b/Source/WebCore/css/CSSStyleRule.h
index 810b9a4..71f3550 100644
--- a/Source/WebCore/css/CSSStyleRule.h
+++ b/Source/WebCore/css/CSSStyleRule.h
@@ -41,7 +41,7 @@
WEBCORE_EXPORT CSSStyleDeclaration& style();
// FIXME: Not CSSOM. Remove.
- StyleRule& styleRule() const { return const_cast<StyleRule&>(m_styleRule.get()); }
+ StyleRule& styleRule() const { return m_styleRule.get(); }
private:
CSSStyleRule(StyleRule&, CSSStyleSheet*);
diff --git a/Source/WebCore/css/CSSToStyleMap.cpp b/Source/WebCore/css/CSSToStyleMap.cpp
index 2a27ddb..85c44a2 100644
--- a/Source/WebCore/css/CSSToStyleMap.cpp
+++ b/Source/WebCore/css/CSSToStyleMap.cpp
@@ -188,12 +188,11 @@
static inline bool convertToLengthSize(const CSSPrimitiveValue& primitiveValue, CSSToLengthConversionData conversionData, LengthSize& size)
{
if (auto* pair = primitiveValue.pairValue()) {
- size.setWidth(pair->first()->convertToLength<AnyConversion>(conversionData));
- size.setHeight(pair->second()->convertToLength<AnyConversion>(conversionData));
+ size.width = pair->first()->convertToLength<AnyConversion>(conversionData);
+ size.height = pair->second()->convertToLength<AnyConversion>(conversionData);
} else
- size.setWidth(primitiveValue.convertToLength<AnyConversion>(conversionData));
-
- return !size.width().isUndefined() && !size.height().isUndefined();
+ size.width = primitiveValue.convertToLength<AnyConversion>(conversionData);
+ return !size.width.isUndefined() && !size.height.isUndefined();
}
void CSSToStyleMap::mapFillSize(CSSPropertyID propertyID, FillLayer& layer, const CSSValue& value)
diff --git a/Source/WebCore/css/FontFace.cpp b/Source/WebCore/css/FontFace.cpp
index c9fb733..c289f78 100644
--- a/Source/WebCore/css/FontFace.cpp
+++ b/Source/WebCore/css/FontFace.cpp
@@ -258,13 +258,13 @@
String FontFace::family() const
{
- const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
+ m_backing->updateStyleIfNeeded();
return m_backing->families()->cssText();
}
String FontFace::style() const
{
- const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
+ m_backing->updateStyleIfNeeded();
switch (m_backing->traitsMask() & FontStyleMask) {
case FontStyleNormalMask:
return String("normal", String::ConstructFromLiteral);
@@ -277,7 +277,7 @@
String FontFace::weight() const
{
- const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
+ m_backing->updateStyleIfNeeded();
switch (m_backing->traitsMask() & FontWeightMask) {
case FontWeight100Mask:
return String("100", String::ConstructFromLiteral);
@@ -309,7 +309,7 @@
String FontFace::unicodeRange() const
{
- const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
+ m_backing->updateStyleIfNeeded();
if (!m_backing->ranges().size())
return ASCIILiteral("U+0-10FFFF");
RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
@@ -320,13 +320,13 @@
String FontFace::variant() const
{
- const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
+ m_backing->updateStyleIfNeeded();
return computeFontVariant(m_backing->variantSettings())->cssText();
}
String FontFace::featureSettings() const
{
- const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
+ m_backing->updateStyleIfNeeded();
if (!m_backing->featureSettings().size())
return ASCIILiteral("normal");
RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
diff --git a/Source/WebCore/css/LengthFunctions.cpp b/Source/WebCore/css/LengthFunctions.cpp
index b21dd5d..68fffdeb 100644
--- a/Source/WebCore/css/LengthFunctions.cpp
+++ b/Source/WebCore/css/LengthFunctions.cpp
@@ -25,6 +25,7 @@
#include "LengthFunctions.h"
#include "FloatSize.h"
+#include "LayoutSize.h"
#include "LengthSize.h"
namespace WebCore {
@@ -58,6 +59,11 @@
return 0;
}
+LayoutSize sizeForLengthSize(const LengthSize& length, const LayoutSize& maximumValue)
+{
+ return { valueForLength(length.width, maximumValue.width()), valueForLength(length.height, maximumValue.height()) };
+}
+
// FIXME: when subpixel layout is supported this copy of floatValueForLength() can be removed. See bug 71143.
float floatValueForLength(const Length& length, LayoutUnit maximumValue)
{
@@ -113,7 +119,7 @@
FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatSize& boxSize)
{
- return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width()), floatValueForLength(lengthSize.height(), boxSize.height()));
+ return { floatValueForLength(lengthSize.width, boxSize.width()), floatValueForLength(lengthSize.height, boxSize.height()) };
}
} // namespace WebCore
diff --git a/Source/WebCore/css/LengthFunctions.h b/Source/WebCore/css/LengthFunctions.h
index 9d224d9..1c4e050 100644
--- a/Source/WebCore/css/LengthFunctions.h
+++ b/Source/WebCore/css/LengthFunctions.h
@@ -1,6 +1,6 @@
/*
Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ Copyright (C) 2006-2017 Apple Inc. All rights reserved.
Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved.
@@ -29,8 +29,9 @@
namespace WebCore {
class FloatSize;
-class LayoutUnit;
+class LayoutSize;
class RenderView;
+
struct Length;
struct LengthSize;
@@ -38,6 +39,7 @@
int intValueForLength(const Length&, LayoutUnit maximumValue);
LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue);
WEBCORE_EXPORT LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue);
+LayoutSize sizeForLengthSize(const LengthSize&, const LayoutSize& maximumValue);
float floatValueForLength(const Length&, LayoutUnit maximumValue);
WEBCORE_EXPORT float floatValueForLength(const Length&, float maximumValue);
FloatSize floatSizeForLengthSize(const LengthSize&, const FloatSize&);
diff --git a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
index 5383427..d769a5a 100644
--- a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
@@ -23,6 +23,7 @@
#include "CSSPrimitiveValueMappings.h"
#include "CSSPropertyNames.h"
+#include "CSSValueList.h"
#include "Document.h"
#include "Element.h"
#include "RenderStyle.h"
@@ -31,34 +32,34 @@
static Ref<CSSValue> paintOrder(PaintOrder paintOrder)
{
- Ref<CSSValueList> paintOrderList = CSSValueList::createSpaceSeparated();
- Ref<CSSValue> fill = CSSPrimitiveValue::createIdentifier(CSSValueFill);
- Ref<CSSValue> stroke = CSSPrimitiveValue::createIdentifier(CSSValueStroke);
- Ref<CSSValue> markers = CSSPrimitiveValue::createIdentifier(CSSValueMarkers);
+ if (paintOrder == PaintOrderNormal)
+ return CSSPrimitiveValue::createIdentifier(CSSValueNormal);
+ auto paintOrderList = CSSValueList::createSpaceSeparated();
switch (paintOrder) {
case PaintOrderNormal:
- return CSSPrimitiveValue::createIdentifier(CSSValueNormal);
+ ASSERT_NOT_REACHED();
+ break;
case PaintOrderFill:
- paintOrderList->append(WTFMove(fill));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueFill));
break;
case PaintOrderFillMarkers:
- paintOrderList->append(WTFMove(fill));
- paintOrderList->append(WTFMove(markers));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueFill));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers));
break;
case PaintOrderStroke:
- paintOrderList->append(WTFMove(stroke));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke));
break;
case PaintOrderStrokeMarkers:
- paintOrderList->append(WTFMove(stroke));
- paintOrderList->append(WTFMove(markers));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers));
break;
case PaintOrderMarkers:
- paintOrderList->append(WTFMove(markers));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers));
break;
case PaintOrderMarkersStroke:
- paintOrderList->append(WTFMove(markers));
- paintOrderList->append(WTFMove(stroke));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers));
+ paintOrderList->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke));
break;
}
return WTFMove(paintOrderList);
diff --git a/Source/WebCore/css/StyleBuilderConverter.h b/Source/WebCore/css/StyleBuilderConverter.h
index e4c7943..d4950a0 100644
--- a/Source/WebCore/css/StyleBuilderConverter.h
+++ b/Source/WebCore/css/StyleBuilderConverter.h
@@ -294,21 +294,19 @@
inline LengthSize StyleBuilderConverter::convertRadius(StyleResolver& styleResolver, const CSSValue& value)
{
- auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
- Pair* pair = primitiveValue.pairValue();
+ auto* pair = downcast<CSSPrimitiveValue>(value).pairValue();
if (!pair || !pair->first() || !pair->second())
- return LengthSize(Length(0, Fixed), Length(0, Fixed));
+ return { { 0, Fixed }, { 0, Fixed } };
CSSToLengthConversionData conversionData = styleResolver.state().cssToLengthConversionData();
- Length radiusWidth = convertToRadiusLength(conversionData, *pair->first());
- Length radiusHeight = convertToRadiusLength(conversionData, *pair->second());
+ LengthSize radius { convertToRadiusLength(conversionData, *pair->first()), convertToRadiusLength(conversionData, *pair->second()) };
- ASSERT(!radiusWidth.isNegative());
- ASSERT(!radiusHeight.isNegative());
- if (radiusWidth.isZero() || radiusHeight.isZero())
- return LengthSize(Length(0, Fixed), Length(0, Fixed));
+ ASSERT(!radius.width.isNegative());
+ ASSERT(!radius.height.isNegative());
+ if (radius.width.isZero() || radius.height.isZero())
+ return { { 0, Fixed }, { 0, Fixed } };
- return LengthSize(radiusWidth, radiusHeight);
+ return radius;
}
inline Length StyleBuilderConverter::convertTo100PercentMinusLength(const Length& length)
@@ -766,7 +764,7 @@
}
if (isImageShape(value))
- return ShapeValue::create(styleResolver.styleImage(value));
+ return ShapeValue::create(styleResolver.styleImage(value).releaseNonNull());
RefPtr<BasicShape> shape;
CSSBoxType referenceBox = BoxMissing;
@@ -786,7 +784,7 @@
}
if (shape)
- return ShapeValue::create(WTFMove(shape), referenceBox);
+ return ShapeValue::create(shape.releaseNonNull(), referenceBox);
if (referenceBox != BoxMissing)
return ShapeValue::create(referenceBox);
diff --git a/Source/WebCore/css/StyleBuilderCustom.h b/Source/WebCore/css/StyleBuilderCustom.h
index 0ffd9d4..fbfbd82 100644
--- a/Source/WebCore/css/StyleBuilderCustom.h
+++ b/Source/WebCore/css/StyleBuilderCustom.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -58,6 +58,11 @@
static void applyInitial##property(StyleResolver&); \
static void applyValue##property(StyleResolver&, CSSValue&)
+template<typename T> inline T forwardInheritedValue(T&& value) { return std::forward<T>(value); }
+inline Length forwardInheritedValue(const Length& value) { auto copy = value; return copy; }
+inline LengthSize forwardInheritedValue(const LengthSize& value) { auto copy = value; return copy; }
+inline LengthBox forwardInheritedValue(const LengthBox& value) { auto copy = value; return copy; }
+
// Note that we assume the CSS parser only allows valid CSSValue types.
class StyleBuilderCustom {
public:
@@ -301,6 +306,7 @@
}
#if ENABLE(DASHBOARD_SUPPORT)
+
static Length convertToIntLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData)
{
return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(conversionData) : Length(Undefined);
@@ -318,7 +324,7 @@
if (!region)
return;
- DashboardRegion* first = region;
+ auto* first = region;
while (region) {
Length top = convertToIntLength(region->top(), styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
Length right = convertToIntLength(region->right(), styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
@@ -335,17 +341,20 @@
left = Length();
if (region->m_isCircle)
- styleResolver.style()->setDashboardRegion(StyleDashboardRegion::Circle, region->m_label, top, right, bottom, left, region == first ? false : true);
+ styleResolver.style()->setDashboardRegion(StyleDashboardRegion::Circle, region->m_label, WTFMove(top), WTFMove(right), WTFMove(bottom), WTFMove(left), region != first);
else if (region->m_isRectangle)
- styleResolver.style()->setDashboardRegion(StyleDashboardRegion::Rectangle, region->m_label, top, right, bottom, left, region == first ? false : true);
+ styleResolver.style()->setDashboardRegion(StyleDashboardRegion::Rectangle, region->m_label, WTFMove(top), WTFMove(right), WTFMove(bottom), WTFMove(left), region != first);
+
region = region->m_next.get();
}
styleResolver.document().setHasAnnotatedRegions(true);
}
+
#endif // ENABLE(DASHBOARD_SUPPORT)
#if ENABLE(CSS_IMAGE_RESOLUTION)
+
inline void StyleBuilderCustom::applyInheritImageResolution(StyleResolver& styleResolver)
{
styleResolver.style()->setImageResolutionSource(styleResolver.parentStyle()->imageResolutionSource());
@@ -378,18 +387,23 @@
styleResolver.style()->setImageResolutionSnap(snap);
styleResolver.style()->setImageResolution(resolution);
}
+
#endif // ENABLE(CSS_IMAGE_RESOLUTION)
inline void StyleBuilderCustom::applyInheritSize(StyleResolver&) { }
+
inline void StyleBuilderCustom::applyInitialSize(StyleResolver&) { }
+
inline void StyleBuilderCustom::applyValueSize(StyleResolver& styleResolver, CSSValue& value)
{
styleResolver.style()->resetPageSizeType();
+
+ if (!is<CSSValueList>(value))
+ return;
+
Length width;
Length height;
PageSizeType pageSizeType = PAGE_SIZE_AUTO;
- if (!is<CSSValueList>(value))
- return;
auto& valueList = downcast<CSSValueList>(value);
switch (valueList.length()) {
@@ -453,12 +467,12 @@
return;
}
styleResolver.style()->setPageSizeType(pageSizeType);
- styleResolver.style()->setPageSize(LengthSize(width, height));
+ styleResolver.style()->setPageSize({ WTFMove(width), WTFMove(height) });
}
inline void StyleBuilderCustom::applyInheritTextIndent(StyleResolver& styleResolver)
{
- styleResolver.style()->setTextIndent(styleResolver.parentStyle()->textIndent());
+ styleResolver.style()->setTextIndent(Length { styleResolver.parentStyle()->textIndent() });
#if ENABLE(CSS3_TEXT)
styleResolver.style()->setTextIndentLine(styleResolver.parentStyle()->textIndentLine());
styleResolver.style()->setTextIndentType(styleResolver.parentStyle()->textIndentType());
@@ -496,7 +510,7 @@
if (lengthOrPercentageValue.isUndefined())
return;
- styleResolver.style()->setTextIndent(lengthOrPercentageValue);
+ styleResolver.style()->setTextIndent(WTFMove(lengthOrPercentageValue));
#if ENABLE(CSS3_TEXT)
styleResolver.style()->setTextIndentLine(textIndentLineValue);
styleResolver.style()->setTextIndentType(textIndentTypeValue);
@@ -611,8 +625,8 @@
inline void StyleBuilderCustom::applyInheritLineHeight(StyleResolver& styleResolver)
{
- styleResolver.style()->setLineHeight(styleResolver.parentStyle()->lineHeight());
- styleResolver.style()->setSpecifiedLineHeight(styleResolver.parentStyle()->specifiedLineHeight());
+ styleResolver.style()->setLineHeight(Length { styleResolver.parentStyle()->lineHeight() });
+ styleResolver.style()->setSpecifiedLineHeight(Length { styleResolver.parentStyle()->specifiedLineHeight() });
}
inline void StyleBuilderCustom::applyInitialLineHeight(StyleResolver& styleResolver)
@@ -628,8 +642,8 @@
if (!lineHeight)
return;
- styleResolver.style()->setLineHeight(lineHeight.value());
- styleResolver.style()->setSpecifiedLineHeight(lineHeight.value());
+ styleResolver.style()->setLineHeight(Length { lineHeight.value() });
+ styleResolver.style()->setSpecifiedLineHeight(WTFMove(lineHeight.value()));
}
#endif
@@ -665,21 +679,21 @@
auto* parentStyle = styleResolver.parentStyle();
if (!parentStyle->hasClip())
return applyInitialClip(styleResolver);
- styleResolver.style()->setClip(parentStyle->clipTop(), parentStyle->clipRight(), parentStyle->clipBottom(), parentStyle->clipLeft());
+ styleResolver.style()->setClip(Length { parentStyle->clipTop() }, Length { parentStyle->clipRight() },
+ Length { parentStyle->clipBottom() }, Length { parentStyle->clipLeft() });
styleResolver.style()->setHasClip(true);
}
inline void StyleBuilderCustom::applyValueClip(StyleResolver& styleResolver, CSSValue& value)
{
auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
-
- if (Rect* rect = primitiveValue.rectValue()) {
+ if (auto* rect = primitiveValue.rectValue()) {
auto conversionData = styleResolver.state().cssToLengthConversionData();
- Length top = rect->top()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
- Length right = rect->right()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
- Length bottom = rect->bottom()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
- Length left = rect->left()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
- styleResolver.style()->setClip(top, right, bottom, left);
+ auto top = rect->top()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
+ auto right = rect->right()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
+ auto bottom = rect->bottom()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
+ auto left = rect->left()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(conversionData);
+ styleResolver.style()->setClip(WTFMove(top), WTFMove(right), WTFMove(bottom), WTFMove(left));
styleResolver.style()->setHasClip(true);
} else {
ASSERT(primitiveValue.valueID() == CSSValueAuto);
@@ -735,12 +749,12 @@
styleResolver.state().setFontDirty(true);
}
-template <CSSPropertyID id>
+template<CSSPropertyID property>
inline void StyleBuilderCustom::applyTextOrBoxShadowValue(StyleResolver& styleResolver, CSSValue& value)
{
if (is<CSSPrimitiveValue>(value)) {
ASSERT(downcast<CSSPrimitiveValue>(value).valueID() == CSSValueNone);
- if (id == CSSPropertyTextShadow)
+ if (property == CSSPropertyTextShadow)
styleResolver.style()->setTextShadow(nullptr);
else
styleResolver.style()->setBoxShadow(nullptr);
@@ -761,8 +775,8 @@
color = styleResolver.colorFromPrimitiveValue(*shadowValue.color);
else
color = styleResolver.style()->color();
- auto shadowData = std::make_unique<ShadowData>(IntPoint(x, y), blur, spread, shadowStyle, id == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent);
- if (id == CSSPropertyTextShadow)
+ auto shadowData = std::make_unique<ShadowData>(IntPoint(x, y), blur, spread, shadowStyle, property == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent);
+ if (property == CSSPropertyTextShadow)
styleResolver.style()->setTextShadow(WTFMove(shadowData), !isFirstEntry); // add to the list if this is not the first entry
else
styleResolver.style()->setBoxShadow(WTFMove(shadowData), !isFirstEntry); // add to the list if this is not the first entry
@@ -1156,22 +1170,22 @@
inline void StyleBuilderCustom::applyInitialFill(StyleResolver& styleResolver)
{
- SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
+ auto& svgStyle = styleResolver.style()->accessSVGStyle();
svgStyle.setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
}
inline void StyleBuilderCustom::applyInheritFill(StyleResolver& styleResolver)
{
- SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
- const SVGRenderStyle& svgParentStyle = styleResolver.parentStyle()->svgStyle();
+ auto& svgStyle = styleResolver.style()->accessSVGStyle();
+ auto& svgParentStyle = styleResolver.parentStyle()->svgStyle();
svgStyle.setFillPaint(svgParentStyle.fillPaintType(), svgParentStyle.fillPaintColor(), svgParentStyle.fillPaintUri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
}
inline void StyleBuilderCustom::applyValueFill(StyleResolver& styleResolver, CSSValue& value)
{
- SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
- const CSSPrimitiveValue* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr;
+ auto& svgStyle = styleResolver.style()->accessSVGStyle();
+ const auto* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr;
String url;
if (value.isValueList()) {
const CSSValueList& list = downcast<CSSValueList>(value);
@@ -1183,10 +1197,10 @@
return;
Color color;
- SVGPaintType paintType = SVG_PAINTTYPE_RGBCOLOR;
+ auto paintType = SVG_PAINTTYPE_RGBCOLOR;
if (localValue->isURI()) {
paintType = SVG_PAINTTYPE_URI;
- url = downcast<CSSPrimitiveValue>(localValue)->stringValue();
+ url = localValue->stringValue();
} else if (localValue->isValueID() && localValue->valueID() == CSSValueNone)
paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
else if (localValue->isValueID() && localValue->valueID() == CSSValueCurrentcolor) {
@@ -1207,15 +1221,15 @@
inline void StyleBuilderCustom::applyInheritStroke(StyleResolver& styleResolver)
{
- SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
- const SVGRenderStyle& svgParentStyle = styleResolver.parentStyle()->svgStyle();
+ auto& svgStyle = styleResolver.style()->accessSVGStyle();
+ auto& svgParentStyle = styleResolver.parentStyle()->svgStyle();
svgStyle.setStrokePaint(svgParentStyle.strokePaintType(), svgParentStyle.strokePaintColor(), svgParentStyle.strokePaintUri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
}
inline void StyleBuilderCustom::applyValueStroke(StyleResolver& styleResolver, CSSValue& value)
{
- SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
- const CSSPrimitiveValue* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr;
+ auto& svgStyle = styleResolver.style()->accessSVGStyle();
+ const auto* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr;
String url;
if (value.isValueList()) {
const CSSValueList& list = downcast<CSSValueList>(value);
@@ -1227,7 +1241,7 @@
return;
Color color;
- SVGPaintType paintType = SVG_PAINTTYPE_RGBCOLOR;
+ auto paintType = SVG_PAINTTYPE_RGBCOLOR;
if (localValue->isURI()) {
paintType = SVG_PAINTTYPE_URI;
url = downcast<CSSPrimitiveValue>(localValue)->stringValue();
@@ -1258,7 +1272,7 @@
inline void StyleBuilderCustom::applyValueWebkitSvgShadow(StyleResolver& styleResolver, CSSValue& value)
{
- SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
+ auto& svgStyle = styleResolver.style()->accessSVGStyle();
if (is<CSSPrimitiveValue>(value)) {
ASSERT(downcast<CSSPrimitiveValue>(value).valueID() == CSSValueNone);
svgStyle.setShadow(nullptr);
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 00469ee7..3497b2a 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -168,7 +168,7 @@
m_hasUAAppearance = m_style->hasAppearance();
if (m_hasUAAppearance) {
m_borderData = m_style->border();
- m_backgroundData = *m_style->backgroundLayers();
+ m_backgroundData = m_style->backgroundLayers();
m_backgroundColor = m_style->backgroundColor();
}
}
@@ -1328,7 +1328,7 @@
// We can build up the style by copying non-inherited properties from an earlier style object built using the same exact
// style declarations. We then only need to apply the inherited properties, if any, as their values can depend on the
// element context. This is fast and saves memory by reusing the style data structures.
- state.style()->copyNonInheritedFrom(cacheItem->renderStyle.get());
+ state.style()->copyNonInheritedFrom(*cacheItem->renderStyle);
if (state.parentStyle()->inheritedDataShared(cacheItem->parentRenderStyle.get()) && !isAtShadowBoundary(element)) {
EInsideLink linkStatus = state.style()->insideLink();
// If the cache item parent style has identical inherited properties to the current parent style then the
@@ -1661,17 +1661,10 @@
if (isInherit && !CSSProperty::isInheritedProperty(id))
state.style()->setHasExplicitlyInheritedProperties();
- if (id == CSSPropertyCustom) {
- CSSCustomPropertyValue* customProperty = &downcast<CSSCustomPropertyValue>(*valueToApply);
- if (isInherit) {
- RefPtr<CSSCustomPropertyValue> customVal = state.parentStyle()->getCustomPropertyValue(customProperty->name());
- if (!customVal)
- customVal = CSSCustomPropertyValue::createInvalid();
- state.style()->setCustomPropertyValue(customProperty->name(), customVal);
- } else if (isInitial)
- state.style()->setCustomPropertyValue(customProperty->name(), CSSCustomPropertyValue::createInvalid());
- else
- state.style()->setCustomPropertyValue(customProperty->name(), customProperty);
+ if (customPropertyValue) {
+ auto& name = customPropertyValue->name();
+ auto* value = isInitial ? nullptr : isInherit ? state.parentStyle()->customProperties().get(name) : customPropertyValue;
+ state.style()->setCustomPropertyValue(name, value ? makeRef(*value) : CSSCustomPropertyValue::createInvalid());
return;
}
diff --git a/Source/WebCore/css/makeprop.pl b/Source/WebCore/css/makeprop.pl
index 8519855..e617c38 100755
--- a/Source/WebCore/css/makeprop.pl
+++ b/Source/WebCore/css/makeprop.pl
@@ -614,8 +614,8 @@
my $indent = shift;
my $setterContent = "";
- $setterContent .= $indent . "AnimationList& list = styleResolver.style()->" . getEnsureAnimationsOrTransitionsMethod($name) . "();\n";
- $setterContent .= $indent . "const AnimationList* parentList = styleResolver.parentStyle()->" . getAnimationsOrTransitionsMethod($name) . "();\n";
+ $setterContent .= $indent . "auto& list = styleResolver.style()->" . getEnsureAnimationsOrTransitionsMethod($name) . "();\n";
+ $setterContent .= $indent . "auto* parentList = styleResolver.parentStyle()->" . getAnimationsOrTransitionsMethod($name) . "();\n";
$setterContent .= $indent . "size_t i = 0, parentSize = parentList ? parentList->size() : 0;\n";
$setterContent .= $indent . "for ( ; i < parentSize && parentList->animation(i)." . getTestFunction($name) . "(); ++i) {\n";
$setterContent .= $indent . " if (list.size() <= i)\n";
@@ -626,7 +626,7 @@
$setterContent .= $indent . " list.animation(i).setAnimationMode(parentList->animation(i).animationMode());\n";
$setterContent .= $indent . "}\n";
$setterContent .= "\n";
- $setterContent .= $indent . "/* Reset any remaining animations to not have the property set. */\n";
+ $setterContent .= $indent . "// Reset any remaining animations to not have the property set.\n";
$setterContent .= $indent . "for ( ; i < list.size(); ++i)\n";
$setterContent .= $indent . " list.animation(i)." . getClearFunction($name) . "();\n";
@@ -674,11 +674,11 @@
my $setterContent = "";
$setterContent .= $indent . "// Check for (single-layer) no-op before clearing anything.\n";
- $setterContent .= $indent . "const FillLayer& layers = *styleResolver.style()->" . getLayersFunction($name) . "();\n";
+ $setterContent .= $indent . "auto& layers = styleResolver.style()->" . getLayersFunction($name) . "();\n";
$setterContent .= $indent . "if (!layers.next() && (!layers." . $testFunction . "() || layers." . $getter . "() == $initial))\n";
$setterContent .= $indent . " return;\n";
$setterContent .= "\n";
- $setterContent .= $indent . "FillLayer* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
+ $setterContent .= $indent . "auto* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
$setterContent .= $indent . "child->" . $setter . "(" . $initial . ");\n";
$setterContent .= $indent . "for (child = child->next(); child; child = child->next())\n";
$setterContent .= $indent . " child->" . $clearFunction . "();\n";
@@ -697,12 +697,12 @@
my $setterContent = "";
$setterContent .= $indent . "// Check for no-op before copying anything.\n";
- $setterContent .= $indent . "if (*styleResolver.parentStyle()->" . getLayersFunction($name) ."() == *styleResolver.style()->" . getLayersFunction($name) . "())\n";
+ $setterContent .= $indent . "if (styleResolver.parentStyle()->" . getLayersFunction($name) ."() == styleResolver.style()->" . getLayersFunction($name) . "())\n";
$setterContent .= $indent . " return;\n";
$setterContent .= "\n";
$setterContent .= $indent . "auto* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
$setterContent .= $indent . "FillLayer* previousChild = nullptr;\n";
- $setterContent .= $indent . "for (auto* parent = styleResolver.parentStyle()->" . getLayersFunction($name) . "(); parent && parent->" . $testFunction . "(); parent = parent->next()) {\n";
+ $setterContent .= $indent . "for (auto* parent = &styleResolver.parentStyle()->" . getLayersFunction($name) . "(); parent && parent->" . $testFunction . "(); parent = parent->next()) {\n";
$setterContent .= $indent . " if (!child) {\n";
$setterContent .= $indent . " previousChild->setNext(std::make_unique<FillLayer>(" . getFillLayerType($name) . "));\n";
$setterContent .= $indent . " child = previousChild->next();\n";
@@ -724,7 +724,7 @@
my $CSSPropertyId = "CSSProperty" . $nameToId{$name};
my $setterContent = "";
- $setterContent .= $indent . "FillLayer* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
+ $setterContent .= $indent . "auto* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
$setterContent .= $indent . "FillLayer* previousChild = nullptr;\n";
$setterContent .= $indent . "if (is<CSSValueList>(value) && !is<CSSImageSetValue>(value)) {\n";
$setterContent .= $indent . " // Walk each value and put it into a layer, creating new layers as needed.\n";
@@ -830,7 +830,7 @@
}
if (!$didCallSetValue) {
my $inheritedValue = $parentStyle . "->" . ($isSVG ? "svgStyle()." : "") . $getter . "()";
- $setterContent .= $indent . " " . generateSetValueStatement($name, $inheritedValue) . ";\n";
+ $setterContent .= $indent . " " . generateSetValueStatement($name, "forwardInheritedValue(" . $inheritedValue . ")") . ";\n";
}
$setterContent .= $indent . "}\n";
@@ -849,7 +849,7 @@
$convertedValue = "StyleBuilderConverter::convert" . $propertiesWithStyleBuilderOptions{$name}{"converter"} . "(styleResolver, value)";
} elsif (exists($propertiesWithStyleBuilderOptions{$name}{"conditional-converter"})) {
$setterContent .= $indent . " auto convertedValue = StyleBuilderConverter::convert" . $propertiesWithStyleBuilderOptions{$name}{"conditional-converter"} . "(styleResolver, value);\n";
- $convertedValue = "convertedValue.value()";
+ $convertedValue = "WTFMove(convertedValue.value())";
} else {
$convertedValue = "downcast<CSSPrimitiveValue>(value)";
}
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index a506265..29de371 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -2072,7 +2072,7 @@
void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft)
{
updateStyleIfNeeded();
- std::unique_ptr<RenderStyle> style = styleScope().resolver().styleForPage(pageIndex);
+ auto style = styleScope().resolver().styleForPage(pageIndex);
int width = pageSize.width();
int height = pageSize.height();
@@ -2088,11 +2088,11 @@
std::swap(width, height);
break;
case PAGE_SIZE_RESOLVED: {
- LengthSize size = style->pageSize();
- ASSERT(size.width().isFixed());
- ASSERT(size.height().isFixed());
- width = valueForLength(size.width(), 0);
- height = valueForLength(size.height(), 0);
+ auto& size = style->pageSize();
+ ASSERT(size.width.isFixed());
+ ASSERT(size.height.isFixed());
+ width = valueForLength(size.width, 0);
+ height = valueForLength(size.height, 0);
break;
}
default:
diff --git a/Source/WebCore/dom/EventPath.cpp b/Source/WebCore/dom/EventPath.cpp
index c2bdd05..7771281 100644
--- a/Source/WebCore/dom/EventPath.cpp
+++ b/Source/WebCore/dom/EventPath.cpp
@@ -258,23 +258,21 @@
Vector<EventTarget*> EventPath::computePathUnclosedToTarget(const EventTarget& target) const
{
Vector<EventTarget*> path;
- const Node* targetNode = const_cast<EventTarget&>(target).toNode();
+ auto* targetNode = const_cast<EventTarget&>(target).toNode();
if (!targetNode) {
- const DOMWindow* domWindow = const_cast<EventTarget&>(target).toDOMWindow();
+ auto* domWindow = const_cast<EventTarget&>(target).toDOMWindow();
if (!domWindow)
return path;
targetNode = domWindow->document();
ASSERT(targetNode);
}
-
for (auto& context : m_path) {
- if (Node* nodeInPath = context->currentTarget()->toNode()) {
+ if (auto* nodeInPath = context->currentTarget()->toNode()) {
if (!targetNode->isClosedShadowHidden(*nodeInPath))
path.append(context->currentTarget());
} else
path.append(context->currentTarget());
}
-
return path;
}
diff --git a/Source/WebCore/dom/LiveNodeList.h b/Source/WebCore/dom/LiveNodeList.h
index a2e9611..dee646c 100644
--- a/Source/WebCore/dom/LiveNodeList.h
+++ b/Source/WebCore/dom/LiveNodeList.h
@@ -47,7 +47,7 @@
virtual bool isRootedAtDocument() const = 0;
ALWAYS_INLINE NodeListInvalidationType invalidationType() const { return static_cast<NodeListInvalidationType>(m_invalidationType); }
- ContainerNode& ownerNode() const { return const_cast<ContainerNode&>(m_ownerNode.get()); }
+ ContainerNode& ownerNode() const { return m_ownerNode; }
ALWAYS_INLINE void invalidateCacheForAttribute(const QualifiedName* attrName) const
{
if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), *attrName))
diff --git a/Source/WebCore/dom/MessageEvent.cpp b/Source/WebCore/dom/MessageEvent.cpp
index cc1a6a4..5ba37cf 100644
--- a/Source/WebCore/dom/MessageEvent.cpp
+++ b/Source/WebCore/dom/MessageEvent.cpp
@@ -158,8 +158,8 @@
return nullptr;
return WTF::switchOn(m_source.value(),
- [](const RefPtr<DOMWindow>& window) -> EventTarget* { return const_cast<EventTarget*>(static_cast<const EventTarget*>(window.get())); },
- [](const RefPtr<MessagePort>& messagePort) -> EventTarget* { return const_cast<EventTarget*>(static_cast<const EventTarget*>(messagePort.get())); }
+ [] (const RefPtr<DOMWindow>& window) -> EventTarget* { return const_cast<DOMWindow*>(window.get()); },
+ [] (const RefPtr<MessagePort>& messagePort) -> EventTarget* { return const_cast<MessagePort*>(messagePort.get()); }
);
}
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 0c2793d..038e789 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -430,11 +430,10 @@
HashSet<RefPtr<Node>> nodeSet;
for (const auto& variant : vector) {
WTF::switchOn(variant,
- [&](const RefPtr<Node>& node) { nodeSet.add(const_cast<Node*>(node.get())); },
- [](const String&) { }
+ [&] (const RefPtr<Node>& node) { nodeSet.add(const_cast<Node*>(node.get())); },
+ [] (const String&) { }
);
}
-
return nodeSet;
}
diff --git a/Source/WebCore/dom/Range.h b/Source/WebCore/dom/Range.h
index 803f8fe..b9a022d 100644
--- a/Source/WebCore/dom/Range.h
+++ b/Source/WebCore/dom/Range.h
@@ -54,7 +54,7 @@
WEBCORE_EXPORT static Ref<Range> create(Document&, const VisiblePosition&, const VisiblePosition&);
WEBCORE_EXPORT ~Range();
- Document& ownerDocument() const { return const_cast<Document&>(m_ownerDocument.get()); }
+ Document& ownerDocument() const { return m_ownerDocument; }
Node& startContainer() const { ASSERT(m_start.container()); return *m_start.container(); }
unsigned startOffset() const { return m_start.offset(); }
diff --git a/Source/WebCore/dom/RegisteredEventListener.h b/Source/WebCore/dom/RegisteredEventListener.h
index 10b2ad9..2a58a3f 100644
--- a/Source/WebCore/dom/RegisteredEventListener.h
+++ b/Source/WebCore/dom/RegisteredEventListener.h
@@ -48,7 +48,7 @@
return adoptRef(*new RegisteredEventListener(WTFMove(listener), options));
}
- EventListener& callback() const { return const_cast<EventListener&>(m_callback.get()); }
+ EventListener& callback() const { return m_callback; }
bool useCapture() const { return m_useCapture; }
bool isPassive() const { return m_isPassive; }
bool isOnce() const { return m_isOnce; }
diff --git a/Source/WebCore/dom/ScriptRunner.cpp b/Source/WebCore/dom/ScriptRunner.cpp
index 041e6d1..1d52e58 100644
--- a/Source/WebCore/dom/ScriptRunner.cpp
+++ b/Source/WebCore/dom/ScriptRunner.cpp
@@ -52,7 +52,7 @@
}
for (auto& pendingScript : m_pendingAsyncScripts) {
if (pendingScript->watchingForLoad())
- const_cast<PendingScript&>(pendingScript.get()).clearClient();
+ pendingScript->clearClient();
m_document.decrementLoadEventDelayCount();
}
}
diff --git a/Source/WebCore/html/HTMLCollection.h b/Source/WebCore/html/HTMLCollection.h
index 6faad40..480126b 100644
--- a/Source/WebCore/html/HTMLCollection.h
+++ b/Source/WebCore/html/HTMLCollection.h
@@ -187,7 +187,7 @@
inline ContainerNode& HTMLCollection::ownerNode() const
{
- return const_cast<ContainerNode&>(m_ownerNode.get());
+ return m_ownerNode;
}
inline Document& HTMLCollection::document() const
diff --git a/Source/WebCore/html/parser/HTMLStackItem.h b/Source/WebCore/html/parser/HTMLStackItem.h
index ef206f6..9853198 100644
--- a/Source/WebCore/html/parser/HTMLStackItem.h
+++ b/Source/WebCore/html/parser/HTMLStackItem.h
@@ -127,7 +127,7 @@
inline ContainerNode& HTMLStackItem::node() const
{
- return const_cast<ContainerNode&>(m_node.get());
+ return m_node.get();
}
inline Element& HTMLStackItem::element() const
diff --git a/Source/WebCore/inspector/PageScriptDebugServer.cpp b/Source/WebCore/inspector/PageScriptDebugServer.cpp
index 3ac2870..c2e514c 100644
--- a/Source/WebCore/inspector/PageScriptDebugServer.cpp
+++ b/Source/WebCore/inspector/PageScriptDebugServer.cpp
@@ -133,58 +133,44 @@
{
setMainThreadCallbacksPaused(paused);
- for (auto& page : pageGroup.pages())
- setJavaScriptPaused(page, paused);
-}
+ for (auto& page : pageGroup.pages()) {
+ page->setDefersLoading(paused);
-void PageScriptDebugServer::setJavaScriptPaused(Page* page, bool paused)
-{
- ASSERT_ARG(page, page);
+ for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext())
+ setJavaScriptPaused(*frame, paused);
- page->setDefersLoading(paused);
-
- for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext())
- setJavaScriptPaused(frame, paused);
-
- if (InspectorFrontendClient* frontendClient = page->inspectorController().inspectorFrontendClient()) {
- if (paused)
- frontendClient->pagePaused();
- else
- frontendClient->pageUnpaused();
+ if (auto* frontendClient = page->inspectorController().inspectorFrontendClient()) {
+ if (paused)
+ frontendClient->pagePaused();
+ else
+ frontendClient->pageUnpaused();
+ }
}
}
-void PageScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
+void PageScriptDebugServer::setJavaScriptPaused(Frame& frame, bool paused)
{
- ASSERT_ARG(frame, frame);
-
- if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
+ if (!frame.script().canExecuteScripts(NotAboutToExecuteScript))
return;
- frame->script().setPaused(paused);
+ frame.script().setPaused(paused);
- Document* document = frame->document();
+ ASSERT(frame.document());
+ auto& document = *frame.document();
if (paused) {
- document->suspendScriptedAnimationControllerCallbacks();
- document->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
+ document.suspendScriptedAnimationControllerCallbacks();
+ document.suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
} else {
- document->resumeActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
- document->resumeScriptedAnimationControllerCallbacks();
+ document.resumeActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
+ document.resumeScriptedAnimationControllerCallbacks();
}
- setJavaScriptPaused(frame->view(), paused);
-}
-
-void PageScriptDebugServer::setJavaScriptPaused(FrameView* view, bool paused)
-{
- if (!view)
- return;
-
- for (auto& child : view->children()) {
- if (!is<PluginViewBase>(*child))
- continue;
-
- downcast<PluginViewBase>(*child).setJavaScriptPaused(paused);
+ if (auto* view = frame.view()) {
+ for (auto& child : view->children()) {
+ if (!is<PluginViewBase>(child.get()))
+ continue;
+ downcast<PluginViewBase>(child.get()).setJavaScriptPaused(paused);
+ }
}
}
diff --git a/Source/WebCore/inspector/PageScriptDebugServer.h b/Source/WebCore/inspector/PageScriptDebugServer.h
index 3b49791..7f58c6c 100644
--- a/Source/WebCore/inspector/PageScriptDebugServer.h
+++ b/Source/WebCore/inspector/PageScriptDebugServer.h
@@ -31,7 +31,6 @@
namespace WebCore {
class Frame;
-class FrameView;
class Page;
class PageGroup;
@@ -56,9 +55,7 @@
void runEventLoopWhilePausedInternal();
void setJavaScriptPaused(const PageGroup&, bool paused);
- void setJavaScriptPaused(Page*, bool paused);
- void setJavaScriptPaused(Frame*, bool paused);
- void setJavaScriptPaused(FrameView*, bool paused);
+ void setJavaScriptPaused(Frame&, bool paused);
Page& m_page;
};
diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp
index 4e82754..295b94a 100644
--- a/Source/WebCore/loader/HistoryController.cpp
+++ b/Source/WebCore/loader/HistoryController.cpp
@@ -741,7 +741,7 @@
Frame* childFrame = m_frame.tree().child(childFrameName);
ASSERT(childFrame);
- childFrame->loader().history().recursiveSetProvisionalItem(const_cast<HistoryItem&>(childItem.get()), fromChildItem);
+ childFrame->loader().history().recursiveSetProvisionalItem(childItem, fromChildItem);
}
}
@@ -761,7 +761,7 @@
HistoryItem* fromChildItem = fromItem->childItemWithTarget(childFrameName);
ASSERT(fromChildItem);
if (Frame* childFrame = m_frame.tree().child(childFrameName))
- childFrame->loader().history().recursiveGoToItem(const_cast<HistoryItem&>(childItem.get()), fromChildItem, type);
+ childFrame->loader().history().recursiveGoToItem(childItem, fromChildItem, type);
}
}
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index 0bb288e..d5a5106 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -723,31 +723,27 @@
RenderWidget* Frame::ownerRenderer() const
{
- HTMLFrameOwnerElement* ownerElement = m_ownerElement;
+ auto* ownerElement = m_ownerElement;
if (!ownerElement)
return nullptr;
auto* object = ownerElement->renderer();
- if (!object)
- return nullptr;
// FIXME: If <object> is ever fixed to disassociate itself from frames
// that it has started but canceled, then this can turn into an ASSERT
- // since m_ownerElement would be 0 when the load is canceled.
+ // since m_ownerElement would be nullptr when the load is canceled.
// https://bugs.webkit.org/show_bug.cgi?id=18585
- if (!is<RenderWidget>(*object))
+ if (!is<RenderWidget>(object))
return nullptr;
return downcast<RenderWidget>(object);
}
-Frame* Frame::frameForWidget(const Widget* widget)
+Frame* Frame::frameForWidget(const Widget& widget)
{
- ASSERT_ARG(widget, widget);
-
- if (RenderWidget* renderer = RenderWidget::find(widget))
+ if (auto* renderer = RenderWidget::find(widget))
return renderer->frameOwnerElement().document().frame();
// Assume all widgets are either a FrameView or owned by a RenderWidget.
// FIXME: That assumption is not right for scroll bars!
- return &downcast<FrameView>(*widget).frame();
+ return &downcast<FrameView>(widget).frame();
}
void Frame::clearTimers(FrameView *view, Document *document)
diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h
index 6834110..9a8f73c 100644
--- a/Source/WebCore/page/Frame.h
+++ b/Source/WebCore/page/Frame.h
@@ -164,7 +164,7 @@
WEBCORE_EXPORT String layerTreeAsText(LayerTreeFlags = 0) const;
WEBCORE_EXPORT String trackedRepaintRectsAsText() const;
- WEBCORE_EXPORT static Frame* frameForWidget(const Widget*);
+ WEBCORE_EXPORT static Frame* frameForWidget(const Widget&);
Settings& settings() const { return *m_settings; }
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 77075fd..b291236 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -3,7 +3,7 @@
* 1999 Lars Knoll <knoll@kde.org>
* 1999 Antti Koivisto <koivisto@kde.org>
* 2000 Dirk Mueller <mueller@kde.org>
- * Copyright (C) 2004-2008, 2013-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
* (C) 2006 Graham Dennis (graham.dennis@gmail.com)
* (C) 2006 Alexey Proskuryakov (ap@nypop.com)
* Copyright (C) 2009 Google Inc. All rights reserved.
@@ -506,18 +506,17 @@
void FrameView::invalidateRect(const IntRect& rect)
{
if (!parent()) {
- if (HostWindow* window = hostWindow())
- window->invalidateContentsAndRootView(rect);
+ if (auto* page = frame().page())
+ page->chrome().invalidateContentsAndRootView(rect);
return;
}
- RenderWidget* renderer = frame().ownerRenderer();
+ auto* renderer = frame().ownerRenderer();
if (!renderer)
return;
IntRect repaintRect = rect;
- repaintRect.move(renderer->borderLeft() + renderer->paddingLeft(),
- renderer->borderTop() + renderer->paddingTop());
+ repaintRect.move(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
renderer->repaintRectangle(repaintRect);
}
@@ -544,14 +543,16 @@
}
#if ENABLE(REQUEST_ANIMATION_FRAME)
+
bool FrameView::scheduleAnimation()
{
- if (HostWindow* window = hostWindow()) {
- window->scheduleAnimation();
- return true;
- }
- return false;
+ auto* page = frame().page();
+ if (!page)
+ return false;
+ page->chrome().scheduleAnimation();
+ return true;
}
+
#endif
void FrameView::setMarginWidth(LayoutUnit w)
@@ -1056,22 +1057,22 @@
{
// To find the Widget that corresponds with platformWidget we have to do a linear
// search of our child widgets.
- Widget* foundWidget = nullptr;
+ const Widget* foundWidget = nullptr;
for (auto& widget : children()) {
if (widget->platformWidget() != platformWidget)
continue;
- foundWidget = widget.get();
+ foundWidget = widget.ptr();
break;
}
if (!foundWidget)
return nullptr;
- auto* renderWidget = RenderWidget::find(foundWidget);
+ auto* renderWidget = RenderWidget::find(*foundWidget);
if (!renderWidget)
return nullptr;
- RenderLayer* widgetLayer = renderWidget->layer();
+ auto* widgetLayer = renderWidget->layer();
if (!widgetLayer || !widgetLayer->isComposited())
return nullptr;
@@ -2180,11 +2181,11 @@
bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
{
if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty()) {
- hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+ frame().page()->chrome().scroll(scrollDelta, rectToScroll, clipRect);
return true;
}
- const bool isCompositedContentLayer = usesCompositedScrolling();
+ bool isCompositedContentLayer = usesCompositedScrolling();
// Get the rects of the fixed objects visible in the rectToScroll
Region regionToUpdate;
@@ -2220,7 +2221,7 @@
}
// 1) scroll
- hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+ frame().page()->chrome().scroll(scrollDelta, rectToScroll, clipRect);
// 2) update the area of fixed objects that has been invalidated
for (auto& updateRect : regionToUpdate.rects()) {
@@ -2235,7 +2236,7 @@
}
if (clipsRepaints())
updateRect.intersect(rectToScroll);
- hostWindow()->invalidateContentsAndRootView(updateRect);
+ frame().page()->chrome().invalidateContentsAndRootView(updateRect);
}
return true;
@@ -2642,9 +2643,10 @@
HostWindow* FrameView::hostWindow() const
{
- if (Page* page = frame().page())
- return &page->chrome();
- return nullptr;
+ auto* page = frame().page();
+ if (!page)
+ return nullptr;
+ return &page->chrome();
}
void FrameView::addTrackedRepaintRect(const FloatRect& r)
@@ -2784,10 +2786,12 @@
}
#if PLATFORM(IOS)
+
void FrameView::unobscuredContentSizeChanged()
{
adjustTiledBackingScrollability();
}
+
#endif
static LayerFlushThrottleState::Flags determineLayerFlushThrottleState(Page& page)
@@ -4082,8 +4086,6 @@
m_scrollCorner->setStyle(WTFMove(*cornerStyle));
invalidateScrollCorner(cornerRect);
}
-
- ScrollView::updateScrollCorner();
}
void FrameView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
@@ -4157,15 +4159,14 @@
bool FrameView::hasCustomScrollbars() const
{
for (auto& widget : children()) {
- if (is<FrameView>(*widget)) {
- if (downcast<FrameView>(*widget).hasCustomScrollbars())
+ if (is<FrameView>(widget.get())) {
+ if (downcast<FrameView>(widget.get()).hasCustomScrollbars())
return true;
- } else if (is<Scrollbar>(*widget)) {
- if (downcast<Scrollbar>(*widget).isCustomScrollbar())
+ } else if (is<Scrollbar>(widget.get())) {
+ if (downcast<Scrollbar>(widget.get()).isCustomScrollbar())
return true;
}
}
-
return false;
}
@@ -4173,11 +4174,10 @@
{
if (!parent())
return nullptr;
-
- if (Frame* parentFrame = frame().tree().parent())
- return parentFrame->view();
-
- return nullptr;
+ auto* parentFrame = frame().tree().parent();
+ if (!parentFrame)
+ return nullptr;
+ return parentFrame->view();
}
bool FrameView::isInChildFrameWithFrameFlattening() const
@@ -5183,8 +5183,8 @@
// scripts in response to NPP_SetWindow, for example), so we need to keep the Widgets
// alive during enumeration.
for (auto& widget : collectAndProtectWidgets(m_widgetsInRenderTree)) {
- if (RenderWidget* renderWidget = RenderWidget::find(widget.get())) {
- auto ignoreWidgetState = renderWidget->updateWidgetPosition();
+ if (auto* renderer = RenderWidget::find(*widget)) {
+ auto ignoreWidgetState = renderer->updateWidgetPosition();
UNUSED_PARAM(ignoreWidgetState);
}
}
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index 23a7fd1..711b74b 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -4,7 +4,7 @@
(C) 1998, 1999 Torben Weis (weis@kde.org)
(C) 1999 Lars Knoll (knoll@kde.org)
(C) 1999 Antti Koivisto (koivisto@kde.org)
- Copyright (C) 2004-2009, 2014-2016 Apple Inc. All rights reserved.
+ Copyright (C) 2004-2017 Apple Inc. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -74,16 +74,16 @@
virtual ~FrameView();
- HostWindow* hostWindow() const override;
+ HostWindow* hostWindow() const final;
- WEBCORE_EXPORT void invalidateRect(const IntRect&) override;
- void setFrameRect(const IntRect&) override;
+ WEBCORE_EXPORT void invalidateRect(const IntRect&) final;
+ void setFrameRect(const IntRect&) final;
#if ENABLE(REQUEST_ANIMATION_FRAME)
- bool scheduleAnimation() override;
+ bool scheduleAnimation() final;
#endif
- Frame& frame() const { return const_cast<Frame&>(m_frame.get()); }
+ Frame& frame() const { return m_frame; }
WEBCORE_EXPORT RenderView* renderView() const;
@@ -95,15 +95,15 @@
void setMarginWidth(LayoutUnit);
void setMarginHeight(LayoutUnit);
- WEBCORE_EXPORT void setCanHaveScrollbars(bool) override;
+ WEBCORE_EXPORT void setCanHaveScrollbars(bool) final;
WEBCORE_EXPORT void updateCanHaveScrollbars();
- Ref<Scrollbar> createScrollbar(ScrollbarOrientation) override;
+ Ref<Scrollbar> createScrollbar(ScrollbarOrientation) final;
- bool avoidScrollbarCreation() const override;
+ bool avoidScrollbarCreation() const final;
- void setContentsSize(const IntSize&) override;
- void updateContentsSize() override;
+ void setContentsSize(const IntSize&) final;
+ void updateContentsSize() final;
void layout(bool allowSubtree = true);
WEBCORE_EXPORT bool didFirstLayout() const;
@@ -162,7 +162,7 @@
WEBCORE_EXPORT GraphicsLayer* graphicsLayerForPlatformWidget(PlatformWidget);
WEBCORE_EXPORT void scheduleLayerFlushAllowingThrottling();
- WEBCORE_EXPORT TiledBacking* tiledBacking() const override;
+ WEBCORE_EXPORT TiledBacking* tiledBacking() const final;
// In the future when any ScrollableArea can have a node in th ScrollingTree, this should
// become a virtual function on ScrollableArea.
@@ -225,21 +225,21 @@
WEBCORE_EXPORT void setViewportSizeForCSSViewportUnits(IntSize);
IntSize viewportSizeForCSSViewportUnits() const;
- IntRect windowClipRect() const override;
+ IntRect windowClipRect() const final;
WEBCORE_EXPORT IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*, bool clipToLayerContents) const;
- float visibleContentScaleFactor() const override;
+ float visibleContentScaleFactor() const final;
#if USE(COORDINATED_GRAPHICS)
- void setFixedVisibleContentRect(const IntRect&) override;
+ void setFixedVisibleContentRect(const IntRect&) final;
#endif
- WEBCORE_EXPORT void setScrollPosition(const ScrollPosition&) override;
- void updateLayerPositionsAfterScrolling() override;
- void updateCompositingLayersAfterScrolling() override;
- bool requestScrollPositionUpdate(const ScrollPosition&) override;
- bool isRubberBandInProgress() const override;
- WEBCORE_EXPORT ScrollPosition minimumScrollPosition() const override;
- WEBCORE_EXPORT ScrollPosition maximumScrollPosition() const override;
+ WEBCORE_EXPORT void setScrollPosition(const ScrollPosition&) final;
+ void updateLayerPositionsAfterScrolling() final;
+ void updateCompositingLayersAfterScrolling() final;
+ bool requestScrollPositionUpdate(const ScrollPosition&) final;
+ bool isRubberBandInProgress() const final;
+ WEBCORE_EXPORT ScrollPosition minimumScrollPosition() const final;
+ WEBCORE_EXPORT ScrollPosition maximumScrollPosition() const final;
// The scrollOrigin, scrollPosition, minimumScrollPosition and maximumScrollPosition are all affected by frame scale,
// but layoutViewport computations require unscaled scroll positions.
@@ -347,7 +347,7 @@
void addEmbeddedObjectToUpdate(RenderEmbeddedObject&);
void removeEmbeddedObjectToUpdate(RenderEmbeddedObject&);
- WEBCORE_EXPORT void paintContents(GraphicsContext&, const IntRect& dirtyRect) override;
+ WEBCORE_EXPORT void paintContents(GraphicsContext&, const IntRect& dirtyRect) final;
struct PaintingState {
PaintBehavior paintBehavior;
@@ -379,9 +379,9 @@
enum CoordinateSpaceForSnapshot { DocumentCoordinates, ViewCoordinates };
WEBCORE_EXPORT void paintContentsForSnapshot(GraphicsContext&, const IntRect& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapshot);
- void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) override;
- void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect) override;
- void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&) override;
+ void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) final;
+ void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect) final;
+ void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&) final;
WEBCORE_EXPORT Color documentBackgroundColor() const;
@@ -436,10 +436,10 @@
WEBCORE_EXPORT IntPoint convertFromContainingViewToRenderer(const RenderElement*, const IntPoint&) const;
// Override ScrollView methods to do point conversion via renderers, in order to take transforms into account.
- IntRect convertToContainingView(const IntRect&) const override;
- IntRect convertFromContainingView(const IntRect&) const override;
- IntPoint convertToContainingView(const IntPoint&) const override;
- IntPoint convertFromContainingView(const IntPoint&) const override;
+ IntRect convertToContainingView(const IntRect&) const final;
+ IntRect convertFromContainingView(const IntRect&) const final;
+ IntPoint convertToContainingView(const IntPoint&) const final;
+ IntPoint convertFromContainingView(const IntPoint&) const final;
bool isFrameViewScrollCorner(const RenderScrollbarPart& scrollCorner) const { return m_scrollCorner == &scrollCorner; }
@@ -451,20 +451,20 @@
enum class Scrollability { Scrollable, ScrollableOrRubberbandable };
WEBCORE_EXPORT bool isScrollable(Scrollability definitionOfScrollable = Scrollability::Scrollable);
- bool isScrollableOrRubberbandable() override;
- bool hasScrollableOrRubberbandableAncestor() override;
+ bool isScrollableOrRubberbandable() final;
+ bool hasScrollableOrRubberbandableAncestor() final;
enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
- IntPoint lastKnownMousePosition() const override;
- bool isHandlingWheelEvent() const override;
+ IntPoint lastKnownMousePosition() const final;
+ bool isHandlingWheelEvent() const final;
bool shouldSetCursor() const;
// FIXME: Remove this method once plugin loading is decoupled from layout.
void flushAnyPendingPostLayoutTasks();
- bool shouldSuspendScrollAnimations() const override;
+ bool shouldSuspendScrollAnimations() const final;
void scrollbarStyleChanged(ScrollbarStyle, bool forceUpdate) override;
RenderBox* embeddedContentBox() const;
@@ -483,7 +483,7 @@
bool containsScrollableArea(ScrollableArea*) const;
const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.get(); }
- void removeChild(Widget&) override;
+ void removeChild(Widget&) final;
// This function exists for ports that need to handle wheel events manually.
// On Mac WebKit1 the underlying NSScrollView just does the scrolling, but on most other platforms
@@ -501,7 +501,7 @@
const Pagination& pagination() const;
void setPagination(const Pagination&);
- bool inProgrammaticScroll() const override { return m_inProgrammaticScroll; }
+ bool inProgrammaticScroll() const final { return m_inProgrammaticScroll; }
void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; }
#if ENABLE(CSS_DEVICE_ADAPTATION)
@@ -509,8 +509,8 @@
void setInitialViewportSize(const IntSize& size) { m_initialViewportSize = size; }
#endif
- bool isActive() const override;
- bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const override;
+ bool isActive() const final;
+ bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const final;
#if ENABLE(RUBBER_BANDING)
WEBCORE_EXPORT GraphicsLayer* setWantsLayerForTopOverHangArea(bool) const;
@@ -523,20 +523,20 @@
LayoutPoint scrollPositionRespectingCustomFixedPosition() const;
- int headerHeight() const override { return m_headerHeight; }
+ int headerHeight() const final { return m_headerHeight; }
WEBCORE_EXPORT void setHeaderHeight(int);
- int footerHeight() const override { return m_footerHeight; }
+ int footerHeight() const final { return m_footerHeight; }
WEBCORE_EXPORT void setFooterHeight(int);
- WEBCORE_EXPORT float topContentInset(TopContentInsetType = TopContentInsetType::WebCoreContentInset) const override;
+ WEBCORE_EXPORT float topContentInset(TopContentInsetType = TopContentInsetType::WebCoreContentInset) const final;
void topContentInsetDidChange(float newTopContentInset);
void topContentDirectionDidChange();
- WEBCORE_EXPORT void willStartLiveResize() override;
- WEBCORE_EXPORT void willEndLiveResize() override;
+ WEBCORE_EXPORT void willStartLiveResize() final;
+ WEBCORE_EXPORT void willEndLiveResize() final;
- WEBCORE_EXPORT void availableContentSizeChanged(AvailableSizeChangeReason) override;
+ WEBCORE_EXPORT void availableContentSizeChanged(AvailableSizeChangeReason) final;
void adjustTiledBackingScrollability();
@@ -574,29 +574,29 @@
std::optional<FloatRect> viewExposedRect() const { return m_viewExposedRect; }
#if ENABLE(CSS_SCROLL_SNAP)
- void updateSnapOffsets() override;
- bool isScrollSnapInProgress() const override;
+ void updateSnapOffsets() final;
+ bool isScrollSnapInProgress() const final;
void updateScrollingCoordinatorScrollSnapProperties() const;
#endif
- float adjustScrollStepForFixedContent(float step, ScrollbarOrientation, ScrollGranularity) override;
+ float adjustScrollStepForFixedContent(float step, ScrollbarOrientation, ScrollGranularity) final;
void didChangeScrollOffset();
- void show() override;
+ void show() final;
bool shouldPlaceBlockDirectionScrollbarOnLeft() const final;
void didRestoreFromPageCache();
protected:
- bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) override;
- void scrollContentsSlowPath(const IntRect& updateRect) override;
+ bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) final;
+ void scrollContentsSlowPath(const IntRect& updateRect) final;
void repaintSlowRepaintObjects();
- bool isVerticalDocument() const override;
- bool isFlippedDocument() const override;
+ bool isVerticalDocument() const final;
+ bool isFlippedDocument() const final;
private:
explicit FrameView(Frame&);
@@ -617,7 +617,7 @@
bool inPreLayoutStyleUpdate() const { return m_layoutPhase == InPreLayoutStyleUpdate; }
- bool isFrameView() const override { return true; }
+ bool isFrameView() const final { return true; }
friend class RenderWidget;
bool useSlowRepaints(bool considerOverlap = true) const;
@@ -628,9 +628,9 @@
bool shouldUpdateCompositingLayersAfterScrolling() const;
bool flushCompositingStateForThisFrame(const Frame& rootFrameForFlush);
- bool shouldDeferScrollUpdateAfterContentSizeChange() override;
+ bool shouldDeferScrollUpdateAfterContentSizeChange() final;
- void scrollOffsetChangedViaPlatformWidgetImpl(const ScrollOffset& oldOffset, const ScrollOffset& newOffset) override;
+ void scrollOffsetChangedViaPlatformWidgetImpl(const ScrollOffset& oldOffset, const ScrollOffset& newOffset) final;
void applyOverflowToViewport(const RenderElement&, ScrollbarMode& hMode, ScrollbarMode& vMode);
void applyPaginationToViewport();
@@ -651,39 +651,39 @@
void updateLayerFlushThrottling();
WEBCORE_EXPORT void adjustTiledBackingCoverage();
- void repaintContentRectangle(const IntRect&) override;
- void addedOrRemovedScrollbar() override;
+ void repaintContentRectangle(const IntRect&) final;
+ void addedOrRemovedScrollbar() final;
- void delegatesScrollingDidChange() override;
+ void delegatesScrollingDidChange() final;
// ScrollableArea interface
- void invalidateScrollbarRect(Scrollbar&, const IntRect&) override;
- void scrollTo(const ScrollPosition&) override;
- void setVisibleScrollerThumbRect(const IntRect&) override;
- ScrollableArea* enclosingScrollableArea() const override;
- IntRect scrollableAreaBoundingBox(bool* = nullptr) const override;
- bool scrollAnimatorEnabled() const override;
- GraphicsLayer* layerForScrolling() const override;
- GraphicsLayer* layerForHorizontalScrollbar() const override;
- GraphicsLayer* layerForVerticalScrollbar() const override;
- GraphicsLayer* layerForScrollCorner() const override;
+ void invalidateScrollbarRect(Scrollbar&, const IntRect&) final;
+ void scrollTo(const ScrollPosition&) final;
+ void setVisibleScrollerThumbRect(const IntRect&) final;
+ ScrollableArea* enclosingScrollableArea() const final;
+ IntRect scrollableAreaBoundingBox(bool* = nullptr) const final;
+ bool scrollAnimatorEnabled() const final;
+ GraphicsLayer* layerForScrolling() const final;
+ GraphicsLayer* layerForHorizontalScrollbar() const final;
+ GraphicsLayer* layerForVerticalScrollbar() const final;
+ GraphicsLayer* layerForScrollCorner() const final;
#if ENABLE(RUBBER_BANDING)
- GraphicsLayer* layerForOverhangAreas() const override;
+ GraphicsLayer* layerForOverhangAreas() const final;
#endif
- void contentsResized() override;
+ void contentsResized() final;
#if PLATFORM(IOS)
- void unobscuredContentSizeChanged() override;
+ void unobscuredContentSizeChanged() final;
#endif
- bool usesCompositedScrolling() const override;
- bool usesAsyncScrolling() const override;
- bool usesMockScrollAnimator() const override;
- void logMockScrollAnimatorMessage(const String&) const override;
+ bool usesCompositedScrolling() const final;
+ bool usesAsyncScrolling() const final;
+ bool usesMockScrollAnimator() const final;
+ void logMockScrollAnimatorMessage(const String&) const final;
// Override scrollbar notifications to update the AXObject cache.
- void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override;
- void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override;
+ void didAddScrollbar(Scrollbar*, ScrollbarOrientation) final;
+ void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) final;
IntSize sizeForResizeEvent() const;
void sendResizeEventIfNeeded();
@@ -693,7 +693,7 @@
void updateScrollableAreaSet();
void updateLayoutViewport();
- void notifyPageThatContentAreaWillPaint() const override;
+ void notifyPageThatContentAreaWillPaint() const final;
void enableSpeculativeTilingIfNeeded();
void speculativeTilingEnableTimerFired();
@@ -708,7 +708,7 @@
bool hasCustomScrollbars() const;
- void updateScrollCorner() override;
+ void updateScrollCorner() final;
FrameView* parentFrameView() const;
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
index daf88fb..4d272c9 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
@@ -1392,18 +1392,15 @@
Vector<Ref<PluginViewBase>> Page::pluginViews()
{
Vector<Ref<PluginViewBase>> views;
-
for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
- FrameView* view = frame->view();
+ auto* view = frame->view();
if (!view)
break;
-
for (auto& widget : view->children()) {
- if (is<PluginViewBase>(*widget))
- views.append(downcast<PluginViewBase>(*widget));
+ if (is<PluginViewBase>(widget.get()))
+ views.append(downcast<PluginViewBase>(widget.get()));
}
}
-
return views;
}
diff --git a/Source/WebCore/page/PrintContext.cpp b/Source/WebCore/page/PrintContext.cpp
index 4430546..67ce317 100644
--- a/Source/WebCore/page/PrintContext.cpp
+++ b/Source/WebCore/page/PrintContext.cpp
@@ -286,16 +286,19 @@
String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pageNumber)
{
- Document* document = frame->document();
+ ASSERT(frame);
+ ASSERT(frame->document());
+
+ auto& document = *frame->document();
PrintContext printContext(frame);
printContext.begin(800); // Any width is OK here.
- document->updateLayout();
- std::unique_ptr<RenderStyle> style = document->styleScope().resolver().styleForPage(pageNumber);
+ document.updateLayout();
+ auto style = document.styleScope().resolver().styleForPage(pageNumber);
// Implement formatters for properties we care about.
if (!strcmp(propertyName, "margin-left")) {
if (style->marginLeft().isAuto())
- return String("auto");
+ return ASCIILiteral { "auto" };
return String::number(style->marginLeft().value());
}
if (!strcmp(propertyName, "line-height"))
@@ -305,9 +308,9 @@
if (!strcmp(propertyName, "font-family"))
return style->fontDescription().firstFamily();
if (!strcmp(propertyName, "size"))
- return String::number(style->pageSize().width().value()) + ' ' + String::number(style->pageSize().height().value());
+ return String::number(style->pageSize().width.value()) + ' ' + String::number(style->pageSize().height.value());
- return String("pageProperty() unimplemented for: ") + propertyName;
+ return makeString("pageProperty() unimplemented for: ", propertyName);
}
bool PrintContext::isPageBoxVisible(Frame* frame, int pageNumber)
diff --git a/Source/WebCore/page/animation/AnimationBase.cpp b/Source/WebCore/page/animation/AnimationBase.cpp
index 1c47e3d..76e80c0 100644
--- a/Source/WebCore/page/animation/AnimationBase.cpp
+++ b/Source/WebCore/page/animation/AnimationBase.cpp
@@ -494,7 +494,7 @@
if (m_animation->trigger() && m_animation->trigger()->isScrollAnimationTrigger()) {
if (m_object) {
float offset = m_compositeAnimation->animationController().scrollPosition();
- ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger().get());
+ auto& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger());
if (offset > scrollTrigger.startValue().value())
updateStateMachine(AnimationStateInput::StartTimerFired, 0);
}
@@ -577,7 +577,7 @@
if (m_animation->trigger()->isScrollAnimationTrigger()) {
if (m_object) {
float currentScrollPosition = m_object->view().frameView().scrollPositionForFixedPosition().y().toFloat();
- ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger().get());
+ auto& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger());
if (currentScrollPosition >= scrollTrigger.startValue().value() && (!scrollTrigger.hasEndValue() || currentScrollPosition <= scrollTrigger.endValue().value()))
return 0;
}
@@ -653,7 +653,7 @@
}
if (!timingFunction)
- timingFunction = m_animation->timingFunction().get();
+ timingFunction = m_animation->timingFunction();
switch (timingFunction->type()) {
case TimingFunction::CubicBezierFunction: {
@@ -743,7 +743,7 @@
{
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
if (m_animation->trigger() && m_animation->trigger()->isScrollAnimationTrigger()) {
- ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger().get());
+ auto& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger());
if (scrollTrigger.hasEndValue() && m_object) {
float offset = m_compositeAnimation->animationController().scrollPosition();
float startValue = scrollTrigger.startValue().value();
diff --git a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
index 2d89404..9f6b917 100644
--- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
+++ b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
@@ -90,8 +90,7 @@
static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress)
{
- return LengthSize(blendFunc(anim, from.width(), to.width(), progress),
- blendFunc(anim, from.height(), to.height(), progress));
+ return { blendFunc(anim, from.width, to.width, progress), blendFunc(anim, from.height, to.height, progress) };
}
static inline ShadowStyle blendFunc(const AnimationBase* anim, ShadowStyle from, ShadowStyle to, double progress)
@@ -492,7 +491,7 @@
class LengthPropertyWrapper : public PropertyWrapperGetter<const T&> {
WTF_MAKE_FAST_ALLOCATED;
public:
- LengthPropertyWrapper(CSSPropertyID prop, const T& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(T))
+ LengthPropertyWrapper(CSSPropertyID prop, const T& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(T&&))
: PropertyWrapperGetter<const T&>(prop, getter)
, m_setter(setter)
{
@@ -504,7 +503,7 @@
}
protected:
- void (RenderStyle::*m_setter)(T);
+ void (RenderStyle::*m_setter)(T&&);
};
class PropertyWrapperClipPath : public RefCountedPropertyWrapper<ClipPathOperation> {
@@ -1049,7 +1048,7 @@
class FillLayersPropertyWrapper : public AnimationPropertyWrapperBase {
WTF_MAKE_FAST_ALLOCATED;
public:
- typedef const FillLayer* (RenderStyle::*LayersGetter)() const;
+ typedef const FillLayer& (RenderStyle::*LayersGetter)() const;
typedef FillLayer& (RenderStyle::*LayersAccessor)();
FillLayersPropertyWrapper(CSSPropertyID prop, LayersGetter getter, LayersAccessor accessor)
@@ -1086,8 +1085,8 @@
if (!a || !b)
return false;
- const FillLayer* fromLayer = (a->*m_layersGetter)();
- const FillLayer* toLayer = (b->*m_layersGetter)();
+ auto* fromLayer = &(a->*m_layersGetter)();
+ auto* toLayer = &(b->*m_layersGetter)();
while (fromLayer && toLayer) {
if (!m_fillLayerPropertyWrapper->equals(fromLayer, toLayer))
@@ -1102,9 +1101,9 @@
void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
- const FillLayer* aLayer = (a->*m_layersGetter)();
- const FillLayer* bLayer = (b->*m_layersGetter)();
- FillLayer* dstLayer = &(dst->*m_layersAccessor)();
+ auto* aLayer = &(a->*m_layersGetter)();
+ auto* bLayer = &(b->*m_layersGetter)();
+ auto* dstLayer = &(dst->*m_layersAccessor)();
while (aLayer && bLayer && dstLayer) {
m_fillLayerPropertyWrapper->blend(anim, dstLayer, aLayer, bLayer, progress);
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
index ed96ab1..22bde46 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
@@ -99,28 +99,28 @@
EventTrackingRegions ScrollingCoordinator::absoluteEventTrackingRegionsForFrame(const Frame& frame) const
{
- RenderView* renderView = frame.contentRenderer();
+ auto* renderView = frame.contentRenderer();
if (!renderView || renderView->documentBeingDestroyed())
return EventTrackingRegions();
#if ENABLE(IOS_TOUCH_EVENTS)
// On iOS, we use nonFastScrollableRegion to represent the region covered by elements with touch event handlers.
ASSERT(frame.isMainFrame());
-
- Document* document = frame.document();
+ auto* document = frame.document();
if (!document)
return EventTrackingRegions();
return document->eventTrackingRegions();
#else
- Region nonFastScrollableRegion;
- FrameView* frameView = frame.view();
+ auto* frameView = frame.view();
if (!frameView)
return EventTrackingRegions();
+ Region nonFastScrollableRegion;
+
// FIXME: should ASSERT(!frameView->needsLayout()) here, but need to fix DebugPageOverlays
// to not ask for regions at bad times.
- if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) {
+ if (auto* scrollableAreas = frameView->scrollableAreas()) {
for (auto& scrollableArea : *scrollableAreas) {
// Composited scrollable areas can be scrolled off the main thread.
if (scrollableArea->usesAsyncScrolling())
@@ -136,18 +136,21 @@
}
for (auto& widget : frameView->widgetsInRenderTree()) {
- RenderWidget* renderWidget = RenderWidget::find(widget);
- if (!renderWidget || !is<PluginViewBase>(*widget))
+ if (!is<PluginViewBase>(*widget))
continue;
-
- if (downcast<PluginViewBase>(*widget).wantsWheelEvents())
- nonFastScrollableRegion.unite(renderWidget->absoluteBoundingBoxRect());
+ if (!downcast<PluginViewBase>(*widget).wantsWheelEvents())
+ continue;
+ auto* renderWidget = RenderWidget::find(*widget);
+ if (!renderWidget)
+ continue;
+ nonFastScrollableRegion.unite(renderWidget->absoluteBoundingBoxRect());
}
- // FIXME: if we've already accounted for this subframe as a scrollable area, we can avoid recursing into it here.
EventTrackingRegions eventTrackingRegions;
+
+ // FIXME: if we've already accounted for this subframe as a scrollable area, we can avoid recursing into it here.
for (Frame* subframe = frame.tree().firstChild(); subframe; subframe = subframe->tree().nextSibling()) {
- FrameView* subframeView = subframe->view();
+ auto* subframeView = subframe->view();
if (!subframeView)
continue;
@@ -160,7 +163,7 @@
eventTrackingRegions.unite(subframeRegion);
}
- Document::RegionFixedPair wheelHandlerRegion = frame.document()->absoluteRegionForEventTargets(frame.document()->wheelEventTargets());
+ auto wheelHandlerRegion = frame.document()->absoluteRegionForEventTargets(frame.document()->wheelEventTargets());
bool wheelHandlerInFixedContent = wheelHandlerRegion.second;
if (wheelHandlerInFixedContent) {
// FIXME: need to handle position:sticky here too.
@@ -172,6 +175,7 @@
// FIXME: If this is not the main frame, we could clip the region to the frame's bounds.
eventTrackingRegions.uniteSynchronousRegion(eventNames().wheelEvent, nonFastScrollableRegion);
+
return eventTrackingRegions;
#endif
}
diff --git a/Source/WebCore/platform/KeyedCoding.h b/Source/WebCore/platform/KeyedCoding.h
index 9e70e9d..b11164f 100644
--- a/Source/WebCore/platform/KeyedCoding.h
+++ b/Source/WebCore/platform/KeyedCoding.h
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KeyedCoding_h
-#define KeyedCoding_h
+#pragma once
#include <functional>
#include <wtf/Forward.h>
@@ -156,7 +155,7 @@
virtual void encodeDouble(const String& key, double) = 0;
virtual void encodeString(const String& key, const String&) = 0;
- virtual PassRefPtr<SharedBuffer> finishEncoding() = 0;
+ virtual RefPtr<SharedBuffer> finishEncoding() = 0;
template<typename T>
void encodeEnum(const String& key, T value)
@@ -211,5 +210,3 @@
};
} // namespace WebCore
-
-#endif // KeyedCoding_h
diff --git a/Source/WebCore/platform/LengthBox.h b/Source/WebCore/platform/LengthBox.h
index e7a978a..3e0f218 100644
--- a/Source/WebCore/platform/LengthBox.h
+++ b/Source/WebCore/platform/LengthBox.h
@@ -19,8 +19,7 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef LengthBox_h
-#define LengthBox_h
+#pragma once
#include "Length.h"
#include "WritingMode.h"
@@ -31,12 +30,17 @@
template<typename T> class BoxExtent {
public:
BoxExtent()
- : m_sides({{ T(0), T(0), T(0), T(0) }})
+ : m_sides({ { { 0 }, { 0 }, { 0 }, { 0 } } })
{
}
BoxExtent(const T& top, const T& right, const T& bottom, const T& left)
- : m_sides({{ top, right, bottom, left }})
+ : m_sides({ { top, right, bottom, left } })
+ {
+ }
+
+ BoxExtent(T&& top, T&& right, T&& bottom, T&& left)
+ : m_sides({ { std::forward<T>(top), std::forward<T>(right), std::forward<T>(bottom), std::forward<T>(left) } })
{
}
@@ -139,8 +143,8 @@
{
}
- LengthBox(const Length& top, const Length& right, const Length& bottom, const Length& left)
- : BoxExtent(top, right, bottom, left)
+ LengthBox(Length&& top, Length&& right, Length&& bottom, Length&& left)
+ : BoxExtent { WTFMove(top), WTFMove(right), WTFMove(bottom), WTFMove(left) }
{
}
@@ -150,11 +154,9 @@
}
};
-typedef BoxExtent<LayoutUnit> LayoutBoxExtent;
-typedef BoxExtent<float> FloatBoxExtent;
+using LayoutBoxExtent = BoxExtent<LayoutUnit>;
+using FloatBoxExtent = BoxExtent<float>;
TextStream& operator<<(TextStream&, const LengthBox&);
} // namespace WebCore
-
-#endif // LengthBox_h
diff --git a/Source/WebCore/platform/LengthSize.cpp b/Source/WebCore/platform/LengthSize.cpp
index 16839cc..7f350e7 100644
--- a/Source/WebCore/platform/LengthSize.cpp
+++ b/Source/WebCore/platform/LengthSize.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,7 +32,7 @@
TextStream& operator<<(TextStream& ts, const LengthSize& size)
{
- return ts << size.width() << " " << size.height();
+ return ts << size.width << " " << size.height;
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/LengthSize.h b/Source/WebCore/platform/LengthSize.h
index d713e18..60523ee 100644
--- a/Source/WebCore/platform/LengthSize.h
+++ b/Source/WebCore/platform/LengthSize.h
@@ -1,6 +1,5 @@
/*
- Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ Copyright (C) 2006-2017 Apple Inc. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -18,48 +17,27 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef LengthSize_h
-#define LengthSize_h
+#pragma once
#include "Length.h"
namespace WebCore {
struct LengthSize {
-public:
- LengthSize()
- {
- }
-
- LengthSize(Length width, Length height)
- : m_width(WTFMove(width))
- , m_height(WTFMove(height))
- {
- }
-
- bool operator==(const LengthSize& o) const
- {
- return m_width == o.m_width && m_height == o.m_height;
- }
-
- void setWidth(Length width) { m_width = WTFMove(width); }
- const Length& width() const { return m_width; }
-
- void setHeight(Length height) { m_height = WTFMove(height); }
- const Length& height() const { return m_height; }
-
-private:
- Length m_width;
- Length m_height;
+ Length width;
+ Length height;
};
+inline bool operator==(const LengthSize& a, const LengthSize& b)
+{
+ return a.width == b.width && a.height == b.height;
+}
+
inline LengthSize blend(const LengthSize& from, const LengthSize& to, double progress)
{
- return LengthSize(blend(from.width(), to.width(), progress), blend(from.height(), to.height(), progress));
+ return { blend(from.width, to.width, progress), blend(from.height, to.height, progress) };
}
TextStream& operator<<(TextStream&, const LengthSize&);
} // namespace WebCore
-
-#endif // LengthSize_h
diff --git a/Source/WebCore/platform/PlatformSpeechSynthesis.h b/Source/WebCore/platform/PlatformSpeechSynthesis.h
deleted file mode 100644
index 1434001..0000000
--- a/Source/WebCore/platform/PlatformSpeechSynthesis.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PlatformSpeechSynthesis_h
-#define PlatformSpeechSynthesis_h
-
-#if ENABLE(SPEECH_SYNTHESIS)
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class SpeechSynthesis;
-class SpeechSynthesisUtterance;
-class SpeechSynthesisVoice;
-
-class PlatformSpeechSynthesis : public RefCounted<PlatformSpeechSynthesis> {
-public:
- static PassRefPtr<PlatformSpeechSynthesis> create(SpeechSynthesis*);
-
- void platformInitializeVoiceList(Vector<RefPtr<SpeechSynthesisVoice> >&);
- void platformSpeak(SpeechSynthesisUtterance*);
-
-private:
- PlatformSpeechSynthesis(SpeechSynthesis*);
-
- SpeechSynthesis* m_speechSynthesis;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SPEECH_SYNTHESIS)
-
-#endif // PlatformSpeechSynthesis_h
diff --git a/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.cpp b/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.cpp
index 1f207f4..10a830e 100644
--- a/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.cpp
+++ b/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,16 +30,13 @@
namespace WebCore {
-PassRefPtr<PlatformSpeechSynthesisUtterance> PlatformSpeechSynthesisUtterance::create(PlatformSpeechSynthesisUtteranceClient* client)
+Ref<PlatformSpeechSynthesisUtterance> PlatformSpeechSynthesisUtterance::create(PlatformSpeechSynthesisUtteranceClient& client)
{
- return adoptRef(new PlatformSpeechSynthesisUtterance(client));
+ return adoptRef(*new PlatformSpeechSynthesisUtterance(client));
}
-PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient* client)
- : m_client(client)
- , m_volume(1.0f)
- , m_rate(1.0f)
- , m_pitch(1.0f)
+inline PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient& client)
+ : m_client(&client)
{
}
diff --git a/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.h b/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.h
index a869bb8..e08775b 100644
--- a/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.h
+++ b/Source/WebCore/platform/PlatformSpeechSynthesisUtterance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,29 +23,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PlatformSpeechSynthesisUtterance_h
-#define PlatformSpeechSynthesisUtterance_h
+#pragma once
#if ENABLE(SPEECH_SYNTHESIS)
#include "PlatformSpeechSynthesisVoice.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
namespace WebCore {
class PlatformSpeechSynthesisUtteranceClient {
-public:
- // Implement methods as needed.
-protected:
- virtual ~PlatformSpeechSynthesisUtteranceClient() { }
};
class PlatformSpeechSynthesisUtterance : public RefCounted<PlatformSpeechSynthesisUtterance> {
public:
- static PassRefPtr<PlatformSpeechSynthesisUtterance> create(PlatformSpeechSynthesisUtteranceClient*);
-
+ static Ref<PlatformSpeechSynthesisUtterance> create(PlatformSpeechSynthesisUtteranceClient&);
+
const String& text() const { return m_text; }
void setText(const String& text) { m_text = text; }
@@ -74,20 +66,18 @@
void setClient(PlatformSpeechSynthesisUtteranceClient* client) { m_client = client; }
private:
- explicit PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient*);
+ explicit PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient&);
PlatformSpeechSynthesisUtteranceClient* m_client;
String m_text;
String m_lang;
RefPtr<PlatformSpeechSynthesisVoice> m_voice;
- float m_volume;
- float m_rate;
- float m_pitch;
- double m_startTime;
+ float m_volume { 1 };
+ float m_rate { 1 };
+ float m_pitch { 1 };
+ double m_startTime { 0 };
};
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
-
-#endif // PlatformSpeechSynthesisUtterance_h
diff --git a/Source/WebCore/platform/PlatformSpeechSynthesisVoice.cpp b/Source/WebCore/platform/PlatformSpeechSynthesisVoice.cpp
index 580f19d..24376cd 100644
--- a/Source/WebCore/platform/PlatformSpeechSynthesisVoice.cpp
+++ b/Source/WebCore/platform/PlatformSpeechSynthesisVoice.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,17 +30,17 @@
namespace WebCore {
-PassRefPtr<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
+Ref<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
{
- return adoptRef(new PlatformSpeechSynthesisVoice(voiceURI, name, lang, localService, isDefault));
+ return adoptRef(*new PlatformSpeechSynthesisVoice(voiceURI, name, lang, localService, isDefault));
}
-PassRefPtr<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create()
+Ref<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create()
{
- return adoptRef(new PlatformSpeechSynthesisVoice());
+ return adoptRef(*new PlatformSpeechSynthesisVoice);
}
-
-PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
+
+inline PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
: m_voiceURI(voiceURI)
, m_name(name)
, m_lang(lang)
@@ -49,12 +49,6 @@
{
}
-PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice()
- : m_localService(false)
- , m_default(false)
-{
-}
-
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
diff --git a/Source/WebCore/platform/PlatformSpeechSynthesisVoice.h b/Source/WebCore/platform/PlatformSpeechSynthesisVoice.h
index 343b9e7..0158b34 100644
--- a/Source/WebCore/platform/PlatformSpeechSynthesisVoice.h
+++ b/Source/WebCore/platform/PlatformSpeechSynthesisVoice.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,21 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PlatformSpeechSynthesisVoice_h
-#define PlatformSpeechSynthesisVoice_h
+#pragma once
#if ENABLE(SPEECH_SYNTHESIS)
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class PlatformSpeechSynthesisVoice : public RefCounted<PlatformSpeechSynthesisVoice> {
public:
- WEBCORE_EXPORT static PassRefPtr<PlatformSpeechSynthesisVoice> create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault);
- static PassRefPtr<PlatformSpeechSynthesisVoice> create();
+ WEBCORE_EXPORT static Ref<PlatformSpeechSynthesisVoice> create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault);
+ static Ref<PlatformSpeechSynthesisVoice> create();
const String& voiceURI() const { return m_voiceURI; }
void setVoiceURI(const String& voiceURI) { m_voiceURI = voiceURI; }
@@ -56,17 +53,15 @@
private:
PlatformSpeechSynthesisVoice(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault);
- PlatformSpeechSynthesisVoice();
+ PlatformSpeechSynthesisVoice() = default;
String m_voiceURI;
String m_name;
String m_lang;
- bool m_localService;
- bool m_default;
+ bool m_localService { false };
+ bool m_default { false };
};
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
-
-#endif // PlatformSpeechSynthesisVoice_h
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index cbffe6e..b89d566 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2014-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -62,14 +62,14 @@
{
}
-void ScrollView::addChild(PassRefPtr<Widget> prpChild)
+void ScrollView::addChild(Widget& child)
{
- Widget* child = prpChild.get();
- ASSERT(child != this && !child->parent());
- child->setParent(this);
- m_children.add(prpChild);
- if (child->platformWidget())
- platformAddChild(child);
+ ASSERT(&child != this);
+ ASSERT(!child.parent());
+ child.setParent(this);
+ m_children.add(child);
+ if (child.platformWidget())
+ platformAddChild(&child);
}
void ScrollView::removeChild(Widget& child)
@@ -97,7 +97,7 @@
if (hasBar && !scrollbar) {
scrollbar = createScrollbar(orientation);
- addChild(scrollbar.get());
+ addChild(*scrollbar);
didAddScrollbar(scrollbar.get(), orientation);
scrollbar->styleChanged();
if (contentSizeAffected)
@@ -829,12 +829,6 @@
window->invalidateRootView(IntRect());
}
-bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
-{
- hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
- return true;
-}
-
void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
{
hostWindow()->invalidateContentsForSlowScroll(updateRect);
@@ -1038,17 +1032,14 @@
{
if (platformWidget())
return;
-
- HashSet<RefPtr<Widget>>::const_iterator end = m_children.end();
- for (HashSet<RefPtr<Widget>>::const_iterator current = m_children.begin(); current != end; ++current)
- (*current)->frameRectsChanged();
+ for (auto& child : m_children)
+ child->frameRectsChanged();
}
void ScrollView::clipRectChanged()
{
- HashSet<RefPtr<Widget>>::const_iterator end = m_children.end();
- for (HashSet<RefPtr<Widget>>::const_iterator current = m_children.begin(); current != end; ++current)
- (*current)->clipRectChanged();
+ for (auto& child : m_children)
+ child->clipRectChanged();
}
static void positionScrollbarLayer(GraphicsLayer* graphicsLayer, Scrollbar* scrollbar)
@@ -1150,10 +1141,6 @@
positionScrollbarLayers();
}
-void ScrollView::updateScrollCorner()
-{
-}
-
void ScrollView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
{
ScrollbarTheme::theme().paintScrollCorner(this, context, cornerRect);
@@ -1392,9 +1379,8 @@
if (!isSelfVisible())
return;
- HashSet<RefPtr<Widget>>::iterator end = m_children.end();
- for (HashSet<RefPtr<Widget>>::iterator it = m_children.begin(); it != end; ++it)
- (*it)->setParentVisible(visible);
+ for (auto& child : m_children)
+ child->setParentVisible(visible);
}
void ScrollView::show()
@@ -1402,9 +1388,8 @@
if (!isSelfVisible()) {
setSelfVisible(true);
if (isParentVisible()) {
- HashSet<RefPtr<Widget>>::iterator end = m_children.end();
- for (HashSet<RefPtr<Widget>>::iterator it = m_children.begin(); it != end; ++it)
- (*it)->setParentVisible(true);
+ for (auto& child : m_children)
+ child->setParentVisible(true);
}
}
@@ -1415,9 +1400,8 @@
{
if (isSelfVisible()) {
if (isParentVisible()) {
- HashSet<RefPtr<Widget>>::iterator end = m_children.end();
- for (HashSet<RefPtr<Widget>>::iterator it = m_children.begin(); it != end; ++it)
- (*it)->setParentVisible(false);
+ for (auto& child : m_children)
+ child->setParentVisible(false);
}
setSelfVisible(false);
}
diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h
index db570dd..6b31f98 100644
--- a/Source/WebCore/platform/ScrollView.h
+++ b/Source/WebCore/platform/ScrollView.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006, 2007, 2008, 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
* Copyright (C) 2009 Holger Hans Peter Freyther
*
* Redistribution and use in source and binary forms, with or without
@@ -32,10 +32,10 @@
#include "ScrollableArea.h"
#include "ScrollTypes.h"
#include "Widget.h"
-
#include <wtf/HashSet.h>
#if PLATFORM(IOS)
+
OBJC_CLASS WAKScrollView;
OBJC_CLASS WAKView;
@@ -46,6 +46,7 @@
#ifndef NSView
#define NSView WAKView
#endif
+
#endif // PLATFORM(IOS)
#if PLATFORM(COCOA) && defined __OBJC__
@@ -64,10 +65,10 @@
virtual ~ScrollView();
// ScrollableArea functions.
- int scrollSize(ScrollbarOrientation) const override;
- int scrollOffset(ScrollbarOrientation) const override;
- WEBCORE_EXPORT void setScrollOffset(const ScrollOffset&) override;
- bool isScrollCornerVisible() const override;
+ int scrollSize(ScrollbarOrientation) const final;
+ int scrollOffset(ScrollbarOrientation) const final;
+ WEBCORE_EXPORT void setScrollOffset(const ScrollOffset&) final;
+ bool isScrollCornerVisible() const final;
void scrollbarStyleChanged(ScrollbarStyle, bool forceUpdate) override;
virtual void notifyPageThatContentAreaWillPaint() const;
@@ -85,14 +86,14 @@
virtual IntRect windowClipRect() const = 0;
// Functions for child manipulation and inspection.
- const HashSet<RefPtr<Widget>>& children() const { return m_children; }
- WEBCORE_EXPORT virtual void addChild(PassRefPtr<Widget>);
+ const HashSet<Ref<Widget>>& children() const { return m_children; }
+ WEBCORE_EXPORT void addChild(Widget&);
virtual void removeChild(Widget&);
// If the scroll view does not use a native widget, then it will have cross-platform Scrollbars. These functions
// can be used to obtain those scrollbars.
- Scrollbar* horizontalScrollbar() const override { return m_horizontalScrollbar.get(); }
- Scrollbar* verticalScrollbar() const override { return m_verticalScrollbar.get(); }
+ Scrollbar* horizontalScrollbar() const final { return m_horizontalScrollbar.get(); }
+ Scrollbar* verticalScrollbar() const final { return m_verticalScrollbar.get(); }
bool isScrollViewScrollbar(const Widget* child) const { return horizontalScrollbar() == child || verticalScrollbar() == child; }
void positionScrollbarLayers();
@@ -121,7 +122,7 @@
virtual bool avoidScrollbarCreation() const { return false; }
- void setScrollbarOverlayStyle(ScrollbarOverlayStyle) override;
+ void setScrollbarOverlayStyle(ScrollbarOverlayStyle) final;
// By default you only receive paint events for the area that is visible. In the case of using a
// tiled backing store, this function can be set, so that the view paints the entire contents.
@@ -167,7 +168,7 @@
// In the situation the client is responsible for the scrolling (ie. with a tiled backing store) it is possible to use
// the setFixedVisibleContentRect instead for the mainframe, though this must be updated manually, e.g just before resuming the page
// which usually will happen when panning, pinching and rotation ends, or when scale or position are changed manually.
- IntSize visibleSize() const override { return visibleContentRect(LegacyIOSDocumentVisibleRect).size(); }
+ IntSize visibleSize() const final { return visibleContentRect(LegacyIOSDocumentVisibleRect).size(); }
#if USE(COORDINATED_GRAPHICS)
virtual void setFixedVisibleContentRect(const IntRect& visibleContentRect) { m_fixedVisibleContentRect = visibleContentRect; }
@@ -217,13 +218,13 @@
// Functions for getting/setting the size of the document contained inside the ScrollView (as an IntSize or as individual width and height
// values).
- WEBCORE_EXPORT IntSize contentsSize() const override; // Always at least as big as the visibleWidth()/visibleHeight().
+ WEBCORE_EXPORT IntSize contentsSize() const final; // Always at least as big as the visibleWidth()/visibleHeight().
int contentsWidth() const { return contentsSize().width(); }
int contentsHeight() const { return contentsSize().height(); }
virtual void setContentsSize(const IntSize&);
// Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values).
- ScrollPosition scrollPosition() const override { return visibleContentRect(LegacyIOSDocumentVisibleRect).location(); }
+ ScrollPosition scrollPosition() const final { return visibleContentRect(LegacyIOSDocumentVisibleRect).location(); }
ScrollPosition maximumScrollPosition() const override; // The maximum position we can be scrolled to.
@@ -258,7 +259,7 @@
// relative to the very top of the view.
WEBCORE_EXPORT ScrollPosition documentScrollPositionRelativeToViewOrigin() const;
- IntSize overhangAmount() const override;
+ IntSize overhangAmount() const final;
void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(); }
ScrollPosition cachedScrollPosition() const { return m_cachedScrollPosition; }
@@ -313,13 +314,13 @@
bool isOffscreen() const;
// Called when our frame rect changes (or the rect/scroll position of an ancestor changes).
- void frameRectsChanged() override;
+ void frameRectsChanged() final;
// Widget override to update our scrollbars and notify our contents of the resize.
void setFrameRect(const IntRect&) override;
// Widget override to notify our contents of a cliprect change.
- void clipRectChanged() override;
+ void clipRectChanged() final;
// For platforms that need to hit test scrollbars from within the engine's event handlers (like Win32).
Scrollbar* scrollbarAtPoint(const IntPoint& windowPoint);
@@ -343,13 +344,13 @@
}
// Widget override. Handles painting of the contents of the view as well as the scrollbars.
- WEBCORE_EXPORT void paint(GraphicsContext&, const IntRect&) override;
+ WEBCORE_EXPORT void paint(GraphicsContext&, const IntRect&) final;
void paintScrollbars(GraphicsContext&, const IntRect&);
// Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
WEBCORE_EXPORT void show() override;
- WEBCORE_EXPORT void hide() override;
- WEBCORE_EXPORT void setParentVisible(bool) override;
+ WEBCORE_EXPORT void hide() final;
+ WEBCORE_EXPORT void setParentVisible(bool) final;
// Pan scrolling.
static const int noPanScrollRadius = 15;
@@ -357,21 +358,19 @@
void removePanScrollIcon();
void paintPanScrollIcon(GraphicsContext&);
- virtual bool isPointInScrollbarCorner(const IntPoint&);
- virtual bool scrollbarCornerPresent() const;
- IntRect scrollCornerRect() const override;
+ bool isPointInScrollbarCorner(const IntPoint&);
+ bool scrollbarCornerPresent() const;
+ IntRect scrollCornerRect() const final;
virtual void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect);
virtual void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&);
- IntRect convertFromScrollbarToContainingView(const Scrollbar&, const IntRect&) const override;
- IntRect convertFromContainingViewToScrollbar(const Scrollbar&, const IntRect&) const override;
- IntPoint convertFromScrollbarToContainingView(const Scrollbar&, const IntPoint&) const override;
- IntPoint convertFromContainingViewToScrollbar(const Scrollbar&, const IntPoint&) const override;
+ IntRect convertFromScrollbarToContainingView(const Scrollbar&, const IntRect&) const final;
+ IntRect convertFromContainingViewToScrollbar(const Scrollbar&, const IntRect&) const final;
+ IntPoint convertFromScrollbarToContainingView(const Scrollbar&, const IntPoint&) const final;
+ IntPoint convertFromContainingViewToScrollbar(const Scrollbar&, const IntPoint&) const final;
void calculateAndPaintOverhangAreas(GraphicsContext&, const IntRect& dirtyRect);
- bool isScrollView() const override { return true; }
-
WEBCORE_EXPORT void scrollOffsetChangedViaPlatformWidget(const ScrollOffset& oldOffset, const ScrollOffset& newOffset);
protected:
@@ -384,26 +383,26 @@
void availableContentSizeChanged(AvailableSizeChangeReason) override;
virtual void addedOrRemovedScrollbar() = 0;
- virtual void delegatesScrollingDidChange() { }
+ virtual void delegatesScrollingDidChange() = 0;
// These functions are used to create/destroy scrollbars.
// They return true if the scrollbar was added or removed.
- bool setHasHorizontalScrollbar(bool, bool* contentSizeAffected = 0);
- bool setHasVerticalScrollbar(bool, bool* contentSizeAffected = 0);
+ bool setHasHorizontalScrollbar(bool, bool* contentSizeAffected = nullptr);
+ bool setHasVerticalScrollbar(bool, bool* contentSizeAffected = nullptr);
- virtual void updateScrollCorner();
- void invalidateScrollCornerRect(const IntRect&) override;
+ virtual void updateScrollCorner() = 0;
+ void invalidateScrollCornerRect(const IntRect&) final;
// Scroll the content by blitting the pixels.
- virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+ virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) = 0;
// Scroll the content by invalidating everything.
virtual void scrollContentsSlowPath(const IntRect& updateRect);
void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updatePositionSynchronously);
// Subclassed by FrameView to check the writing-mode of the document.
- virtual bool isVerticalDocument() const { return true; }
- virtual bool isFlippedDocument() const { return false; }
+ virtual bool isVerticalDocument() const = 0;
+ virtual bool isFlippedDocument() const = 0;
// Called to update the scrollbars to accurately reflect the state of the view.
void updateScrollbars(const ScrollPosition& desiredPosition);
@@ -411,27 +410,29 @@
float platformTopContentInset() const;
void platformSetTopContentInset(float);
- virtual void handleDeferredScrollUpdateAfterContentSizeChange();
+ void handleDeferredScrollUpdateAfterContentSizeChange();
- virtual bool shouldDeferScrollUpdateAfterContentSizeChange() { return false; }
+ virtual bool shouldDeferScrollUpdateAfterContentSizeChange() = 0;
- virtual void scrollOffsetChangedViaPlatformWidgetImpl(const ScrollOffset&, const ScrollOffset&) { }
+ virtual void scrollOffsetChangedViaPlatformWidgetImpl(const ScrollOffset&, const ScrollOffset&) = 0;
#if PLATFORM(IOS)
- virtual void unobscuredContentSizeChanged() { }
+ virtual void unobscuredContentSizeChanged() = 0;
#endif
private:
// Size available for view contents, excluding content insets. Not affected by zooming.
IntSize sizeForUnobscuredContent(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
- IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
+ IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const final;
WEBCORE_EXPORT IntRect unobscuredContentRectInternal(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
void completeUpdatesAfterScrollTo(const IntSize& scrollDelta);
bool setHasScrollbarInternal(RefPtr<Scrollbar>&, ScrollbarOrientation, bool hasBar, bool* contentSizeAffected);
+ bool isScrollView() const final { return true; }
+
RefPtr<Scrollbar> m_horizontalScrollbar;
RefPtr<Scrollbar> m_verticalScrollbar;
ScrollbarMode m_horizontalScrollbarMode;
@@ -442,7 +443,7 @@
bool m_prohibitsScrolling;
- HashSet<RefPtr<Widget>> m_children;
+ HashSet<Ref<Widget>> m_children;
// This bool is unused on Mac OS because we directly ask the platform widget
// whether it is safe to blit on scroll.
@@ -483,9 +484,9 @@
IntRect rectToCopyOnScroll() const;
- // Called when the scroll position within this view changes. FrameView overrides this to generate repaint invalidations.
- virtual void updateLayerPositionsAfterScrolling() { }
- virtual void updateCompositingLayersAfterScrolling() { }
+ // Called when the scroll position within this view changes. FrameView overrides this to generate repaint invalidations.
+ virtual void updateLayerPositionsAfterScrolling() = 0;
+ virtual void updateCompositingLayersAfterScrolling() = 0;
void platformAddChild(Widget*);
void platformRemoveChild(Widget*);
diff --git a/Source/WebCore/platform/Theme.h b/Source/WebCore/platform/Theme.h
index 5911978..314a8df 100644
--- a/Source/WebCore/platform/Theme.h
+++ b/Source/WebCore/platform/Theme.h
@@ -90,7 +90,7 @@
virtual LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, float /*zoomFactor*/) const { return zoomedSize; }
// Returns the minimum size for a control in zoomed coordinates.
- virtual LengthSize minimumControlSize(ControlPart, const FontCascade&, float /*zoomFactor*/) const { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
+ virtual LengthSize minimumControlSize(ControlPart, const FontCascade&, float /*zoomFactor*/) const { return { { 0, Fixed }, { 0, Fixed } }; }
// Allows the theme to modify the existing padding/border.
virtual LengthBox controlPadding(ControlPart, const FontCascade&, const LengthBox& zoomedBox, float zoomFactor) const;
diff --git a/Source/WebCore/platform/animation/Animation.h b/Source/WebCore/platform/animation/Animation.h
index 9a0df17..8f5ad93 100644
--- a/Source/WebCore/platform/animation/Animation.h
+++ b/Source/WebCore/platform/animation/Animation.h
@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -22,21 +22,16 @@
*
*/
-#ifndef Animation_h
-#define Animation_h
+#pragma once
-#include "PlatformExportMacros.h"
-
-#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
-#include "AnimationTrigger.h"
-#endif
#include "CSSPropertyNames.h"
#include "RenderStyleConstants.h"
#include "StyleScope.h"
#include "TimingFunction.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
+
+#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
+#include "AnimationTrigger.h"
+#endif
namespace WebCore {
@@ -62,20 +57,20 @@
// Flags this to be the special "none" animation (animation-name: none)
bool isNoneAnimation() const { return m_isNone; }
+
// We can make placeholder Animation objects to keep the comma-separated lists
// of properties in sync. isValidAnimation means this is not a placeholder.
bool isValidAnimation() const { return !m_isNone && !m_name.isEmpty(); }
bool isEmpty() const
{
- return (!m_directionSet && !m_durationSet && !m_fillModeSet
- && !m_nameSet && !m_playStateSet && !m_iterationCountSet
- && !m_delaySet && !m_timingFunctionSet && !m_propertySet
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- && !m_triggerSet);
-#else
- );
+ if (m_triggerSet)
+ return false;
#endif
+ return !m_directionSet && !m_durationSet && !m_fillModeSet
+ && !m_nameSet && !m_playStateSet && !m_iterationCountSet
+ && !m_delaySet && !m_timingFunctionSet && !m_propertySet;
}
bool isEmptyOrZeroDuration() const
@@ -114,11 +109,7 @@
double delay() const { return m_delay; }
- enum AnimationMode {
- AnimateAll,
- AnimateNone,
- AnimateSingleProperty
- };
+ enum AnimationMode { AnimateAll, AnimateNone, AnimateSingleProperty };
enum AnimationDirection {
AnimationDirectionNormal,
@@ -139,10 +130,10 @@
Style::ScopeOrdinal nameStyleScopeOrdinal() const { return m_nameStyleScopeOrdinal; }
EAnimPlayState playState() const { return static_cast<EAnimPlayState>(m_playState); }
CSSPropertyID property() const { return m_property; }
- PassRefPtr<TimingFunction> timingFunction() const { return m_timingFunction; }
+ TimingFunction* timingFunction() const { return m_timingFunction.get(); }
AnimationMode animationMode() const { return m_mode; }
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- PassRefPtr<AnimationTrigger> trigger() const { return m_trigger; }
+ AnimationTrigger* trigger() const { return m_trigger.get(); }
#endif
void setDelay(double c) { m_delay = c; m_delaySet = true; }
@@ -158,10 +149,10 @@
}
void setPlayState(EAnimPlayState d) { m_playState = d; m_playStateSet = true; }
void setProperty(CSSPropertyID t) { m_property = t; m_propertySet = true; }
- void setTimingFunction(PassRefPtr<TimingFunction> f) { m_timingFunction = f; m_timingFunctionSet = true; }
+ void setTimingFunction(RefPtr<TimingFunction>&& function) { m_timingFunction = WTFMove(function); m_timingFunctionSet = true; }
void setAnimationMode(AnimationMode mode) { m_mode = mode; }
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- void setTrigger(PassRefPtr<AnimationTrigger> t) { m_trigger = t; m_triggerSet = true; }
+ void setTrigger(RefPtr<AnimationTrigger>&& trigger) { m_trigger = WTFMove(trigger); m_triggerSet = true; }
#endif
void setIsNoneAnimation(bool n) { m_isNone = n; }
@@ -197,22 +188,22 @@
unsigned m_fillMode : 2;
- unsigned m_playState : 2;
+ unsigned m_playState : 2;
- bool m_delaySet : 1;
- bool m_directionSet : 1;
- bool m_durationSet : 1;
- bool m_fillModeSet : 1;
+ bool m_delaySet : 1;
+ bool m_directionSet : 1;
+ bool m_durationSet : 1;
+ bool m_fillModeSet : 1;
bool m_iterationCountSet : 1;
- bool m_nameSet : 1;
- bool m_playStateSet : 1;
- bool m_propertySet : 1;
+ bool m_nameSet : 1;
+ bool m_playStateSet : 1;
+ bool m_propertySet : 1;
bool m_timingFunctionSet : 1;
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- bool m_triggerSet : 1;
+ bool m_triggerSet : 1;
#endif
- bool m_isNone : 1;
+ bool m_isNone : 1;
public:
static double initialDelay() { return 0; }
@@ -223,12 +214,10 @@
static const String& initialName();
static EAnimPlayState initialPlayState() { return AnimPlayStatePlaying; }
static CSSPropertyID initialProperty() { return CSSPropertyInvalid; }
- static const PassRefPtr<TimingFunction> initialTimingFunction() { return CubicBezierTimingFunction::create(); }
+ static Ref<TimingFunction> initialTimingFunction() { return CubicBezierTimingFunction::create(); }
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- static const PassRefPtr<AnimationTrigger> initialTrigger() { return AutoAnimationTrigger::create(); }
+ static Ref<AnimationTrigger> initialTrigger() { return AutoAnimationTrigger::create(); }
#endif
};
} // namespace WebCore
-
-#endif // Animation_h
diff --git a/Source/WebCore/platform/animation/AnimationList.cpp b/Source/WebCore/platform/animation/AnimationList.cpp
index 625d790..0a32022 100644
--- a/Source/WebCore/platform/animation/AnimationList.cpp
+++ b/Source/WebCore/platform/animation/AnimationList.cpp
@@ -26,15 +26,16 @@
#define FILL_UNSET_PROPERTY(test, propGet, propSet) \
for (i = 0; i < size() && animation(i).test(); ++i) { } \
-if (i < size() && i != 0) { \
+if (i) { \
for (size_t j = 0; i < size(); ++i, ++j) \
animation(i).propSet(animation(j).propGet()); \
}
AnimationList::AnimationList(const AnimationList& other)
{
- for (size_t i = 0; i < other.size(); ++i)
- m_animations.append(Animation::create(other.animation(i)));
+ m_animations.reserveInitialCapacity(other.size());
+ for (auto& animation : other.m_animations)
+ m_animations.uncheckedAppend(Animation::create(animation.get()));
}
void AnimationList::fillUnsetProperties()
@@ -55,9 +56,10 @@
{
if (size() != other.size())
return false;
- for (size_t i = 0; i < size(); ++i)
+ for (size_t i = 0; i < size(); ++i) {
if (animation(i) != other.animation(i))
return false;
+ }
return true;
}
diff --git a/Source/WebCore/platform/animation/AnimationList.h b/Source/WebCore/platform/animation/AnimationList.h
index c84cb9b..ea7c9b7 100644
--- a/Source/WebCore/platform/animation/AnimationList.h
+++ b/Source/WebCore/platform/animation/AnimationList.h
@@ -22,8 +22,7 @@
*
*/
-#ifndef AnimationList_h
-#define AnimationList_h
+#pragma once
#include "Animation.h"
#include <wtf/RefPtr.h>
@@ -36,6 +35,7 @@
public:
AnimationList() { }
AnimationList(const AnimationList&);
+ AnimationList(AnimationList&&) = default;
void fillUnsetProperties();
bool operator==(const AnimationList&) const;
@@ -49,22 +49,17 @@
void resize(size_t n) { m_animations.resize(n); }
void remove(size_t i) { m_animations.remove(i); }
- void append(PassRefPtr<Animation> animation)
- {
- ASSERT(animation);
- m_animations.append(animation);
- }
-
- Animation& animation(size_t i) { return *m_animations[i]; }
- const Animation& animation(size_t i) const { return *m_animations[i]; }
+ void append(Ref<Animation>&& animation) { m_animations.append(WTFMove(animation)); }
+
+ Animation& animation(size_t i) { return m_animations[i].get(); }
+ const Animation& animation(size_t i) const { return m_animations[i].get(); }
private:
AnimationList& operator=(const AnimationList&);
+ AnimationList& operator=(AnimationList&&) = default;
- Vector<RefPtr<Animation>> m_animations;
+ Vector<Ref<Animation>> m_animations;
};
} // namespace WebCore
-
-#endif // AnimationList_h
diff --git a/Source/WebCore/platform/animation/AnimationTrigger.h b/Source/WebCore/platform/animation/AnimationTrigger.h
index fca45c1..5ea01b2 100644
--- a/Source/WebCore/platform/animation/AnimationTrigger.h
+++ b/Source/WebCore/platform/animation/AnimationTrigger.h
@@ -23,29 +23,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef AnimationTrigger_h
-#define AnimationTrigger_h
+#pragma once
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
#include "Length.h"
+#include <wtf/Ref.h>
#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
#include <wtf/TypeCasts.h>
namespace WebCore {
class AnimationTrigger : public RefCounted<AnimationTrigger> {
public:
-
- virtual PassRefPtr<AnimationTrigger> clone() const = 0;
-
- enum class AnimationTriggerType {
- AutoAnimationTriggerType, ScrollAnimationTriggerType
- };
+ virtual Ref<AnimationTrigger> clone() const = 0;
virtual ~AnimationTrigger() { }
+ enum class AnimationTriggerType { AutoAnimationTriggerType, ScrollAnimationTriggerType };
AnimationTriggerType type() const { return m_type; }
bool isAutoAnimationTrigger() const { return m_type == AnimationTriggerType::AutoAnimationTriggerType; }
@@ -62,16 +57,14 @@
AnimationTriggerType m_type;
};
-class AutoAnimationTrigger : public AnimationTrigger {
+class AutoAnimationTrigger final : public AnimationTrigger {
public:
- static PassRefPtr<AutoAnimationTrigger> create()
+ static Ref<AutoAnimationTrigger> create()
{
- return adoptRef(new AutoAnimationTrigger);
+ return adoptRef(*new AutoAnimationTrigger);
}
- virtual ~AutoAnimationTrigger() { }
-
- bool operator==(const AnimationTrigger& other) override
+ bool operator==(const AnimationTrigger& other) final
{
return other.isAutoAnimationTrigger();
}
@@ -82,22 +75,20 @@
{
}
- PassRefPtr<AnimationTrigger> clone() const override
+ Ref<AnimationTrigger> clone() const final
{
- return adoptRef(new AutoAnimationTrigger);
+ return adoptRef(*new AutoAnimationTrigger);
}
};
-class ScrollAnimationTrigger : public AnimationTrigger {
+class ScrollAnimationTrigger final : public AnimationTrigger {
public:
- static PassRefPtr<ScrollAnimationTrigger> create(Length startValue, Length endValue)
+ static Ref<ScrollAnimationTrigger> create(Length startValue, Length endValue)
{
- return adoptRef(new ScrollAnimationTrigger(startValue, endValue));
+ return adoptRef(*new ScrollAnimationTrigger(startValue, endValue));
}
- virtual ~ScrollAnimationTrigger() { }
-
- bool operator==(const AnimationTrigger& other) override
+ bool operator==(const AnimationTrigger& other) final
{
if (!other.isScrollAnimationTrigger())
return false;
@@ -133,9 +124,9 @@
m_endValue = endValue;
}
- PassRefPtr<AnimationTrigger> clone() const override
+ Ref<AnimationTrigger> clone() const final
{
- return adoptRef(new ScrollAnimationTrigger(m_startValue, m_endValue));
+ return adoptRef(*new ScrollAnimationTrigger(m_startValue, m_endValue));
}
Length m_startValue;
@@ -154,5 +145,3 @@
SPECIALIZE_TYPE_TRAITS_ANIMATION_TRIGGER(ScrollAnimationTrigger, isScrollAnimationTrigger);
#endif
-
-#endif // AnimationTrigger_h
diff --git a/Source/WebCore/platform/animation/TimingFunction.h b/Source/WebCore/platform/animation/TimingFunction.h
index f5e6616..fcaa3c3 100644
--- a/Source/WebCore/platform/animation/TimingFunction.h
+++ b/Source/WebCore/platform/animation/TimingFunction.h
@@ -22,54 +22,50 @@
*
*/
-#ifndef TimingFunction_h
-#define TimingFunction_h
+#pragma once
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
namespace WebCore {
+class TextStream;
+
class TimingFunction : public RefCounted<TimingFunction> {
public:
+ virtual Ref<TimingFunction> clone() const = 0;
- virtual PassRefPtr<TimingFunction> clone() const = 0;
-
- enum TimingFunctionType {
- LinearFunction, CubicBezierFunction, StepsFunction, SpringFunction
- };
-
virtual ~TimingFunction() { }
+ enum TimingFunctionType { LinearFunction, CubicBezierFunction, StepsFunction, SpringFunction };
TimingFunctionType type() const { return m_type; }
-
+
bool isLinearTimingFunction() const { return m_type == LinearFunction; }
bool isCubicBezierTimingFunction() const { return m_type == CubicBezierFunction; }
bool isStepsTimingFunction() const { return m_type == StepsFunction; }
bool isSpringTimingFunction() const { return m_type == SpringFunction; }
-
- virtual bool operator==(const TimingFunction& other) = 0;
+
+ virtual bool operator==(const TimingFunction&) const = 0;
+ bool operator!=(const TimingFunction& other) const { return !(*this == other); }
protected:
- TimingFunction(TimingFunctionType type)
+ explicit TimingFunction(TimingFunctionType type)
: m_type(type)
{
}
-
+
+private:
TimingFunctionType m_type;
};
class LinearTimingFunction final : public TimingFunction {
public:
- static PassRefPtr<LinearTimingFunction> create()
+ static Ref<LinearTimingFunction> create()
{
- return adoptRef(new LinearTimingFunction);
+ return adoptRef(*new LinearTimingFunction);
}
- virtual ~LinearTimingFunction() { }
-
- bool operator==(const TimingFunction& other) override
+ bool operator==(const TimingFunction& other) const final
{
return other.isLinearTimingFunction();
}
@@ -80,61 +76,54 @@
{
}
- PassRefPtr<TimingFunction> clone() const override
+ Ref<TimingFunction> clone() const final
{
- return adoptRef(new LinearTimingFunction);
+ return adoptRef(*new LinearTimingFunction);
}
};
class CubicBezierTimingFunction final : public TimingFunction {
public:
- enum TimingFunctionPreset {
- Ease,
- EaseIn,
- EaseOut,
- EaseInOut,
- Custom
- };
+ enum TimingFunctionPreset { Ease, EaseIn, EaseOut, EaseInOut, Custom };
- static PassRefPtr<CubicBezierTimingFunction> create(double x1, double y1, double x2, double y2)
+ static Ref<CubicBezierTimingFunction> create(double x1, double y1, double x2, double y2)
{
- return adoptRef(new CubicBezierTimingFunction(Custom, x1, y1, x2, y2));
+ return adoptRef(*new CubicBezierTimingFunction(Custom, x1, y1, x2, y2));
}
- static PassRefPtr<CubicBezierTimingFunction> create()
+ static Ref<CubicBezierTimingFunction> create()
{
- return adoptRef(new CubicBezierTimingFunction());
+ return adoptRef(*new CubicBezierTimingFunction());
}
- static PassRefPtr<CubicBezierTimingFunction> create(TimingFunctionPreset preset)
+ static Ref<CubicBezierTimingFunction> create(TimingFunctionPreset preset)
{
switch (preset) {
case Ease:
- return adoptRef(new CubicBezierTimingFunction());
+ return adoptRef(*new CubicBezierTimingFunction);
case EaseIn:
- return adoptRef(new CubicBezierTimingFunction(EaseIn, 0.42, 0.0, 1.0, 1.0));
+ return adoptRef(*new CubicBezierTimingFunction(EaseIn, 0.42, 0.0, 1.0, 1.0));
case EaseOut:
- return adoptRef(new CubicBezierTimingFunction(EaseOut, 0.0, 0.0, 0.58, 1.0));
+ return adoptRef(*new CubicBezierTimingFunction(EaseOut, 0.0, 0.0, 0.58, 1.0));
case EaseInOut:
- return adoptRef(new CubicBezierTimingFunction(EaseInOut, 0.42, 0.0, 0.58, 1.0));
- default:
- ASSERT_NOT_REACHED();
- return 0;
+ return adoptRef(*new CubicBezierTimingFunction(EaseInOut, 0.42, 0.0, 0.58, 1.0));
+ case Custom:
+ break;
}
+ ASSERT_NOT_REACHED();
+ return adoptRef(*new CubicBezierTimingFunction);
}
- virtual ~CubicBezierTimingFunction() { }
-
- bool operator==(const TimingFunction& other) override
+ bool operator==(const TimingFunction& other) const final
{
- if (other.isCubicBezierTimingFunction()) {
- const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(&other);
- if (m_timingFunctionPreset != Custom)
- return m_timingFunctionPreset == ctf->m_timingFunctionPreset;
-
- return m_x1 == ctf->m_x1 && m_y1 == ctf->m_y1 && m_x2 == ctf->m_x2 && m_y2 == ctf->m_y2;
- }
- return false;
+ if (!other.isCubicBezierTimingFunction())
+ return false;
+ auto& otherCubic = static_cast<const CubicBezierTimingFunction&>(other);
+ if (m_timingFunctionPreset != otherCubic.m_timingFunctionPreset)
+ return false;
+ if (m_timingFunctionPreset != Custom)
+ return true;
+ return m_x1 == otherCubic.m_x1 && m_y1 == otherCubic.m_y1 && m_x2 == otherCubic.m_x2 && m_y2 == otherCubic.m_y2;
}
double x1() const { return m_x1; }
@@ -149,21 +138,21 @@
m_x2 = x2;
m_y2 = y2;
}
-
+
TimingFunctionPreset timingFunctionPreset() const { return m_timingFunctionPreset; }
void setTimingFunctionPreset(TimingFunctionPreset preset) { m_timingFunctionPreset = preset; }
-
- static const CubicBezierTimingFunction* defaultTimingFunction()
+
+ static const CubicBezierTimingFunction& defaultTimingFunction()
{
- static const CubicBezierTimingFunction* dtf = create().leakRef();
- return dtf;
+ static const CubicBezierTimingFunction& function = create().leakRef();
+ return function;
}
- PassRefPtr<CubicBezierTimingFunction> createReversed() const
+ Ref<CubicBezierTimingFunction> createReversed() const
{
return create(1.0 - m_x2, 1.0 - m_y2, 1.0 - m_x1, 1.0 - m_y1);
}
-
+
private:
explicit CubicBezierTimingFunction(TimingFunctionPreset preset = Ease, double x1 = 0.25, double y1 = 0.1, double x2 = 0.25, double y2 = 1.0)
: TimingFunction(CubicBezierFunction)
@@ -175,9 +164,9 @@
{
}
- PassRefPtr<TimingFunction> clone() const override
+ Ref<TimingFunction> clone() const final
{
- return adoptRef(new CubicBezierTimingFunction(m_timingFunctionPreset, m_x1, m_y1, m_x2, m_y2));
+ return adoptRef(*new CubicBezierTimingFunction(m_timingFunctionPreset, m_x1, m_y1, m_x2, m_y2));
}
double m_x1;
@@ -189,25 +178,21 @@
class StepsTimingFunction final : public TimingFunction {
public:
-
- static PassRefPtr<StepsTimingFunction> create(int steps, bool stepAtStart)
+ static Ref<StepsTimingFunction> create(int steps, bool stepAtStart)
{
- return adoptRef(new StepsTimingFunction(steps, stepAtStart));
+ return adoptRef(*new StepsTimingFunction(steps, stepAtStart));
}
- static PassRefPtr<StepsTimingFunction> create()
+ static Ref<StepsTimingFunction> create()
{
- return adoptRef(new StepsTimingFunction(1, true));
+ return adoptRef(*new StepsTimingFunction(1, true));
}
- virtual ~StepsTimingFunction() { }
-
- bool operator==(const TimingFunction& other) override
+ bool operator==(const TimingFunction& other) const final
{
- if (other.isStepsTimingFunction()) {
- const StepsTimingFunction* stf = static_cast<const StepsTimingFunction*>(&other);
- return m_steps == stf->m_steps && m_stepAtStart == stf->m_stepAtStart;
- }
- return false;
+ if (!other.isStepsTimingFunction())
+ return false;
+ auto& otherSteps = static_cast<const StepsTimingFunction&>(other);
+ return m_steps == otherSteps.m_steps && m_stepAtStart == otherSteps.m_stepAtStart;
}
int numberOfSteps() const { return m_steps; }
@@ -215,7 +200,7 @@
bool stepAtStart() const { return m_stepAtStart; }
void setStepAtStart(bool stepAtStart) { m_stepAtStart = stepAtStart; }
-
+
private:
StepsTimingFunction(int steps, bool stepAtStart)
: TimingFunction(StepsFunction)
@@ -224,9 +209,9 @@
{
}
- PassRefPtr<TimingFunction> clone() const override
+ Ref<TimingFunction> clone() const final
{
- return adoptRef(new StepsTimingFunction(m_steps, m_stepAtStart));
+ return adoptRef(*new StepsTimingFunction(m_steps, m_stepAtStart));
}
int m_steps;
@@ -247,13 +232,12 @@
return create(0, 0, 0, 0);
}
- bool operator==(const TimingFunction& other) override
+ bool operator==(const TimingFunction& other) const final
{
- if (other.isSpringTimingFunction()) {
- const SpringTimingFunction& otherString = *static_cast<const SpringTimingFunction*>(&other);
- return m_mass == otherString.m_mass && m_stiffness == otherString.m_stiffness && m_damping == otherString.m_damping && m_initialVelocity == otherString.m_initialVelocity;
- }
- return false;
+ if (!other.isSpringTimingFunction())
+ return false;
+ auto& otherSpring = static_cast<const SpringTimingFunction&>(other);
+ return m_mass == otherSpring.m_mass && m_stiffness == otherSpring.m_stiffness && m_damping == otherSpring.m_damping && m_initialVelocity == otherSpring.m_initialVelocity;
}
double mass() const { return m_mass; }
@@ -279,9 +263,9 @@
{
}
- PassRefPtr<TimingFunction> clone() const override
+ Ref<TimingFunction> clone() const final
{
- return adoptRef(new SpringTimingFunction(m_mass, m_stiffness, m_damping, m_initialVelocity));
+ return adoptRef(*new SpringTimingFunction(m_mass, m_stiffness, m_damping, m_initialVelocity));
}
double m_mass;
@@ -290,9 +274,6 @@
double m_initialVelocity;
};
-class TextStream;
WEBCORE_EXPORT TextStream& operator<<(TextStream&, const TimingFunction&);
} // namespace WebCore
-
-#endif // TimingFunction_h
diff --git a/Source/WebCore/platform/audio/AudioBus.h b/Source/WebCore/platform/audio/AudioBus.h
index 4f9b5f5..d18dbdd 100644
--- a/Source/WebCore/platform/audio/AudioBus.h
+++ b/Source/WebCore/platform/audio/AudioBus.h
@@ -75,7 +75,7 @@
unsigned numberOfChannels() const { return m_channels.size(); }
AudioChannel* channel(unsigned channel) { return m_channels[channel].get(); }
- const AudioChannel* channel(unsigned channel) const { return const_cast<AudioBus*>(this)->m_channels[channel].get(); }
+ const AudioChannel* channel(unsigned channel) const { return m_channels[channel].get(); }
AudioChannel* channelByType(unsigned type);
const AudioChannel* channelByType(unsigned type) const;
diff --git a/Source/WebCore/platform/cf/KeyedEncoderCF.cpp b/Source/WebCore/platform/cf/KeyedEncoderCF.cpp
index 1ec53d8..619a2c0 100644
--- a/Source/WebCore/platform/cf/KeyedEncoderCF.cpp
+++ b/Source/WebCore/platform/cf/KeyedEncoderCF.cpp
@@ -140,12 +140,11 @@
m_arrayStack.removeLast();
}
-PassRefPtr<SharedBuffer> KeyedEncoderCF::finishEncoding()
+RefPtr<SharedBuffer> KeyedEncoderCF::finishEncoding()
{
- RetainPtr<CFDataRef> data = adoptCF(CFPropertyListCreateData(kCFAllocatorDefault, m_rootDictionary.get(), kCFPropertyListBinaryFormat_v1_0, 0, nullptr));
+ auto data = adoptCF(CFPropertyListCreateData(kCFAllocatorDefault, m_rootDictionary.get(), kCFPropertyListBinaryFormat_v1_0, 0, nullptr));
if (!data)
return nullptr;
-
return SharedBuffer::wrapCFData(data.get());
}
diff --git a/Source/WebCore/platform/cf/KeyedEncoderCF.h b/Source/WebCore/platform/cf/KeyedEncoderCF.h
index fc58fb6..82b6b61 100644
--- a/Source/WebCore/platform/cf/KeyedEncoderCF.h
+++ b/Source/WebCore/platform/cf/KeyedEncoderCF.h
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KeyedEncoderCF_h
-#define KeyedEncoderCF_h
+#pragma once
#include "KeyedCoding.h"
#include <wtf/RetainPtr.h>
@@ -37,25 +36,25 @@
KeyedEncoderCF();
~KeyedEncoderCF();
- PassRefPtr<WebCore::SharedBuffer> finishEncoding() override;
-
private:
- void encodeBytes(const String& key, const uint8_t*, size_t) override;
- void encodeBool(const String& key, bool) override;
- void encodeUInt32(const String& key, uint32_t) override;
- void encodeInt32(const String& key, int32_t) override;
- void encodeInt64(const String& key, int64_t) override;
- void encodeFloat(const String& key, float) override;
- void encodeDouble(const String& key, double) override;
- void encodeString(const String& key, const String&) override;
+ RefPtr<WebCore::SharedBuffer> finishEncoding() final;
- void beginObject(const String& key) override;
- void endObject() override;
+ void encodeBytes(const String& key, const uint8_t*, size_t) final;
+ void encodeBool(const String& key, bool) final;
+ void encodeUInt32(const String& key, uint32_t) final;
+ void encodeInt32(const String& key, int32_t) final;
+ void encodeInt64(const String& key, int64_t) final;
+ void encodeFloat(const String& key, float) final;
+ void encodeDouble(const String& key, double) final;
+ void encodeString(const String& key, const String&) final;
- void beginArray(const String& key) override;
- void beginArrayElement() override;
- void endArrayElement() override;
- void endArray() override;
+ void beginObject(const String& key) final;
+ void endObject() final;
+
+ void beginArray(const String& key) final;
+ void beginArrayElement() final;
+ void endArrayElement() final;
+ void endArray() final;
RetainPtr<CFMutableDictionaryRef> m_rootDictionary;
@@ -64,5 +63,3 @@
};
} // namespace WebCore
-
-#endif // KeyedEncoderCF_h
diff --git a/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h b/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h
index b38d2ca..7782017 100644
--- a/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h
+++ b/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h
@@ -23,13 +23,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PlatformSpeechSynthesisProviderEfl_h
-#define PlatformSpeechSynthesisProviderEfl_h
+#pragma once
#if ENABLE(SPEECH_SYNTHESIS)
#include <speak_lib.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
@@ -76,5 +74,3 @@
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
-
-#endif // PlatformSpeechSynthesisProviderEfl_h
diff --git a/Source/WebCore/platform/glib/KeyedEncoderGlib.cpp b/Source/WebCore/platform/glib/KeyedEncoderGlib.cpp
index d492136..81cbed5 100644
--- a/Source/WebCore/platform/glib/KeyedEncoderGlib.cpp
+++ b/Source/WebCore/platform/glib/KeyedEncoderGlib.cpp
@@ -127,7 +127,7 @@
m_arrayStack.removeLast();
}
-PassRefPtr<SharedBuffer> KeyedEncoderGlib::finishEncoding()
+RefPtr<SharedBuffer> KeyedEncoderGlib::finishEncoding()
{
g_assert(m_variantBuilderStack.last() == &m_variantBuilder);
GRefPtr<GVariant> variant = g_variant_builder_end(&m_variantBuilder);
diff --git a/Source/WebCore/platform/glib/KeyedEncoderGlib.h b/Source/WebCore/platform/glib/KeyedEncoderGlib.h
index 2d7b1c3..f91b4dd 100644
--- a/Source/WebCore/platform/glib/KeyedEncoderGlib.h
+++ b/Source/WebCore/platform/glib/KeyedEncoderGlib.h
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KeyedEncoderGlib_h
-#define KeyedEncoderGlib_h
+#pragma once
#include "KeyedCoding.h"
#include <glib.h>
@@ -39,25 +38,25 @@
KeyedEncoderGlib();
~KeyedEncoderGlib();
- PassRefPtr<WebCore::SharedBuffer> finishEncoding() override;
-
private:
- void encodeBytes(const String& key, const uint8_t*, size_t) override;
- void encodeBool(const String& key, bool) override;
- void encodeUInt32(const String& key, uint32_t) override;
- void encodeInt32(const String& key, int32_t) override;
- void encodeInt64(const String& key, int64_t) override;
- void encodeFloat(const String& key, float) override;
- void encodeDouble(const String& key, double) override;
- void encodeString(const String& key, const String&) override;
+ RefPtr<WebCore::SharedBuffer> finishEncoding() final;
- void beginObject(const String& key) override;
- void endObject() override;
+ void encodeBytes(const String& key, const uint8_t*, size_t) final;
+ void encodeBool(const String& key, bool) final;
+ void encodeUInt32(const String& key, uint32_t) final;
+ void encodeInt32(const String& key, int32_t) final;
+ void encodeInt64(const String& key, int64_t) final;
+ void encodeFloat(const String& key, float) final;
+ void encodeDouble(const String& key, double) final;
+ void encodeString(const String& key, const String&) final;
- void beginArray(const String& key) override;
- void beginArrayElement() override;
- void endArrayElement() override;
- void endArray() override;
+ void beginObject(const String& key) final;
+ void endObject() final;
+
+ void beginArray(const String& key) final;
+ void beginArrayElement() final;
+ void endArrayElement() final;
+ void endArray() final;
GVariantBuilder m_variantBuilder;
Vector<GVariantBuilder*, 16> m_variantBuilderStack;
@@ -66,5 +65,3 @@
};
} // namespace WebCore
-
-#endif // KeyedEncoderGlib_h
diff --git a/Source/WebCore/platform/graphics/FontCache.h b/Source/WebCore/platform/graphics/FontCache.h
index d056ebf..af48b0b 100644
--- a/Source/WebCore/platform/graphics/FontCache.h
+++ b/Source/WebCore/platform/graphics/FontCache.h
@@ -27,15 +27,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FontCache_h
-#define FontCache_h
+#pragma once
#include "FontDescription.h"
#include "Timer.h"
#include <array>
#include <limits.h>
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/AtomicStringHash.h>
@@ -290,5 +288,3 @@
#endif
}
-
-#endif
diff --git a/Source/WebCore/platform/graphics/FontPlatformData.h b/Source/WebCore/platform/graphics/FontPlatformData.h
index 9303a90..ad382f4 100644
--- a/Source/WebCore/platform/graphics/FontPlatformData.h
+++ b/Source/WebCore/platform/graphics/FontPlatformData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2010, 2013-2016 Apple Inc.
+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2007 Pioneer Research Center USA, Inc.
@@ -22,10 +22,15 @@
*
*/
-#ifndef FontPlatformData_h
-#define FontPlatformData_h
+#pragma once
#include "TextFlags.h"
+#include <wtf/Forward.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/text/StringImpl.h>
+
#if PLATFORM(WIN)
#include "COMPtr.h"
@@ -44,25 +49,18 @@
#include "OpenTypeVerticalData.h"
#endif
-#if PLATFORM(COCOA)
#if USE(APPKIT)
OBJC_CLASS NSFont;
#endif
+#if PLATFORM(COCOA)
typedef const struct __CTFont* CTFontRef;
-
#endif
#if USE(CG)
#include <CoreGraphics/CoreGraphics.h>
#endif
-#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/text/StringImpl.h>
-
#if PLATFORM(WIN)
#include <wtf/win/GDIObject.h>
typedef struct HFONT__* HFONT;
@@ -70,7 +68,6 @@
interface IDWriteFontFace;
#endif
-
namespace WebCore {
class FontDescription;
@@ -82,10 +79,7 @@
public:
FontPlatformData(WTF::HashTableDeletedValueType);
FontPlatformData();
-#if !USE(FREETYPE)
- FontPlatformData(const FontPlatformData&) = default;
-#endif
- FontPlatformData(FontPlatformData&&) = default;
+
FontPlatformData(const FontDescription&, const AtomicString& family);
FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, TextRenderingMode = AutoTextRendering);
@@ -103,27 +97,36 @@
#if PLATFORM(WIN)
FontPlatformData(GDIObject<HFONT>, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
-
-#if USE(CG)
- FontPlatformData(GDIObject<HFONT>, CGFontRef, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
-#elif USE(DIRECT2D)
- FontPlatformData(GDIObject<HFONT>, IDWriteFont*, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
-#elif USE(CAIRO)
- FontPlatformData(GDIObject<HFONT>, cairo_font_face_t*, float size, bool bold, bool italic);
#endif
+
+#if PLATFORM(WIN) && USE(CG)
+ FontPlatformData(GDIObject<HFONT>, CGFontRef, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
+#endif
+
+#if PLATFORM(WIN) && USE(DIRECT2D)
+ FontPlatformData(GDIObject<HFONT>, IDWriteFont*, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
+#endif
+
+#if PLATFORM(WIN) && USE(CAIRO)
+ FontPlatformData(GDIObject<HFONT>, cairo_font_face_t*, float size, bool bold, bool italic);
#endif
#if USE(FREETYPE)
FontPlatformData(FcPattern*, const FontDescription&);
FontPlatformData(cairo_font_face_t*, const FontDescription&, bool syntheticBold, bool syntheticOblique);
FontPlatformData(const FontPlatformData&);
+ FontPlatformData(FontPlatformData&&) = default;
+ FontPlatformData& operator=(const FontPlatformData&);
+ FontPlatformData& operator=(FontPlatformData&&) = default;
~FontPlatformData();
#endif
#if PLATFORM(WIN)
HFONT hfont() const { return m_font ? m_font->get() : 0; }
bool useGDI() const { return m_useGDI; }
-#elif PLATFORM(COCOA)
+#endif
+
+#if PLATFORM(COCOA)
CTFontRef font() const { return m_font.get(); }
WEBCORE_EXPORT CTFontRef registeredFont() const; // Returns nullptr iff the font is not registered, such as web fonts (otherwise returns font()).
@@ -189,12 +192,6 @@
#endif
}
-#if USE(FREETYPE)
- FontPlatformData& operator=(const FontPlatformData&);
-#else
- FontPlatformData& operator=(const FontPlatformData&) = default;
-#endif
-
bool operator==(const FontPlatformData& other) const
{
return platformIsEqual(other)
@@ -232,12 +229,15 @@
private:
bool platformIsEqual(const FontPlatformData&) const;
+
#if PLATFORM(COCOA)
CGFloat ctFontSize() const;
#endif
+
#if PLATFORM(WIN)
void platformDataInit(HFONT, float size, HDC, WCHAR* faceName);
#endif
+
#if USE(FREETYPE)
void buildScaledFont(cairo_font_face_t*);
#endif
@@ -253,13 +253,16 @@
#if USE(CG) && (PLATFORM(WIN) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 100000))
RetainPtr<CGFontRef> m_cgFont;
#endif
+
#if USE(DIRECT2D)
COMPtr<IDWriteFont> m_dwFont;
COMPtr<IDWriteFontFace> m_dwFontFace;
#endif
+
#if USE(CAIRO)
RefPtr<cairo_scaled_font_t> m_scaledFont;
#endif
+
#if USE(FREETYPE)
RefPtr<FcPattern> m_pattern;
mutable FcUniquePtr<FcFontSet> m_fallbacks;
@@ -285,15 +288,18 @@
#if PLATFORM(IOS)
bool m_isEmoji { false };
#endif
+
#if PLATFORM(WIN)
bool m_useGDI { false };
#endif
+
#if USE(FREETYPE)
bool m_fixedWidth { false };
#endif
};
#if USE(APPKIT)
+
// NSFonts and CTFontRefs are toll-free-bridged.
inline CTFontRef toCTFont(NSFont *font)
{
@@ -304,9 +310,11 @@
{
return (NSFont *)font;
}
+
#endif
#if USE(CG)
+
class ScopedTextMatrix {
public:
ScopedTextMatrix(CGAffineTransform newMatrix, CGContextRef context)
@@ -330,8 +338,7 @@
CGContextRef m_context;
CGAffineTransform m_textMatrix;
};
+
#endif
} // namespace WebCore
-
-#endif // FontPlatformData_h
diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.h b/Source/WebCore/platform/graphics/GraphicsLayer.h
index d919ffd..fe37d25 100644
--- a/Source/WebCore/platform/graphics/GraphicsLayer.h
+++ b/Source/WebCore/platform/graphics/GraphicsLayer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,8 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GraphicsLayer_h
-#define GraphicsLayer_h
+#pragma once
#include "Animation.h"
#include "Color.h"
@@ -80,11 +79,15 @@
AnimationValue(const AnimationValue& other)
: m_keyTime(other.m_keyTime)
- , m_timingFunction(other.m_timingFunction ? other.m_timingFunction->clone() : nullptr)
+ , m_timingFunction(other.m_timingFunction ? RefPtr<TimingFunction> { other.m_timingFunction->clone() } : nullptr)
{
}
+ AnimationValue(AnimationValue&&) = default;
+
private:
+ void operator=(const AnimationValue&) = delete;
+
double m_keyTime;
RefPtr<TimingFunction> m_timingFunction;
};
@@ -104,12 +107,6 @@
return std::make_unique<FloatAnimationValue>(*this);
}
- FloatAnimationValue(const FloatAnimationValue& other)
- : AnimationValue(other)
- , m_value(other.m_value)
- {
- }
-
float value() const { return m_value; }
private:
@@ -134,10 +131,13 @@
TransformAnimationValue(const TransformAnimationValue& other)
: AnimationValue(other)
{
- for (size_t i = 0; i < other.m_value.operations().size(); ++i)
- m_value.operations().append(other.m_value.operations()[i]->clone());
+ m_value.operations().reserveInitialCapacity(other.m_value.operations().size());
+ for (auto& operation : other.m_value.operations())
+ m_value.operations().uncheckedAppend(operation->clone());
}
+ TransformAnimationValue(TransformAnimationValue&&) = default;
+
const TransformOperations& value() const { return m_value; }
private:
@@ -162,10 +162,13 @@
FilterAnimationValue(const FilterAnimationValue& other)
: AnimationValue(other)
{
- for (size_t i = 0; i < other.m_value.operations().size(); ++i)
- m_value.operations().append(other.m_value.operations()[i]->clone());
+ m_value.operations().reserveInitialCapacity(other.m_value.operations().size());
+ for (auto& operation : other.m_value.operations())
+ m_value.operations().uncheckedAppend(operation->clone());
}
+ FilterAnimationValue(FilterAnimationValue&&) = default;
+
const FilterOperations& value() const { return m_value; }
private:
@@ -185,13 +188,12 @@
KeyframeValueList(const KeyframeValueList& other)
: m_property(other.property())
{
- for (size_t i = 0; i < other.m_values.size(); ++i)
- m_values.append(other.m_values[i]->clone());
+ m_values.reserveInitialCapacity(other.m_values.size());
+ for (auto& value : other.m_values)
+ m_values.uncheckedAppend(value->clone());
}
- ~KeyframeValueList()
- {
- }
+ KeyframeValueList(KeyframeValueList&&) = default;
KeyframeValueList& operator=(const KeyframeValueList& other)
{
@@ -200,6 +202,8 @@
return *this;
}
+ KeyframeValueList& operator=(KeyframeValueList&&) = default;
+
void swap(KeyframeValueList& other)
{
std::swap(m_property, other.m_property);
@@ -210,10 +214,10 @@
size_t size() const { return m_values.size(); }
const AnimationValue& at(size_t i) const { return *m_values.at(i); }
-
+
// Insert, sorted by keyTime.
WEBCORE_EXPORT void insert(std::unique_ptr<const AnimationValue>);
-
+
protected:
Vector<std::unique_ptr<const AnimationValue>> m_values;
AnimatedPropertyID m_property;
@@ -225,7 +229,6 @@
class GraphicsLayer {
WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
public:
-
enum class Type {
Normal,
PageTiledBacking,
@@ -241,7 +244,7 @@
virtual void initialize(Type) { }
- typedef uint64_t PlatformLayerID;
+ using PlatformLayerID = uint64_t;
virtual PlatformLayerID primaryLayerID() const { return 0; }
GraphicsLayerClient& client() const { return m_client; }
@@ -683,5 +686,3 @@
// Outside the WebCore namespace for ease of invocation from the debugger.
void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
#endif
-
-#endif // GraphicsLayer_h
diff --git a/Source/WebCore/platform/graphics/LegacyCDMSession.h b/Source/WebCore/platform/graphics/LegacyCDMSession.h
index 8245d4e..8546c71 100644
--- a/Source/WebCore/platform/graphics/LegacyCDMSession.h
+++ b/Source/WebCore/platform/graphics/LegacyCDMSession.h
@@ -23,21 +23,18 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CDMSession_h
-#define CDMSession_h
+#pragma once
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
#include <runtime/Uint8Array.h>
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
namespace WebCore {
class CDMSessionClient {
public:
- virtual ~CDMSessionClient() { };
+ virtual ~CDMSessionClient() { }
virtual void sendMessage(Uint8Array*, String destinationURL) = 0;
enum {
@@ -64,7 +61,6 @@
class CDMSession {
public:
- CDMSession() { }
virtual ~CDMSession() { }
virtual CDMSessionType type() { return CDMSessionTypeUnknown; }
@@ -79,5 +75,3 @@
}
#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#endif // CDMSession_h
diff --git a/Source/WebCore/platform/graphics/PathUtilities.cpp b/Source/WebCore/platform/graphics/PathUtilities.cpp
index b176324..914a0a2 100644
--- a/Source/WebCore/platform/graphics/PathUtilities.cpp
+++ b/Source/WebCore/platform/graphics/PathUtilities.cpp
@@ -486,14 +486,15 @@
return FloatRect(topLeft.value(), bottomRight.value());
}
-Path PathUtilities::pathWithShrinkWrappedRectsForOutline(const Vector<FloatRect>& rects, const BorderData& borderData, float outlineOffset, TextDirection direction,
- WritingMode writingMode, float deviceScaleFactor)
+Path PathUtilities::pathWithShrinkWrappedRectsForOutline(const Vector<FloatRect>& rects, const BorderData& borderData,
+ float outlineOffset, TextDirection direction, WritingMode writingMode, float deviceScaleFactor)
{
ASSERT(borderData.hasBorderRadius());
- FloatSize topLeftRadius = FloatSize(borderData.topLeft().width().value(), borderData.topLeft().height().value());
- FloatSize topRightRadius = FloatSize(borderData.topRight().width().value(), borderData.topRight().height().value());
- FloatSize bottomRightRadius = FloatSize(borderData.bottomRight().width().value(), borderData.bottomRight().height().value());
- FloatSize bottomLeftRadius = FloatSize(borderData.bottomLeft().width().value(), borderData.bottomLeft().height().value());
+
+ FloatSize topLeftRadius { borderData.topLeft().width.value(), borderData.topLeft().height.value() };
+ FloatSize topRightRadius { borderData.topRight().width.value(), borderData.topRight().height.value() };
+ FloatSize bottomRightRadius { borderData.bottomRight().width.value(), borderData.bottomRight().height.value() };
+ FloatSize bottomLeftRadius { borderData.bottomLeft().width.value(), borderData.bottomLeft().height.value() };
auto roundedRect = [topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius, outlineOffset, deviceScaleFactor] (const FloatRect& rect)
{
diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp
index d7546e2..86185fc 100644
--- a/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp
+++ b/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp
@@ -44,16 +44,14 @@
namespace WebCore {
-CDMSessionAVFoundationCF::CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF* parent, CDMSessionClient* client)
+CDMSessionAVFoundationCF::CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF& parent, CDMSessionClient*)
: m_parent(parent)
- , m_client(client)
, m_sessionId(createCanonicalUUIDString())
{
}
-RefPtr<Uint8Array> CDMSessionAVFoundationCF::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
+RefPtr<Uint8Array> CDMSessionAVFoundationCF::generateKeyRequest(const String&, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
{
- UNUSED_PARAM(mimeType);
#if USE(DIRECT2D)
UNUSED_PARAM(initData);
UNUSED_PARAM(destinationURL);
@@ -70,35 +68,30 @@
return nullptr;
}
- m_request = m_parent->takeRequestForKeyURI(keyURI);
+ m_request = m_parent.takeRequestForKeyURI(keyURI);
if (!m_request) {
errorCode = MediaPlayer::InvalidPlayerState;
return nullptr;
}
- RetainPtr<CFMutableDataRef> certificateData = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, certificate->byteLength()));
+ auto certificateData = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, certificate->byteLength()));
CFDataAppendBytes(certificateData.get(), reinterpret_cast<const UInt8*>(certificate->baseAddress()), certificate->byteLength());
- CString assetStr = keyID.utf8();
- RetainPtr<CFMutableDataRef> assetID = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, assetStr.length()));
+ auto assetStr = keyID.utf8();
+ auto assetID = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, assetStr.length()));
CFDataAppendBytes(assetID.get(), reinterpret_cast<const UInt8*>(assetStr.data()), assetStr.length());
CFErrorRef cfError = nullptr;
- RetainPtr<CFDataRef> keyRequest = adoptCF(AVCFAssetResourceLoadingRequestCreateStreamingContentKeyRequestDataForApp(m_request.get(), certificateData.get(), assetID.get(), nullptr, &cfError));
+ auto keyRequest = adoptCF(AVCFAssetResourceLoadingRequestCreateStreamingContentKeyRequestDataForApp(m_request.get(), certificateData.get(), assetID.get(), nullptr, &cfError));
if (!keyRequest) {
- RetainPtr<CFDictionaryRef> userInfo;
if (cfError) {
- userInfo = adoptCF(CFErrorCopyUserInfo(cfError));
-
- if (userInfo) {
- if (CFErrorRef underlyingError = (CFErrorRef)CFDictionaryGetValue(userInfo.get(), kCFErrorUnderlyingErrorKey))
+ if (auto userInfo = adoptCF(CFErrorCopyUserInfo(cfError))) {
+ if (auto underlyingError = (CFErrorRef)CFDictionaryGetValue(userInfo.get(), kCFErrorUnderlyingErrorKey))
systemCode = CFErrorGetCode(underlyingError);
}
-
CFRelease(cfError);
}
-
return nullptr;
}
@@ -106,8 +99,8 @@
systemCode = 0;
destinationURL = String();
- RefPtr<ArrayBuffer> keyRequestBuffer = ArrayBuffer::create(CFDataGetBytePtr(keyRequest.get()), CFDataGetLength(keyRequest.get()));
- return Uint8Array::create(keyRequestBuffer, 0, keyRequestBuffer->byteLength());
+ auto keyRequestBuffer = ArrayBuffer::create(CFDataGetBytePtr(keyRequest.get()), CFDataGetLength(keyRequest.get()));
+ return Uint8Array::create(WTFMove(keyRequestBuffer), 0, keyRequestBuffer->byteLength());
#endif
}
@@ -117,7 +110,7 @@
bool CDMSessionAVFoundationCF::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode)
{
- RetainPtr<CFMutableDataRef> keyData = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, key->byteLength()));
+ auto keyData = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, key->byteLength()));
CFDataAppendBytes(keyData.get(), reinterpret_cast<const UInt8*>(key->baseAddress()), key->byteLength());
AVCFAssetResourceLoadingRequestFinishLoadingWithResponse(m_request.get(), nullptr, keyData.get(), nullptr);
@@ -125,7 +118,6 @@
errorCode = MediaPlayer::NoError;
systemCode = 0;
nextMessage = nullptr;
-
return true;
}
diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h b/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h
index 6524d1d..12a6a79 100644
--- a/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h
+++ b/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h
@@ -23,11 +23,11 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CDMSessionAVFoundationCF_h
-#define CDMSessionAVFoundationCF_h
+#pragma once
#include "LegacyCDMSession.h"
#include <wtf/RetainPtr.h>
+#include <wtf/text/WTFString.h>
#if HAVE(AVFOUNDATION_LOADER_DELEGATE) && ENABLE(LEGACY_ENCRYPTED_MEDIA)
@@ -37,26 +37,22 @@
class MediaPlayerPrivateAVFoundationCF;
-class CDMSessionAVFoundationCF : public CDMSession {
+class CDMSessionAVFoundationCF final : public CDMSession {
public:
- CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF* parent, CDMSessionClient*);
- virtual ~CDMSessionAVFoundationCF() { }
+ CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF& parent, CDMSessionClient*);
- void setClient(CDMSessionClient* client) override { m_client = client; }
- const String& sessionId() const override { return m_sessionId; }
- RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
- void releaseKeys() override;
- bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
+private:
+ void setClient(CDMSessionClient* client) final { }
+ const String& sessionId() const final { return m_sessionId; }
+ RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) final;
+ void releaseKeys() final;
+ bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) final;
-protected:
- MediaPlayerPrivateAVFoundationCF* m_parent;
- CDMSessionClient* m_client;
- String m_sessionId;
+ MediaPlayerPrivateAVFoundationCF& m_parent;
+ const String m_sessionId;
RetainPtr<AVCFAssetResourceLoadingRequestRef> m_request;
};
}
#endif
-
-#endif // CDMSessionAVFoundationCF_h
diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
index d1a063e..49d3509 100644
--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
@@ -1122,6 +1122,7 @@
}
#if HAVE(AVFOUNDATION_LOADER_DELEGATE) && ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
RetainPtr<AVCFAssetResourceLoadingRequestRef> MediaPlayerPrivateAVFoundationCF::takeRequestForKeyURI(const String& keyURI)
{
if (!m_avfWrapper)
@@ -1135,13 +1136,16 @@
if (!keySystemIsSupported(keySystem))
return nullptr;
- return std::make_unique<CDMSessionAVFoundationCF>(this, client);
+ return std::make_unique<CDMSessionAVFoundationCF>(*this, client);
}
+
#elif ENABLE(LEGACY_ENCRYPTED_MEDIA)
-std::unique_ptr<CDMSession> MediaPlayerPrivateAVFoundationCF::createSession(const String& keySystem, , CDMSessionClient*)
+
+std::unique_ptr<CDMSession> MediaPlayerPrivateAVFoundationCF::createSession(const String& keySystem, CDMSessionClient*)
{
return nullptr;
}
+
#endif
long MediaPlayerPrivateAVFoundationCF::assetErrorCode() const
diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h
index df03ccb..bbc05d5 100644
--- a/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h
+++ b/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h
@@ -23,12 +23,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CDMSessionAVFoundationObjC_h
-#define CDMSessionAVFoundationObjC_h
+#pragma once
#include "LegacyCDMSession.h"
#include <wtf/RetainPtr.h>
#include <wtf/WeakPtr.h>
+#include <wtf/text/WTFString.h>
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
@@ -66,5 +66,3 @@
}
#endif
-
-#endif // CDMSessionAVFoundationObjC_h
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
index ba49635..fa4444b 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
@@ -924,8 +924,8 @@
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
// If there is a trigger that depends on the scroll position, we cannot accelerate the animation.
- if (anim->trigger()->isScrollAnimationTrigger()) {
- ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*anim->trigger().get());
+ if (is<ScrollAnimationTrigger>(anim->trigger())) {
+ auto& scrollTrigger = downcast<ScrollAnimationTrigger>(*anim->trigger());
if (scrollTrigger.hasEndValue())
return false;
}
@@ -2805,7 +2805,7 @@
int animationIndex = 0;
RefPtr<PlatformCAAnimation> caAnimation;
-
+
if (isKeyframe) {
caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive);
valuesOK = setAnimationKeyframes(valueList, animation, caAnimation.get());
@@ -2816,7 +2816,7 @@
caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive);
valuesOK = setAnimationEndpoints(valueList, animation, caAnimation.get());
}
-
+
if (!valuesOK)
return false;
@@ -3024,13 +3024,12 @@
propertyAnim->setFillMode(fillMode);
}
-const TimingFunction* GraphicsLayerCA::timingFunctionForAnimationValue(const AnimationValue& animValue, const Animation& anim)
+const TimingFunction& GraphicsLayerCA::timingFunctionForAnimationValue(const AnimationValue& animValue, const Animation& anim)
{
if (animValue.timingFunction())
- return animValue.timingFunction();
+ return *animValue.timingFunction();
if (anim.isTimingFunctionSet())
- return anim.timingFunction().get();
-
+ return *anim.timingFunction();
return CubicBezierTimingFunction::defaultTimingFunction();
}
@@ -3054,9 +3053,7 @@
// This codepath is used for 2-keyframe animations, so we still need to look in the start
// for a timing function. Even in the reversing animation case, the first keyframe provides the timing function.
- const TimingFunction* timingFunction = timingFunctionForAnimationValue(valueList.at(0), *animation);
- if (timingFunction)
- basicAnim->setTimingFunction(timingFunction, !forwards);
+ basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards);
return true;
}
@@ -3086,13 +3083,13 @@
}
if (i < (valueList.size() - 1))
- timingFunctions.append(timingFunctionForAnimationValue(forwards ? curValue : valueList.at(index - 1), *animation));
+ timingFunctions.append(&timingFunctionForAnimationValue(forwards ? curValue : valueList.at(index - 1), *animation));
}
-
+
keyframeAnim->setKeyTimes(keyTimes);
keyframeAnim->setValues(values);
keyframeAnim->setTimingFunctions(timingFunctions, !forwards);
-
+
return true;
}
@@ -3105,8 +3102,8 @@
unsigned fromIndex = !forwards;
unsigned toIndex = forwards;
- const TransformAnimationValue& startValue = static_cast<const TransformAnimationValue&>(valueList.at(fromIndex));
- const TransformAnimationValue& endValue = static_cast<const TransformAnimationValue&>(valueList.at(toIndex));
+ auto& startValue = static_cast<const TransformAnimationValue&>(valueList.at(fromIndex));
+ auto& endValue = static_cast<const TransformAnimationValue&>(valueList.at(toIndex));
if (isMatrixAnimation) {
TransformationMatrix fromTransform, toTransform;
@@ -3149,10 +3146,9 @@
// This codepath is used for 2-keyframe animations, so we still need to look in the start
// for a timing function. Even in the reversing animation case, the first keyframe provides the timing function.
- const TimingFunction* timingFunction = timingFunctionForAnimationValue(valueList.at(0), *animation);
- basicAnim->setTimingFunction(timingFunction, !forwards);
+ basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards);
- PlatformCAAnimation::ValueFunctionType valueFunction = getValueFunctionNameForTransformOperation(transformOpType);
+ auto valueFunction = getValueFunctionNameForTransformOperation(transformOpType);
if (valueFunction != PlatformCAAnimation::NoValueFunction)
basicAnim->setValueFunction(valueFunction);
@@ -3204,7 +3200,7 @@
}
if (i < (valueList.size() - 1))
- timingFunctions.append(timingFunctionForAnimationValue(forwards ? curValue : valueList.at(index - 1), *animation));
+ timingFunctions.append(&timingFunctionForAnimationValue(forwards ? curValue : valueList.at(index - 1), *animation));
}
keyframeAnim->setKeyTimes(keyTimes);
@@ -3260,7 +3256,7 @@
// This codepath is used for 2-keyframe animations, so we still need to look in the start
// for a timing function. Even in the reversing animation case, the first keyframe provides the timing function.
- basicAnim->setTimingFunction(timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards);
+ basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards);
return true;
}
@@ -3288,7 +3284,7 @@
}
if (i < (valueList.size() - 1))
- timingFunctions.append(timingFunctionForAnimationValue(forwards ? curValue : valueList.at(index - 1), *animation));
+ timingFunctions.append(&timingFunctionForAnimationValue(forwards ? curValue : valueList.at(index - 1), *animation));
}
keyframeAnim->setKeyTimes(keyTimes);
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
index d2497c3..223b15f 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
@@ -239,7 +239,7 @@
RefPtr<PlatformCAAnimation> createSpringAnimation(const Animation*, const String&, bool additive);
void setupAnimation(PlatformCAAnimation*, const Animation*, bool additive);
- const TimingFunction* timingFunctionForAnimationValue(const AnimationValue&, const Animation&);
+ const TimingFunction& timingFunctionForAnimationValue(const AnimationValue&, const Animation&);
bool setAnimationEndpoints(const KeyframeValueList&, const Animation*, PlatformCAAnimation*);
bool setAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformCAAnimation*);
diff --git a/Source/WebCore/platform/graphics/filters/FilterOperations.cpp b/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
index e1d0a97..dc2be1b 100644
--- a/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
+++ b/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,49 +35,33 @@
static inline IntSize outsetSizeForBlur(float stdDeviation)
{
- IntSize kernelSize = FEGaussianBlur::calculateUnscaledKernelSize(FloatPoint(stdDeviation, stdDeviation));
+ auto kernelSize = FEGaussianBlur::calculateUnscaledKernelSize(FloatPoint(stdDeviation, stdDeviation));
- IntSize outset;
// We take the half kernel size and multiply it with three, because we run box blur three times.
- outset.setWidth(3 * kernelSize.width() * 0.5f);
- outset.setHeight(3 * kernelSize.height() * 0.5f);
-
- return outset;
+ return {
+ 3 * kernelSize.width() / 2,
+ 3 * kernelSize.height() / 2
+ };
}
-FilterOperations::FilterOperations()
+bool FilterOperations::operator==(const FilterOperations& other) const
{
-}
-
-FilterOperations& FilterOperations::operator=(const FilterOperations& other)
-{
- m_operations = other.m_operations;
- return *this;
-}
-
-bool FilterOperations::operator==(const FilterOperations& o) const
-{
- if (m_operations.size() != o.m_operations.size())
+ size_t size = m_operations.size();
+ if (size != other.m_operations.size())
return false;
-
- unsigned s = m_operations.size();
- for (unsigned i = 0; i < s; i++) {
- if (*m_operations[i] != *o.m_operations[i])
+ for (size_t i = 0; i < size; i++) {
+ if (*m_operations[i] != *other.m_operations[i])
return false;
}
-
return true;
}
bool FilterOperations::operationsMatch(const FilterOperations& other) const
{
- size_t numOperations = operations().size();
- // If the sizes of the function lists don't match, the lists don't match
- if (numOperations != other.operations().size())
+ size_t size = operations().size();
+ if (size != other.operations().size())
return false;
-
- // If the types of each function are not the same, the lists don't match
- for (size_t i = 0; i < numOperations; ++i) {
+ for (size_t i = 0; i < size; ++i) {
if (!operations()[i]->isSameType(*other.operations()[i]))
return false;
}
@@ -86,8 +70,8 @@
bool FilterOperations::hasReferenceFilter() const
{
- for (size_t i = 0; i < m_operations.size(); ++i) {
- if (m_operations.at(i)->type() == FilterOperation::REFERENCE)
+ for (auto& operation : m_operations) {
+ if (operation->type() == FilterOperation::REFERENCE)
return true;
}
return false;
@@ -95,9 +79,9 @@
bool FilterOperations::hasOutsets() const
{
- for (size_t i = 0; i < m_operations.size(); ++i) {
- FilterOperation::OperationType operationType = m_operations.at(i).get()->type();
- if (operationType == FilterOperation::BLUR || operationType == FilterOperation::DROP_SHADOW)
+ for (auto& operation : m_operations) {
+ auto type = operation->type();
+ if (type == FilterOperation::BLUR || type == FilterOperation::DROP_SHADOW)
return true;
}
return false;
@@ -106,11 +90,10 @@
FilterOutsets FilterOperations::outsets() const
{
FilterOutsets totalOutsets;
- for (size_t i = 0; i < m_operations.size(); ++i) {
- const FilterOperation& filterOperation = *m_operations.at(i);
- switch (filterOperation.type()) {
+ for (auto& operation : m_operations) {
+ switch (operation->type()) {
case FilterOperation::BLUR: {
- const BlurFilterOperation& blurOperation = downcast<BlurFilterOperation>(filterOperation);
+ auto& blurOperation = downcast<BlurFilterOperation>(*operation);
float stdDeviation = floatValueForLength(blurOperation.stdDeviation(), 0);
IntSize outsetSize = outsetSizeForBlur(stdDeviation);
FilterOutsets outsets(outsetSize.height(), outsetSize.width(), outsetSize.height(), outsetSize.width());
@@ -118,14 +101,14 @@
break;
}
case FilterOperation::DROP_SHADOW: {
- const DropShadowFilterOperation& dropShadowOperation = downcast<DropShadowFilterOperation>(filterOperation);
+ auto& dropShadowOperation = downcast<DropShadowFilterOperation>(*operation);
IntSize outsetSize = outsetSizeForBlur(dropShadowOperation.stdDeviation());
- FilterOutsets outsets(
+ FilterOutsets outsets {
std::max(0, outsetSize.height() - dropShadowOperation.y()),
std::max(0, outsetSize.width() + dropShadowOperation.x()),
std::max(0, outsetSize.height() + dropShadowOperation.y()),
std::max(0, outsetSize.width() - dropShadowOperation.x())
- );
+ };
totalOutsets += outsets;
break;
}
@@ -138,24 +121,26 @@
bool FilterOperations::hasFilterThatAffectsOpacity() const
{
- for (size_t i = 0; i < m_operations.size(); ++i)
- if (m_operations[i]->affectsOpacity())
+ for (auto& operation : m_operations) {
+ if (operation->affectsOpacity())
return true;
+ }
return false;
}
bool FilterOperations::hasFilterThatMovesPixels() const
{
- for (size_t i = 0; i < m_operations.size(); ++i)
- if (m_operations[i]->movesPixels())
+ for (auto& operation : m_operations) {
+ if (operation->movesPixels())
return true;
+ }
return false;
}
TextStream& operator<<(TextStream& ts, const FilterOperations& filters)
{
for (size_t i = 0; i < filters.size(); ++i) {
- const auto filter = filters.at(i);
+ auto filter = filters.at(i);
if (filter)
ts << *filter;
else
diff --git a/Source/WebCore/platform/graphics/filters/FilterOperations.h b/Source/WebCore/platform/graphics/filters/FilterOperations.h
index cf2c5b9..486f686 100644
--- a/Source/WebCore/platform/graphics/filters/FilterOperations.h
+++ b/Source/WebCore/platform/graphics/filters/FilterOperations.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,8 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FilterOperations_h
-#define FilterOperations_h
+#pragma once
#include "FilterOperation.h"
#include "IntRectExtent.h"
@@ -33,33 +32,22 @@
namespace WebCore {
-typedef IntRectExtent FilterOutsets;
+using FilterOutsets = IntRectExtent;
class FilterOperations {
WTF_MAKE_FAST_ALLOCATED;
public:
- WEBCORE_EXPORT FilterOperations();
- FilterOperations(const FilterOperations& other) { *this = other; }
-
- WEBCORE_EXPORT FilterOperations& operator=(const FilterOperations&);
-
bool operator==(const FilterOperations&) const;
- bool operator!=(const FilterOperations& o) const
- {
- return !(*this == o);
- }
-
- void clear()
- {
- m_operations.clear();
- }
-
+ bool operator!=(const FilterOperations& other) const { return !(*this == other); }
+
+ void clear() { m_operations.clear(); }
+
Vector<RefPtr<FilterOperation>>& operations() { return m_operations; }
const Vector<RefPtr<FilterOperation>>& operations() const { return m_operations; }
- bool isEmpty() const { return !m_operations.size(); }
+ bool isEmpty() const { return m_operations.isEmpty(); }
size_t size() const { return m_operations.size(); }
- const FilterOperation* at(size_t index) const { return index < m_operations.size() ? m_operations.at(index).get() : 0; }
+ const FilterOperation* at(size_t index) const { return index < m_operations.size() ? m_operations[index].get() : nullptr; }
bool operationsMatch(const FilterOperations&) const;
@@ -70,6 +58,7 @@
bool hasFilterThatMovesPixels() const;
bool hasReferenceFilter() const;
+
private:
Vector<RefPtr<FilterOperation>> m_operations;
};
@@ -77,5 +66,3 @@
WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FilterOperations&);
} // namespace WebCore
-
-#endif // FilterOperations_h
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
index 0bedd0a..9cc1df6 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
@@ -128,19 +128,16 @@
return floor(numSteps * t) / numSteps;
}
-static inline float applyTimingFunction(const TimingFunction* timingFunction, float progress, double duration)
+static inline float applyTimingFunction(const TimingFunction& timingFunction, float progress, double duration)
{
- if (!timingFunction)
- return progress;
-
- if (timingFunction->isCubicBezierTimingFunction()) {
- const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(timingFunction);
- return solveCubicBezierFunction(ctf->x1(), ctf->y1(), ctf->x2(), ctf->y2(), progress, duration);
+ if (timingFunction.isCubicBezierTimingFunction()) {
+ auto& ctf = static_cast<const CubicBezierTimingFunction&>(timingFunction);
+ return solveCubicBezierFunction(ctf.x1(), ctf.y1(), ctf.x2(), ctf.y2(), progress, duration);
}
- if (timingFunction->isStepsTimingFunction()) {
- const StepsTimingFunction* stf = static_cast<const StepsTimingFunction*>(timingFunction);
- return solveStepsFunction(stf->numberOfSteps(), stf->stepAtStart(), double(progress));
+ if (timingFunction.isStepsTimingFunction()) {
+ auto& stf = static_cast<const StepsTimingFunction&>(timingFunction);
+ return solveStepsFunction(stf.numberOfSteps(), stf.stepAtStart(), double(progress));
}
return progress;
@@ -194,13 +191,12 @@
return matrix;
}
-static const TimingFunction* timingFunctionForAnimationValue(const AnimationValue& animValue, const Animation* anim)
+static const TimingFunction& timingFunctionForAnimationValue(const AnimationValue& animationValue, const Animation& animation)
{
- if (animValue.timingFunction())
- return animValue.timingFunction();
- if (anim->timingFunction())
- return anim->timingFunction().get();
-
+ if (animationValue.timingFunction())
+ return *animationValue.timingFunction();
+ if (animation.timingFunction())
+ return *animation.timingFunction();
return CubicBezierTimingFunction::defaultTimingFunction();
}
@@ -257,7 +253,7 @@
return;
}
if (m_keyframes.size() == 2) {
- const TimingFunction* timingFunction = timingFunctionForAnimationValue(m_keyframes.at(0), m_animation.get());
+ auto& timingFunction = timingFunctionForAnimationValue(m_keyframes.at(0), *m_animation);
normalizedValue = applyTimingFunction(timingFunction, normalizedValue, m_animation->duration());
applyInternal(client, m_keyframes.at(0), m_keyframes.at(1), normalizedValue);
return;
@@ -270,7 +266,7 @@
continue;
normalizedValue = (normalizedValue - from.keyTime()) / (to.keyTime() - from.keyTime());
- const TimingFunction* timingFunction = timingFunctionForAnimationValue(from, m_animation.get());
+ auto& timingFunction = timingFunctionForAnimationValue(from, *m_animation);
normalizedValue = applyTimingFunction(timingFunction, normalizedValue, m_animation->duration());
applyInternal(client, from, to, normalizedValue);
break;
diff --git a/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm b/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm
index 584fdab..efbe80f 100644
--- a/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm
+++ b/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm
@@ -60,7 +60,7 @@
}
- (WebSpeechSynthesisWrapper *)initWithSpeechSynthesizer:(WebCore::PlatformSpeechSynthesizer*)synthesizer;
-- (void)speakUtterance:(PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>)utterance;
+- (void)speakUtterance:(RefPtr<WebCore::PlatformSpeechSynthesisUtterance>&&)utterance;
@end
@@ -87,7 +87,7 @@
return rate;
}
-- (void)speakUtterance:(PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>)utterance
+- (void)speakUtterance:(RefPtr<WebCore::PlatformSpeechSynthesisUtterance>&&)utterance
{
// When speak is called we should not have an existing speech utterance outstanding.
ASSERT(!m_utterance);
@@ -124,7 +124,7 @@
[avUtterance setVolume:utterance->volume()];
[avUtterance setPitchMultiplier:utterance->pitch()];
[avUtterance setVoice:avVoice];
- m_utterance = utterance;
+ m_utterance = WTFMove(utterance);
[m_synthesizer speakUtterance:avUtterance];
END_BLOCK_OBJC_EXCEPTIONS
diff --git a/Source/WebCore/platform/mac/ThemeMac.mm b/Source/WebCore/platform/mac/ThemeMac.mm
index a1d785f..2e1b2cb 100644
--- a/Source/WebCore/platform/mac/ThemeMac.mm
+++ b/Source/WebCore/platform/mac/ThemeMac.mm
@@ -155,10 +155,10 @@
if (zoomFactor != 1.0f)
controlSize = IntSize(controlSize.width() * zoomFactor, controlSize.height() * zoomFactor);
LengthSize result = zoomedSize;
- if (zoomedSize.width().isIntrinsicOrAuto() && controlSize.width() > 0)
- result.setWidth(Length(controlSize.width(), Fixed));
- if (zoomedSize.height().isIntrinsicOrAuto() && controlSize.height() > 0)
- result.setHeight(Length(controlSize.height(), Fixed));
+ if (zoomedSize.width.isIntrinsicOrAuto() && controlSize.width() > 0)
+ result.width = { controlSize.width(), Fixed };
+ if (zoomedSize.height.isIntrinsicOrAuto() && controlSize.height() > 0)
+ result.height = { controlSize.height(), Fixed };
return result;
}
@@ -280,7 +280,7 @@
static LengthSize checkboxSize(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor)
{
// If the width and height are both specified, then we have nothing to do.
- if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
+ if (!zoomedSize.width.isIntrinsicOrAuto() && !zoomedSize.height.isIntrinsicOrAuto())
return zoomedSize;
// Use the font size to determine the intrinsic width of the control.
@@ -310,7 +310,7 @@
static LengthSize radioSize(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor)
{
// If the width and height are both specified, then we have nothing to do.
- if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
+ if (!zoomedSize.width.isIntrinsicOrAuto() && !zoomedSize.height.isIntrinsicOrAuto())
return zoomedSize;
// Use the font size to determine the intrinsic width of the control.
@@ -713,9 +713,9 @@
return radioSize(font, zoomedSize, zoomFactor);
case PushButtonPart:
// Height is reset to auto so that specified heights can be ignored.
- return sizeFromFont(font, LengthSize(zoomedSize.width(), Length()), zoomFactor, buttonSizes());
+ return sizeFromFont(font, { zoomedSize.width, { } }, zoomFactor, buttonSizes());
case InnerSpinButtonPart:
- if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
+ if (!zoomedSize.width.isIntrinsicOrAuto() && !zoomedSize.height.isIntrinsicOrAuto())
return zoomedSize;
return sizeFromNSControlSize(stepperControlSizeForFont(font), zoomedSize, zoomFactor, stepperSizes());
default:
@@ -726,17 +726,17 @@
LengthSize ThemeMac::minimumControlSize(ControlPart part, const FontCascade& font, float zoomFactor) const
{
switch (part) {
- case SquareButtonPart:
- case DefaultButtonPart:
- case ButtonPart:
- return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
- case InnerSpinButtonPart:{
- IntSize base = stepperSizes()[NSControlSizeMini];
- return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
- Length(static_cast<int>(base.height() * zoomFactor), Fixed));
- }
- default:
- return Theme::minimumControlSize(part, font, zoomFactor);
+ case SquareButtonPart:
+ case DefaultButtonPart:
+ case ButtonPart:
+ return { { 0, Fixed }, { static_cast<int>(15 * zoomFactor), Fixed } };
+ case InnerSpinButtonPart: {
+ auto& base = stepperSizes()[NSControlSizeMini];
+ return { { static_cast<int>(base.width() * zoomFactor), Fixed },
+ { static_cast<int>(base.height() * zoomFactor), Fixed } };
+ }
+ default:
+ return Theme::minimumControlSize(part, font, zoomFactor);
}
}
diff --git a/Source/WebCore/platform/mac/WidgetMac.mm b/Source/WebCore/platform/mac/WidgetMac.mm
index 4315ccc..ed30ab0 100644
--- a/Source/WebCore/platform/mac/WidgetMac.mm
+++ b/Source/WebCore/platform/mac/WidgetMac.mm
@@ -89,7 +89,7 @@
if (!focused)
return;
- Frame* frame = Frame::frameForWidget(this);
+ Frame* frame = Frame::frameForWidget(*this);
if (!frame)
return;
diff --git a/Source/WebCore/platform/mock/DeviceMotionClientMock.cpp b/Source/WebCore/platform/mock/DeviceMotionClientMock.cpp
deleted file mode 100644
index 922ad43..0000000
--- a/Source/WebCore/platform/mock/DeviceMotionClientMock.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DeviceMotionClientMock.h"
-
-#include "DeviceMotionController.h"
-
-namespace WebCore {
-
-DeviceMotionClientMock::DeviceMotionClientMock()
- : m_controller(0)
- , m_timer(*this, &DeviceMotionClientMock::timerFired)
- , m_isUpdating(false)
-{
-}
-
-void DeviceMotionClientMock::setController(DeviceMotionController* controller)
-{
- ASSERT(!m_controller);
- m_controller = controller;
- ASSERT(m_controller);
-}
-
-void DeviceMotionClientMock::startUpdating()
-{
- m_isUpdating = true;
-}
-
-void DeviceMotionClientMock::stopUpdating()
-{
- m_isUpdating = false;
- m_timer.stop();
-}
-
-void DeviceMotionClientMock::setMotion(PassRefPtr<DeviceMotionData> motion)
-{
- m_motion = motion;
- if (m_isUpdating && !m_timer.isActive())
- m_timer.startOneShot(0);
-}
-
-void DeviceMotionClientMock::timerFired()
-{
- m_timer.stop();
- m_controller->didChangeDeviceMotion(m_motion.get());
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/mock/DeviceMotionClientMock.h b/Source/WebCore/platform/mock/DeviceMotionClientMock.h
deleted file mode 100644
index 7c62682..0000000
--- a/Source/WebCore/platform/mock/DeviceMotionClientMock.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DeviceMotionClientMock_h
-#define DeviceMotionClientMock_h
-
-#include "DeviceMotionClient.h"
-#include "DeviceMotionData.h"
-#include "Timer.h"
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class DeviceMotionController;
-
-// A mock implementation of DeviceMotionClient used to test the feature in
-// DumpRenderTree. Embedders should should configure the Page object to use this
-// client when running DumpRenderTree.
-class DeviceMotionClientMock : public DeviceMotionClient {
-public:
- DeviceMotionClientMock();
-
- // DeviceMotionClient
- void setController(DeviceMotionController*) override;
- void startUpdating() override;
- void stopUpdating() override;
- DeviceMotionData* lastMotion() const override { return m_motion.get(); }
- // mock is owned by the testing framework, which should handle deletion
- void deviceMotionControllerDestroyed() override { }
-
- void setMotion(PassRefPtr<DeviceMotionData>);
-
-private:
- void timerFired();
-
- RefPtr<DeviceMotionData> m_motion;
- DeviceMotionController* m_controller;
- Timer m_timer;
- bool m_isUpdating;
-};
-
-} // namespace WebCore
-
-#endif // DeviceMotionClientMock_h
diff --git a/Source/WebCore/platform/win/CursorWin.cpp b/Source/WebCore/platform/win/CursorWin.cpp
index 38811fc..7a99313 100644
--- a/Source/WebCore/platform/win/CursorWin.cpp
+++ b/Source/WebCore/platform/win/CursorWin.cpp
@@ -40,10 +40,8 @@
namespace WebCore {
-static PassRefPtr<SharedCursor> createSharedCursor(Image* img, const IntPoint& hotSpot)
+static Ref<SharedCursor> createSharedCursor(Image* img, const IntPoint& hotSpot)
{
- RefPtr<SharedCursor> impl;
-
IntPoint effectiveHotSpot = determineHotSpot(img, hotSpot);
static bool doAlpha = windowsVersion() >= WindowsXP;
BitmapInfo cursorImage = BitmapInfo::create(IntSize(img->width(), img->height()));
@@ -52,8 +50,6 @@
auto workingDC = adoptGDIObject(::CreateCompatibleDC(dc));
if (doAlpha) {
auto hCursor = adoptGDIObject(::CreateDIBSection(dc, &cursorImage, DIB_RGB_COLORS, nullptr, 0, 0));
- if (!hCursor)
- return nullptr;
img->getHBITMAP(hCursor.get());
HBITMAP hOldBitmap = (HBITMAP)SelectObject(workingDC.get(), hCursor.get());
@@ -71,15 +67,13 @@
ii.hbmMask = hMask.get();
ii.hbmColor = hCursor.get();
- impl = SharedCursor::create(::CreateIconIndirect(&ii));
+ return SharedCursor::create(::CreateIconIndirect(&ii));
} else {
// Platform doesn't support alpha blended cursors, so we need
// to create the mask manually
auto andMaskDC = adoptGDIObject(::CreateCompatibleDC(dc));
auto xorMaskDC = adoptGDIObject(::CreateCompatibleDC(dc));
auto hCursor = adoptGDIObject(::CreateDIBSection(dc, &cursorImage, DIB_RGB_COLORS, nullptr, 0, 0));
- if (!hCursor)
- return nullptr;
img->getHBITMAP(hCursor.get());
BITMAP cursor;
@@ -108,18 +102,16 @@
icon.yHotspot = effectiveHotSpot.y();
icon.hbmMask = andMask.get();
icon.hbmColor = xorMask.get();
- impl = SharedCursor::create(CreateIconIndirect(&icon));
+ return SharedCursor::create(CreateIconIndirect(&icon));
}
-
- return impl.release();
}
-static PassRefPtr<SharedCursor> loadSharedCursor(HINSTANCE hInstance, LPCWSTR lpCursorName)
+static Ref<SharedCursor> loadSharedCursor(HINSTANCE hInstance, LPCWSTR lpCursorName)
{
return SharedCursor::create(::LoadCursorW(hInstance, lpCursorName));
}
-static PassRefPtr<SharedCursor> loadCursorByName(char* name, int x, int y)
+static Ref<SharedCursor> loadCursorByName(char* name, int x, int y)
{
IntPoint hotSpot(x, y);
RefPtr<Image> cursorImage(Image::loadPlatformResource(name));
diff --git a/Source/WebCore/rendering/FilterEffectRenderer.cpp b/Source/WebCore/rendering/FilterEffectRenderer.cpp
index 00087d2..f59f15f 100644
--- a/Source/WebCore/rendering/FilterEffectRenderer.cpp
+++ b/Source/WebCore/rendering/FilterEffectRenderer.cpp
@@ -364,7 +364,7 @@
ImageBuffer* FilterEffectRenderer::output() const
{
- return const_cast<FilterEffect&>(m_effects.last().get()).asImageBuffer();
+ return m_effects.last()->asImageBuffer();
}
void FilterEffectRenderer::setMaxEffectRects(const FloatRect& effectRect)
@@ -375,7 +375,7 @@
IntRect FilterEffectRenderer::outputRect() const
{
- auto& lastEffect = const_cast<FilterEffect&>(m_effects.last().get());
+ auto& lastEffect = m_effects.last().get();
if (!lastEffect.hasResult())
return { };
return lastEffect.requestedRegionOfInputImageData(IntRect { m_filterRegion });
diff --git a/Source/WebCore/rendering/ImageQualityController.cpp b/Source/WebCore/rendering/ImageQualityController.cpp
index 63b73c5..c2b2216 100644
--- a/Source/WebCore/rendering/ImageQualityController.cpp
+++ b/Source/WebCore/rendering/ImageQualityController.cpp
@@ -113,7 +113,7 @@
return std::nullopt;
}
-InterpolationQuality ImageQualityController::chooseInterpolationQuality(GraphicsContext& context, RenderBoxModelObject* object, Image& image, const void *layer, const LayoutSize& size)
+InterpolationQuality ImageQualityController::chooseInterpolationQuality(GraphicsContext& context, RenderBoxModelObject* object, Image& image, const void* layer, const LayoutSize& size)
{
// If the image is not a bitmap image, then none of this is relevant and we just paint at high quality.
if (!(image.isBitmapImage() || image.isPDFDocumentImage()) || context.paintingDisabled())
diff --git a/Source/WebCore/rendering/InlineFlowBox.cpp b/Source/WebCore/rendering/InlineFlowBox.cpp
index b1fb30a..5a00f9e 100644
--- a/Source/WebCore/rendering/InlineFlowBox.cpp
+++ b/Source/WebCore/rendering/InlineFlowBox.cpp
@@ -1231,12 +1231,14 @@
}
}
-void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op)
+void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& color, const FillLayer& fillLayer, const LayoutRect& rect, CompositeOperator op)
{
- if (!fillLayer)
- return;
- paintFillLayers(paintInfo, c, fillLayer->next(), rect, op);
- paintFillLayer(paintInfo, c, fillLayer, rect, op);
+ Vector<const FillLayer*, 8> layers;
+ for (auto* layer = &fillLayer; layer; layer = layer->next())
+ layers.append(layer);
+ layers.reverse();
+ for (auto* layer : layers)
+ paintFillLayer(paintInfo, color, *layer, rect, op);
}
bool InlineFlowBox::boxShadowCanBeAppliedToBackground(const FillLayer& lastBackgroundLayer) const
@@ -1248,17 +1250,17 @@
return (!hasFillImage && !renderer().style().hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent();
}
-void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op)
+void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& color, const FillLayer& fillLayer, const LayoutRect& rect, CompositeOperator op)
{
- StyleImage* img = fillLayer->image();
- bool hasFillImage = img && img->canRender(&renderer(), renderer().style().effectiveZoom());
+ auto* image = fillLayer.image();
+ bool hasFillImage = image && image->canRender(&renderer(), renderer().style().effectiveZoom());
if ((!hasFillImage && !renderer().style().hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent())
- renderer().paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
+ renderer().paintFillLayerExtended(paintInfo, color, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
#if ENABLE(CSS_BOX_DECORATION_BREAK)
else if (renderer().style().boxDecorationBreak() == DCLONE) {
GraphicsContextStateSaver stateSaver(paintInfo.context());
paintInfo.context().clip(LayoutRect(rect.x(), rect.y(), width(), height()));
- renderer().paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
+ renderer().paintFillLayerExtended(paintInfo, color, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
}
#endif
else {
@@ -1290,7 +1292,7 @@
GraphicsContextStateSaver stateSaver(paintInfo.context());
paintInfo.context().clip(LayoutRect(rect.x(), rect.y(), width(), height()));
- renderer().paintFillLayerExtended(paintInfo, c, fillLayer, LayoutRect(stripX, stripY, stripWidth, stripHeight), BackgroundBleedNone, this, rect.size(), op);
+ renderer().paintFillLayerExtended(paintInfo, color, fillLayer, LayoutRect(stripX, stripY, stripWidth, stripHeight), BackgroundBleedNone, this, rect.size(), op);
}
}
@@ -1446,7 +1448,7 @@
bool flattenCompositingLayers = renderer().view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers;
CompositeOperator compositeOp = CompositeSourceOver;
if (!compositedMask || flattenCompositingLayers) {
- if ((maskBoxImage && renderer().style().maskLayers()->hasImage()) || renderer().style().maskLayers()->next())
+ if ((maskBoxImage && renderer().style().maskLayers().hasImage()) || renderer().style().maskLayers().next())
pushTransparencyLayer = true;
compositeOp = CompositeDestinationIn;
diff --git a/Source/WebCore/rendering/InlineFlowBox.h b/Source/WebCore/rendering/InlineFlowBox.h
index 83905bd..572b025 100644
--- a/Source/WebCore/rendering/InlineFlowBox.h
+++ b/Source/WebCore/rendering/InlineFlowBox.h
@@ -115,8 +115,8 @@
void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
void paintMask(PaintInfo&, const LayoutPoint&);
- void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
- void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
+ void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, CompositeOperator = CompositeSourceOver);
+ void paintFillLayer(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(const PaintInfo&, const RenderStyle&, ShadowStyle, const LayoutRect&);
void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override;
bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction) override;
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 3433ec5..c6ac769 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -1305,10 +1305,9 @@
if (!rootBackgroundRenderer)
return;
- const FillLayer* bgLayer = rootBackgroundRenderer->style().backgroundLayers();
- Color bgColor = rootBackgroundRenderer->style().visitedDependentColor(CSSPropertyBackgroundColor);
-
- paintFillLayers(paintInfo, bgColor, bgLayer, view().backgroundRect(), BackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer);
+ auto& style = rootBackgroundRenderer->style();
+ auto color = style.visitedDependentColor(CSSPropertyBackgroundColor);
+ paintFillLayers(paintInfo, color, style.backgroundLayers(), view().backgroundRect(), BackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer);
}
BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext& context) const
@@ -1449,12 +1448,13 @@
return true;
}
- if (!style().backgroundLayers()->image() || style().backgroundLayers()->next()) {
+ auto& layers = style().backgroundLayers();
+ if (!layers.image() || layers.next()) {
paintedExtent = backgroundRect;
return true;
}
- BackgroundImageGeometry geometry = calculateBackgroundImageGeometry(nullptr, *style().backgroundLayers(), paintOffset, backgroundRect);
+ auto geometry = calculateBackgroundImageGeometry(nullptr, layers, paintOffset, backgroundRect);
paintedExtent = geometry.destRect();
return !geometry.hasNonLocalGeometry();
}
@@ -1484,7 +1484,7 @@
return false;
// FIXME: The background color clip is defined by the last layer.
- if (style().backgroundLayers()->next())
+ if (style().backgroundLayers().next())
return false;
LayoutRect backgroundRect;
switch (style().backgroundClip()) {
@@ -1574,19 +1574,19 @@
bool RenderBox::backgroundHasOpaqueTopLayer() const
{
- const FillLayer* fillLayer = style().backgroundLayers();
- if (!fillLayer || fillLayer->clip() != BorderFillBox)
+ auto& fillLayer = style().backgroundLayers();
+ if (fillLayer.clip() != BorderFillBox)
return false;
// Clipped with local scrolling
- if (hasOverflowClip() && fillLayer->attachment() == LocalBackgroundAttachment)
+ if (hasOverflowClip() && fillLayer.attachment() == LocalBackgroundAttachment)
return false;
- if (fillLayer->hasOpaqueImage(*this) && fillLayer->hasRepeatXY() && fillLayer->image()->canRender(this, style().effectiveZoom()))
+ if (fillLayer.hasOpaqueImage(*this) && fillLayer.hasRepeatXY() && fillLayer.image()->canRender(this, style().effectiveZoom()))
return true;
// If there is only one layer and no image, check whether the background color is opaque.
- if (!fillLayer->next() && !fillLayer->hasImage()) {
+ if (!fillLayer.next() && !fillLayer.hasImage()) {
Color bgColor = style().visitedDependentColor(CSSPropertyBackgroundColor);
if (bgColor.isOpaque())
return true;
@@ -1625,15 +1625,12 @@
if (!compositedMask || flattenCompositingLayers) {
pushTransparencyLayer = true;
- StyleImage* maskBoxImage = style().maskBoxImage().image();
- const FillLayer* maskLayers = style().maskLayers();
// Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content.
- if (maskBoxImage)
+ if (auto* maskBoxImage = style().maskBoxImage().image())
allMaskImagesLoaded &= maskBoxImage->isLoaded();
- if (maskLayers)
- allMaskImagesLoaded &= maskLayers->imagesAreLoaded();
+ allMaskImagesLoaded &= style().maskLayers().imagesAreLoaded();
paintInfo.context().setCompositeOperation(CompositeDestinationIn);
paintInfo.context().beginTransparencyLayer(1);
@@ -1662,71 +1659,69 @@
LayoutRect result;
LayoutRect borderBox = borderBoxRect();
- for (const FillLayer* maskLayer = style().maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
+ for (auto* maskLayer = &style().maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
if (maskLayer->image()) {
// Masks should never have fixed attachment, so it's OK for paintContainer to be null.
- BackgroundImageGeometry geometry = calculateBackgroundImageGeometry(nullptr, *maskLayer, paintOffset, borderBox);
- result.unite(geometry.destRect());
+ result.unite(calculateBackgroundImageGeometry(nullptr, *maskLayer, paintOffset, borderBox).destRect());
}
}
return result;
}
-void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect,
+void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& color, const FillLayer& fillLayer, const LayoutRect& rect,
BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderElement* backgroundObject)
{
Vector<const FillLayer*, 8> layers;
- const FillLayer* curLayer = fillLayer;
bool shouldDrawBackgroundInSeparateBuffer = false;
- while (curLayer) {
- layers.append(curLayer);
+
+ for (auto* layer = &fillLayer; layer; layer = layer->next()) {
+ layers.append(layer);
+
+ if (layer->blendMode() != BlendModeNormal)
+ shouldDrawBackgroundInSeparateBuffer = true;
+
// Stop traversal when an opaque layer is encountered.
- // FIXME : It would be possible for the following occlusion culling test to be more aggressive
+ // FIXME: It would be possible for the following occlusion culling test to be more aggressive
// on layers with no repeat by testing whether the image covers the layout rect.
// Testing that here would imply duplicating a lot of calculations that are currently done in
// RenderBoxModelObject::paintFillLayerExtended. A more efficient solution might be to move
// the layer recursion into paintFillLayerExtended, or to compute the layer geometry here
// and pass it down.
- if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != BlendModeNormal)
- shouldDrawBackgroundInSeparateBuffer = true;
-
// The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting.
- if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer->hasOpaqueImage(*this) && curLayer->image()->canRender(this, style().effectiveZoom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == BlendModeNormal)
+ if (layer->clipOccludesNextLayers(layer == &fillLayer) && layer->hasOpaqueImage(*this) && layer->image()->canRender(this, style().effectiveZoom()) && layer->hasRepeatXY() && layer->blendMode() == BlendModeNormal)
break;
- curLayer = curLayer->next();
}
- GraphicsContext& context = paintInfo.context();
- BaseBackgroundColorUsage baseBgColorUsage = BaseBackgroundColorUse;
+ auto& context = paintInfo.context();
+ auto baseBgColorUsage = BaseBackgroundColorUse;
if (shouldDrawBackgroundInSeparateBuffer) {
- paintFillLayer(paintInfo, c, *layers.rbegin(), rect, bleedAvoidance, op, backgroundObject, BaseBackgroundColorOnly);
+ paintFillLayer(paintInfo, color, *layers.last(), rect, bleedAvoidance, op, backgroundObject, BaseBackgroundColorOnly);
baseBgColorUsage = BaseBackgroundColorSkip;
context.beginTransparencyLayer(1);
}
- Vector<const FillLayer*>::const_reverse_iterator topLayer = layers.rend();
- for (Vector<const FillLayer*>::const_reverse_iterator it = layers.rbegin(); it != topLayer; ++it)
- paintFillLayer(paintInfo, c, *it, rect, bleedAvoidance, op, backgroundObject, baseBgColorUsage);
+ auto topLayer = layers.rend();
+ for (auto it = layers.rbegin(); it != topLayer; ++it)
+ paintFillLayer(paintInfo, color, **it, rect, bleedAvoidance, op, backgroundObject, baseBgColorUsage);
if (shouldDrawBackgroundInSeparateBuffer)
context.endTransparencyLayer();
}
-void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect,
+void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer& fillLayer, const LayoutRect& rect,
BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderElement* backgroundObject, BaseBackgroundColorUsage baseBgColorUsage)
{
paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, nullptr, LayoutSize(), op, backgroundObject, baseBgColorUsage);
}
-static bool layersUseImage(WrappedImagePtr image, const FillLayer* layers)
+static bool layersUseImage(WrappedImagePtr image, const FillLayer& layers)
{
- for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer->next()) {
- if (curLayer->image() && image == curLayer->image()->data())
+ for (auto* layer = &layers; layer; layer = layer->next()) {
+ if (layer->image() && image == layer->image()->data())
return true;
}
-
return false;
}
@@ -1760,13 +1755,13 @@
layer()->contentChanged(BackgroundImageChanged);
}
-bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layers, bool drawingBackground)
+bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer& layers, bool drawingBackground)
{
LayoutRect rendererRect;
RenderBox* layerRenderer = nullptr;
- for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer->next()) {
- if (curLayer->image() && image == curLayer->image()->data() && curLayer->image()->canRender(this, style().effectiveZoom())) {
+ for (auto* layer = &layers; layer; layer = layer->next()) {
+ if (layer->image() && image == layer->image()->data() && layer->image()->canRender(this, style().effectiveZoom())) {
// Now that we know this image is being used, compute the renderer and the rect if we haven't already.
bool drawingRootBackground = drawingBackground && (isDocumentElementRenderer() || (isBody() && !document().documentElement()->renderer()->hasBackground()));
if (!layerRenderer) {
@@ -1786,7 +1781,7 @@
}
}
// FIXME: Figure out how to pass absolute position to calculateBackgroundImageGeometry (for pixel snapping)
- BackgroundImageGeometry geometry = layerRenderer->calculateBackgroundImageGeometry(nullptr, *curLayer, LayoutPoint(), rendererRect);
+ BackgroundImageGeometry geometry = layerRenderer->calculateBackgroundImageGeometry(nullptr, *layer, LayoutPoint(), rendererRect);
if (geometry.hasNonLocalGeometry()) {
// Rather than incur the costs of computing the paintContainer for renderers with fixed backgrounds
// in order to get the right destRect, just repaint the entire renderer.
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index 4f5549d..1001427 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -627,8 +627,8 @@
void paintBackground(const PaintInfo&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone);
- void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderElement* backgroundObject, BaseBackgroundColorUsage = BaseBackgroundColorUse);
- void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderElement* backgroundObject = nullptr);
+ void paintFillLayer(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderElement* backgroundObject, BaseBackgroundColorUsage = BaseBackgroundColorUse);
+ void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderElement* backgroundObject = nullptr);
void paintMaskImages(const PaintInfo&, const LayoutRect&);
@@ -667,8 +667,8 @@
bool isScrollableOrRubberbandableBox() const override;
- // Returns true if we did a full repaint
- bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layers, bool drawingBackground);
+ // Returns true if we did a full repaint.
+ bool repaintLayerRectsForImage(WrappedImagePtr, const FillLayer& layers, bool drawingBackground);
bool skipContainingBlockForPercentHeightCalculation(const RenderBox& containingBlock, bool isPerpendicularWritingMode) const;
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp
index 766bffd..a6657e2 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp
@@ -623,7 +623,7 @@
}
}
-void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, const LayoutRect& rect,
+void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer& bgLayer, const LayoutRect& rect,
BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSize& boxSize, CompositeOperator op, RenderElement* backgroundObject, BaseBackgroundColorUsage baseBgColorUsage)
{
GraphicsContext& context = paintInfo.context();
@@ -634,12 +634,12 @@
bool includeRightEdge = box ? box->includeLogicalRightEdge() : true;
bool hasRoundedBorder = style().hasBorderRadius() && (includeLeftEdge || includeRightEdge);
- bool clippedWithLocalScrolling = hasOverflowClip() && bgLayer->attachment() == LocalBackgroundAttachment;
- bool isBorderFill = bgLayer->clip() == BorderFillBox;
+ bool clippedWithLocalScrolling = hasOverflowClip() && bgLayer.attachment() == LocalBackgroundAttachment;
+ bool isBorderFill = bgLayer.clip() == BorderFillBox;
bool isRoot = this->isDocumentElementRenderer();
Color bgColor = color;
- StyleImage* bgImage = bgLayer->image();
+ StyleImage* bgImage = bgLayer.image();
bool shouldPaintBackgroundImage = bgImage && bgImage->canRender(this, style().effectiveZoom());
bool forceBackgroundToWhite = false;
@@ -659,7 +659,7 @@
// while rendering.)
if (forceBackgroundToWhite) {
// Note that we can't reuse this variable below because the bgColor might be changed
- bool shouldPaintBackgroundColor = !bgLayer->next() && bgColor.isVisible();
+ bool shouldPaintBackgroundColor = !bgLayer.next() && bgColor.isVisible();
if (shouldPaintBackgroundImage || shouldPaintBackgroundColor) {
bgColor = Color::white;
shouldPaintBackgroundImage = false;
@@ -667,7 +667,7 @@
}
bool baseBgColorOnly = (baseBgColorUsage == BaseBackgroundColorOnly);
- if (baseBgColorOnly && (!isRoot || bgLayer->next() || bgColor.isOpaque()))
+ if (baseBgColorOnly && (!isRoot || bgLayer.next() || bgColor.isOpaque()))
return;
bool colorVisible = bgColor.isVisible();
@@ -675,7 +675,7 @@
FloatRect pixelSnappedRect = snapRectToDevicePixels(rect, deviceScaleFactor);
// Fast path for drawing simple color backgrounds.
- if (!isRoot && !clippedWithLocalScrolling && !shouldPaintBackgroundImage && isBorderFill && !bgLayer->next()) {
+ if (!isRoot && !clippedWithLocalScrolling && !shouldPaintBackgroundImage && isBorderFill && !bgLayer.next()) {
if (!colorVisible)
return;
@@ -708,10 +708,10 @@
RoundedRect border = isBorderFill ? backgroundRoundedRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance, box, boxSize, includeLeftEdge, includeRightEdge) : getBackgroundRoundedRect(rect, box, boxSize.width(), boxSize.height(), includeLeftEdge, includeRightEdge);
// Clip to the padding or content boxes as necessary.
- if (bgLayer->clip() == ContentFillBox) {
+ if (bgLayer.clip() == ContentFillBox) {
border = style().getRoundedInnerBorderFor(border.rect(),
paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), paddingRight() + borderRight(), includeLeftEdge, includeRightEdge);
- } else if (bgLayer->clip() == PaddingFillBox)
+ } else if (bgLayer.clip() == PaddingFillBox)
border = style().getRoundedInnerBorderFor(border.rect(), includeLeftEdge, includeRightEdge);
clipRoundedInnerRect(context, pixelSnappedRect, border.pixelSnappedRoundedRectForPainting(deviceScaleFactor));
@@ -739,10 +739,10 @@
std::unique_ptr<ImageBuffer> maskImage;
IntRect maskRect;
- if (bgLayer->clip() == PaddingFillBox || bgLayer->clip() == ContentFillBox) {
+ if (bgLayer.clip() == PaddingFillBox || bgLayer.clip() == ContentFillBox) {
// Clip to the padding or content boxes as necessary.
if (!clipToBorderRadius) {
- bool includePadding = bgLayer->clip() == ContentFillBox;
+ bool includePadding = bgLayer.clip() == ContentFillBox;
LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : LayoutUnit()),
scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : LayoutUnit()),
scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : LayoutUnit()),
@@ -750,7 +750,7 @@
backgroundClipStateSaver.save();
context.clip(clipRect);
}
- } else if (bgLayer->clip() == TextFillBox) {
+ } else if (bgLayer.clip() == TextFillBox) {
// We have to draw our text into a mask that can then be used to clip background drawing.
// First figure out how big the mask has to be. It should be no bigger than what we need
// to actually render, so we should intersect the dirty rect with the border box of the background.
@@ -774,7 +774,7 @@
bool isOpaqueRoot = false;
if (isRoot) {
isOpaqueRoot = true;
- if (!bgLayer->next() && !bgColor.isOpaque()) {
+ if (!bgLayer.next() && !bgColor.isOpaque()) {
HTMLFrameOwnerElement* ownerElement = document().ownerElement();
if (ownerElement) {
if (!ownerElement->hasTagName(frameTag)) {
@@ -797,12 +797,12 @@
}
// Paint the color first underneath all images, culled if background image occludes it.
- // FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culling test
+ // FIXME: In the bgLayer.hasFiniteBounds() case, we could improve the culling test
// by verifying whether the background image covers the entire layout rect.
- if (!bgLayer->next()) {
+ if (!bgLayer.next()) {
LayoutRect backgroundRect(scrolledPaintRect);
bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(rect.location(), bleedAvoidance, box);
- if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer->hasOpaqueImage(*this) || !bgLayer->hasRepeatXY()) {
+ if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer.hasOpaqueImage(*this) || !bgLayer.hasRepeatXY()) {
if (!boxShadowShouldBeAppliedToBackground)
backgroundRect.intersect(paintInfo.rect);
@@ -823,10 +823,9 @@
if (baseColor.isVisible()) {
if (!baseBgColorOnly && bgColor.isVisible())
baseColor = baseColor.blend(bgColor);
-
context.fillRect(backgroundRectForPainting, baseColor, CompositeCopy);
} else if (!baseBgColorOnly && bgColor.isVisible()) {
- CompositeOperator operation = shouldClearBackground ? CompositeCopy : context.compositeOperation();
+ auto operation = shouldClearBackground ? CompositeCopy : context.compositeOperation();
context.fillRect(backgroundRectForPainting, bgColor, operation);
} else if (shouldClearBackground)
context.clearRect(backgroundRectForPainting);
@@ -835,19 +834,19 @@
// no progressive loading of the background image
if (!baseBgColorOnly && shouldPaintBackgroundImage) {
- BackgroundImageGeometry geometry = calculateBackgroundImageGeometry(paintInfo.paintContainer, *bgLayer, rect.location(), scrolledPaintRect, backgroundObject);
+ auto geometry = calculateBackgroundImageGeometry(paintInfo.paintContainer, bgLayer, rect.location(), scrolledPaintRect, backgroundObject);
geometry.clip(LayoutRect(pixelSnappedRect));
RefPtr<Image> image;
if (!geometry.destRect().isEmpty() && (image = bgImage->image(backgroundObject ? backgroundObject : this, geometry.tileSize()))) {
- CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer->composite() : op;
- context.setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance);
+ auto compositeOp = op == CompositeSourceOver ? bgLayer.composite() : op;
+ context.setDrawLuminanceMask(bgLayer.maskSourceType() == MaskLuminance);
- InterpolationQuality interpolation = chooseInterpolationQuality(context, *image, bgLayer, geometry.tileSize());
- context.drawTiledImage(*image, geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), geometry.spaceSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), interpolation));
+ auto interpolation = chooseInterpolationQuality(context, *image, &bgLayer, geometry.tileSize());
+ context.drawTiledImage(*image, geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), geometry.spaceSize(), ImagePaintingOptions(compositeOp, bgLayer.blendMode(), ImageOrientationDescription(), interpolation));
}
}
- if (maskImage && bgLayer->clip() == TextFillBox) {
+ if (maskImage && bgLayer.clip() == TextFillBox) {
context.drawConsumingImageBuffer(WTFMove(maskImage), maskRect, CompositeDestinationIn);
context.endTransparencyLayer();
}
@@ -960,8 +959,8 @@
case SizeLength: {
LayoutSize tileSize = positioningAreaSize;
- Length layerWidth = fillLayer.size().size.width();
- Length layerHeight = fillLayer.size().size.height();
+ Length layerWidth = fillLayer.size().size.width;
+ Length layerHeight = fillLayer.size().size.height;
if (layerWidth.isFixed())
tileSize.setWidth(layerWidth.value());
@@ -985,7 +984,7 @@
// If both width and height are auto, use the image's intrinsic size.
tileSize = imageIntrinsicSize;
}
-
+
tileSize.clampNegativeToZero();
return tileSize;
}
@@ -1170,7 +1169,7 @@
LayoutUnit computedXPosition = resolveEdgeRelativeLength(fillLayer.xPosition(), fillLayer.backgroundXOrigin(), availableWidth, positioningAreaSize, tileSize);
if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > 0 && tileSize.width() > 0) {
int numTiles = std::max(1, roundToInt(positioningAreaSize.width() / tileSize.width()));
- if (fillLayer.size().size.height().isAuto() && backgroundRepeatY != RoundFill)
+ if (fillLayer.size().size.height.isAuto() && backgroundRepeatY != RoundFill)
tileSize.setHeight(tileSize.height() * positioningAreaSize.width() / (numTiles * tileSize.width()));
tileSize.setWidth(positioningAreaSize.width() / numTiles);
@@ -1180,7 +1179,7 @@
LayoutUnit computedYPosition = resolveEdgeRelativeLength(fillLayer.yPosition(), fillLayer.backgroundYOrigin(), availableHeight, positioningAreaSize, tileSize);
if (backgroundRepeatY == RoundFill && positioningAreaSize.height() > 0 && tileSize.height() > 0) {
int numTiles = std::max(1, roundToInt(positioningAreaSize.height() / tileSize.height()));
- if (fillLayer.size().size.width().isAuto() && backgroundRepeatX != RoundFill)
+ if (fillLayer.size().size.width.isAuto() && backgroundRepeatX != RoundFill)
tileSize.setWidth(tileSize.width() * positioningAreaSize.height() / (numTiles * tileSize.height()));
tileSize.setHeight(positioningAreaSize.height() / numTiles);
@@ -1249,7 +1248,7 @@
void RenderBoxModelObject::getGeometryForBackgroundImage(const RenderLayerModelObject* paintContainer, const LayoutPoint& paintOffset, FloatRect& destRect, FloatSize& phase, FloatSize& tileSize) const
{
LayoutRect paintRect(destRect);
- BackgroundImageGeometry geometry = calculateBackgroundImageGeometry(paintContainer, *style().backgroundLayers(), paintOffset, paintRect);
+ auto geometry = calculateBackgroundImageGeometry(paintContainer, style().backgroundLayers(), paintOffset, paintRect);
phase = geometry.phase();
tileSize = geometry.tileSize();
destRect = geometry.destRect();
@@ -2169,8 +2168,8 @@
if (!backgroundColor.isOpaque())
return false;
- const FillLayer* lastBackgroundLayer = style().backgroundLayers();
- for (const FillLayer* next = lastBackgroundLayer->next(); next; next = lastBackgroundLayer->next())
+ auto* lastBackgroundLayer = &style().backgroundLayers();
+ while (auto* next = lastBackgroundLayer->next())
lastBackgroundLayer = next;
if (lastBackgroundLayer->clip() != BorderFillBox)
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.h b/Source/WebCore/rendering/RenderBoxModelObject.h
index 78f52ec..93ec2ce 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.h
+++ b/Source/WebCore/rendering/RenderBoxModelObject.h
@@ -206,7 +206,7 @@
void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle&, BackgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
bool paintNinePieceImage(GraphicsContext&, const LayoutRect&, const RenderStyle&, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle&, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
- void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = nullptr, const LayoutSize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderElement* backgroundObject = nullptr, BaseBackgroundColorUsage = BaseBackgroundColorUse);
+ void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = nullptr, const LayoutSize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderElement* backgroundObject = nullptr, BaseBackgroundColorUsage = BaseBackgroundColorUse);
virtual bool boxShadowShouldBeAppliedToBackground(const LayoutPoint& absolutePaintPostion, BackgroundBleedAvoidance, InlineFlowBox* = nullptr) const;
diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp
index e27b41a..f847ffd 100644
--- a/Source/WebCore/rendering/RenderElement.cpp
+++ b/Source/WebCore/rendering/RenderElement.cpp
@@ -135,22 +135,18 @@
RenderElement::~RenderElement()
{
if (hasInitializedStyle()) {
- for (const FillLayer* bgLayer = m_style.backgroundLayers(); bgLayer; bgLayer = bgLayer->next()) {
- if (StyleImage* backgroundImage = bgLayer->image())
+ for (auto* bgLayer = &m_style.backgroundLayers(); bgLayer; bgLayer = bgLayer->next()) {
+ if (auto* backgroundImage = bgLayer->image())
backgroundImage->removeClient(this);
}
-
- for (const FillLayer* maskLayer = m_style.maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
- if (StyleImage* maskImage = maskLayer->image())
+ for (auto* maskLayer = &m_style.maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
+ if (auto* maskImage = maskLayer->image())
maskImage->removeClient(this);
}
-
- if (StyleImage* borderImage = m_style.borderImage().image())
+ if (auto* borderImage = m_style.borderImage().image())
borderImage->removeClient(this);
-
- if (StyleImage* maskBoxImage = m_style.maskBoxImage().image())
+ if (auto* maskBoxImage = m_style.maskBoxImage().image())
maskBoxImage->removeClient(this);
-
if (auto shapeValue = m_style.shapeOutside()) {
if (auto shapeImage = shapeValue->image())
shapeImage->removeClient(this);
@@ -303,8 +299,8 @@
}
if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLayer()) {
- RenderLayer* layer = downcast<RenderLayerModelObject>(*this).layer();
- if (!layer->isComposited() || layer->paintsWithFilters())
+ auto& layer = *downcast<RenderLayerModelObject>(*this).layer();
+ if (!layer.isComposited() || layer.paintsWithFilters())
diff = std::max(diff, StyleDifferenceRepaintLayer);
else
diff = std::max(diff, StyleDifferenceRecompositeLayer);
@@ -341,21 +337,20 @@
return diff == StyleDifferenceRepaint || (diff == StyleDifferenceRepaintIfTextOrBorderOrOutline && hasImmediateNonWhitespaceTextChildOrBorderOrOutline());
}
-void RenderElement::updateFillImages(const FillLayer* oldLayers, const FillLayer* newLayers)
+void RenderElement::updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers)
{
- // Optimize the common case
- if (FillLayer::imagesIdentical(oldLayers, newLayers))
+ // Optimize the common case.
+ if (FillLayer::imagesIdentical(oldLayers, &newLayers))
return;
- // Go through the new layers and addClients first, to avoid removing all clients of an image.
- for (const FillLayer* currNew = newLayers; currNew; currNew = currNew->next()) {
- if (currNew->image())
- currNew->image()->addClient(this);
+ // Add before removing, to avoid removing all clients of an image that is in both sets.
+ for (auto* layer = &newLayers; layer; layer = layer->next()) {
+ if (layer->image())
+ layer->image()->addClient(this);
}
-
- for (const FillLayer* currOld = oldLayers; currOld; currOld = currOld->next()) {
- if (currOld->image())
- currOld->image()->removeClient(this);
+ for (auto* layer = oldLayers; layer; layer = layer->next()) {
+ if (layer->image())
+ layer->image()->removeClient(this);
}
}
@@ -409,8 +404,7 @@
Style::loadPendingResources(style, document(), element());
styleWillChange(diff, style);
- auto oldStyle = WTFMove(m_style);
- m_style = WTFMove(style);
+ auto oldStyle = m_style.replace(WTFMove(style));
bool detachedFromParent = !parent();
// Make sure we invalidate the containing block cache for flows when the contianing block context changes
@@ -807,7 +801,7 @@
auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), elementChild.style().display());
if (style().specifiesColumns()) {
if (elementChild.style().specifiesColumns())
- newStyle.inheritColumnPropertiesFrom(&style());
+ newStyle.inheritColumnPropertiesFrom(style());
if (elementChild.style().columnSpan())
newStyle.setColumnSpan(ColumnSpanAll);
}
@@ -999,8 +993,8 @@
void RenderElement::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
- updateFillImages(oldStyle ? oldStyle->backgroundLayers() : nullptr, m_style.backgroundLayers());
- updateFillImages(oldStyle ? oldStyle->maskLayers() : nullptr, m_style.maskLayers());
+ updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : nullptr, m_style.backgroundLayers());
+ updateFillImages(oldStyle ? &oldStyle->maskLayers() : nullptr, m_style.maskLayers());
updateImage(oldStyle ? oldStyle->borderImage().image() : nullptr, m_style.borderImage().image());
updateImage(oldStyle ? oldStyle->maskBoxImage().image() : nullptr, m_style.maskBoxImage().image());
updateShapeImage(oldStyle ? oldStyle->shapeOutside() : nullptr, m_style.shapeOutside());
@@ -1231,41 +1225,39 @@
{
StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
- RenderObject* child = firstChild();
- while (child) {
+ for (auto* child = firstChild(); child; child = child->nextSibling()) {
if (child->needsLayout())
downcast<RenderElement>(*child).layout();
ASSERT(!child->needsLayout());
- child = child->nextSibling();
}
clearNeedsLayout();
}
-static bool mustRepaintFillLayers(const RenderElement& renderer, const FillLayer* layer)
+static bool mustRepaintFillLayers(const RenderElement& renderer, const FillLayer& layer)
{
// Nobody will use multiple layers without wanting fancy positioning.
- if (layer->next())
+ if (layer.next())
return true;
// Make sure we have a valid image.
- StyleImage* image = layer->image();
+ auto* image = layer.image();
if (!image || !image->canRender(&renderer, renderer.style().effectiveZoom()))
return false;
- if (!layer->xPosition().isZero() || !layer->yPosition().isZero())
+ if (!layer.xPosition().isZero() || !layer.yPosition().isZero())
return true;
- EFillSizeType sizeType = layer->sizeType();
+ auto sizeType = layer.sizeType();
if (sizeType == Contain || sizeType == Cover)
return true;
if (sizeType == SizeLength) {
- LengthSize size = layer->sizeLength();
- if (size.width().isPercentOrCalculated() || size.height().isPercentOrCalculated())
+ auto size = layer.sizeLength();
+ if (size.width.isPercentOrCalculated() || size.height.isPercentOrCalculated())
return true;
// If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.
- if ((size.width().isAuto() || size.height().isAuto()) && image->isGeneratedImage())
+ if ((size.width.isAuto() || size.height.isAuto()) && image->isGeneratedImage())
return true;
} else if (image->usesImageContainerSize())
return true;
@@ -1365,14 +1357,14 @@
style().getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
LayoutUnit borderRight = is<RenderBox>(*this) ? downcast<RenderBox>(*this).borderRight() : LayoutUnit::fromPixel(0);
LayoutUnit boxWidth = is<RenderBox>(*this) ? downcast<RenderBox>(*this).width() : LayoutUnit();
- LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min<LayoutUnit>(newBounds.width(), oldBounds.width()));
- LayoutUnit borderWidth = std::max<LayoutUnit>(borderRight, std::max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));
- LayoutUnit decorationsWidth = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderWidth + minInsetRightShadowExtent) + std::max<LayoutUnit>(outlineWidth, shadowRight);
+ LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min(newBounds.width(), oldBounds.width()));
+ LayoutUnit borderWidth = std::max(borderRight, std::max(valueForLength(style().borderTopRightRadius().width, boxWidth), valueForLength(style().borderBottomRightRadius().width, boxWidth)));
+ LayoutUnit decorationsWidth = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderWidth + minInsetRightShadowExtent) + std::max(outlineWidth, shadowRight);
LayoutRect rightRect(newOutlineBox.x() + std::min(newOutlineBox.width(), oldOutlineBox.width()) - decorationsWidth,
newOutlineBox.y(),
width + decorationsWidth,
std::max(newOutlineBox.height(), oldOutlineBox.height()));
- LayoutUnit right = std::min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX());
+ LayoutUnit right = std::min(newBounds.maxX(), oldBounds.maxX());
if (rightRect.x() < right) {
rightRect.setWidth(std::min(rightRect.width(), right - rightRect.x()));
repaintUsingContainer(repaintContainer, rightRect);
@@ -1385,10 +1377,10 @@
style().getBoxShadowVerticalExtent(shadowTop, shadowBottom);
LayoutUnit borderBottom = is<RenderBox>(*this) ? downcast<RenderBox>(*this).borderBottom() : LayoutUnit::fromPixel(0);
LayoutUnit boxHeight = is<RenderBox>(*this) ? downcast<RenderBox>(*this).height() : LayoutUnit();
- LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min<LayoutUnit>(newBounds.height(), oldBounds.height()));
- LayoutUnit borderHeight = std::max<LayoutUnit>(borderBottom, std::max<LayoutUnit>(valueForLength(style().borderBottomLeftRadius().height(), boxHeight),
- valueForLength(style().borderBottomRightRadius().height(), boxHeight)));
- LayoutUnit decorationsHeight = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderHeight + minInsetBottomShadowExtent) + std::max<LayoutUnit>(outlineWidth, shadowBottom);
+ LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min(newBounds.height(), oldBounds.height()));
+ LayoutUnit borderHeight = std::max(borderBottom, std::max(valueForLength(style().borderBottomLeftRadius().height, boxHeight),
+ valueForLength(style().borderBottomRightRadius().height, boxHeight)));
+ LayoutUnit decorationsHeight = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderHeight + minInsetBottomShadowExtent) + std::max(outlineWidth, shadowBottom);
LayoutRect bottomRect(newOutlineBox.x(),
std::min(newOutlineBox.maxY(), oldOutlineBox.maxY()) - decorationsHeight,
std::max(newOutlineBox.width(), oldOutlineBox.width()),
diff --git a/Source/WebCore/rendering/RenderElement.h b/Source/WebCore/rendering/RenderElement.h
index 2803744..c6f9701 100644
--- a/Source/WebCore/rendering/RenderElement.h
+++ b/Source/WebCore/rendering/RenderElement.h
@@ -294,7 +294,7 @@
bool shouldRepaintForStyleDifference(StyleDifference) const;
bool hasImmediateNonWhitespaceTextChildOrBorderOrOutline() const;
- void updateFillImages(const FillLayer*, const FillLayer*);
+ void updateFillImages(const FillLayer*, const FillLayer&);
void updateImage(StyleImage*, StyleImage*);
void updateShapeImage(const ShapeValue*, const ShapeValue*);
diff --git a/Source/WebCore/rendering/RenderGrid.cpp b/Source/WebCore/rendering/RenderGrid.cpp
index 13fca78..21ce261 100644
--- a/Source/WebCore/rendering/RenderGrid.cpp
+++ b/Source/WebCore/rendering/RenderGrid.cpp
@@ -2755,7 +2755,7 @@
if (contentAlignment.isValid())
return contentAlignment;
- auto overflow = isRowAxis ? style().justifyContentOverflowAlignment() : style().alignContentOverflowAlignment();
+ auto overflow = (isRowAxis ? style().justifyContent() : style().alignContent()).overflow();
if (availableFreeSpace <= 0 && overflow == OverflowAlignmentSafe)
return {0, 0};
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 051d44b..aceed7d 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -3143,17 +3143,18 @@
Ref<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientation)
{
RefPtr<Scrollbar> widget;
- RenderElement* actualRenderer = rendererForScrollbar(renderer());
- bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->style().hasPseudoStyle(SCROLLBAR);
+ ASSERT(rendererForScrollbar(renderer()));
+ auto& actualRenderer = *rendererForScrollbar(renderer());
+ bool hasCustomScrollbarStyle = is<RenderBox>(actualRenderer) && downcast<RenderBox>(actualRenderer).style().hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(*this, orientation, actualRenderer->element());
+ widget = RenderScrollbar::createCustomScrollbar(*this, orientation, downcast<RenderBox>(actualRenderer).element());
else {
widget = Scrollbar::createNativeScrollbar(*this, orientation, RegularScrollbar);
didAddScrollbar(widget.get(), orientation);
if (page().expectsWheelEventTriggers())
scrollAnimator().setWheelEventTestTrigger(page().testTrigger());
}
- renderer().view().frameView().addChild(widget.get());
+ renderer().view().frameView().addChild(*widget);
return widget.releaseNonNull();
}
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index c8c40c5..3ec7fdd 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -1726,30 +1726,27 @@
static bool canCreateTiledImage(const RenderStyle& style)
{
- const FillLayer* fillLayer = style.backgroundLayers();
- if (fillLayer->next())
+ auto& fillLayer = style.backgroundLayers();
+ if (fillLayer.next())
return false;
- if (!fillLayer->imagesAreLoaded())
+ if (!fillLayer.imagesAreLoaded())
return false;
- if (fillLayer->attachment() != ScrollBackgroundAttachment)
+ if (fillLayer.attachment() != ScrollBackgroundAttachment)
return false;
- Color color = style.visitedDependentColor(CSSPropertyBackgroundColor);
-
// FIXME: Allow color+image compositing when it makes sense.
// For now bailing out.
- if (color.isVisible())
+ if (style.visitedDependentColor(CSSPropertyBackgroundColor).isVisible())
return false;
- StyleImage* styleImage = fillLayer->image();
-
// FIXME: support gradients with isGeneratedImage.
+ auto* styleImage = fillLayer.image();
if (!styleImage->isCachedImage())
return false;
- Image* image = styleImage->cachedImage()->image();
+ auto* image = styleImage->cachedImage()->image();
if (!image->isBitmapImage())
return false;
@@ -1809,25 +1806,24 @@
if (isDirectlyCompositedImage())
return;
- const RenderStyle& style = renderer().style();
-
+ auto& style = renderer().style();
if (!isSimpleContainer || !style.hasBackgroundImage()) {
m_graphicsLayer->setContentsToImage(0);
return;
}
- FloatRect destRect = backgroundBoxForSimpleContainerPainting();
+ auto destRect = backgroundBoxForSimpleContainerPainting();
FloatSize phase;
FloatSize tileSize;
-
- RefPtr<Image> image = style.backgroundLayers()->image()->cachedImage()->image();
- // FIXME: absolute paint location is required here.
+ // FIXME: Absolute paint location is required here.
downcast<RenderBox>(renderer()).getGeometryForBackgroundImage(&renderer(), LayoutPoint(), destRect, phase, tileSize);
+
m_graphicsLayer->setContentsTileSize(tileSize);
m_graphicsLayer->setContentsTilePhase(phase);
m_graphicsLayer->setContentsRect(destRect);
m_graphicsLayer->setContentsClippingRect(FloatRoundedRect(destRect));
- m_graphicsLayer->setContentsToImage(image.get());
+ m_graphicsLayer->setContentsToImage(style.backgroundLayers().image()->cachedImage()->image());
+
didUpdateContentsRect = true;
}
diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp
index 22ee981..cdf8060 100644
--- a/Source/WebCore/rendering/RenderListBox.cpp
+++ b/Source/WebCore/rendering/RenderListBox.cpp
@@ -902,7 +902,7 @@
if (page().expectsWheelEventTriggers())
scrollAnimator().setWheelEventTestTrigger(page().testTrigger());
}
- view().frameView().addChild(widget.get());
+ view().frameView().addChild(*widget);
return widget.releaseNonNull();
}
diff --git a/Source/WebCore/rendering/RenderMenuList.cpp b/Source/WebCore/rendering/RenderMenuList.cpp
index d39f646..d2c02ef 100644
--- a/Source/WebCore/rendering/RenderMenuList.cpp
+++ b/Source/WebCore/rendering/RenderMenuList.cpp
@@ -116,7 +116,7 @@
// Use margin:auto instead of align-items:center to get safe centering, i.e.
// when the content overflows, treat it the same as align-items: flex-start.
// But we only do that for the cases where html.css would otherwise use center.
- if (style().alignItemsPosition() == ItemPositionCenter) {
+ if (style().alignItems().position() == ItemPositionCenter) {
innerStyle.setMarginTop(Length());
innerStyle.setMarginBottom(Length());
innerStyle.setAlignSelfPosition(ItemPositionFlexStart);
diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp
index e1a7eaa..3e70320 100644
--- a/Source/WebCore/rendering/RenderTableCell.cpp
+++ b/Source/WebCore/rendering/RenderTableCell.cpp
@@ -1276,9 +1276,9 @@
adjustedPaintOffset.moveBy(location());
Color c = backgroundObject->style().visitedDependentColor(CSSPropertyBackgroundColor);
- const FillLayer* bgLayer = backgroundObject->style().backgroundLayers();
+ auto& bgLayer = backgroundObject->style().backgroundLayers();
- if (bgLayer->hasImage() || c.isValid()) {
+ if (bgLayer.hasImage() || c.isValid()) {
// We have to clip here because the background would paint
// on top of the borders otherwise. This only matters for cells and rows.
bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == this || backgroundObject == parent()) && tableElt->collapseBorders();
diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp
index fa599a7..c31a9aa 100644
--- a/Source/WebCore/rendering/RenderTheme.cpp
+++ b/Source/WebCore/rendering/RenderTheme.cpp
@@ -146,7 +146,7 @@
// Padding
LengthBox paddingBox = m_theme->controlPadding(part, style.fontCascade(), style.paddingBox(), style.effectiveZoom());
if (paddingBox != style.paddingBox())
- style.setPaddingBox(paddingBox);
+ style.setPaddingBox(WTFMove(paddingBox));
// Whitespace
if (m_theme->controlRequiresPreWhiteSpace(part))
@@ -155,19 +155,19 @@
// Width / Height
// The width and height here are affected by the zoom.
// FIXME: Check is flawed, since it doesn't take min-width/max-width into account.
- LengthSize controlSize = m_theme->controlSize(part, style.fontCascade(), LengthSize(style.width(), style.height()), style.effectiveZoom());
- if (controlSize.width() != style.width())
- style.setWidth(controlSize.width());
- if (controlSize.height() != style.height())
- style.setHeight(controlSize.height());
-
+ LengthSize controlSize = m_theme->controlSize(part, style.fontCascade(), { style.width(), style.height() }, style.effectiveZoom());
+ if (controlSize.width != style.width())
+ style.setWidth(WTFMove(controlSize.width));
+ if (controlSize.height != style.height())
+ style.setHeight(WTFMove(controlSize.height));
+
// Min-Width / Min-Height
LengthSize minControlSize = m_theme->minimumControlSize(part, style.fontCascade(), style.effectiveZoom());
- if (minControlSize.width() != style.minWidth())
- style.setMinWidth(minControlSize.width());
- if (minControlSize.height() != style.minHeight())
- style.setMinHeight(minControlSize.height());
-
+ if (minControlSize.width != style.minWidth())
+ style.setMinWidth(WTFMove(minControlSize.width));
+ if (minControlSize.height != style.minHeight())
+ style.setMinHeight(WTFMove(minControlSize.height));
+
// Font
if (auto themeFont = m_theme->controlFont(part, style.fontCascade(), style.effectiveZoom())) {
// If overriding the specified font with the theme font, also override the line height with the standard line height.
@@ -709,9 +709,9 @@
case TextFieldPart:
case TextAreaPart:
// Test the style to see if the UA border and background match.
- return (style.border() != border
- || *style.backgroundLayers() != background
- || !style.backgroundColorEqualsToColorIgnoringVisited(backgroundColor));
+ return style.border() != border
+ || style.backgroundLayers() != background
+ || !style.backgroundColorEqualsToColorIgnoringVisited(backgroundColor);
default:
return false;
}
diff --git a/Source/WebCore/rendering/RenderThemeEfl.cpp b/Source/WebCore/rendering/RenderThemeEfl.cpp
index 11260fa..cd4a8396 100644
--- a/Source/WebCore/rendering/RenderThemeEfl.cpp
+++ b/Source/WebCore/rendering/RenderThemeEfl.cpp
@@ -145,20 +145,26 @@
// These are always valid, even if no theme could be loaded.
const ThemePartDesc* desc = m_partDescs + (size_t)type;
- if (style.minWidth().isIntrinsic())
- style.setMinWidth(desc->min.width());
- if (style.minHeight().isIntrinsic())
- style.setMinHeight(desc->min.height());
+ if (style.minWidth().isIntrinsic()) {
+ auto copy = desc->min.width;
+ style.setMinWidth(WTFMove(copy));
+ }
+ if (style.minHeight().isIntrinsic()) {
+ auto copy = desc->min.height;
+ style.setMinHeight(WTFMove(copy));
+ }
- if (desc->max.width().value() > 0 && style.maxWidth().isIntrinsicOrAuto())
- style.setMaxWidth(desc->max.width());
- if (desc->max.height().value() > 0 && style.maxHeight().isIntrinsicOrAuto())
- style.setMaxHeight(desc->max.height());
+ if (desc->max.width.value() > 0 && style.maxWidth().isIntrinsicOrAuto()) {
+ auto copy = desc->max.width;
+ style.setMaxWidth(WTFMove(copy));
+ }
+ if (desc->max.height.value() > 0 && style.maxHeight().isIntrinsicOrAuto()) {
+ auto copy = desc->max.height;
+ style.setMaxHeight(WTFMove(copy));
+ }
- style.setPaddingTop(desc->padding.top());
- style.setPaddingBottom(desc->padding.bottom());
- style.setPaddingLeft(desc->padding.left());
- style.setPaddingRight(desc->padding.right());
+ auto paddingCopy = desc->padding;
+ style.setPaddingBox(WTFMove(paddingCopy));
}
static bool isFormElementTooLargeToDisplay(const IntSize& elementSize)
@@ -365,7 +371,7 @@
if (!entry)
return true;
- bool haveBackgroundColor = isControlStyled(object.style(), object.style().border(), *object.style().backgroundLayers(), Color::white);
+ bool haveBackgroundColor = isControlStyled(object.style(), object.style().border(), object.style().backgroundLayers(), Color::white);
ControlStates states(extractControlStatesForRenderer(object));
applyEdjeStateFromForm(entry->edje(), &states, haveBackgroundColor);
@@ -542,11 +548,11 @@
void RenderThemeEfl::applyPartDescriptionFallback(ThemePartDesc* desc)
{
- desc->min.setWidth(Length(0, Fixed));
- desc->min.setHeight(Length(0, Fixed));
+ desc->min.width = { 0, Fixed };
+ desc->min.height = { 0, Fixed };
- desc->max.setWidth(Length(0, Fixed));
- desc->max.setHeight(Length(0, Fixed));
+ desc->max.width = { 0, Fixed };
+ desc->max.height = { 0, Fixed };
desc->padding = LengthBox(0, 0, 0, 0);
}
@@ -559,12 +565,12 @@
if (!minw && !minh)
edje_object_size_min_calc(object, &minw, &minh);
- desc->min.setWidth(Length(minw, Fixed));
- desc->min.setHeight(Length(minh, Fixed));
+ desc->min.width = { minw, Fixed };
+ desc->min.height = { minh, Fixed };
edje_object_size_max_get(object, &maxw, &maxh);
- desc->max.setWidth(Length(maxw, Fixed));
- desc->max.setHeight(Length(maxh, Fixed));
+ desc->max.width = { maxw, Fixed };
+ desc->max.height = { maxh, Fixed };
if (!edje_object_part_exists(object, "text_confinement"))
desc->padding = LengthBox(0, 0, 0, 0);
@@ -800,10 +806,14 @@
style.resetBorder();
const ThemePartDesc* desc = m_partDescs + (size_t)CheckBox;
- if (style.width().value() < desc->min.width().value())
- style.setWidth(desc->min.width());
- if (style.height().value() < desc->min.height().value())
- style.setHeight(desc->min.height());
+ if (style.width().value() < desc->min.width.value()) {
+ auto copy = desc->min.width;
+ style.setWidth(WTFMove(copy));
+ }
+ if (style.height().value() < desc->min.height.value()) {
+ auto copy = desc->min.height;
+ style.setHeight(WTFMove(copy));
+ }
}
bool RenderThemeEfl::paintCheckbox(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
@@ -823,10 +833,14 @@
style.resetBorder();
const ThemePartDesc* desc = m_partDescs + (size_t)RadioButton;
- if (style.width().value() < desc->min.width().value())
- style.setWidth(desc->min.width());
- if (style.height().value() < desc->min.height().value())
- style.setHeight(desc->min.height());
+ if (style.width().value() < desc->min.width.value()) {
+ auto copy = desc->min.width;
+ style.setWidth(WTFMove(copy));
+ }
+ if (style.height().value() < desc->min.height.value()) {
+ auto copy = desc->min.height;
+ style.setHeight(WTFMove(copy));
+ }
}
bool RenderThemeEfl::paintRadio(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
diff --git a/Source/WebCore/rendering/RenderThemeGtk.cpp b/Source/WebCore/rendering/RenderThemeGtk.cpp
index fa80b28..b737fb8 100644
--- a/Source/WebCore/rendering/RenderThemeGtk.cpp
+++ b/Source/WebCore/rendering/RenderThemeGtk.cpp
@@ -2014,10 +2014,10 @@
static FloatRoundedRect::Radii borderRadiiFromStyle(const RenderStyle& style)
{
return FloatRoundedRect::Radii(
- IntSize(style.borderTopLeftRadius().width().intValue(), style.borderTopLeftRadius().height().intValue()),
- IntSize(style.borderTopRightRadius().width().intValue(), style.borderTopRightRadius().height().intValue()),
- IntSize(style.borderBottomLeftRadius().width().intValue(), style.borderBottomLeftRadius().height().intValue()),
- IntSize(style.borderBottomRightRadius().width().intValue(), style.borderBottomRightRadius().height().intValue()));
+ IntSize(style.borderTopLeftRadius().width.intValue(), style.borderTopLeftRadius().height.intValue()),
+ IntSize(style.borderTopRightRadius().width.intValue(), style.borderTopRightRadius().height.intValue()),
+ IntSize(style.borderBottomLeftRadius().width.intValue(), style.borderBottomLeftRadius().height.intValue()),
+ IntSize(style.borderBottomRightRadius().width.intValue(), style.borderBottomRightRadius().height.intValue()));
}
bool RenderThemeGtk::paintMediaSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm
index 100a5d1..191afa7 100644
--- a/Source/WebCore/rendering/RenderThemeIOS.mm
+++ b/Source/WebCore/rendering/RenderThemeIOS.mm
@@ -357,10 +357,9 @@
if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto())
return;
- Length length = Length(static_cast<int>(ceilf(std::max(style.fontSize(), 10))), Fixed);
-
- style.setWidth(length);
- style.setHeight(length);
+ int size = std::max(style.fontSize(), 10);
+ style.setWidth({ size, Fixed });
+ style.setHeight({ size, Fixed });
}
static CGPoint shortened(CGPoint start, CGPoint end, float width)
@@ -448,10 +447,10 @@
{
// Buttons and MenulistButtons are styled if they contain a background image.
if (style.appearance() == PushButtonPart || style.appearance() == MenulistButtonPart)
- return !style.visitedDependentColor(CSSPropertyBackgroundColor).alpha() || style.backgroundLayers()->hasImage();
+ return !style.visitedDependentColor(CSSPropertyBackgroundColor).isVisible() || style.backgroundLayers().hasImage();
if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPart)
- return *style.backgroundLayers() != background;
+ return style.backgroundLayers() != background;
return RenderTheme::isControlStyled(style, border, background, backgroundColor);
}
@@ -461,10 +460,10 @@
if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto())
return;
- Length length = Length(static_cast<int>(ceilf(std::max(style.fontSize(), 10))), Fixed);
- style.setWidth(length);
- style.setHeight(length);
- style.setBorderRadius(IntSize(length.value() / 2.0f, length.value() / 2.0f));
+ int size = std::max(style.fontSize(), 10);
+ style.setWidth({ size, Fixed });
+ style.setHeight({ size, Fixed });
+ style.setBorderRadius({ size / 2, size / 2 });
}
bool RenderThemeIOS::paintRadioDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
@@ -538,13 +537,11 @@
void RenderThemeIOS::adjustRoundBorderRadius(RenderStyle& style, RenderBox& box)
{
- if (style.appearance() == NoControlPart || style.backgroundLayers()->hasImage())
+ if (style.appearance() == NoControlPart || style.backgroundLayers().hasImage())
return;
- // FIXME: We should not be relying on border radius for the appearance of our controls <rdar://problem/7675493>
- Length radiusWidth(static_cast<int>(std::min(box.width(), box.height()) / 2.0), Fixed);
- Length radiusHeight(static_cast<int>(box.height() / 2.0), Fixed);
- style.setBorderRadius(LengthSize(radiusWidth, radiusHeight));
+ // FIXME: We should not be relying on border radius for the appearance of our controls <rdar://problem/7675493>.
+ style.setBorderRadius({ { std::min(box.width(), box.height()) / 2, Fixed }, { box.height() / 2, Fixed } });
}
static void applyCommonButtonPaddingToStyle(RenderStyle& style, const Element& element)
@@ -655,11 +652,11 @@
FloatSize bottomRightRadius;
if (isRTL) {
- topRightRadius = FloatSize(valueForLength(style.borderTopRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height(), rect.height()) - style.borderTopWidth());
- bottomRightRadius = FloatSize(valueForLength(style.borderBottomRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height(), rect.height()) - style.borderBottomWidth());
+ topRightRadius = FloatSize(valueForLength(style.borderTopRightRadius().width, rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height, rect.height()) - style.borderTopWidth());
+ bottomRightRadius = FloatSize(valueForLength(style.borderBottomRightRadius().width, rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height, rect.height()) - style.borderBottomWidth());
} else {
- topLeftRadius = FloatSize(valueForLength(style.borderTopLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderTopLeftRadius().height(), rect.height()) - style.borderTopWidth());
- bottomLeftRadius = FloatSize(valueForLength(style.borderBottomLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderBottomLeftRadius().height(), rect.height()) - style.borderBottomWidth());
+ topLeftRadius = FloatSize(valueForLength(style.borderTopLeftRadius().width, rect.width()) - style.borderLeftWidth(), valueForLength(style.borderTopLeftRadius().height, rect.height()) - style.borderTopWidth());
+ bottomLeftRadius = FloatSize(valueForLength(style.borderBottomLeftRadius().width, rect.width()) - style.borderLeftWidth(), valueForLength(style.borderBottomLeftRadius().height, rect.height()) - style.borderBottomWidth());
}
paintInfo.context().clipRoundedRect(FloatRoundedRect(titleClip,
@@ -692,11 +689,11 @@
FloatSize bottomRightRadius;
if (isRTL) {
- topLeftRadius = FloatSize(valueForLength(style.borderTopLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderTopLeftRadius().height(), rect.height()) - style.borderTopWidth());
- bottomLeftRadius = FloatSize(valueForLength(style.borderBottomLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderBottomLeftRadius().height(), rect.height()) - style.borderBottomWidth());
+ topLeftRadius = FloatSize(valueForLength(style.borderTopLeftRadius().width, rect.width()) - style.borderLeftWidth(), valueForLength(style.borderTopLeftRadius().height, rect.height()) - style.borderTopWidth());
+ bottomLeftRadius = FloatSize(valueForLength(style.borderBottomLeftRadius().width, rect.width()) - style.borderLeftWidth(), valueForLength(style.borderBottomLeftRadius().height, rect.height()) - style.borderBottomWidth());
} else {
- topRightRadius = FloatSize(valueForLength(style.borderTopRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height(), rect.height()) - style.borderTopWidth());
- bottomRightRadius = FloatSize(valueForLength(style.borderBottomRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height(), rect.height()) - style.borderBottomWidth());
+ topRightRadius = FloatSize(valueForLength(style.borderTopRightRadius().width, rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height, rect.height()) - style.borderTopWidth());
+ bottomRightRadius = FloatSize(valueForLength(style.borderBottomRightRadius().width, rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height, rect.height()) - style.borderBottomWidth());
}
paintInfo.context().clipRoundedRect(FloatRoundedRect(buttonClip,
@@ -758,10 +755,9 @@
{
RenderTheme::adjustSliderTrackStyle(selector, style, element);
- // FIXME: We should not be relying on border radius for the appearance of our controls <rdar://problem/7675493>
- Length radiusWidth(static_cast<int>(kTrackRadius), Fixed);
- Length radiusHeight(static_cast<int>(kTrackRadius), Fixed);
- style.setBorderRadius(LengthSize(radiusWidth, radiusHeight));
+ // FIXME: We should not be relying on border radius for the appearance of our controls <rdar://problem/7675493>.
+ int radius = static_cast<int>(kTrackRadius);
+ style.setBorderRadius({ { radius, Fixed }, { radius, Fixed } });
}
bool RenderThemeIOS::paintSliderTrack(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
@@ -848,14 +844,12 @@
return;
// Enforce "border-radius: 50%".
- Length length(50.0f, Percent);
- style.setBorderRadius(LengthSize(length, length));
+ style.setBorderRadius({ { 50, Percent }, { 50, Percent } });
// Enforce a 16x16 size if no size is provided.
if (style.width().isIntrinsicOrAuto() || style.height().isAuto()) {
- Length length = Length(kDefaultSliderThumbSize, Fixed);
- style.setWidth(length);
- style.setHeight(length);
+ style.setWidth({ kDefaultSliderThumbSize, Fixed });
+ style.setHeight({ kDefaultSliderThumbSize, Fixed });
}
}
diff --git a/Source/WebCore/rendering/RenderWidget.cpp b/Source/WebCore/rendering/RenderWidget.cpp
index 37395e4..623a6c7 100644
--- a/Source/WebCore/rendering/RenderWidget.cpp
+++ b/Source/WebCore/rendering/RenderWidget.cpp
@@ -52,29 +52,27 @@
void WidgetHierarchyUpdatesSuspensionScope::moveWidgets()
{
- WidgetToParentMap map;
- widgetNewParentMap().swap(map);
- WidgetToParentMap::iterator end = map.end();
- for (WidgetToParentMap::iterator it = map.begin(); it != end; ++it) {
- Widget* child = it->key.get();
- ScrollView* currentParent = child->parent();
- FrameView* newParent = it->value;
+ auto map = WTFMove(widgetNewParentMap());
+ for (auto& entry : map) {
+ auto& child = *entry.key;
+ auto* currentParent = child.parent();
+ auto* newParent = entry.value;
if (newParent != currentParent) {
if (currentParent)
- currentParent->removeChild(*child);
+ currentParent->removeChild(child);
if (newParent)
newParent->addChild(child);
}
}
}
-static void moveWidgetToParentSoon(Widget* child, FrameView* parent)
+static void moveWidgetToParentSoon(Widget& child, FrameView* parent)
{
if (!WidgetHierarchyUpdatesSuspensionScope::isSuspended()) {
if (parent)
parent->addChild(child);
else
- child->removeFromParent();
+ child.removeFromParent();
return;
}
WidgetHierarchyUpdatesSuspensionScope::scheduleWidgetToMove(child, parent);
@@ -167,7 +165,7 @@
return;
if (m_widget) {
- moveWidgetToParentSoon(m_widget.get(), 0);
+ moveWidgetToParentSoon(*m_widget, nullptr);
view().frameView().willRemoveWidgetFromRenderTree(*m_widget);
widgetRendererMap().remove(m_widget.get());
m_widget = nullptr;
@@ -193,7 +191,7 @@
repaint();
}
}
- moveWidgetToParentSoon(m_widget.get(), &view().frameView());
+ moveWidgetToParentSoon(*m_widget, &view().frameView());
}
}
@@ -338,9 +336,9 @@
m_widget->setIsSelected(isSelected());
}
-RenderWidget* RenderWidget::find(const Widget* widget)
+RenderWidget* RenderWidget::find(const Widget& widget)
{
- return widgetRendererMap().get(widget);
+ return widgetRendererMap().get(&widget);
}
bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
diff --git a/Source/WebCore/rendering/RenderWidget.h b/Source/WebCore/rendering/RenderWidget.h
index 6e011d7..c6a9bc5 100644
--- a/Source/WebCore/rendering/RenderWidget.h
+++ b/Source/WebCore/rendering/RenderWidget.h
@@ -44,14 +44,13 @@
}
static bool isSuspended() { return s_widgetHierarchyUpdateSuspendCount; }
- static void scheduleWidgetToMove(Widget* widget, FrameView* frame) { widgetNewParentMap().set(widget, frame); }
+ static void scheduleWidgetToMove(Widget& widget, FrameView* frame) { widgetNewParentMap().set(&widget, frame); }
private:
- typedef HashMap<RefPtr<Widget>, FrameView*> WidgetToParentMap;
+ using WidgetToParentMap = HashMap<RefPtr<Widget>, FrameView*>;
static WidgetToParentMap& widgetNewParentMap();
WEBCORE_EXPORT void moveWidgets();
-
WEBCORE_EXPORT static unsigned s_widgetHierarchyUpdateSuspendCount;
};
@@ -64,7 +63,7 @@
Widget* widget() const { return m_widget.get(); }
WEBCORE_EXPORT void setWidget(RefPtr<Widget>&&);
- static RenderWidget* find(const Widget*);
+ static RenderWidget* find(const Widget&);
enum class ChildWidgetState { Valid, Destroyed };
ChildWidgetState updateWidgetPosition() WARN_UNUSED_RETURN;
diff --git a/Source/WebCore/rendering/TextAutoSizing.cpp b/Source/WebCore/rendering/TextAutoSizing.cpp
index 1a59f65..aaf71cb 100644
--- a/Source/WebCore/rendering/TextAutoSizing.cpp
+++ b/Source/WebCore/rendering/TextAutoSizing.cpp
@@ -133,7 +133,7 @@
// Resize the line height of the parent.
auto& parentStyle = parentRenderer->style();
- Length lineHeightLength = parentStyle.specifiedLineHeight();
+ auto& lineHeightLength = parentStyle.specifiedLineHeight();
int specifiedLineHeight;
if (lineHeightLength.isPercent())
@@ -147,7 +147,7 @@
auto newParentStyle = cloneRenderStyleWithState(parentStyle);
newParentStyle.setLineHeight(Length(lineHeight, Fixed));
- newParentStyle.setSpecifiedLineHeight(lineHeightLength);
+ newParentStyle.setSpecifiedLineHeight(Length { lineHeightLength });
newParentStyle.setFontDescription(fontDescription);
newParentStyle.fontCascade().update(&node->document().fontSelector());
parentRenderer->setStyle(WTFMove(newParentStyle));
@@ -188,12 +188,12 @@
parentRenderer = parentRenderer->parent();
auto& parentStyle = parentRenderer->style();
- Length originalLineHeight = parentStyle.specifiedLineHeight();
+ auto& originalLineHeight = parentStyle.specifiedLineHeight();
if (originalLineHeight == parentStyle.lineHeight())
continue;
auto newParentStyle = cloneRenderStyleWithState(parentStyle);
- newParentStyle.setLineHeight(originalLineHeight);
+ newParentStyle.setLineHeight(Length { originalLineHeight });
newParentStyle.setFontDescription(fontDescription);
newParentStyle.fontCascade().update(&node->document().fontSelector());
parentRenderer->setStyle(WTFMove(newParentStyle));
diff --git a/Source/WebCore/rendering/mathml/MathMLStyle.cpp b/Source/WebCore/rendering/mathml/MathMLStyle.cpp
index ca46c2e..6162acb 100644
--- a/Source/WebCore/rendering/mathml/MathMLStyle.cpp
+++ b/Source/WebCore/rendering/mathml/MathMLStyle.cpp
@@ -49,14 +49,11 @@
const MathMLStyle* MathMLStyle::getMathMLStyle(RenderObject* renderer)
{
- if (renderer) {
- // FIXME: Should we make RenderMathMLTable derive from RenderMathMLBlock in order to simplify this?
- if (is<RenderMathMLTable>(renderer))
- return downcast<RenderMathMLTable>(renderer)->mathMLStyle();
- if (is<RenderMathMLBlock>(renderer))
- return downcast<RenderMathMLBlock>(renderer)->mathMLStyle();
- }
-
+ // FIXME: Should we make RenderMathMLTable derive from RenderMathMLBlock in order to simplify this?
+ if (is<RenderMathMLTable>(renderer))
+ return &downcast<RenderMathMLTable>(*renderer).mathMLStyle();
+ if (is<RenderMathMLBlock>(renderer))
+ return &downcast<RenderMathMLBlock>(*renderer).mathMLStyle();
return nullptr;
}
@@ -65,9 +62,9 @@
for (auto* child = renderer; child; child = child->nextInPreOrder(renderer)) {
// FIXME: Should we make RenderMathMLTable derive from RenderMathMLBlock in order to simplify this?
if (is<RenderMathMLTable>(child))
- downcast<RenderMathMLTable>(child)->mathMLStyle()->resolveMathMLStyle(child);
+ downcast<RenderMathMLTable>(*child).mathMLStyle().resolveMathMLStyle(child);
else if (is<RenderMathMLBlock>(child))
- downcast<RenderMathMLBlock>(child)->mathMLStyle()->resolveMathMLStyle(child);
+ downcast<RenderMathMLBlock>(*child).mathMLStyle().resolveMathMLStyle(child);
}
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
index bb142a2..61a12ca 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
@@ -45,7 +45,7 @@
RenderMathMLBlock(Document&, RenderStyle&&);
virtual ~RenderMathMLBlock();
- MathMLStyle* mathMLStyle() const { return const_cast<MathMLStyle*>(&m_mathMLStyle.get()); }
+ MathMLStyle& mathMLStyle() const { return m_mathMLStyle; }
bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
@@ -104,7 +104,7 @@
}
- MathMLStyle* mathMLStyle() const { return const_cast<MathMLStyle*>(&m_mathMLStyle.get()); }
+ MathMLStyle& mathMLStyle() const { return m_mathMLStyle; }
private:
bool isRenderMathMLTable() const final { return true; }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
index 35e4414..a20bd12 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
@@ -89,7 +89,7 @@
// We try and read constants to draw the fraction from the OpenType MATH and use fallback values otherwise.
const auto& primaryFont = style().fontCascade().primaryFont();
const auto* mathData = style().fontCascade().primaryFont().mathData();
- bool display = mathMLStyle()->displayStyle();
+ bool display = mathMLStyle().displayStyle();
if (mathData) {
parameters.numeratorGapMin = mathData->getMathConstant(primaryFont, display ? OpenTypeMathData::FractionNumDisplayStyleGapMin : OpenTypeMathData::FractionNumeratorGapMin);
parameters.denominatorGapMin = mathData->getMathConstant(primaryFont, display ? OpenTypeMathData::FractionDenomDisplayStyleGapMin : OpenTypeMathData::FractionDenominatorGapMin);
@@ -116,7 +116,7 @@
// We try and read constants to draw the stack from the OpenType MATH and use fallback values otherwise.
const auto& primaryFont = style().fontCascade().primaryFont();
const auto* mathData = style().fontCascade().primaryFont().mathData();
- bool display = mathMLStyle()->displayStyle();
+ bool display = mathMLStyle().displayStyle();
if (mathData) {
parameters.gapMin = mathData->getMathConstant(primaryFont, display ? OpenTypeMathData::StackDisplayStyleGapMin : OpenTypeMathData::StackGapMin);
parameters.topShiftUp = mathData->getMathConstant(primaryFont, display ? OpenTypeMathData::StackTopDisplayStyleShiftUp : OpenTypeMathData::StackTopShiftUp);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
index e212e9b..02fd44e5 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
@@ -48,8 +48,8 @@
void resetStretchSize();
virtual bool hasOperatorFlag(MathMLOperatorDictionary::Flag) const;
- bool isLargeOperatorInDisplayStyle() const { return !hasOperatorFlag(MathMLOperatorDictionary::Stretchy) && hasOperatorFlag(MathMLOperatorDictionary::LargeOp) && mathMLStyle()->displayStyle(); }
- bool shouldMoveLimits() const { return hasOperatorFlag(MathMLOperatorDictionary::MovableLimits) && !mathMLStyle()->displayStyle(); }
+ bool isLargeOperatorInDisplayStyle() const { return !hasOperatorFlag(MathMLOperatorDictionary::Stretchy) && hasOperatorFlag(MathMLOperatorDictionary::LargeOp) && mathMLStyle().displayStyle(); }
+ bool shouldMoveLimits() const { return hasOperatorFlag(MathMLOperatorDictionary::MovableLimits) && !mathMLStyle().displayStyle(); }
virtual bool isVertical() const;
LayoutUnit italicCorrection() const { return m_mathOperator.italicCorrection(); }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
index 1a66ec8..3d757a7 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
@@ -120,7 +120,7 @@
const auto& primaryFont = style().fontCascade().primaryFont();
if (auto* mathData = style().fontCascade().primaryFont().mathData()) {
parameters.ruleThickness = mathData->getMathConstant(primaryFont, OpenTypeMathData::RadicalRuleThickness);
- parameters.verticalGap = mathData->getMathConstant(primaryFont, mathMLStyle()->displayStyle() ? OpenTypeMathData::RadicalDisplayStyleVerticalGap : OpenTypeMathData::RadicalVerticalGap);
+ parameters.verticalGap = mathData->getMathConstant(primaryFont, mathMLStyle().displayStyle() ? OpenTypeMathData::RadicalDisplayStyleVerticalGap : OpenTypeMathData::RadicalVerticalGap);
parameters.extraAscender = mathData->getMathConstant(primaryFont, OpenTypeMathData::RadicalExtraAscender);
if (m_kind == RootWithIndex)
parameters.degreeBottomRaisePercent = mathData->getMathConstant(primaryFont, OpenTypeMathData::RadicalDegreeBottomRaisePercent);
@@ -131,7 +131,7 @@
// RadicalExtraAscender: Suggested value is RadicalRuleThickness.
// RadicalDegreeBottomRaisePercent: Suggested value is 60%.
parameters.ruleThickness = ruleThicknessFallback();
- if (mathMLStyle()->displayStyle())
+ if (mathMLStyle().displayStyle())
parameters.verticalGap = parameters.ruleThickness + style().fontMetrics().xHeight() / 4;
else
parameters.verticalGap = 5 * parameters.ruleThickness / 4;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
index 555bd68..a5c4c1c 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
@@ -528,7 +528,7 @@
const auto& tokenElement = element();
if (auto codePoint = MathMLTokenElement::convertToSingleCodePoint(element().textContent())) {
- MathMLElement::MathVariant mathvariant = mathMLStyle()->mathVariant();
+ MathMLElement::MathVariant mathvariant = mathMLStyle().mathVariant();
if (mathvariant == MathMLElement::MathVariant::None)
mathvariant = tokenElement.hasTagName(MathMLNames::miTag) ? MathMLElement::MathVariant::Italic : MathMLElement::MathVariant::Normal;
UChar32 transformedCodePoint = mathVariant(codePoint.value(), mathvariant);
diff --git a/Source/WebCore/rendering/style/BasicShapes.cpp b/Source/WebCore/rendering/style/BasicShapes.cpp
index 290c6d8..06b3e09 100644
--- a/Source/WebCore/rendering/style/BasicShapes.cpp
+++ b/Source/WebCore/rendering/style/BasicShapes.cpp
@@ -387,8 +387,8 @@
static FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatRect& boundingBox)
{
- return FloatSize(floatValueForLength(lengthSize.width(), boundingBox.width()),
- floatValueForLength(lengthSize.height(), boundingBox.height()));
+ return { floatValueForLength(lengthSize.width, boundingBox.width()),
+ floatValueForLength(lengthSize.height, boundingBox.height()) };
}
const Path& BasicShapeInset::path(const FloatRect& boundingBox)
diff --git a/Source/WebCore/rendering/style/BorderData.h b/Source/WebCore/rendering/style/BorderData.h
index 294fb82..06bcc99 100644
--- a/Source/WebCore/rendering/style/BorderData.h
+++ b/Source/WebCore/rendering/style/BorderData.h
@@ -34,10 +34,11 @@
class BorderData {
friend class RenderStyle;
public:
- BorderData() : m_topLeft(Length(0, Fixed), Length(0, Fixed))
- , m_topRight(Length(0, Fixed), Length(0, Fixed))
- , m_bottomLeft(Length(0, Fixed), Length(0, Fixed))
- , m_bottomRight(Length(0, Fixed), Length(0, Fixed))
+ BorderData()
+ : m_topLeft { { 0, Fixed }, { 0, Fixed } }
+ , m_topRight { { 0, Fixed }, { 0, Fixed } }
+ , m_bottomLeft { { 0, Fixed }, { 0, Fixed } }
+ , m_bottomRight { { 0, Fixed }, { 0, Fixed } }
{
}
bool hasBorder() const
@@ -59,15 +60,10 @@
bool hasBorderRadius() const
{
- if (!m_topLeft.width().isZero())
- return true;
- if (!m_topRight.width().isZero())
- return true;
- if (!m_bottomLeft.width().isZero())
- return true;
- if (!m_bottomRight.width().isZero())
- return true;
- return false;
+ return !m_topLeft.width.isZero()
+ || !m_topRight.width.isZero()
+ || !m_bottomLeft.width.isZero()
+ || !m_bottomRight.width.isZero();
}
float borderLeftWidth() const
diff --git a/Source/WebCore/rendering/style/ContentData.cpp b/Source/WebCore/rendering/style/ContentData.cpp
index 0bd0d70..c6c0224 100644
--- a/Source/WebCore/rendering/style/ContentData.cpp
+++ b/Source/WebCore/rendering/style/ContentData.cpp
@@ -38,8 +38,7 @@
auto result = cloneInternal();
auto* lastNewData = result.get();
for (auto* contentData = next(); contentData; contentData = contentData->next()) {
- auto newData = contentData->cloneInternal();
- lastNewData->setNext(WTFMove(newData));
+ lastNewData->setNext(contentData->cloneInternal());
lastNewData = lastNewData->next();
}
return result;
diff --git a/Source/WebCore/rendering/style/ContentData.h b/Source/WebCore/rendering/style/ContentData.h
index 16d6557..9e97c02 100644
--- a/Source/WebCore/rendering/style/ContentData.h
+++ b/Source/WebCore/rendering/style/ContentData.h
@@ -126,7 +126,7 @@
private:
RenderPtr<RenderObject> createContentRenderer(Document&, const RenderStyle&) const final;
- std::unique_ptr<ContentData> cloneInternal() const final { return std::make_unique<TextContentData>(text()); }
+ std::unique_ptr<ContentData> cloneInternal() const final { return std::make_unique<TextContentData>(m_text); }
String m_text;
};
diff --git a/Source/WebCore/rendering/style/DataRef.h b/Source/WebCore/rendering/style/DataRef.h
index 3f93a57..f542d6c 100644
--- a/Source/WebCore/rendering/style/DataRef.h
+++ b/Source/WebCore/rendering/style/DataRef.h
@@ -1,8 +1,5 @@
/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * (C) 2000 Antti Koivisto (koivisto@kde.org)
- * (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -29,30 +26,65 @@
template <typename T> class DataRef {
public:
- DataRef(Ref<T>&& data) : m_data(WTFMove(data)) { }
- DataRef(const DataRef& other) : m_data(const_cast<T&>(other.m_data.get())) { }
- DataRef& operator=(const DataRef& other) { m_data = const_cast<T&>(other.m_data.get()); return *this; }
-
- const T* get() const { return m_data.ptr(); }
-
- const T& operator*() const { return *get(); }
- const T* operator->() const { return get(); }
-
- T* access()
+ DataRef(Ref<T>&& data)
+ : m_data(WTFMove(data))
{
- if (!m_data->hasOneRef())
- m_data = m_data->copy();
+ }
+
+ DataRef(const DataRef& other)
+ : m_data(other.m_data.copyRef())
+ {
+ }
+
+ DataRef& operator=(const DataRef& other)
+ {
+ m_data = other.m_data.copyRef();
+ return *this;
+ }
+
+ DataRef(DataRef&&) = default;
+ DataRef& operator=(DataRef&&) = default;
+
+ DataRef replace(DataRef&& other)
+ {
+ return m_data.replace(WTFMove(other.m_data));
+ }
+
+ operator const T&() const
+ {
+ return m_data;
+ }
+
+ const T& get() const
+ {
+ return m_data;
+ }
+
+ const T& operator*() const
+ {
+ return m_data;
+ }
+
+ const T* operator->() const
+ {
return m_data.ptr();
}
- bool operator==(const DataRef<T>& o) const
+ T& access()
{
- return m_data.ptr() == o.m_data.ptr() || m_data.get() == o.m_data.get();
+ if (!m_data->hasOneRef())
+ m_data = m_data->copy();
+ return m_data;
}
-
- bool operator!=(const DataRef<T>& o) const
+
+ bool operator==(const DataRef& other) const
{
- return m_data.ptr() != o.m_data.ptr() && m_data.get() != o.m_data.get();
+ return m_data.ptr() == other.m_data.ptr() || m_data.get() == other.m_data.get();
+ }
+
+ bool operator!=(const DataRef& other) const
+ {
+ return !(*this == other);
}
private:
diff --git a/Source/WebCore/rendering/style/KeyframeList.cpp b/Source/WebCore/rendering/style/KeyframeList.cpp
index 7652380..97298ab 100644
--- a/Source/WebCore/rendering/style/KeyframeList.cpp
+++ b/Source/WebCore/rendering/style/KeyframeList.cpp
@@ -29,14 +29,14 @@
TimingFunction* KeyframeValue::timingFunction(const AtomicString& name) const
{
- const RenderStyle* keyframeStyle = style();
+ auto* keyframeStyle = style();
if (!keyframeStyle || !keyframeStyle->animations())
return nullptr;
for (size_t i = 0; i < keyframeStyle->animations()->size(); ++i) {
const Animation& animation = keyframeStyle->animations()->animation(i);
if (name == animation.name())
- return animation.timingFunction().get();
+ return animation.timingFunction();
}
return nullptr;
@@ -44,7 +44,6 @@
KeyframeList::~KeyframeList()
{
- clear();
}
void KeyframeList::clear()
@@ -58,15 +57,12 @@
if (m_keyframes.size() != o.m_keyframes.size())
return false;
- Vector<KeyframeValue>::const_iterator it2 = o.m_keyframes.begin();
- for (Vector<KeyframeValue>::const_iterator it1 = m_keyframes.begin(); it1 != m_keyframes.end(); ++it1) {
+ auto it2 = o.m_keyframes.begin();
+ for (auto it1 = m_keyframes.begin(); it1 != m_keyframes.end(); ++it1, ++it2) {
if (it1->key() != it2->key())
return false;
- const RenderStyle& style1 = *it1->style();
- const RenderStyle& style2 = *it2->style();
- if (style1 != style2)
+ if (*it1->style() != *it2->style())
return false;
- ++it2;
}
return true;
diff --git a/Source/WebCore/rendering/style/NinePieceImage.cpp b/Source/WebCore/rendering/style/NinePieceImage.cpp
index ce84b16..e8c9232 100644
--- a/Source/WebCore/rendering/style/NinePieceImage.cpp
+++ b/Source/WebCore/rendering/style/NinePieceImage.cpp
@@ -60,20 +60,22 @@
LayoutBoxExtent NinePieceImage::computeSlices(const LayoutSize& size, const LengthBox& lengths, int scaleFactor)
{
- LayoutUnit top = std::min<LayoutUnit>(size.height(), valueForLength(lengths.top(), size.height())) * scaleFactor;
- LayoutUnit right = std::min<LayoutUnit>(size.width(), valueForLength(lengths.right(), size.width())) * scaleFactor;
- LayoutUnit bottom = std::min<LayoutUnit>(size.height(), valueForLength(lengths.bottom(), size.height())) * scaleFactor;
- LayoutUnit left = std::min<LayoutUnit>(size.width(), valueForLength(lengths.left(), size.width())) * scaleFactor;
- return LayoutBoxExtent(top, right, bottom, left);
+ return {
+ std::min(size.height(), valueForLength(lengths.top(), size.height())) * scaleFactor,
+ std::min(size.width(), valueForLength(lengths.right(), size.width())) * scaleFactor,
+ std::min(size.height(), valueForLength(lengths.bottom(), size.height())) * scaleFactor,
+ std::min(size.width(), valueForLength(lengths.left(), size.width())) * scaleFactor
+ };
}
LayoutBoxExtent NinePieceImage::computeSlices(const LayoutSize& size, const LengthBox& lengths, const FloatBoxExtent& widths, const LayoutBoxExtent& slices)
{
- LayoutUnit top = computeSlice(lengths.top(), widths.top(), slices.top(), size.height());
- LayoutUnit right = computeSlice(lengths.right(), widths.right(), slices.right(), size.width());
- LayoutUnit bottom = computeSlice(lengths.bottom(), widths.bottom(), slices.bottom(), size.height());
- LayoutUnit left = computeSlice(lengths.left(), widths.left(), slices.left(), size.width());
- return LayoutBoxExtent(top, right, bottom, left);
+ return {
+ computeSlice(lengths.top(), widths.top(), slices.top(), size.height()),
+ computeSlice(lengths.right(), widths.right(), slices.right(), size.width()),
+ computeSlice(lengths.bottom(), widths.bottom(), slices.bottom(), size.height()),
+ computeSlice(lengths.left(), widths.left(), slices.left(), size.width())
+ };
}
void NinePieceImage::scaleSlicesIfNeeded(const LayoutSize& size, LayoutBoxExtent& slices, float deviceScaleFactor)
diff --git a/Source/WebCore/rendering/style/NinePieceImage.h b/Source/WebCore/rendering/style/NinePieceImage.h
index faabbfd..2b5fe65 100644
--- a/Source/WebCore/rendering/style/NinePieceImage.h
+++ b/Source/WebCore/rendering/style/NinePieceImage.h
@@ -108,53 +108,53 @@
bool hasImage() const { return m_data->image; }
StyleImage* image() const { return m_data->image.get(); }
- void setImage(RefPtr<StyleImage>&& image) { m_data.access()->image = WTFMove(image); }
+ void setImage(RefPtr<StyleImage>&& image) { m_data.access().image = WTFMove(image); }
const LengthBox& imageSlices() const { return m_data->imageSlices; }
- void setImageSlices(LengthBox slices) { m_data.access()->imageSlices = WTFMove(slices); }
+ void setImageSlices(LengthBox slices) { m_data.access().imageSlices = WTFMove(slices); }
bool fill() const { return m_data->fill; }
- void setFill(bool fill) { m_data.access()->fill = fill; }
+ void setFill(bool fill) { m_data.access().fill = fill; }
const LengthBox& borderSlices() const { return m_data->borderSlices; }
- void setBorderSlices(LengthBox slices) { m_data.access()->borderSlices = WTFMove(slices); }
+ void setBorderSlices(LengthBox slices) { m_data.access().borderSlices = WTFMove(slices); }
const LengthBox& outset() const { return m_data->outset; }
- void setOutset(LengthBox outset) { m_data.access()->outset = WTFMove(outset); }
+ void setOutset(LengthBox outset) { m_data.access().outset = WTFMove(outset); }
ENinePieceImageRule horizontalRule() const { return static_cast<ENinePieceImageRule>(m_data->horizontalRule); }
- void setHorizontalRule(ENinePieceImageRule rule) { m_data.access()->horizontalRule = rule; }
+ void setHorizontalRule(ENinePieceImageRule rule) { m_data.access().horizontalRule = rule; }
ENinePieceImageRule verticalRule() const { return static_cast<ENinePieceImageRule>(m_data->verticalRule); }
- void setVerticalRule(ENinePieceImageRule rule) { m_data.access()->verticalRule = rule; }
+ void setVerticalRule(ENinePieceImageRule rule) { m_data.access().verticalRule = rule; }
void copyImageSlicesFrom(const NinePieceImage& other)
{
- m_data.access()->imageSlices = other.m_data->imageSlices;
- m_data.access()->fill = other.m_data->fill;
+ m_data.access().imageSlices = other.m_data->imageSlices;
+ m_data.access().fill = other.m_data->fill;
}
void copyBorderSlicesFrom(const NinePieceImage& other)
{
- m_data.access()->borderSlices = other.m_data->borderSlices;
+ m_data.access().borderSlices = other.m_data->borderSlices;
}
void copyOutsetFrom(const NinePieceImage& other)
{
- m_data.access()->outset = other.m_data->outset;
+ m_data.access().outset = other.m_data->outset;
}
void copyRepeatFrom(const NinePieceImage& other)
{
- m_data.access()->horizontalRule = other.m_data->horizontalRule;
- m_data.access()->verticalRule = other.m_data->verticalRule;
+ m_data.access().horizontalRule = other.m_data->horizontalRule;
+ m_data.access().verticalRule = other.m_data->verticalRule;
}
void setMaskDefaults()
{
- m_data.access()->imageSlices = LengthBox(0);
- m_data.access()->fill = true;
- m_data.access()->borderSlices = LengthBox();
+ m_data.access().imageSlices = LengthBox(0);
+ m_data.access().fill = true;
+ m_data.access().borderSlices = LengthBox();
}
static LayoutUnit computeOutset(const Length& outsetSide, LayoutUnit borderSide)
diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp
index 9c47125..8fe82e1 100644
--- a/Source/WebCore/rendering/style/RenderStyle.cpp
+++ b/Source/WebCore/rendering/style/RenderStyle.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2004-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
* Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -71,11 +71,11 @@
void* dataRefSvgStyle;
struct InheritedFlags {
unsigned m_bitfields[2];
- } inherited_flags;
+ } m_inheritedFlags;
struct NonInheritedFlags {
uint64_t m_flags;
- } noninherited_flags;
+ } m_nonInheritedFlags;
#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
bool deletionCheck;
#endif
@@ -85,7 +85,7 @@
RenderStyle& RenderStyle::defaultStyle()
{
- static RenderStyle& style = *new RenderStyle(CreateDefaultStyle);
+ static NeverDestroyed<RenderStyle> style { CreateDefaultStyle };
return style;
}
@@ -128,53 +128,68 @@
}
RenderStyle::RenderStyle(CreateDefaultStyleTag)
- : m_box(StyleBoxData::create())
- , visual(StyleVisualData::create())
- , m_background(StyleBackgroundData::create())
- , surround(StyleSurroundData::create())
- , rareNonInheritedData(StyleRareNonInheritedData::create())
- , rareInheritedData(StyleRareInheritedData::create())
- , inherited(StyleInheritedData::create())
+ : m_boxData(StyleBoxData::create())
+ , m_visualData(StyleVisualData::create())
+ , m_backgroundData(StyleBackgroundData::create())
+ , m_surroundData(StyleSurroundData::create())
+ , m_rareNonInheritedData(StyleRareNonInheritedData::create())
+ , m_rareInheritedData(StyleRareInheritedData::create())
+ , m_inheritedData(StyleInheritedData::create())
, m_svgStyle(SVGRenderStyle::create())
{
- inherited_flags._empty_cells = initialEmptyCells();
- inherited_flags._caption_side = initialCaptionSide();
- inherited_flags._list_style_type = initialListStyleType();
- inherited_flags._list_style_position = initialListStylePosition();
- inherited_flags._visibility = initialVisibility();
- inherited_flags._text_align = initialTextAlign();
- inherited_flags._text_transform = initialTextTransform();
- inherited_flags._text_decorations = initialTextDecoration();
- inherited_flags._cursor_style = initialCursor();
+ m_inheritedFlags.emptyCells = initialEmptyCells();
+ m_inheritedFlags.captionSide = initialCaptionSide();
+ m_inheritedFlags.listStyleType = initialListStyleType();
+ m_inheritedFlags.listStylePosition = initialListStylePosition();
+ m_inheritedFlags.visibility = initialVisibility();
+ m_inheritedFlags.textAlign = initialTextAlign();
+ m_inheritedFlags.textTransform = initialTextTransform();
+ m_inheritedFlags.textDecorations = initialTextDecoration();
+ m_inheritedFlags.cursor = initialCursor();
#if ENABLE(CURSOR_VISIBILITY)
- inherited_flags.m_cursorVisibility = initialCursorVisibility();
+ m_inheritedFlags.cursorVisibility = initialCursorVisibility();
#endif
- inherited_flags._direction = initialDirection();
- inherited_flags._white_space = initialWhiteSpace();
- inherited_flags._border_collapse = initialBorderCollapse();
- inherited_flags.m_rtlOrdering = initialRTLOrdering();
- inherited_flags._box_direction = initialBoxDirection();
- inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
- inherited_flags._pointerEvents = initialPointerEvents();
- inherited_flags._insideLink = NotInsideLink;
- inherited_flags._insideDefaultButton = false;
- inherited_flags.m_writingMode = initialWritingMode();
+ m_inheritedFlags.direction = initialDirection();
+ m_inheritedFlags.whiteSpace = initialWhiteSpace();
+ m_inheritedFlags.borderCollapse = initialBorderCollapse();
+ m_inheritedFlags.rtlOrdering = initialRTLOrdering();
+ m_inheritedFlags.boxDirection = initialBoxDirection();
+ m_inheritedFlags.printColorAdjust = initialPrintColorAdjust();
+ m_inheritedFlags.pointerEvents = initialPointerEvents();
+ m_inheritedFlags.insideLink = NotInsideLink;
+ m_inheritedFlags.insideDefaultButton = false;
+ m_inheritedFlags.writingMode = initialWritingMode();
static_assert((sizeof(InheritedFlags) <= 8), "InheritedFlags does not grow");
static_assert((sizeof(NonInheritedFlags) <= 8), "NonInheritedFlags does not grow");
}
-RenderStyle::RenderStyle(const RenderStyle& other, CloneTag)
- : m_box(other.m_box)
- , visual(other.visual)
- , m_background(other.m_background)
- , surround(other.surround)
- , rareNonInheritedData(other.rareNonInheritedData)
- , rareInheritedData(other.rareInheritedData)
- , inherited(other.inherited)
+inline RenderStyle::RenderStyle(const RenderStyle& other, CloneTag)
+ : m_boxData(other.m_boxData)
+ , m_visualData(other.m_visualData)
+ , m_backgroundData(other.m_backgroundData)
+ , m_surroundData(other.m_surroundData)
+ , m_rareNonInheritedData(other.m_rareNonInheritedData)
+ , m_nonInheritedFlags(other.m_nonInheritedFlags)
+ , m_rareInheritedData(other.m_rareInheritedData)
+ , m_inheritedData(other.m_inheritedData)
+ , m_inheritedFlags(other.m_inheritedFlags)
, m_svgStyle(other.m_svgStyle)
- , inherited_flags(other.inherited_flags)
- , noninherited_flags(other.noninherited_flags)
+{
+}
+
+inline RenderStyle::RenderStyle(RenderStyle& a, RenderStyle&& b)
+ : m_boxData(a.m_boxData.replace(WTFMove(b.m_boxData)))
+ , m_visualData(a.m_visualData.replace(WTFMove(b.m_visualData)))
+ , m_backgroundData(a.m_backgroundData.replace(WTFMove(b.m_backgroundData)))
+ , m_surroundData(a.m_surroundData.replace(WTFMove(b.m_surroundData)))
+ , m_rareNonInheritedData(a.m_rareNonInheritedData.replace(WTFMove(b.m_rareNonInheritedData)))
+ , m_nonInheritedFlags(std::exchange(a.m_nonInheritedFlags, b.m_nonInheritedFlags))
+ , m_rareInheritedData(a.m_rareInheritedData.replace(WTFMove(b.m_rareInheritedData)))
+ , m_inheritedData(a.m_inheritedData.replace(WTFMove(b.m_inheritedData)))
+ , m_inheritedFlags(std::exchange(a.m_inheritedFlags, b.m_inheritedFlags))
+ , m_cachedPseudoStyles(std::exchange(a.m_cachedPseudoStyles, WTFMove(b.m_cachedPseudoStyles)))
+ , m_svgStyle(a.m_svgStyle.replace(WTFMove(b.m_svgStyle)))
{
}
@@ -186,6 +201,11 @@
#endif
}
+RenderStyle RenderStyle::replace(RenderStyle&& newStyle)
+{
+ return RenderStyle { *this, WTFMove(newStyle) };
+}
+
bool RenderStyle::isCSSGridLayoutEnabled()
{
#if ENABLE(CSS_GRID_LAYOUT)
@@ -212,7 +232,7 @@
{
// The auto keyword computes to the parent's align-items computed value.
// We will return the behaviour of 'normal' value if needed, which is specific of each layout model.
- if (alignSelfPosition() == ItemPositionAuto)
+ if (alignSelf().position() == ItemPositionAuto)
return parentStyle.resolvedAlignItems(normalValueBehaviour);
return resolvedSelfAlignment(alignSelf(), normalValueBehaviour);
}
@@ -222,9 +242,8 @@
// FIXME: justify-items 'auto' value is allowed only to provide the 'legacy' keyword's behavior, which it's still not implemented for layout.
// "If the inherited value of justify-items includes the legacy keyword, auto computes to the inherited value."
// https://drafts.csswg.org/css-align/#justify-items-property
- if (justifyItemsPosition() == ItemPositionAuto)
+ if (justifyItems().position() == ItemPositionAuto)
return { normalValueBehaviour, OverflowAlignmentDefault };
-
return resolvedSelfAlignment(justifyItems(), normalValueBehaviour);
}
@@ -232,7 +251,7 @@
{
// The auto keyword computes to the parent's justify-items computed value.
// We will return the behaviour of 'normal' value if needed, which is specific of each layout model.
- if (justifySelfPosition() == ItemPositionAuto)
+ if (justifySelf().position() == ItemPositionAuto)
return parentStyle.resolvedJustifyItems(normalValueBehaviour);
return resolvedSelfAlignment(justifySelf(), normalValueBehaviour);
}
@@ -269,43 +288,42 @@
void RenderStyle::inheritFrom(const RenderStyle& inheritParent)
{
- rareInheritedData = inheritParent.rareInheritedData;
- inherited = inheritParent.inherited;
- inherited_flags = inheritParent.inherited_flags;
+ m_rareInheritedData = inheritParent.m_rareInheritedData;
+ m_inheritedData = inheritParent.m_inheritedData;
+ m_inheritedFlags = inheritParent.m_inheritedFlags;
if (m_svgStyle != inheritParent.m_svgStyle)
- m_svgStyle.access()->inheritFrom(inheritParent.m_svgStyle.get());
+ m_svgStyle.access().inheritFrom(inheritParent.m_svgStyle.get());
}
-void RenderStyle::copyNonInheritedFrom(const RenderStyle* other)
+void RenderStyle::copyNonInheritedFrom(const RenderStyle& other)
{
- m_box = other->m_box;
- visual = other->visual;
- m_background = other->m_background;
- surround = other->surround;
- rareNonInheritedData = other->rareNonInheritedData;
- noninherited_flags.copyNonInheritedFrom(other->noninherited_flags);
+ m_boxData = other.m_boxData;
+ m_visualData = other.m_visualData;
+ m_backgroundData = other.m_backgroundData;
+ m_surroundData = other.m_surroundData;
+ m_rareNonInheritedData = other.m_rareNonInheritedData;
+ m_nonInheritedFlags.copyNonInheritedFrom(other.m_nonInheritedFlags);
- if (m_svgStyle != other->m_svgStyle)
- m_svgStyle.access()->copyNonInheritedFrom(other->m_svgStyle.get());
+ if (m_svgStyle != other.m_svgStyle)
+ m_svgStyle.access().copyNonInheritedFrom(other.m_svgStyle.get());
ASSERT(zoom() == initialZoom());
}
-bool RenderStyle::operator==(const RenderStyle& o) const
+bool RenderStyle::operator==(const RenderStyle& other) const
{
// compare everything except the pseudoStyle pointer
- return inherited_flags == o.inherited_flags
- && noninherited_flags == o.noninherited_flags
- && m_box == o.m_box
- && visual == o.visual
- && m_background == o.m_background
- && surround == o.surround
- && rareNonInheritedData == o.rareNonInheritedData
- && rareInheritedData == o.rareInheritedData
- && inherited == o.inherited
- && m_svgStyle == o.m_svgStyle
- ;
+ return m_inheritedFlags == other.m_inheritedFlags
+ && m_nonInheritedFlags == other.m_nonInheritedFlags
+ && m_boxData == other.m_boxData
+ && m_visualData == other.m_visualData
+ && m_backgroundData == other.m_backgroundData
+ && m_surroundData == other.m_surroundData
+ && m_rareNonInheritedData == other.m_rareNonInheritedData
+ && m_rareInheritedData == other.m_rareInheritedData
+ && m_inheritedData == other.m_inheritedData
+ && m_svgStyle == other.m_svgStyle;
}
bool RenderStyle::hasUniquePseudoStyle() const
@@ -313,8 +331,7 @@
if (!m_cachedPseudoStyles || styleType() != NOPSEUDO)
return false;
- for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) {
- RenderStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get();
+ for (auto& pseudoStyle : *m_cachedPseudoStyles) {
if (pseudoStyle->unique())
return true;
}
@@ -330,10 +347,9 @@
if (styleType() != NOPSEUDO)
return nullptr;
- for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) {
- RenderStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get();
+ for (auto& pseudoStyle : *m_cachedPseudoStyles) {
if (pseudoStyle->styleType() == pid)
- return pseudoStyle;
+ return pseudoStyle.get();
}
return nullptr;
@@ -371,10 +387,10 @@
bool RenderStyle::inheritedNotEqual(const RenderStyle* other) const
{
- return inherited_flags != other->inherited_flags
- || inherited != other->inherited
- || m_svgStyle->inheritedNotEqual(other->m_svgStyle.get())
- || rareInheritedData != other->rareInheritedData;
+ return m_inheritedFlags != other->m_inheritedFlags
+ || m_inheritedData != other->m_inheritedData
+ || m_svgStyle->inheritedNotEqual(other->m_svgStyle)
+ || m_rareInheritedData != other->m_rareInheritedData;
}
#if ENABLE(TEXT_AUTOSIZING)
@@ -390,46 +406,46 @@
unsigned RenderStyle::hashForTextAutosizing() const
{
// FIXME: Not a very smart hash. Could be improved upon. See <https://bugs.webkit.org/show_bug.cgi?id=121131>.
- unsigned hash = rareNonInheritedData->m_appearance;
- hash ^= rareNonInheritedData->marginBeforeCollapse;
- hash ^= rareNonInheritedData->marginAfterCollapse;
- hash ^= rareNonInheritedData->lineClamp.value();
- hash ^= rareInheritedData->overflowWrap;
- hash ^= rareInheritedData->nbspMode;
- hash ^= rareInheritedData->lineBreak;
- hash ^= WTF::FloatHash<float>::hash(inherited->specifiedLineHeight.value());
- hash ^= computeFontHash(inherited->fontCascade);
- hash ^= WTF::FloatHash<float>::hash(inherited->horizontal_border_spacing);
- hash ^= WTF::FloatHash<float>::hash(inherited->vertical_border_spacing);
- hash ^= inherited_flags._box_direction;
- hash ^= inherited_flags.m_rtlOrdering;
- hash ^= noninherited_flags.position();
- hash ^= noninherited_flags.floating();
- hash ^= rareNonInheritedData->textOverflow;
- hash ^= rareInheritedData->textSecurity;
+ unsigned hash = m_rareNonInheritedData->appearance;
+ hash ^= m_rareNonInheritedData->marginBeforeCollapse;
+ hash ^= m_rareNonInheritedData->marginAfterCollapse;
+ hash ^= m_rareNonInheritedData->lineClamp.value();
+ hash ^= m_rareInheritedData->overflowWrap;
+ hash ^= m_rareInheritedData->nbspMode;
+ hash ^= m_rareInheritedData->lineBreak;
+ hash ^= WTF::FloatHash<float>::hash(m_inheritedData->specifiedLineHeight.value());
+ hash ^= computeFontHash(m_inheritedData->fontCascade);
+ hash ^= WTF::FloatHash<float>::hash(m_inheritedData->horizontalBorderSpacing);
+ hash ^= WTF::FloatHash<float>::hash(m_inheritedData->verticalBorderSpacing);
+ hash ^= m_inheritedFlags.boxDirection;
+ hash ^= m_inheritedFlags.rtlOrdering;
+ hash ^= m_nonInheritedFlags.position();
+ hash ^= m_nonInheritedFlags.floating();
+ hash ^= m_rareNonInheritedData->textOverflow;
+ hash ^= m_rareInheritedData->textSecurity;
return hash;
}
bool RenderStyle::equalForTextAutosizing(const RenderStyle& other) const
{
- return rareNonInheritedData->m_appearance == other.rareNonInheritedData->m_appearance
- && rareNonInheritedData->marginBeforeCollapse == other.rareNonInheritedData->marginBeforeCollapse
- && rareNonInheritedData->marginAfterCollapse == other.rareNonInheritedData->marginAfterCollapse
- && rareNonInheritedData->lineClamp == other.rareNonInheritedData->lineClamp
- && rareInheritedData->textSizeAdjust == other.rareInheritedData->textSizeAdjust
- && rareInheritedData->overflowWrap == other.rareInheritedData->overflowWrap
- && rareInheritedData->nbspMode == other.rareInheritedData->nbspMode
- && rareInheritedData->lineBreak == other.rareInheritedData->lineBreak
- && rareInheritedData->textSecurity == other.rareInheritedData->textSecurity
- && inherited->specifiedLineHeight == other.inherited->specifiedLineHeight
- && inherited->fontCascade.equalForTextAutoSizing(other.inherited->fontCascade)
- && inherited->horizontal_border_spacing == other.inherited->horizontal_border_spacing
- && inherited->vertical_border_spacing == other.inherited->vertical_border_spacing
- && inherited_flags._box_direction == other.inherited_flags._box_direction
- && inherited_flags.m_rtlOrdering == other.inherited_flags.m_rtlOrdering
- && noninherited_flags.position() == other.noninherited_flags.position()
- && noninherited_flags.floating() == other.noninherited_flags.floating()
- && rareNonInheritedData->textOverflow == other.rareNonInheritedData->textOverflow;
+ return m_rareNonInheritedData->appearance == other.m_rareNonInheritedData->appearance
+ && m_rareNonInheritedData->marginBeforeCollapse == other.m_rareNonInheritedData->marginBeforeCollapse
+ && m_rareNonInheritedData->marginAfterCollapse == other.m_rareNonInheritedData->marginAfterCollapse
+ && m_rareNonInheritedData->lineClamp == other.m_rareNonInheritedData->lineClamp
+ && m_rareInheritedData->textSizeAdjust == other.m_rareInheritedData->textSizeAdjust
+ && m_rareInheritedData->overflowWrap == other.m_rareInheritedData->overflowWrap
+ && m_rareInheritedData->nbspMode == other.m_rareInheritedData->nbspMode
+ && m_rareInheritedData->lineBreak == other.m_rareInheritedData->lineBreak
+ && m_rareInheritedData->textSecurity == other.m_rareInheritedData->textSecurity
+ && m_inheritedData->specifiedLineHeight == other.m_inheritedData->specifiedLineHeight
+ && m_inheritedData->fontCascade.equalForTextAutoSizing(other.m_inheritedData->fontCascade)
+ && m_inheritedData->horizontalBorderSpacing == other.m_inheritedData->horizontalBorderSpacing
+ && m_inheritedData->verticalBorderSpacing == other.m_inheritedData->verticalBorderSpacing
+ && m_inheritedFlags.boxDirection == other.m_inheritedFlags.boxDirection
+ && m_inheritedFlags.rtlOrdering == other.m_inheritedFlags.rtlOrdering
+ && m_nonInheritedFlags.position() == other.m_nonInheritedFlags.position()
+ && m_nonInheritedFlags.floating() == other.m_nonInheritedFlags.floating()
+ && m_rareNonInheritedData->textOverflow == other.m_rareNonInheritedData->textOverflow;
}
#endif // ENABLE(TEXT_AUTOSIZING)
@@ -437,10 +453,10 @@
bool RenderStyle::inheritedDataShared(const RenderStyle* other) const
{
// This is a fast check that only looks if the data structures are shared.
- return inherited_flags == other->inherited_flags
- && inherited.get() == other->inherited.get()
+ return m_inheritedFlags == other->m_inheritedFlags
+ && m_inheritedData.get() == other->m_inheritedData.get()
&& m_svgStyle.get() == other->m_svgStyle.get()
- && rareInheritedData.get() == other->rareInheritedData.get();
+ && m_rareInheritedData.get() == other->m_rareInheritedData.get();
}
static bool positionChangeIsMovementOnly(const LengthBox& a, const LengthBox& b, const Length& width)
@@ -472,17 +488,17 @@
inline bool RenderStyle::changeAffectsVisualOverflow(const RenderStyle& other) const
{
- if (rareNonInheritedData.get() != other.rareNonInheritedData.get()
- && !arePointingToEqualData(rareNonInheritedData->m_boxShadow, other.rareNonInheritedData->m_boxShadow))
+ if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()
+ && !arePointingToEqualData(m_rareNonInheritedData->boxShadow, other.m_rareNonInheritedData->boxShadow))
return true;
- if (rareInheritedData.get() != other.rareInheritedData.get()
- && !arePointingToEqualData(rareInheritedData->textShadow, other.rareInheritedData->textShadow))
+ if (m_rareInheritedData.get() != other.m_rareInheritedData.get()
+ && !arePointingToEqualData(m_rareInheritedData->textShadow, other.m_rareInheritedData->textShadow))
return true;
- if (inherited_flags._text_decorations != other.inherited_flags._text_decorations
- || visual->textDecoration != other.visual->textDecoration
- || rareNonInheritedData->m_textDecorationStyle != other.rareNonInheritedData->m_textDecorationStyle) {
+ if (m_inheritedFlags.textDecorations != other.m_inheritedFlags.textDecorations
+ || m_visualData->textDecoration != other.m_visualData->textDecoration
+ || m_rareNonInheritedData->textDecorationStyle != other.m_rareNonInheritedData->textDecorationStyle) {
// Underlines are always drawn outside of their textbox bounds when text-underline-position: under;
// is specified. We can take an early out here.
if (textUnderlinePosition() == TextUnderlinePositionUnder
@@ -498,168 +514,168 @@
bool RenderStyle::changeRequiresLayout(const RenderStyle& other, unsigned& changedContextSensitiveProperties) const
{
- if (m_box->width() != other.m_box->width()
- || m_box->minWidth() != other.m_box->minWidth()
- || m_box->maxWidth() != other.m_box->maxWidth()
- || m_box->height() != other.m_box->height()
- || m_box->minHeight() != other.m_box->minHeight()
- || m_box->maxHeight() != other.m_box->maxHeight())
+ if (m_boxData->width() != other.m_boxData->width()
+ || m_boxData->minWidth() != other.m_boxData->minWidth()
+ || m_boxData->maxWidth() != other.m_boxData->maxWidth()
+ || m_boxData->height() != other.m_boxData->height()
+ || m_boxData->minHeight() != other.m_boxData->minHeight()
+ || m_boxData->maxHeight() != other.m_boxData->maxHeight())
return true;
- if (m_box->verticalAlign() != other.m_box->verticalAlign() || noninherited_flags.verticalAlign() != other.noninherited_flags.verticalAlign())
+ if (m_boxData->verticalAlign() != other.m_boxData->verticalAlign() || m_nonInheritedFlags.verticalAlign() != other.m_nonInheritedFlags.verticalAlign())
return true;
- if (m_box->boxSizing() != other.m_box->boxSizing())
+ if (m_boxData->boxSizing() != other.m_boxData->boxSizing())
return true;
- if (surround->margin != other.surround->margin)
+ if (m_surroundData->margin != other.m_surroundData->margin)
return true;
- if (surround->padding != other.surround->padding)
+ if (m_surroundData->padding != other.m_surroundData->padding)
return true;
// FIXME: We should add an optimized form of layout that just recomputes visual overflow.
if (changeAffectsVisualOverflow(other))
return true;
- if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
- if (rareNonInheritedData->m_appearance != other.rareNonInheritedData->m_appearance
- || rareNonInheritedData->marginBeforeCollapse != other.rareNonInheritedData->marginBeforeCollapse
- || rareNonInheritedData->marginAfterCollapse != other.rareNonInheritedData->marginAfterCollapse
- || rareNonInheritedData->lineClamp != other.rareNonInheritedData->lineClamp
- || rareNonInheritedData->m_initialLetter != other.rareNonInheritedData->m_initialLetter
- || rareNonInheritedData->textOverflow != other.rareNonInheritedData->textOverflow)
+ if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) {
+ if (m_rareNonInheritedData->appearance != other.m_rareNonInheritedData->appearance
+ || m_rareNonInheritedData->marginBeforeCollapse != other.m_rareNonInheritedData->marginBeforeCollapse
+ || m_rareNonInheritedData->marginAfterCollapse != other.m_rareNonInheritedData->marginAfterCollapse
+ || m_rareNonInheritedData->lineClamp != other.m_rareNonInheritedData->lineClamp
+ || m_rareNonInheritedData->initialLetter != other.m_rareNonInheritedData->initialLetter
+ || m_rareNonInheritedData->textOverflow != other.m_rareNonInheritedData->textOverflow)
return true;
- if (rareNonInheritedData->m_regionFragment != other.rareNonInheritedData->m_regionFragment)
+ if (m_rareNonInheritedData->regionFragment != other.m_rareNonInheritedData->regionFragment)
return true;
- if (rareNonInheritedData->m_shapeMargin != other.rareNonInheritedData->m_shapeMargin)
+ if (m_rareNonInheritedData->shapeMargin != other.m_rareNonInheritedData->shapeMargin)
return true;
- if (rareNonInheritedData->m_deprecatedFlexibleBox != other.rareNonInheritedData->m_deprecatedFlexibleBox)
+ if (m_rareNonInheritedData->deprecatedFlexibleBox != other.m_rareNonInheritedData->deprecatedFlexibleBox)
return true;
- if (rareNonInheritedData->m_flexibleBox != other.rareNonInheritedData->m_flexibleBox)
+ if (m_rareNonInheritedData->flexibleBox != other.m_rareNonInheritedData->flexibleBox)
return true;
- if (rareNonInheritedData->m_order != other.rareNonInheritedData->m_order
- || rareNonInheritedData->m_alignContent != other.rareNonInheritedData->m_alignContent
- || rareNonInheritedData->m_alignItems != other.rareNonInheritedData->m_alignItems
- || rareNonInheritedData->m_alignSelf != other.rareNonInheritedData->m_alignSelf
- || rareNonInheritedData->m_justifyContent != other.rareNonInheritedData->m_justifyContent
- || rareNonInheritedData->m_justifyItems != other.rareNonInheritedData->m_justifyItems
- || rareNonInheritedData->m_justifySelf != other.rareNonInheritedData->m_justifySelf)
+ if (m_rareNonInheritedData->order != other.m_rareNonInheritedData->order
+ || m_rareNonInheritedData->alignContent != other.m_rareNonInheritedData->alignContent
+ || m_rareNonInheritedData->alignItems != other.m_rareNonInheritedData->alignItems
+ || m_rareNonInheritedData->alignSelf != other.m_rareNonInheritedData->alignSelf
+ || m_rareNonInheritedData->justifyContent != other.m_rareNonInheritedData->justifyContent
+ || m_rareNonInheritedData->justifyItems != other.m_rareNonInheritedData->justifyItems
+ || m_rareNonInheritedData->justifySelf != other.m_rareNonInheritedData->justifySelf)
return true;
- if (!arePointingToEqualData(rareNonInheritedData->m_boxReflect, other.rareNonInheritedData->m_boxReflect))
+ if (!arePointingToEqualData(m_rareNonInheritedData->boxReflect, other.m_rareNonInheritedData->boxReflect))
return true;
- if (rareNonInheritedData->m_multiCol != other.rareNonInheritedData->m_multiCol)
+ if (m_rareNonInheritedData->multiCol != other.m_rareNonInheritedData->multiCol)
return true;
- if (rareNonInheritedData->m_transform != other.rareNonInheritedData->m_transform) {
- if (rareNonInheritedData->m_transform->hasTransform() != other.rareNonInheritedData->m_transform->hasTransform())
+ if (m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform) {
+ if (m_rareNonInheritedData->transform->hasTransform() != other.m_rareNonInheritedData->transform->hasTransform())
return true;
- if (*rareNonInheritedData->m_transform != *other.rareNonInheritedData->m_transform) {
+ if (*m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform) {
changedContextSensitiveProperties |= ContextSensitivePropertyTransform;
// Don't return; keep looking for another change
}
}
#if ENABLE(CSS_GRID_LAYOUT)
- if (rareNonInheritedData->m_grid != other.rareNonInheritedData->m_grid
- || rareNonInheritedData->m_gridItem != other.rareNonInheritedData->m_gridItem)
+ if (m_rareNonInheritedData->grid != other.m_rareNonInheritedData->grid
+ || m_rareNonInheritedData->gridItem != other.m_rareNonInheritedData->gridItem)
return true;
#endif
#if ENABLE(DASHBOARD_SUPPORT)
// If regions change, trigger a relayout to re-calc regions.
- if (rareNonInheritedData->m_dashboardRegions != other.rareNonInheritedData->m_dashboardRegions)
+ if (m_rareNonInheritedData->dashboardRegions != other.m_rareNonInheritedData->dashboardRegions)
return true;
#endif
- if (!arePointingToEqualData(rareNonInheritedData->m_willChange, other.rareNonInheritedData->m_willChange)) {
+ if (!arePointingToEqualData(m_rareNonInheritedData->willChange, other.m_rareNonInheritedData->willChange)) {
changedContextSensitiveProperties |= ContextSensitivePropertyWillChange;
// Don't return; keep looking for another change
}
}
- if (rareInheritedData.get() != other.rareInheritedData.get()) {
- if (rareInheritedData->indent != other.rareInheritedData->indent
+ if (m_rareInheritedData.get() != other.m_rareInheritedData.get()) {
+ if (m_rareInheritedData->indent != other.m_rareInheritedData->indent
#if ENABLE(CSS3_TEXT)
- || rareInheritedData->m_textAlignLast != other.rareInheritedData->m_textAlignLast
- || rareInheritedData->m_textJustify != other.rareInheritedData->m_textJustify
- || rareInheritedData->m_textIndentLine != other.rareInheritedData->m_textIndentLine
+ || m_rareInheritedData->textAlignLast != other.m_rareInheritedData->textAlignLast
+ || m_rareInheritedData->textJustify != other.m_rareInheritedData->textJustify
+ || m_rareInheritedData->textIndentLine != other.m_rareInheritedData->textIndentLine
#endif
- || rareInheritedData->m_effectiveZoom != other.rareInheritedData->m_effectiveZoom
- || rareInheritedData->m_textZoom != other.rareInheritedData->m_textZoom
+ || m_rareInheritedData->effectiveZoom != other.m_rareInheritedData->effectiveZoom
+ || m_rareInheritedData->textZoom != other.m_rareInheritedData->textZoom
#if ENABLE(TEXT_AUTOSIZING)
- || rareInheritedData->textSizeAdjust != other.rareInheritedData->textSizeAdjust
+ || m_rareInheritedData->textSizeAdjust != other.m_rareInheritedData->textSizeAdjust
#endif
- || rareInheritedData->wordBreak != other.rareInheritedData->wordBreak
- || rareInheritedData->overflowWrap != other.rareInheritedData->overflowWrap
- || rareInheritedData->nbspMode != other.rareInheritedData->nbspMode
- || rareInheritedData->lineBreak != other.rareInheritedData->lineBreak
- || rareInheritedData->textSecurity != other.rareInheritedData->textSecurity
- || rareInheritedData->hyphens != other.rareInheritedData->hyphens
- || rareInheritedData->hyphenationLimitBefore != other.rareInheritedData->hyphenationLimitBefore
- || rareInheritedData->hyphenationLimitAfter != other.rareInheritedData->hyphenationLimitAfter
- || rareInheritedData->hyphenationString != other.rareInheritedData->hyphenationString
- || rareInheritedData->m_rubyPosition != other.rareInheritedData->m_rubyPosition
- || rareInheritedData->textEmphasisMark != other.rareInheritedData->textEmphasisMark
- || rareInheritedData->textEmphasisPosition != other.rareInheritedData->textEmphasisPosition
- || rareInheritedData->textEmphasisCustomMark != other.rareInheritedData->textEmphasisCustomMark
- || rareInheritedData->m_textOrientation != other.rareInheritedData->m_textOrientation
- || rareInheritedData->m_tabSize != other.rareInheritedData->m_tabSize
- || rareInheritedData->m_lineBoxContain != other.rareInheritedData->m_lineBoxContain
- || rareInheritedData->m_lineGrid != other.rareInheritedData->m_lineGrid
+ || m_rareInheritedData->wordBreak != other.m_rareInheritedData->wordBreak
+ || m_rareInheritedData->overflowWrap != other.m_rareInheritedData->overflowWrap
+ || m_rareInheritedData->nbspMode != other.m_rareInheritedData->nbspMode
+ || m_rareInheritedData->lineBreak != other.m_rareInheritedData->lineBreak
+ || m_rareInheritedData->textSecurity != other.m_rareInheritedData->textSecurity
+ || m_rareInheritedData->hyphens != other.m_rareInheritedData->hyphens
+ || m_rareInheritedData->hyphenationLimitBefore != other.m_rareInheritedData->hyphenationLimitBefore
+ || m_rareInheritedData->hyphenationLimitAfter != other.m_rareInheritedData->hyphenationLimitAfter
+ || m_rareInheritedData->hyphenationString != other.m_rareInheritedData->hyphenationString
+ || m_rareInheritedData->rubyPosition != other.m_rareInheritedData->rubyPosition
+ || m_rareInheritedData->textEmphasisMark != other.m_rareInheritedData->textEmphasisMark
+ || m_rareInheritedData->textEmphasisPosition != other.m_rareInheritedData->textEmphasisPosition
+ || m_rareInheritedData->textEmphasisCustomMark != other.m_rareInheritedData->textEmphasisCustomMark
+ || m_rareInheritedData->textOrientation != other.m_rareInheritedData->textOrientation
+ || m_rareInheritedData->tabSize != other.m_rareInheritedData->tabSize
+ || m_rareInheritedData->lineBoxContain != other.m_rareInheritedData->lineBoxContain
+ || m_rareInheritedData->lineGrid != other.m_rareInheritedData->lineGrid
#if ENABLE(CSS_IMAGE_ORIENTATION)
- || rareInheritedData->m_imageOrientation != other.rareInheritedData->m_imageOrientation
+ || m_rareInheritedData->imageOrientation != other.m_rareInheritedData->imageOrientation
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
- || rareInheritedData->m_imageResolutionSource != other.rareInheritedData->m_imageResolutionSource
- || rareInheritedData->m_imageResolutionSnap != other.rareInheritedData->m_imageResolutionSnap
- || rareInheritedData->m_imageResolution != other.rareInheritedData->m_imageResolution
+ || m_rareInheritedData->imageResolutionSource != other.m_rareInheritedData->imageResolutionSource
+ || m_rareInheritedData->imageResolutionSnap != other.m_rareInheritedData->imageResolutionSnap
+ || m_rareInheritedData->imageResolution != other.m_rareInheritedData->imageResolution
#endif
- || rareInheritedData->m_lineSnap != other.rareInheritedData->m_lineSnap
- || rareInheritedData->m_lineAlign != other.rareInheritedData->m_lineAlign
- || rareInheritedData->m_hangingPunctuation != other.rareInheritedData->m_hangingPunctuation
+ || m_rareInheritedData->lineSnap != other.m_rareInheritedData->lineSnap
+ || m_rareInheritedData->lineAlign != other.m_rareInheritedData->lineAlign
+ || m_rareInheritedData->hangingPunctuation != other.m_rareInheritedData->hangingPunctuation
#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
- || rareInheritedData->useTouchOverflowScrolling != other.rareInheritedData->useTouchOverflowScrolling
+ || m_rareInheritedData->useTouchOverflowScrolling != other.m_rareInheritedData->useTouchOverflowScrolling
#endif
- || rareInheritedData->listStyleImage != other.rareInheritedData->listStyleImage) // FIXME: needs arePointingToEqualData()?
+ || m_rareInheritedData->listStyleImage != other.m_rareInheritedData->listStyleImage) // FIXME: needs arePointingToEqualData()?
return true;
if (textStrokeWidth() != other.textStrokeWidth())
return true;
}
- if (inherited->line_height != other.inherited->line_height
+ if (m_inheritedData->lineHeight != other.m_inheritedData->lineHeight
#if ENABLE(TEXT_AUTOSIZING)
- || inherited->specifiedLineHeight != other.inherited->specifiedLineHeight
+ || m_inheritedData->specifiedLineHeight != other.m_inheritedData->specifiedLineHeight
#endif
- || inherited->fontCascade != other.inherited->fontCascade
- || inherited->horizontal_border_spacing != other.inherited->horizontal_border_spacing
- || inherited->vertical_border_spacing != other.inherited->vertical_border_spacing
- || inherited_flags._box_direction != other.inherited_flags._box_direction
- || inherited_flags.m_rtlOrdering != other.inherited_flags.m_rtlOrdering
- || noninherited_flags.position() != other.noninherited_flags.position()
- || noninherited_flags.floating() != other.noninherited_flags.floating()
- || noninherited_flags.originalDisplay() != other.noninherited_flags.originalDisplay())
+ || m_inheritedData->fontCascade != other.m_inheritedData->fontCascade
+ || m_inheritedData->horizontalBorderSpacing != other.m_inheritedData->horizontalBorderSpacing
+ || m_inheritedData->verticalBorderSpacing != other.m_inheritedData->verticalBorderSpacing
+ || m_inheritedFlags.boxDirection != other.m_inheritedFlags.boxDirection
+ || m_inheritedFlags.rtlOrdering != other.m_inheritedFlags.rtlOrdering
+ || m_nonInheritedFlags.position() != other.m_nonInheritedFlags.position()
+ || m_nonInheritedFlags.floating() != other.m_nonInheritedFlags.floating()
+ || m_nonInheritedFlags.originalDisplay() != other.m_nonInheritedFlags.originalDisplay())
return true;
- if ((noninherited_flags.effectiveDisplay()) >= TABLE) {
- if (inherited_flags._border_collapse != other.inherited_flags._border_collapse
- || inherited_flags._empty_cells != other.inherited_flags._empty_cells
- || inherited_flags._caption_side != other.inherited_flags._caption_side
- || noninherited_flags.tableLayout() != other.noninherited_flags.tableLayout())
+ if ((m_nonInheritedFlags.effectiveDisplay()) >= TABLE) {
+ if (m_inheritedFlags.borderCollapse != other.m_inheritedFlags.borderCollapse
+ || m_inheritedFlags.emptyCells != other.m_inheritedFlags.emptyCells
+ || m_inheritedFlags.captionSide != other.m_inheritedFlags.captionSide
+ || m_nonInheritedFlags.tableLayout() != other.m_nonInheritedFlags.tableLayout())
return true;
// In the collapsing border model, 'hidden' suppresses other borders, while 'none'
// does not, so these style differences can be width differences.
- if (inherited_flags._border_collapse
+ if (m_inheritedFlags.borderCollapse
&& ((borderTopStyle() == BHIDDEN && other.borderTopStyle() == BNONE)
|| (borderTopStyle() == BNONE && other.borderTopStyle() == BHIDDEN)
|| (borderBottomStyle() == BHIDDEN && other.borderBottomStyle() == BNONE)
@@ -671,37 +687,37 @@
return true;
}
- if (noninherited_flags.effectiveDisplay() == LIST_ITEM) {
- if (inherited_flags._list_style_type != other.inherited_flags._list_style_type
- || inherited_flags._list_style_position != other.inherited_flags._list_style_position)
+ if (m_nonInheritedFlags.effectiveDisplay() == LIST_ITEM) {
+ if (m_inheritedFlags.listStyleType != other.m_inheritedFlags.listStyleType
+ || m_inheritedFlags.listStylePosition != other.m_inheritedFlags.listStylePosition)
return true;
}
- if (inherited_flags._text_align != other.inherited_flags._text_align
- || inherited_flags._text_transform != other.inherited_flags._text_transform
- || inherited_flags._direction != other.inherited_flags._direction
- || inherited_flags._white_space != other.inherited_flags._white_space
- || noninherited_flags.clear() != other.noninherited_flags.clear()
- || noninherited_flags.unicodeBidi() != other.noninherited_flags.unicodeBidi())
+ if (m_inheritedFlags.textAlign != other.m_inheritedFlags.textAlign
+ || m_inheritedFlags.textTransform != other.m_inheritedFlags.textTransform
+ || m_inheritedFlags.direction != other.m_inheritedFlags.direction
+ || m_inheritedFlags.whiteSpace != other.m_inheritedFlags.whiteSpace
+ || m_nonInheritedFlags.clear() != other.m_nonInheritedFlags.clear()
+ || m_nonInheritedFlags.unicodeBidi() != other.m_nonInheritedFlags.unicodeBidi())
return true;
// Check block flow direction.
- if (inherited_flags.m_writingMode != other.inherited_flags.m_writingMode)
+ if (m_inheritedFlags.writingMode != other.m_inheritedFlags.writingMode)
return true;
// Check text combine mode.
- if (rareNonInheritedData->m_textCombine != other.rareNonInheritedData->m_textCombine)
+ if (m_rareNonInheritedData->textCombine != other.m_rareNonInheritedData->textCombine)
return true;
// Check breaks.
- if (rareNonInheritedData->m_breakBefore != other.rareNonInheritedData->m_breakBefore
- || rareNonInheritedData->m_breakAfter != other.rareNonInheritedData->m_breakAfter
- || rareNonInheritedData->m_breakInside != other.rareNonInheritedData->m_breakInside)
+ if (m_rareNonInheritedData->breakBefore != other.m_rareNonInheritedData->breakBefore
+ || m_rareNonInheritedData->breakAfter != other.m_rareNonInheritedData->breakAfter
+ || m_rareNonInheritedData->breakInside != other.m_rareNonInheritedData->breakInside)
return true;
// Overflow returns a layout hint.
- if (noninherited_flags.overflowX() != other.noninherited_flags.overflowX()
- || noninherited_flags.overflowY() != other.noninherited_flags.overflowY())
+ if (m_nonInheritedFlags.overflowX() != other.m_nonInheritedFlags.overflowX()
+ || m_nonInheritedFlags.overflowY() != other.m_nonInheritedFlags.overflowY())
return true;
// If our border widths change, then we need to layout. Other changes to borders
@@ -713,13 +729,13 @@
return true;
// If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree.
- if (!arePointingToEqualData(rareNonInheritedData->m_counterDirectives, other.rareNonInheritedData->m_counterDirectives))
+ if (!arePointingToEqualData(m_rareNonInheritedData->counterDirectives, other.m_rareNonInheritedData->counterDirectives))
return true;
if ((visibility() == COLLAPSE) != (other.visibility() == COLLAPSE))
return true;
- if (rareNonInheritedData->hasOpacity() != other.rareNonInheritedData->hasOpacity()) {
+ if (m_rareNonInheritedData->hasOpacity() != other.m_rareNonInheritedData->hasOpacity()) {
// FIXME: We would like to use SimplifiedLayout here, but we can't quite do that yet.
// We need to make sure SimplifiedLayout can operate correctly on RenderInlines (we will need
// to add a selfNeedsSimplifiedLayout bit in order to not get confused and taint every line).
@@ -728,19 +744,19 @@
return true;
}
- if (rareNonInheritedData->hasFilters() != other.rareNonInheritedData->hasFilters())
+ if (m_rareNonInheritedData->hasFilters() != other.m_rareNonInheritedData->hasFilters())
return true;
#if ENABLE(FILTERS_LEVEL_2)
- if (rareNonInheritedData->hasBackdropFilters() != other.rareNonInheritedData->hasBackdropFilters())
+ if (m_rareNonInheritedData->hasBackdropFilters() != other.m_rareNonInheritedData->hasBackdropFilters())
return true;
#endif
- if (!arePointingToEqualData(rareInheritedData->quotes, other.rareInheritedData->quotes))
+ if (!arePointingToEqualData(m_rareInheritedData->quotes, other.m_rareInheritedData->quotes))
return true;
if (position() != StaticPosition) {
- if (surround->offset != other.surround->offset) {
+ if (m_surroundData->offset != other.m_surroundData->offset) {
// FIXME: We would like to use SimplifiedLayout for relative positioning, but we can't quite do that yet.
// We need to make sure SimplifiedLayout can operate correctly on RenderInlines (we will need
// to add a selfNeedsSimplifiedLayout bit in order to not get confused and taint every line).
@@ -748,7 +764,7 @@
return true;
// Optimize for the case where a positioned layer is moving but not changing size.
- if (!positionChangeIsMovementOnly(surround->offset, other.surround->offset, m_box->width()))
+ if (!positionChangeIsMovementOnly(m_surroundData->offset, other.m_surroundData->offset, m_boxData->width()))
return true;
}
}
@@ -776,9 +792,9 @@
if (position() == StaticPosition)
return false;
- if (surround->offset != other.surround->offset) {
+ if (m_surroundData->offset != other.m_surroundData->offset) {
// Optimize for the case where a positioned layer is moving but not changing size.
- if (position() == AbsolutePosition && positionChangeIsMovementOnly(surround->offset, other.surround->offset, m_box->width()))
+ if (position() == AbsolutePosition && positionChangeIsMovementOnly(m_surroundData->offset, other.m_surroundData->offset, m_boxData->width()))
return true;
}
@@ -788,40 +804,40 @@
bool RenderStyle::changeRequiresLayerRepaint(const RenderStyle& other, unsigned& changedContextSensitiveProperties) const
{
// StyleResolver has ensured that zIndex is non-auto only if it's applicable.
- if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex())
+ if (m_boxData->zIndex() != other.m_boxData->zIndex() || m_boxData->hasAutoZIndex() != other.m_boxData->hasAutoZIndex())
return true;
if (position() != StaticPosition) {
- if (visual->clip != other.visual->clip || visual->hasClip != other.visual->hasClip) {
+ if (m_visualData->clip != other.m_visualData->clip || m_visualData->hasClip != other.m_visualData->hasClip) {
changedContextSensitiveProperties |= ContextSensitivePropertyClipRect;
return true;
}
}
#if ENABLE(CSS_COMPOSITING)
- if (rareNonInheritedData->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode)
+ if (m_rareNonInheritedData->effectiveBlendMode != other.m_rareNonInheritedData->effectiveBlendMode)
return true;
#endif
- if (rareNonInheritedData->m_opacity != other.rareNonInheritedData->m_opacity) {
+ if (m_rareNonInheritedData->opacity != other.m_rareNonInheritedData->opacity) {
changedContextSensitiveProperties |= ContextSensitivePropertyOpacity;
// Don't return; keep looking for another change.
}
- if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filter) {
+ if (m_rareNonInheritedData->filter != other.m_rareNonInheritedData->filter) {
changedContextSensitiveProperties |= ContextSensitivePropertyFilter;
// Don't return; keep looking for another change.
}
#if ENABLE(FILTERS_LEVEL_2)
- if (rareNonInheritedData->m_backdropFilter != other.rareNonInheritedData->m_backdropFilter) {
+ if (m_rareNonInheritedData->backdropFilter != other.m_rareNonInheritedData->backdropFilter) {
changedContextSensitiveProperties |= ContextSensitivePropertyFilter;
// Don't return; keep looking for another change.
}
#endif
- if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask
- || rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedData->m_maskBoxImage)
+ if (m_rareNonInheritedData->mask != other.m_rareNonInheritedData->mask
+ || m_rareNonInheritedData->maskBoxImage != other.m_rareNonInheritedData->maskBoxImage)
return true;
return false;
@@ -829,26 +845,26 @@
bool RenderStyle::changeRequiresRepaint(const RenderStyle& other, unsigned& changedContextSensitiveProperties) const
{
- if (inherited_flags._visibility != other.inherited_flags._visibility
- || inherited_flags.m_printColorAdjust != other.inherited_flags.m_printColorAdjust
- || inherited_flags._insideLink != other.inherited_flags._insideLink
- || inherited_flags._insideDefaultButton != other.inherited_flags._insideDefaultButton
- || surround->border != other.surround->border
- || !m_background->isEquivalentForPainting(*other.m_background)
- || rareInheritedData->userModify != other.rareInheritedData->userModify
- || rareInheritedData->userSelect != other.rareInheritedData->userSelect
- || rareNonInheritedData->userDrag != other.rareNonInheritedData->userDrag
- || rareNonInheritedData->m_borderFit != other.rareNonInheritedData->m_borderFit
- || rareNonInheritedData->m_objectFit != other.rareNonInheritedData->m_objectFit
- || rareNonInheritedData->m_objectPosition != other.rareNonInheritedData->m_objectPosition
- || rareInheritedData->m_imageRendering != other.rareInheritedData->m_imageRendering)
+ if (m_inheritedFlags.visibility != other.m_inheritedFlags.visibility
+ || m_inheritedFlags.printColorAdjust != other.m_inheritedFlags.printColorAdjust
+ || m_inheritedFlags.insideLink != other.m_inheritedFlags.insideLink
+ || m_inheritedFlags.insideDefaultButton != other.m_inheritedFlags.insideDefaultButton
+ || m_surroundData->border != other.m_surroundData->border
+ || !m_backgroundData->isEquivalentForPainting(*other.m_backgroundData)
+ || m_rareInheritedData->userModify != other.m_rareInheritedData->userModify
+ || m_rareInheritedData->userSelect != other.m_rareInheritedData->userSelect
+ || m_rareNonInheritedData->userDrag != other.m_rareNonInheritedData->userDrag
+ || m_rareNonInheritedData->borderFit != other.m_rareNonInheritedData->borderFit
+ || m_rareNonInheritedData->objectFit != other.m_rareNonInheritedData->objectFit
+ || m_rareNonInheritedData->objectPosition != other.m_rareNonInheritedData->objectPosition
+ || m_rareInheritedData->imageRendering != other.m_rareInheritedData->imageRendering)
return true;
- if (rareNonInheritedData->m_shapeOutside != other.rareNonInheritedData->m_shapeOutside)
+ if (m_rareNonInheritedData->shapeOutside != other.m_rareNonInheritedData->shapeOutside)
return true;
// FIXME: this should probably be moved to changeRequiresLayerRepaint().
- if (rareNonInheritedData->m_clipPath != other.rareNonInheritedData->m_clipPath) {
+ if (m_rareNonInheritedData->clipPath != other.m_rareNonInheritedData->clipPath) {
changedContextSensitiveProperties |= ContextSensitivePropertyClipPath;
// Don't return; keep looking for another change.
}
@@ -858,16 +874,16 @@
bool RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline(const RenderStyle& other, unsigned&) const
{
- if (inherited->color != other.inherited->color
- || inherited_flags._text_decorations != other.inherited_flags._text_decorations
- || visual->textDecoration != other.visual->textDecoration
- || rareNonInheritedData->m_textDecorationStyle != other.rareNonInheritedData->m_textDecorationStyle
- || rareNonInheritedData->m_textDecorationColor != other.rareNonInheritedData->m_textDecorationColor
- || rareInheritedData->m_textDecorationSkip != other.rareInheritedData->m_textDecorationSkip
- || rareInheritedData->textFillColor != other.rareInheritedData->textFillColor
- || rareInheritedData->textStrokeColor != other.rareInheritedData->textStrokeColor
- || rareInheritedData->textEmphasisColor != other.rareInheritedData->textEmphasisColor
- || rareInheritedData->textEmphasisFill != other.rareInheritedData->textEmphasisFill)
+ if (m_inheritedData->color != other.m_inheritedData->color
+ || m_inheritedFlags.textDecorations != other.m_inheritedFlags.textDecorations
+ || m_visualData->textDecoration != other.m_visualData->textDecoration
+ || m_rareNonInheritedData->textDecorationStyle != other.m_rareNonInheritedData->textDecorationStyle
+ || m_rareNonInheritedData->textDecorationColor != other.m_rareNonInheritedData->textDecorationColor
+ || m_rareInheritedData->textDecorationSkip != other.m_rareInheritedData->textDecorationSkip
+ || m_rareInheritedData->textFillColor != other.m_rareInheritedData->textFillColor
+ || m_rareInheritedData->textStrokeColor != other.m_rareInheritedData->textStrokeColor
+ || m_rareInheritedData->textEmphasisColor != other.m_rareInheritedData->textEmphasisColor
+ || m_rareInheritedData->textEmphasisFill != other.m_rareInheritedData->textEmphasisFill)
return true;
return false;
@@ -875,12 +891,12 @@
bool RenderStyle::changeRequiresRecompositeLayer(const RenderStyle& other, unsigned&) const
{
- if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
- if (rareNonInheritedData->m_transformStyle3D != other.rareNonInheritedData->m_transformStyle3D
- || rareNonInheritedData->m_backfaceVisibility != other.rareNonInheritedData->m_backfaceVisibility
- || rareNonInheritedData->m_perspective != other.rareNonInheritedData->m_perspective
- || rareNonInheritedData->m_perspectiveOriginX != other.rareNonInheritedData->m_perspectiveOriginX
- || rareNonInheritedData->m_perspectiveOriginY != other.rareNonInheritedData->m_perspectiveOriginY)
+ if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) {
+ if (m_rareNonInheritedData->transformStyle3D != other.m_rareNonInheritedData->transformStyle3D
+ || m_rareNonInheritedData->backfaceVisibility != other.m_rareNonInheritedData->backfaceVisibility
+ || m_rareNonInheritedData->perspective != other.m_rareNonInheritedData->perspective
+ || m_rareNonInheritedData->perspectiveOriginX != other.m_rareNonInheritedData->perspectiveOriginX
+ || m_rareNonInheritedData->perspectiveOriginY != other.m_rareNonInheritedData->perspectiveOriginY)
return true;
}
@@ -944,168 +960,150 @@
return false;
}
-void RenderStyle::setClip(Length top, Length right, Length bottom, Length left)
+void RenderStyle::setClip(Length&& top, Length&& right, Length&& bottom, Length&& left)
{
- StyleVisualData* data = visual.access();
- data->clip.top() = top;
- data->clip.right() = right;
- data->clip.bottom() = bottom;
- data->clip.left() = left;
+ auto& data = m_visualData.access();
+ data.clip.top() = WTFMove(top);
+ data.clip.right() = WTFMove(right);
+ data.clip.bottom() = WTFMove(bottom);
+ data.clip.left() = WTFMove(left);
}
void RenderStyle::addCursor(RefPtr<StyleImage>&& image, const IntPoint& hotSpot)
{
- if (!rareInheritedData.access()->cursorData)
- rareInheritedData.access()->cursorData = CursorList::create();
- rareInheritedData.access()->cursorData->append(CursorData(WTFMove(image), hotSpot));
+ auto& cursorData = m_rareInheritedData.access().cursorData;
+ if (!cursorData)
+ cursorData = CursorList::create();
+ cursorData->append(CursorData(WTFMove(image), hotSpot));
}
void RenderStyle::setCursorList(RefPtr<CursorList>&& list)
{
- rareInheritedData.access()->cursorData = WTFMove(list);
+ m_rareInheritedData.access().cursorData = WTFMove(list);
}
void RenderStyle::setQuotes(RefPtr<QuotesData>&& q)
{
- if (rareInheritedData->quotes == q || (rareInheritedData->quotes && q && *rareInheritedData->quotes == *q))
+ if (m_rareInheritedData->quotes == q || (m_rareInheritedData->quotes && q && *m_rareInheritedData->quotes == *q))
return;
- rareInheritedData.access()->quotes = WTFMove(q);
+ m_rareInheritedData.access().quotes = WTFMove(q);
}
void RenderStyle::setWillChange(RefPtr<WillChangeData>&& willChangeData)
{
- if (arePointingToEqualData(rareNonInheritedData->m_willChange.get(), willChangeData.get()))
+ if (arePointingToEqualData(m_rareNonInheritedData->willChange.get(), willChangeData.get()))
return;
- rareNonInheritedData.access()->m_willChange = WTFMove(willChangeData);
+ m_rareNonInheritedData.access().willChange = WTFMove(willChangeData);
}
void RenderStyle::clearCursorList()
{
- if (rareInheritedData->cursorData)
- rareInheritedData.access()->cursorData = nullptr;
+ if (m_rareInheritedData->cursorData)
+ m_rareInheritedData.access().cursorData = nullptr;
}
void RenderStyle::clearContent()
{
- if (rareNonInheritedData->m_content)
- rareNonInheritedData.access()->m_content = nullptr;
+ if (m_rareNonInheritedData->content)
+ m_rareNonInheritedData.access().content = nullptr;
}
-void RenderStyle::appendContent(std::unique_ptr<ContentData> contentData)
+static inline ContentData& lastContent(ContentData& firstContent)
{
- auto& content = rareNonInheritedData.access()->m_content;
- ContentData* lastContent = content.get();
- while (lastContent && lastContent->next())
- lastContent = lastContent->next();
+ auto* lastContent = &firstContent;
+ for (auto* content = &firstContent; content; content = content->next())
+ lastContent = content;
+ return *lastContent;
+}
- if (lastContent)
- lastContent->setNext(WTFMove(contentData));
- else
- content = WTFMove(contentData);
+void RenderStyle::setContent(std::unique_ptr<ContentData> contentData, bool add)
+{
+ auto& data = m_rareNonInheritedData.access();
+ if (add && data.content)
+ lastContent(*data.content).setNext(WTFMove(contentData));
+ else {
+ data.content = WTFMove(contentData);
+ auto& altText = data.altText;
+ if (!altText.isNull())
+ data.content->setAltText(altText);
+ }
}
void RenderStyle::setContent(RefPtr<StyleImage>&& image, bool add)
{
if (!image)
return;
-
- if (add) {
- appendContent(std::make_unique<ImageContentData>(image.releaseNonNull()));
- return;
- }
-
- rareNonInheritedData.access()->m_content = std::make_unique<ImageContentData>(image.releaseNonNull());
- if (!rareNonInheritedData.access()->m_altText.isNull())
- rareNonInheritedData.access()->m_content->setAltText(rareNonInheritedData.access()->m_altText);
+ setContent(std::make_unique<ImageContentData>(image.releaseNonNull()), add);
}
void RenderStyle::setContent(const String& string, bool add)
{
- auto& content = rareNonInheritedData.access()->m_content;
- if (add) {
- ContentData* lastContent = content.get();
- while (lastContent && lastContent->next())
- lastContent = lastContent->next();
-
- if (lastContent) {
- // We attempt to merge with the last ContentData if possible.
- if (is<TextContentData>(*lastContent)) {
- TextContentData& textContent = downcast<TextContentData>(*lastContent);
- textContent.setText(textContent.text() + string);
- } else
- lastContent->setNext(std::make_unique<TextContentData>(string));
-
- if (!rareNonInheritedData.access()->m_altText.isNull())
- lastContent->setAltText(rareNonInheritedData.access()->m_altText);
- return;
+ auto& data = m_rareNonInheritedData.access();
+ if (add && data.content) {
+ auto& last = lastContent(*data.content);
+ if (!is<TextContentData>(last))
+ last.setNext(std::make_unique<TextContentData>(string));
+ else {
+ auto& textContent = downcast<TextContentData>(last);
+ textContent.setText(textContent.text() + string);
}
+ } else {
+ data.content = std::make_unique<TextContentData>(string);
+ auto& altText = data.altText;
+ if (!altText.isNull())
+ data.content->setAltText(altText);
}
-
- content = std::make_unique<TextContentData>(string);
- if (!rareNonInheritedData.access()->m_altText.isNull())
- content->setAltText(rareNonInheritedData.access()->m_altText);
}
void RenderStyle::setContent(std::unique_ptr<CounterContent> counter, bool add)
{
if (!counter)
return;
-
- if (add) {
- appendContent(std::make_unique<CounterContentData>(WTFMove(counter)));
- return;
- }
-
- rareNonInheritedData.access()->m_content = std::make_unique<CounterContentData>(WTFMove(counter));
+ setContent(std::make_unique<CounterContentData>(WTFMove(counter)), add);
}
void RenderStyle::setContent(QuoteType quote, bool add)
{
- if (add) {
- appendContent(std::make_unique<QuoteContentData>(quote));
- return;
- }
-
- rareNonInheritedData.access()->m_content = std::make_unique<QuoteContentData>(quote);
+ setContent(std::make_unique<QuoteContentData>(quote), add);
}
void RenderStyle::setContentAltText(const String& string)
{
- rareNonInheritedData.access()->m_altText = string;
-
- if (rareNonInheritedData.access()->m_content)
- rareNonInheritedData.access()->m_content->setAltText(string);
+ auto& data = m_rareNonInheritedData.access();
+ data.altText = string;
+ if (data.content)
+ data.content->setAltText(string);
}
const String& RenderStyle::contentAltText() const
{
- return rareNonInheritedData->m_altText;
+ return m_rareNonInheritedData->altText;
}
void RenderStyle::setHasAttrContent()
{
setUnique();
- SET_VAR(rareNonInheritedData, m_hasAttrContent, true);
+ SET_VAR(m_rareNonInheritedData, hasAttrContent, true);
}
-// FIXME: use affectedByTransformOrigin().
static inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation>>& transformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
{
- // transform-origin brackets the transform with translate operations.
- // Optimize for the case where the only transform is a translation, since the transform-origin is irrelevant
- // in that case.
+ // The transform-origin property brackets the transform with translate operations.
+ // When the only transform is a translation, the transform-origin is irrelevant.
+
if (applyOrigin != RenderStyle::IncludeTransformOrigin)
return false;
for (auto& operation : transformOperations) {
- TransformOperation::OperationType type = operation->type();
- if (type != TransformOperation::TRANSLATE_X
+ // FIXME: Use affectedByTransformOrigin().
+ auto type = operation->type();
+ if (type != TransformOperation::TRANSLATE
+ && type != TransformOperation::TRANSLATE_3D
+ && type != TransformOperation::TRANSLATE_X
&& type != TransformOperation::TRANSLATE_Y
- && type != TransformOperation::TRANSLATE
- && type != TransformOperation::TRANSLATE_Z
- && type != TransformOperation::TRANSLATE_3D)
+ && type != TransformOperation::TRANSLATE_Z)
return true;
}
@@ -1114,7 +1112,7 @@
void RenderStyle::applyTransform(TransformationMatrix& transform, const FloatRect& boundingBox, ApplyTransformOrigin applyOrigin) const
{
- auto& operations = rareNonInheritedData->m_transform->m_operations.operations();
+ auto& operations = m_rareNonInheritedData->transform->operations.operations();
bool applyTransformOrigin = requireTransformOrigin(operations, applyOrigin);
float offsetX = transformOriginX().isPercent() ? boundingBox.x() : 0;
@@ -1151,78 +1149,91 @@
{
ASSERT(!shadowData || (!shadowData->spread() && shadowData->style() == Normal));
- StyleRareInheritedData* rareData = rareInheritedData.access();
+ auto& rareData = m_rareInheritedData.access();
if (!add) {
- rareData->textShadow = WTFMove(shadowData);
+ rareData.textShadow = WTFMove(shadowData);
return;
}
- shadowData->setNext(WTFMove(rareData->textShadow));
- rareData->textShadow = WTFMove(shadowData);
+ shadowData->setNext(WTFMove(rareData.textShadow));
+ rareData.textShadow = WTFMove(shadowData);
}
void RenderStyle::setBoxShadow(std::unique_ptr<ShadowData> shadowData, bool add)
{
- StyleRareNonInheritedData* rareData = rareNonInheritedData.access();
+ auto& rareData = m_rareNonInheritedData.access();
if (!add) {
- rareData->m_boxShadow = WTFMove(shadowData);
+ rareData.boxShadow = WTFMove(shadowData);
return;
}
- shadowData->setNext(WTFMove(rareData->m_boxShadow));
- rareData->m_boxShadow = WTFMove(shadowData);
+ shadowData->setNext(WTFMove(rareData.boxShadow));
+ rareData.boxShadow = WTFMove(shadowData);
}
static RoundedRect::Radii calcRadiiFor(const BorderData& border, const LayoutSize& size)
{
- return RoundedRect::Radii(
- LayoutSize(valueForLength(border.topLeft().width(), size.width()),
- valueForLength(border.topLeft().height(), size.height())),
- LayoutSize(valueForLength(border.topRight().width(), size.width()),
- valueForLength(border.topRight().height(), size.height())),
- LayoutSize(valueForLength(border.bottomLeft().width(), size.width()),
- valueForLength(border.bottomLeft().height(), size.height())),
- LayoutSize(valueForLength(border.bottomRight().width(), size.width()),
- valueForLength(border.bottomRight().height(), size.height())));
+ return {
+ sizeForLengthSize(border.topLeft(), size),
+ sizeForLengthSize(border.topRight(), size),
+ sizeForLengthSize(border.bottomLeft(), size),
+ sizeForLengthSize(border.bottomRight(), size)
+ };
}
-StyleImage* RenderStyle::listStyleImage() const { return rareInheritedData->listStyleImage.get(); }
+StyleImage* RenderStyle::listStyleImage() const { return m_rareInheritedData->listStyleImage.get(); }
+
void RenderStyle::setListStyleImage(RefPtr<StyleImage>&& v)
{
- if (rareInheritedData->listStyleImage != v)
- rareInheritedData.access()->listStyleImage = WTFMove(v);
+ if (m_rareInheritedData->listStyleImage != v)
+ m_rareInheritedData.access().listStyleImage = WTFMove(v);
}
const Color& RenderStyle::color() const
{
- return inherited->color;
+ return m_inheritedData->color;
}
const Color& RenderStyle::visitedLinkColor() const
{
- return inherited->visitedLinkColor;
+ return m_inheritedData->visitedLinkColor;
}
void RenderStyle::setColor(const Color& v)
{
- SET_VAR(inherited, color, v);
+ SET_VAR(m_inheritedData, color, v);
}
void RenderStyle::setVisitedLinkColor(const Color& v)
{
- SET_VAR(inherited, visitedLinkColor, v);
+ SET_VAR(m_inheritedData, visitedLinkColor, v);
}
-float RenderStyle::horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
-float RenderStyle::verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
-void RenderStyle::setHorizontalBorderSpacing(float v) { SET_VAR(inherited, horizontal_border_spacing, v); }
-void RenderStyle::setVerticalBorderSpacing(float v) { SET_VAR(inherited, vertical_border_spacing, v); }
+float RenderStyle::horizontalBorderSpacing() const
+{
+ return m_inheritedData->horizontalBorderSpacing;
+}
+
+float RenderStyle::verticalBorderSpacing() const
+{
+ return m_inheritedData->verticalBorderSpacing;
+}
+
+void RenderStyle::setHorizontalBorderSpacing(float v)
+{
+ SET_VAR(m_inheritedData, horizontalBorderSpacing, v);
+}
+
+void RenderStyle::setVerticalBorderSpacing(float v)
+{
+ SET_VAR(m_inheritedData, verticalBorderSpacing, v);
+}
RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
RoundedRect roundedRect(borderRect);
if (hasBorderRadius()) {
- RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size());
+ RoundedRect::Radii radii = calcRadiiFor(m_surroundData->border, borderRect.size());
radii.scale(calcBorderRadiiConstraintScaleFor(borderRect, radii));
roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
}
@@ -1232,41 +1243,33 @@
RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
bool horizontal = isHorizontalWritingMode();
-
- LayoutUnit leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
- LayoutUnit rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
- LayoutUnit topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
- LayoutUnit bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
-
+ auto leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
+ auto rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
+ auto topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
+ auto bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge);
}
RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, LayoutUnit topWidth, LayoutUnit bottomWidth,
LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
- LayoutRect innerRect(borderRect.x() + leftWidth,
- borderRect.y() + topWidth,
- borderRect.width() - leftWidth - rightWidth,
- borderRect.height() - topWidth - bottomWidth);
-
- RoundedRect roundedRect(innerRect);
-
+ RoundedRect roundedRect { { borderRect.x() + leftWidth, borderRect.y() + topWidth,
+ borderRect.width() - leftWidth - rightWidth, borderRect.height() - topWidth - bottomWidth } };
if (hasBorderRadius()) {
- RoundedRect::Radii radii = getRoundedBorderFor(borderRect).radii();
+ auto radii = getRoundedBorderFor(borderRect).radii();
radii.shrink(topWidth, bottomWidth, leftWidth, rightWidth);
roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
}
return roundedRect;
}
-static bool allLayersAreFixed(const FillLayer* layer)
+static bool allLayersAreFixed(const FillLayer& layers)
{
- bool allFixed = true;
-
- for (const FillLayer* currLayer = layer; currLayer; currLayer = currLayer->next())
- allFixed &= (currLayer->image() && currLayer->attachment() == FixedBackgroundAttachment);
-
- return layer && allFixed;
+ for (auto* layer = &layers; layer; layer = layer->next()) {
+ if (!(layer->image() && layer->attachment() == FixedBackgroundAttachment))
+ return false;
+ }
+ return true;
}
bool RenderStyle::hasEntirelyFixedBackground() const
@@ -1276,12 +1279,12 @@
const CounterDirectiveMap* RenderStyle::counterDirectives() const
{
- return rareNonInheritedData->m_counterDirectives.get();
+ return m_rareNonInheritedData->counterDirectives.get();
}
CounterDirectiveMap& RenderStyle::accessCounterDirectives()
{
- auto& map = rareNonInheritedData.access()->m_counterDirectives;
+ auto& map = m_rareNonInheritedData.access().counterDirectives;
if (!map)
map = std::make_unique<CounterDirectiveMap>();
return *map;
@@ -1298,7 +1301,7 @@
{
ASSERT(hyphens() != HyphensNone);
- const AtomicString& hyphenationString = rareInheritedData.get()->hyphenationString;
+ auto& hyphenationString = m_rareInheritedData->hyphenationString;
if (!hyphenationString.isNull())
return hyphenationString;
@@ -1350,6 +1353,7 @@
}
#if ENABLE(DASHBOARD_SUPPORT)
+
const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
{
static NeverDestroyed<Vector<StyleDashboardRegion>> emptyList;
@@ -1360,30 +1364,23 @@
{
static NeverDestroyed<Vector<StyleDashboardRegion>> noneList;
static bool noneListInitialized = false;
-
if (!noneListInitialized) {
- StyleDashboardRegion region;
- region.label = emptyString();
- region.offset.top() = Length();
- region.offset.right() = Length();
- region.offset.bottom() = Length();
- region.offset.left() = Length();
- region.type = StyleDashboardRegion::None;
- noneList.get().append(region);
+ noneList.get().append(StyleDashboardRegion { emptyString(), { }, StyleDashboardRegion::None });
noneListInitialized = true;
}
return noneList;
}
+
#endif
void RenderStyle::adjustAnimations()
{
- AnimationList* animationList = rareNonInheritedData->m_animations.get();
+ auto* animationList = m_rareNonInheritedData->animations.get();
if (!animationList)
return;
// Get rid of empty animations and anything beyond them
- for (size_t i = 0; i < animationList->size(); ++i) {
+ for (size_t i = 0, size = animationList->size(); i < size; ++i) {
if (animationList->animation(i).isEmpty()) {
animationList->resize(i);
break;
@@ -1401,12 +1398,12 @@
void RenderStyle::adjustTransitions()
{
- AnimationList* transitionList = rareNonInheritedData->m_transitions.get();
+ auto* transitionList = m_rareNonInheritedData->transitions.get();
if (!transitionList)
return;
// Get rid of empty transitions and anything beyond them
- for (size_t i = 0; i < transitionList->size(); ++i) {
+ for (size_t i = 0, size = transitionList->size(); i < size; ++i) {
if (transitionList->animation(i).isEmpty()) {
transitionList->resize(i);
break;
@@ -1421,10 +1418,10 @@
// Repeat patterns into layers that don't have some properties set.
transitionList->fillUnsetProperties();
- // Make sure there are no duplicate properties. This is an O(n^2) algorithm
- // but the lists tend to be very short, so it is probably ok
+ // Make sure there are no duplicate properties.
+ // This is an O(n^2) algorithm but the lists tend to be short, so it is probably OK.
for (size_t i = 0; i < transitionList->size(); ++i) {
- for (size_t j = i+1; j < transitionList->size(); ++j) {
+ for (size_t j = i + 1; j < transitionList->size(); ++j) {
if (transitionList->animation(i).property() == transitionList->animation(j).property()) {
// toss i
transitionList->remove(i);
@@ -1436,62 +1433,107 @@
AnimationList& RenderStyle::ensureAnimations()
{
- if (!rareNonInheritedData.access()->m_animations)
- rareNonInheritedData.access()->m_animations = std::make_unique<AnimationList>();
- return *rareNonInheritedData->m_animations;
+ if (!m_rareNonInheritedData.access().animations)
+ m_rareNonInheritedData.access().animations = std::make_unique<AnimationList>();
+ return *m_rareNonInheritedData->animations;
}
AnimationList& RenderStyle::ensureTransitions()
{
- if (!rareNonInheritedData.access()->m_transitions)
- rareNonInheritedData.access()->m_transitions = std::make_unique<AnimationList>();
- return *rareNonInheritedData->m_transitions;
+ if (!m_rareNonInheritedData.access().transitions)
+ m_rareNonInheritedData.access().transitions = std::make_unique<AnimationList>();
+ return *m_rareNonInheritedData->transitions;
}
const Animation* RenderStyle::transitionForProperty(CSSPropertyID property) const
{
- if (transitions()) {
- for (size_t i = 0; i < transitions()->size(); ++i) {
- const Animation& p = transitions()->animation(i);
- if (p.animationMode() == Animation::AnimateAll || p.property() == property) {
- return &p;
- }
- }
+ auto* transitions = this->transitions();
+ if (!transitions)
+ return nullptr;
+ for (size_t i = 0, size = transitions->size(); i < size; ++i) {
+ auto& animation = transitions->animation(i);
+ if (animation.animationMode() == Animation::AnimateAll || animation.property() == property)
+ return &animation;
}
- return 0;
+ return nullptr;
}
-const FontCascade& RenderStyle::fontCascade() const { return inherited->fontCascade; }
-const FontMetrics& RenderStyle::fontMetrics() const { return inherited->fontCascade.fontMetrics(); }
-const FontCascadeDescription& RenderStyle::fontDescription() const { return inherited->fontCascade.fontDescription(); }
-float RenderStyle::specifiedFontSize() const { return fontDescription().specifiedSize(); }
-float RenderStyle::computedFontSize() const { return fontDescription().computedSize(); }
-int RenderStyle::fontSize() const { return inherited->fontCascade.pixelSize(); }
-
-const Length& RenderStyle::wordSpacing() const { return rareInheritedData->wordSpacing; }
-float RenderStyle::letterSpacing() const { return inherited->fontCascade.letterSpacing(); }
-
-bool RenderStyle::setFontDescription(const FontCascadeDescription& v)
+const FontCascade& RenderStyle::fontCascade() const
{
- if (inherited->fontCascade.fontDescription() != v) {
- inherited.access()->fontCascade = FontCascade(v, inherited->fontCascade.letterSpacing(), inherited->fontCascade.wordSpacing());
- return true;
- }
- return false;
+ return m_inheritedData->fontCascade;
+}
+
+const FontMetrics& RenderStyle::fontMetrics() const
+{
+ return m_inheritedData->fontCascade.fontMetrics();
+}
+
+const FontCascadeDescription& RenderStyle::fontDescription() const
+{
+ return m_inheritedData->fontCascade.fontDescription();
+}
+
+float RenderStyle::specifiedFontSize() const
+{
+ return fontDescription().specifiedSize();
+}
+
+float RenderStyle::computedFontSize() const
+{
+ return fontDescription().computedSize();
+}
+
+int RenderStyle::fontSize() const
+{
+ return m_inheritedData->fontCascade.pixelSize();
+}
+
+const Length& RenderStyle::wordSpacing() const
+{
+ return m_rareInheritedData->wordSpacing;
+}
+
+float RenderStyle::letterSpacing() const
+{
+ return m_inheritedData->fontCascade.letterSpacing();
+}
+
+bool RenderStyle::setFontDescription(const FontCascadeDescription& description)
+{
+ if (m_inheritedData->fontCascade.fontDescription() == description)
+ return false;
+ auto& cascade = m_inheritedData.access().fontCascade;
+ cascade = { description, cascade.letterSpacing(), cascade.wordSpacing() };
+ return true;
+}
+
+const Length& RenderStyle::specifiedLineHeight() const
+{
+#if ENABLE(TEXT_AUTOSIZING)
+ return m_inheritedData->specifiedLineHeight;
+#else
+ return m_inheritedData->lineHeight;
+#endif
}
#if ENABLE(TEXT_AUTOSIZING)
-const Length& RenderStyle::specifiedLineHeight() const { return inherited->specifiedLineHeight; }
-void RenderStyle::setSpecifiedLineHeight(Length v) { SET_VAR(inherited, specifiedLineHeight, v); }
-#else
-const Length& RenderStyle::specifiedLineHeight() const { return inherited->line_height; }
+
+void RenderStyle::setSpecifiedLineHeight(Length&& height)
+{
+ SET_VAR(m_inheritedData, specifiedLineHeight, WTFMove(height));
+}
+
#endif
-Length RenderStyle::lineHeight() const
+const Length& RenderStyle::lineHeight() const
{
- return inherited->line_height;
+ return m_inheritedData->lineHeight;
}
-void RenderStyle::setLineHeight(Length specifiedLineHeight) { SET_VAR(inherited, line_height, specifiedLineHeight); }
+
+void RenderStyle::setLineHeight(Length&& height)
+{
+ SET_VAR(m_inheritedData, lineHeight, WTFMove(height));
+}
int RenderStyle::computedLineHeight() const
{
@@ -1507,7 +1549,7 @@
return clampTo<int>(lh.value());
}
-void RenderStyle::setWordSpacing(Length value)
+void RenderStyle::setWordSpacing(Length&& value)
{
float fontWordSpacing;
switch (value.type()) {
@@ -1528,11 +1570,11 @@
fontWordSpacing = 0;
break;
}
- inherited.access()->fontCascade.setWordSpacing(fontWordSpacing);
- rareInheritedData.access()->wordSpacing = WTFMove(value);
+ m_inheritedData.access().fontCascade.setWordSpacing(fontWordSpacing);
+ m_rareInheritedData.access().wordSpacing = WTFMove(value);
}
-void RenderStyle::setLetterSpacing(float v) { inherited.access()->fontCascade.setLetterSpacing(v); }
+void RenderStyle::setLetterSpacing(float v) { m_inheritedData.access().fontCascade.setLetterSpacing(v); }
void RenderStyle::setFontSize(float size)
{
@@ -1566,7 +1608,7 @@
}
#endif
-void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit &top, LayoutUnit &right, LayoutUnit &bottom, LayoutUnit &left) const
+void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const
{
top = 0;
right = 0;
@@ -1810,53 +1852,53 @@
return isLeftToRightDirection() ? borderBottomWidth() : borderTopWidth();
}
-void RenderStyle::setMarginStart(Length margin)
+void RenderStyle::setMarginStart(Length&& margin)
{
if (isHorizontalWritingMode()) {
if (isLeftToRightDirection())
- setMarginLeft(margin);
+ setMarginLeft(WTFMove(margin));
else
- setMarginRight(margin);
+ setMarginRight(WTFMove(margin));
} else {
if (isLeftToRightDirection())
- setMarginTop(margin);
+ setMarginTop(WTFMove(margin));
else
- setMarginBottom(margin);
+ setMarginBottom(WTFMove(margin));
}
}
-void RenderStyle::setMarginEnd(Length margin)
+void RenderStyle::setMarginEnd(Length&& margin)
{
if (isHorizontalWritingMode()) {
if (isLeftToRightDirection())
- setMarginRight(margin);
+ setMarginRight(WTFMove(margin));
else
- setMarginLeft(margin);
+ setMarginLeft(WTFMove(margin));
} else {
if (isLeftToRightDirection())
- setMarginBottom(margin);
+ setMarginBottom(WTFMove(margin));
else
- setMarginTop(margin);
+ setMarginTop(WTFMove(margin));
}
}
TextEmphasisMark RenderStyle::textEmphasisMark() const
{
- TextEmphasisMark mark = static_cast<TextEmphasisMark>(rareInheritedData->textEmphasisMark);
+ auto mark = static_cast<TextEmphasisMark>(m_rareInheritedData->textEmphasisMark);
if (mark != TextEmphasisMarkAuto)
return mark;
-
if (isHorizontalWritingMode())
return TextEmphasisMarkDot;
-
return TextEmphasisMarkSesame;
}
#if ENABLE(TOUCH_EVENTS)
+
Color RenderStyle::initialTapHighlightColor()
{
return RenderTheme::tapHighlightColor();
}
+
#endif
LayoutBoxExtent RenderStyle::imageOutsets(const NinePieceImage& image) const
@@ -1889,30 +1931,30 @@
void RenderStyle::setBorderImageSource(RefPtr<StyleImage>&& image)
{
- if (surround->border.m_image.image() == image.get())
+ if (m_surroundData->border.m_image.image() == image.get())
return;
- surround.access()->border.m_image.setImage(WTFMove(image));
+ m_surroundData.access().border.m_image.setImage(WTFMove(image));
}
-void RenderStyle::setBorderImageSlices(LengthBox slices)
+void RenderStyle::setBorderImageSlices(LengthBox&& slices)
{
- if (surround->border.m_image.imageSlices() == slices)
+ if (m_surroundData->border.m_image.imageSlices() == slices)
return;
- surround.access()->border.m_image.setImageSlices(slices);
+ m_surroundData.access().border.m_image.setImageSlices(WTFMove(slices));
}
-void RenderStyle::setBorderImageWidth(LengthBox slices)
+void RenderStyle::setBorderImageWidth(LengthBox&& slices)
{
- if (surround->border.m_image.borderSlices() == slices)
+ if (m_surroundData->border.m_image.borderSlices() == slices)
return;
- surround.access()->border.m_image.setBorderSlices(slices);
+ m_surroundData.access().border.m_image.setBorderSlices(WTFMove(slices));
}
-void RenderStyle::setBorderImageOutset(LengthBox outset)
+void RenderStyle::setBorderImageOutset(LengthBox&& outset)
{
- if (surround->border.m_image.outset() == outset)
+ if (m_surroundData->border.m_image.outset() == outset)
return;
- surround.access()->border.m_image.setOutset(outset);
+ m_surroundData.access().border.m_image.setOutset(WTFMove(outset));
}
void RenderStyle::setColumnStylesFromPaginationMode(const Pagination::Mode& paginationMode)
@@ -1958,6 +2000,7 @@
}
#if ENABLE(CSS_SCROLL_SNAP)
+
ScrollSnapType RenderStyle::initialScrollSnapType()
{
return { };
@@ -1970,22 +2013,22 @@
const StyleScrollSnapArea& RenderStyle::scrollSnapArea() const
{
- return *rareNonInheritedData->m_scrollSnapArea;
+ return *m_rareNonInheritedData->scrollSnapArea;
}
const StyleScrollSnapPort& RenderStyle::scrollSnapPort() const
{
- return *rareNonInheritedData->m_scrollSnapPort;
+ return *m_rareNonInheritedData->scrollSnapPort;
}
const ScrollSnapType& RenderStyle::scrollSnapType() const
{
- return rareNonInheritedData->m_scrollSnapPort->type;
+ return m_rareNonInheritedData->scrollSnapPort->type;
}
const LengthBox& RenderStyle::scrollPadding() const
{
- return rareNonInheritedData->m_scrollSnapPort->scrollPadding;
+ return m_rareNonInheritedData->scrollSnapPort->scrollPadding;
}
const Length& RenderStyle::scrollPaddingTop() const
@@ -2010,12 +2053,12 @@
const ScrollSnapAlign& RenderStyle::scrollSnapAlign() const
{
- return rareNonInheritedData->m_scrollSnapArea->alignment;
+ return m_rareNonInheritedData->scrollSnapArea->alignment;
}
const LengthBox& RenderStyle::scrollSnapMargin() const
{
- return rareNonInheritedData->m_scrollSnapArea->scrollSnapMargin;
+ return m_rareNonInheritedData->scrollSnapArea->scrollSnapMargin;
}
const Length& RenderStyle::scrollSnapMarginTop() const
@@ -2040,79 +2083,74 @@
void RenderStyle::setScrollSnapType(const ScrollSnapType& type)
{
- rareNonInheritedData.access()->m_scrollSnapPort.access()->type = type;
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapPort, type, type);
}
-void RenderStyle::setScrollPaddingTop(const Length& length)
+void RenderStyle::setScrollPaddingTop(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapPort.access()->scrollPadding.setTop(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapPort, scrollPadding.top(), WTFMove(length));
}
-void RenderStyle::setScrollPaddingBottom(const Length& length)
+void RenderStyle::setScrollPaddingBottom(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapPort.access()->scrollPadding.setBottom(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapPort, scrollPadding.bottom(), WTFMove(length));
}
-void RenderStyle::setScrollPaddingLeft(const Length& length)
+void RenderStyle::setScrollPaddingLeft(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapPort.access()->scrollPadding.setLeft(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapPort, scrollPadding.left(), WTFMove(length));
}
-void RenderStyle::setScrollPaddingRight(const Length& length)
+void RenderStyle::setScrollPaddingRight(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapPort.access()->scrollPadding.setRight(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapPort, scrollPadding.right(), WTFMove(length));
}
void RenderStyle::setScrollSnapAlign(const ScrollSnapAlign& alignment)
{
- rareNonInheritedData.access()->m_scrollSnapArea.access()->alignment = alignment;
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapArea, alignment, alignment);
}
-void RenderStyle::setScrollSnapMarginTop(const Length& length)
+void RenderStyle::setScrollSnapMarginTop(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapArea.access()->scrollSnapMargin.setTop(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapArea, scrollSnapMargin.top(), WTFMove(length));
}
-void RenderStyle::setScrollSnapMarginBottom(const Length& length)
+void RenderStyle::setScrollSnapMarginBottom(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapArea.access()->scrollSnapMargin.setBottom(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapArea, scrollSnapMargin.bottom(), WTFMove(length));
}
-void RenderStyle::setScrollSnapMarginLeft(const Length& length)
+void RenderStyle::setScrollSnapMarginLeft(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapArea.access()->scrollSnapMargin.setLeft(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapArea, scrollSnapMargin.left(), WTFMove(length));
}
-void RenderStyle::setScrollSnapMarginRight(const Length& length)
+void RenderStyle::setScrollSnapMarginRight(Length&& length)
{
- rareNonInheritedData.access()->m_scrollSnapArea.access()->scrollSnapMargin.setRight(length);
+ SET_NESTED_VAR(m_rareNonInheritedData, scrollSnapArea, scrollSnapMargin.right(), WTFMove(length));
}
+
#endif
bool RenderStyle::hasReferenceFilterOnly() const
{
if (!hasFilter())
return false;
-
- const FilterOperations& filterOperations = rareNonInheritedData->m_filter->m_operations;
- if (filterOperations.size() != 1)
- return false;
-
- const FilterOperation& filterOperation = *filterOperations.at(0);
- if (filterOperation.type() != FilterOperation::REFERENCE)
- return false;
-
- return true;
+ auto& filterOperations = m_rareNonInheritedData->filter->operations;
+ return filterOperations.size() == 1 && filterOperations.at(0)->type() == FilterOperation::REFERENCE;
}
void RenderStyle::checkVariablesInCustomProperties()
{
- if (!rareInheritedData->m_customProperties->containsVariables())
+ if (!m_rareInheritedData->customProperties->containsVariables)
return;
-
+
+ auto& customPropertyData = m_rareInheritedData.access().customProperties.access();
+
// Our first pass checks the variables for validity and replaces any properties that became
// invalid with empty values.
- auto& customProperties = rareInheritedData.access()->m_customProperties.access()->values();
+ auto& customProperties = customPropertyData.values;
HashSet<AtomicString> invalidProperties;
for (auto entry : customProperties) {
if (!entry.value->containsVariables())
@@ -2142,25 +2180,25 @@
for (auto& resolvedValue : resolvedValues)
customProperties.set(resolvedValue->name(), resolvedValue.copyRef());
- rareInheritedData.access()->m_customProperties.access()->setContainsVariables(false);
+ customPropertyData.containsVariables = false;
}
float RenderStyle::outlineWidth() const
{
- if (m_background->outline().style() == BNONE)
+ if (m_backgroundData->outline.style() == BNONE)
return 0;
if (outlineStyleIsAuto())
- return std::max(m_background->outline().width(), RenderTheme::platformFocusRingWidth());
- return m_background->outline().width();
+ return std::max(m_backgroundData->outline.width(), RenderTheme::platformFocusRingWidth());
+ return m_backgroundData->outline.width();
}
float RenderStyle::outlineOffset() const
{
- if (m_background->outline().style() == BNONE)
+ if (m_backgroundData->outline.style() == BNONE)
return 0;
if (outlineStyleIsAuto())
- return (m_background->outline().offset() + RenderTheme::platformFocusRingOffset(outlineWidth()));
- return m_background->outline().offset();
+ return (m_backgroundData->outline.offset() + RenderTheme::platformFocusRingOffset(outlineWidth()));
+ return m_backgroundData->outline.offset();
}
bool RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft() const
@@ -2168,4 +2206,15 @@
return !isLeftToRightDirection() && isHorizontalWritingMode();
}
+#if ENABLE(DASHBOARD_SUPPORT)
+
+void RenderStyle::setDashboardRegion(int type, const String& label, Length&& top, Length&& right, Length&& bottom, Length&& left, bool append)
+{
+ if (!append)
+ m_rareNonInheritedData.access().dashboardRegions.clear();
+ m_rareNonInheritedData.access().dashboardRegions.append({ label, { WTFMove(top), WTFMove(right), WTFMove(bottom), WTFMove(left) }, type });
+}
+
+#endif
+
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index c28af1a..99c1547 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -82,19 +82,20 @@
#include "TextSizeAdjustment.h"
#endif
-template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<const T&>(u); }
+#define SET_VAR(group, variable, value) do { \
+ if (!compareEqual(group->variable, value)) \
+ group.access().variable = value; \
+ } while (0)
-#define SET_VAR(group, variable, value) \
- if (!compareEqual(group->variable, value)) \
- group.access()->variable = value
+#define SET_NESTED_VAR(group, parentVariable, variable, value) do { \
+ if (!compareEqual(group->parentVariable->variable, value)) \
+ group.access().parentVariable.access().variable = value; \
+ } while (0)
-#define SET_NESTED_VAR(group, parentVariable, variable, value) \
- if (!compareEqual(group->parentVariable->variable, value)) \
- group.access()->parentVariable.access()->variable = value
-
-#define SET_BORDERVALUE_COLOR(group, variable, value) \
- if (!compareEqual(group->variable.color(), value)) \
- group.access()->variable.setColor(value)
+#define SET_BORDERVALUE_COLOR(group, variable, value) do { \
+ if (!compareEqual(group->variable.color(), value)) \
+ group.access().variable.setColor(value); \
+ } while (0)
namespace WebCore {
@@ -111,75 +112,1591 @@
class StyleImage;
class StyleInheritedData;
class StyleResolver;
+class StyleScrollSnapArea;
+class StyleScrollSnapPort;
class TransformationMatrix;
-#if ENABLE(CSS_SCROLL_SNAP)
-class StyleScrollSnapPort;
-class StyleScrollSnapArea;
-struct ScrollSnapType;
struct ScrollSnapAlign;
-#endif
+struct ScrollSnapType;
-typedef Vector<std::unique_ptr<RenderStyle>, 4> PseudoStyleCache;
+using PseudoStyleCache = Vector<std::unique_ptr<RenderStyle>, 4>;
+
+template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<const T&>(u); }
class RenderStyle {
WTF_MAKE_FAST_ALLOCATED;
-
- friend class CSSPropertyAnimationWrapperMap; // Used by CSS animations. We can't allow them to animate based off visited colors.
- friend class ApplyStyleCommand; // Editing has to only reveal unvisited info.
- friend class EditingStyle; // Editing has to only reveal unvisited info.
- friend class ComputedStyleExtractor; // Ignores visited styles, so needs to be able to see unvisited info.
- friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
- friend class RenderSVGResource; // FIXME: Needs to alter the visited state by hand. Should clean the SVG code up and move it into RenderStyle perhaps.
- friend class RenderTreeAsText; // FIXME: Only needed so the render tree can keep lying and dump the wrong colors. Rebaselining would allow this to be yanked.
- friend class StyleBuilderConverter; // Sets members directly.
- friend class StyleBuilderCustom; // Sets members directly.
- friend class StyleBuilderFunctions; // Sets members directly.
- friend class StyleResolver; // Sets members directly.
+
+private:
+ enum CloneTag { Clone };
+ enum CreateDefaultStyleTag { CreateDefaultStyle };
public:
+ RenderStyle(RenderStyle&&) = default;
+ RenderStyle& operator=(RenderStyle&&) = default;
+ ~RenderStyle();
+
+ RenderStyle replace(RenderStyle&&) WARN_UNUSED_RETURN;
+
+ explicit RenderStyle(CreateDefaultStyleTag);
+ RenderStyle(const RenderStyle&, CloneTag);
+
+ static RenderStyle& defaultStyle();
+
+ static RenderStyle create();
+ static std::unique_ptr<RenderStyle> createPtr();
+
+ static RenderStyle clone(const RenderStyle&);
+ static std::unique_ptr<RenderStyle> clonePtr(const RenderStyle&);
+
+ static RenderStyle createAnonymousStyleWithDisplay(const RenderStyle& parentStyle, EDisplay);
+ static RenderStyle createStyleInheritingFromPseudoStyle(const RenderStyle& pseudoStyle);
+
+#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
+ bool deletionHasBegun() const { return m_deletionHasBegun; }
+#endif
+
+ bool operator==(const RenderStyle&) const;
+ bool operator!=(const RenderStyle& other) const { return !(*this == other); }
+
+ void inheritFrom(const RenderStyle& inheritParent);
+ void copyNonInheritedFrom(const RenderStyle&);
+
+ ContentPosition resolvedJustifyContentPosition(const StyleContentAlignmentData& normalValueBehavior) const;
+ ContentDistributionType resolvedJustifyContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const;
+ ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData& normalValueBehavior) const;
+ ContentDistributionType resolvedAlignContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const;
+ StyleSelfAlignmentData resolvedAlignItems(ItemPosition normalValueBehaviour) const;
+ StyleSelfAlignmentData resolvedAlignSelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
+ StyleSelfAlignmentData resolvedJustifyItems(ItemPosition normalValueBehaviour) const;
+ StyleSelfAlignmentData resolvedJustifySelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
+
+ PseudoId styleType() const { return m_nonInheritedFlags.styleType(); }
+ void setStyleType(PseudoId styleType) { m_nonInheritedFlags.setStyleType(styleType); }
+
+ RenderStyle* getCachedPseudoStyle(PseudoId) const;
+ RenderStyle* addCachedPseudoStyle(std::unique_ptr<RenderStyle>);
+ void removeCachedPseudoStyle(PseudoId);
+
+ const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
+
+ const CustomPropertyValueMap& customProperties() const { return m_rareInheritedData->customProperties->values; }
+ void setCustomPropertyValue(const AtomicString& name, Ref<CSSCustomPropertyValue>&& value) { return m_rareInheritedData.access().customProperties.access().setCustomPropertyValue(name, WTFMove(value)); }
+
+ void setHasViewportUnits(bool hasViewportUnits = true) { m_nonInheritedFlags.setHasViewportUnits(hasViewportUnits); }
+ bool hasViewportUnits() const { return m_nonInheritedFlags.hasViewportUnits(); }
+
+ bool affectedByHover() const { return m_nonInheritedFlags.affectedByHover(); }
+ bool affectedByActive() const { return m_nonInheritedFlags.affectedByActive(); }
+ bool affectedByDrag() const { return m_nonInheritedFlags.affectedByDrag(); }
+
+ void setAffectedByHover() { m_nonInheritedFlags.setAffectedByHover(true); }
+ void setAffectedByActive() { m_nonInheritedFlags.setAffectedByActive(true); }
+ void setAffectedByDrag() { m_nonInheritedFlags.setAffectedByDrag(true); }
+
+ void setColumnStylesFromPaginationMode(const Pagination::Mode&);
+
+ bool isFloating() const { return m_nonInheritedFlags.isFloating(); }
+ bool hasMargin() const { return !m_surroundData->margin.isZero(); }
+ bool hasBorder() const { return m_surroundData->border.hasBorder(); }
+ bool hasBorderFill() const { return m_surroundData->border.hasFill(); }
+ bool hasVisibleBorderDecoration() const { return hasVisibleBorder() || hasBorderFill(); }
+ bool hasVisibleBorder() const { return m_surroundData->border.hasVisibleBorder(); }
+ bool hasPadding() const { return !m_surroundData->padding.isZero(); }
+ bool hasOffset() const { return !m_surroundData->offset.isZero(); }
+ bool hasMarginBeforeQuirk() const { return marginBefore().hasQuirk(); }
+ bool hasMarginAfterQuirk() const { return marginAfter().hasQuirk(); }
+
+ bool hasBackgroundImage() const { return m_backgroundData->background.hasImage(); }
+ bool hasFixedBackgroundImage() const { return m_backgroundData->background.hasFixedImage(); }
+
+ bool hasEntirelyFixedBackground() const;
+
+ bool hasAppearance() const { return appearance() != NoControlPart; }
+
+ bool hasBackground() const;
+
+ LayoutBoxExtent imageOutsets(const NinePieceImage&) const;
+ bool hasBorderImageOutsets() const { return borderImage().hasImage() && !borderImage().outset().isZero(); }
+ LayoutBoxExtent borderImageOutsets() const { return imageOutsets(borderImage()); }
+
+ LayoutBoxExtent maskBoxImageOutsets() const { return imageOutsets(maskBoxImage()); }
+
+ bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); }
+ FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); }
+
+ Order rtlOrdering() const { return static_cast<Order>(m_inheritedFlags.rtlOrdering); }
+ void setRTLOrdering(Order ordering) { m_inheritedFlags.rtlOrdering = ordering; }
+
+ bool isStyleAvailable() const;
+
+ bool hasAnyPublicPseudoStyles() const;
+ bool hasPseudoStyle(PseudoId) const;
+ void setHasPseudoStyle(PseudoId);
+ void setHasPseudoStyles(PseudoIdSet);
+ bool hasUniquePseudoStyle() const;
+
+ // attribute getter methods
+
+ EDisplay display() const { return m_nonInheritedFlags.effectiveDisplay(); }
+
+ const Length& left() const { return m_surroundData->offset.left(); }
+ const Length& right() const { return m_surroundData->offset.right(); }
+ const Length& top() const { return m_surroundData->offset.top(); }
+ const Length& bottom() const { return m_surroundData->offset.bottom(); }
+
+ // Accessors for positioned object edges that take into account writing mode.
+ const Length& logicalLeft() const { return m_surroundData->offset.start(writingMode()); }
+ const Length& logicalRight() const { return m_surroundData->offset.end(writingMode()); }
+ const Length& logicalTop() const { return m_surroundData->offset.before(writingMode()); }
+ const Length& logicalBottom() const { return m_surroundData->offset.after(writingMode()); }
+
+ // Whether or not a positioned element requires normal flow x/y to be computed to determine its position.
+ bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
+ bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
+
+ EPosition position() const { return m_nonInheritedFlags.position(); }
+ bool hasOutOfFlowPosition() const { return position() == AbsolutePosition || position() == FixedPosition; }
+ bool hasInFlowPosition() const { return position() == RelativePosition || position() == StickyPosition; }
+ bool hasViewportConstrainedPosition() const { return position() == FixedPosition || position() == StickyPosition; }
+ EFloat floating() const { return m_nonInheritedFlags.floating(); }
+
+ const Length& width() const { return m_boxData->width(); }
+ const Length& height() const { return m_boxData->height(); }
+ const Length& minWidth() const { return m_boxData->minWidth(); }
+ const Length& maxWidth() const { return m_boxData->maxWidth(); }
+ const Length& minHeight() const { return m_boxData->minHeight(); }
+ const Length& maxHeight() const { return m_boxData->maxHeight(); }
+
+ const Length& logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
+ const Length& logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
+ const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
+ const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
+ const Length& logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
+ const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
+
+ const BorderData& border() const { return m_surroundData->border; }
+ const BorderValue& borderLeft() const { return m_surroundData->border.left(); }
+ const BorderValue& borderRight() const { return m_surroundData->border.right(); }
+ const BorderValue& borderTop() const { return m_surroundData->border.top(); }
+ const BorderValue& borderBottom() const { return m_surroundData->border.bottom(); }
+
+ const BorderValue& borderBefore() const;
+ const BorderValue& borderAfter() const;
+ const BorderValue& borderStart() const;
+ const BorderValue& borderEnd() const;
+
+ const NinePieceImage& borderImage() const { return m_surroundData->border.image(); }
+ StyleImage* borderImageSource() const { return m_surroundData->border.image().image(); }
+ const LengthBox& borderImageSlices() const { return m_surroundData->border.image().imageSlices(); }
+ const LengthBox& borderImageWidth() const { return m_surroundData->border.image().borderSlices(); }
+ const LengthBox& borderImageOutset() const { return m_surroundData->border.image().outset(); }
+
+ const LengthSize& borderTopLeftRadius() const { return m_surroundData->border.topLeft(); }
+ const LengthSize& borderTopRightRadius() const { return m_surroundData->border.topRight(); }
+ const LengthSize& borderBottomLeftRadius() const { return m_surroundData->border.bottomLeft(); }
+ const LengthSize& borderBottomRightRadius() const { return m_surroundData->border.bottomRight(); }
+ bool hasBorderRadius() const { return m_surroundData->border.hasBorderRadius(); }
+
+ float borderLeftWidth() const { return m_surroundData->border.borderLeftWidth(); }
+ EBorderStyle borderLeftStyle() const { return m_surroundData->border.left().style(); }
+ bool borderLeftIsTransparent() const { return m_surroundData->border.left().isTransparent(); }
+ float borderRightWidth() const { return m_surroundData->border.borderRightWidth(); }
+ EBorderStyle borderRightStyle() const { return m_surroundData->border.right().style(); }
+ bool borderRightIsTransparent() const { return m_surroundData->border.right().isTransparent(); }
+ float borderTopWidth() const { return m_surroundData->border.borderTopWidth(); }
+ EBorderStyle borderTopStyle() const { return m_surroundData->border.top().style(); }
+ bool borderTopIsTransparent() const { return m_surroundData->border.top().isTransparent(); }
+ float borderBottomWidth() const { return m_surroundData->border.borderBottomWidth(); }
+ EBorderStyle borderBottomStyle() const { return m_surroundData->border.bottom().style(); }
+ bool borderBottomIsTransparent() const { return m_surroundData->border.bottom().isTransparent(); }
+ FloatBoxExtent borderWidth() const { return m_surroundData->border.borderWidth(); }
+
+ float borderBeforeWidth() const;
+ float borderAfterWidth() const;
+ float borderStartWidth() const;
+ float borderEndWidth() const;
+
+ float outlineSize() const { return std::max<float>(0, outlineWidth() + outlineOffset()); }
+ float outlineWidth() const;
+ bool hasOutline() const { return outlineStyle() > BHIDDEN && outlineWidth() > 0; }
+ EBorderStyle outlineStyle() const { return m_backgroundData->outline.style(); }
+ OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_backgroundData->outline.isAuto()); }
+ bool hasOutlineInVisualOverflow() const { return hasOutline() && outlineSize() > 0; }
+
+ EOverflow overflowX() const { return m_nonInheritedFlags.overflowX(); }
+ EOverflow overflowY() const { return m_nonInheritedFlags.overflowY(); }
+
+ EVisibility visibility() const { return static_cast<EVisibility>(m_inheritedFlags.visibility); }
+ EVerticalAlign verticalAlign() const { return m_nonInheritedFlags.verticalAlign(); }
+ const Length& verticalAlignLength() const { return m_boxData->verticalAlign(); }
+
+ const Length& clipLeft() const { return m_visualData->clip.left(); }
+ const Length& clipRight() const { return m_visualData->clip.right(); }
+ const Length& clipTop() const { return m_visualData->clip.top(); }
+ const Length& clipBottom() const { return m_visualData->clip.bottom(); }
+ const LengthBox& clip() const { return m_visualData->clip; }
+ bool hasClip() const { return m_visualData->hasClip; }
+
+ EUnicodeBidi unicodeBidi() const { return m_nonInheritedFlags.unicodeBidi(); }
+
+ EClear clear() const { return m_nonInheritedFlags.clear(); }
+ ETableLayout tableLayout() const { return m_nonInheritedFlags.tableLayout(); }
+
+ WEBCORE_EXPORT const FontCascade& fontCascade() const;
+ WEBCORE_EXPORT const FontMetrics& fontMetrics() const;
+ WEBCORE_EXPORT const FontCascadeDescription& fontDescription() const;
+ float specifiedFontSize() const;
+ float computedFontSize() const;
+ int fontSize() const;
+ std::pair<FontOrientation, NonCJKGlyphOrientation> fontAndGlyphOrientation();
+
+#if ENABLE(VARIATION_FONTS)
+ FontVariationSettings fontVariationSettings() const { return fontDescription().variationSettings(); }
+#endif
+
+ const Length& textIndent() const { return m_rareInheritedData->indent; }
+ ETextAlign textAlign() const { return static_cast<ETextAlign>(m_inheritedFlags.textAlign); }
+ ETextTransform textTransform() const { return static_cast<ETextTransform>(m_inheritedFlags.textTransform); }
+ TextDecoration textDecorationsInEffect() const { return static_cast<TextDecoration>(m_inheritedFlags.textDecorations); }
+ TextDecoration textDecoration() const { return static_cast<TextDecoration>(m_visualData->textDecoration); }
+ TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(m_rareNonInheritedData->textDecorationStyle); }
+ TextDecorationSkip textDecorationSkip() const { return static_cast<TextDecorationSkip>(m_rareInheritedData->textDecorationSkip); }
+ TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(m_rareInheritedData->textUnderlinePosition); }
+
+#if ENABLE(CSS3_TEXT)
+ TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(m_rareInheritedData->textIndentLine); }
+ TextIndentType textIndentType() const { return static_cast<TextIndentType>(m_rareInheritedData->textIndentType); }
+ TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(m_rareInheritedData->textAlignLast); }
+ TextJustify textJustify() const { return static_cast<TextJustify>(m_rareInheritedData->textJustify); }
+#endif
+
+ const Length& wordSpacing() const;
+ float letterSpacing() const;
+
+ float zoom() const { return m_visualData->zoom; }
+ float effectiveZoom() const { return m_rareInheritedData->effectiveZoom; }
+
+ TextZoom textZoom() const { return static_cast<TextZoom>(m_rareInheritedData->textZoom); }
+
+ TextDirection direction() const { return static_cast<TextDirection>(m_inheritedFlags.direction); }
+ bool isLeftToRightDirection() const { return direction() == LTR; }
+ bool hasExplicitlySetDirection() const { return m_nonInheritedFlags.hasExplicitlySetDirection(); }
+
+ const Length& specifiedLineHeight() const;
+ WEBCORE_EXPORT const Length& lineHeight() const;
+ WEBCORE_EXPORT int computedLineHeight() const;
+
+ EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(m_inheritedFlags.whiteSpace); }
+ static bool autoWrap(EWhiteSpace);
+ bool autoWrap() const { return autoWrap(whiteSpace()); }
+ static bool preserveNewline(EWhiteSpace);
+ bool preserveNewline() const { return preserveNewline(whiteSpace()); }
+ static bool collapseWhiteSpace(EWhiteSpace);
+ bool collapseWhiteSpace() const { return collapseWhiteSpace(whiteSpace()); }
+ bool isCollapsibleWhiteSpace(UChar) const;
+ bool breakOnlyAfterWhiteSpace() const;
+ bool breakWords() const;
+
+ EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_backgroundData->background.repeatX()); }
+ EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_backgroundData->background.repeatY()); }
+ CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_backgroundData->background.composite()); }
+ EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_backgroundData->background.attachment()); }
+ EFillBox backgroundClip() const { return static_cast<EFillBox>(m_backgroundData->background.clip()); }
+ EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_backgroundData->background.origin()); }
+ const Length& backgroundXPosition() const { return m_backgroundData->background.xPosition(); }
+ const Length& backgroundYPosition() const { return m_backgroundData->background.yPosition(); }
+ EFillSizeType backgroundSizeType() const { return m_backgroundData->background.sizeType(); }
+ const LengthSize& backgroundSizeLength() const { return m_backgroundData->background.sizeLength(); }
+ FillLayer& ensureBackgroundLayers() { return m_backgroundData.access().background; }
+ const FillLayer& backgroundLayers() const { return m_backgroundData->background; }
+
+ StyleImage* maskImage() const { return m_rareNonInheritedData->mask.image(); }
+ EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(m_rareNonInheritedData->mask.repeatX()); }
+ EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(m_rareNonInheritedData->mask.repeatY()); }
+ CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(m_rareNonInheritedData->mask.composite()); }
+ EFillBox maskClip() const { return static_cast<EFillBox>(m_rareNonInheritedData->mask.clip()); }
+ EFillBox maskOrigin() const { return static_cast<EFillBox>(m_rareNonInheritedData->mask.origin()); }
+ const Length& maskXPosition() const { return m_rareNonInheritedData->mask.xPosition(); }
+ const Length& maskYPosition() const { return m_rareNonInheritedData->mask.yPosition(); }
+ EFillSizeType maskSizeType() const { return m_rareNonInheritedData->mask.sizeType(); }
+ const LengthSize& maskSizeLength() const { return m_rareNonInheritedData->mask.sizeLength(); }
+ FillLayer& ensureMaskLayers() { return m_rareNonInheritedData.access().mask; }
+ const FillLayer& maskLayers() const { return m_rareNonInheritedData->mask; }
+ const NinePieceImage& maskBoxImage() const { return m_rareNonInheritedData->maskBoxImage; }
+ StyleImage* maskBoxImageSource() const { return m_rareNonInheritedData->maskBoxImage.image(); }
+
+ EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(m_inheritedFlags.borderCollapse); }
+ float horizontalBorderSpacing() const;
+ float verticalBorderSpacing() const;
+ EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(m_inheritedFlags.emptyCells); }
+ ECaptionSide captionSide() const { return static_cast<ECaptionSide>(m_inheritedFlags.captionSide); }
+
+ EListStyleType listStyleType() const { return static_cast<EListStyleType>(m_inheritedFlags.listStyleType); }
+ StyleImage* listStyleImage() const;
+ EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(m_inheritedFlags.listStylePosition); }
+
+ const Length& marginTop() const { return m_surroundData->margin.top(); }
+ const Length& marginBottom() const { return m_surroundData->margin.bottom(); }
+ const Length& marginLeft() const { return m_surroundData->margin.left(); }
+ const Length& marginRight() const { return m_surroundData->margin.right(); }
+ const Length& marginBefore() const { return m_surroundData->margin.before(writingMode()); }
+ const Length& marginAfter() const { return m_surroundData->margin.after(writingMode()); }
+ const Length& marginStart() const { return m_surroundData->margin.start(writingMode(), direction()); }
+ const Length& marginEnd() const { return m_surroundData->margin.end(writingMode(), direction()); }
+ const Length& marginStartUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.start(otherStyle->writingMode(), otherStyle->direction()); }
+ const Length& marginEndUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.end(otherStyle->writingMode(), otherStyle->direction()); }
+ const Length& marginBeforeUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.before(otherStyle->writingMode()); }
+ const Length& marginAfterUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.after(otherStyle->writingMode()); }
+
+ const LengthBox& paddingBox() const { return m_surroundData->padding; }
+ const Length& paddingTop() const { return m_surroundData->padding.top(); }
+ const Length& paddingBottom() const { return m_surroundData->padding.bottom(); }
+ const Length& paddingLeft() const { return m_surroundData->padding.left(); }
+ const Length& paddingRight() const { return m_surroundData->padding.right(); }
+ const Length& paddingBefore() const { return m_surroundData->padding.before(writingMode()); }
+ const Length& paddingAfter() const { return m_surroundData->padding.after(writingMode()); }
+ const Length& paddingStart() const { return m_surroundData->padding.start(writingMode(), direction()); }
+ const Length& paddingEnd() const { return m_surroundData->padding.end(writingMode(), direction()); }
+
+ ECursor cursor() const { return static_cast<ECursor>(m_inheritedFlags.cursor); }
+
+#if ENABLE(CURSOR_VISIBILITY)
+ CursorVisibility cursorVisibility() const { return static_cast<CursorVisibility>(m_inheritedFlags.cursorVisibility); }
+#endif
+
+ CursorList* cursors() const { return m_rareInheritedData->cursorData.get(); }
+
+ EInsideLink insideLink() const { return static_cast<EInsideLink>(m_inheritedFlags.insideLink); }
+ bool isLink() const { return m_nonInheritedFlags.isLink(); }
+
+ bool insideDefaultButton() const { return m_inheritedFlags.insideDefaultButton; }
+
+ short widows() const { return m_rareInheritedData->widows; }
+ short orphans() const { return m_rareInheritedData->orphans; }
+ bool hasAutoWidows() const { return m_rareInheritedData->hasAutoWidows; }
+ bool hasAutoOrphans() const { return m_rareInheritedData->hasAutoOrphans; }
+
+ BreakInside breakInside() const { return static_cast<BreakInside>(m_rareNonInheritedData->breakInside); }
+ BreakBetween breakBefore() const { return static_cast<BreakBetween>(m_rareNonInheritedData->breakBefore); }
+ BreakBetween breakAfter() const { return static_cast<BreakBetween>(m_rareNonInheritedData->breakAfter); }
+
+ HangingPunctuation hangingPunctuation() const { return static_cast<HangingPunctuation>(m_rareInheritedData->hangingPunctuation); }
+
+ float outlineOffset() const;
+ const ShadowData* textShadow() const { return m_rareInheritedData->textShadow.get(); }
+ void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
+ void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
+
+ float textStrokeWidth() const { return m_rareInheritedData->textStrokeWidth; }
+ float opacity() const { return m_rareNonInheritedData->opacity; }
+ ControlPart appearance() const { return static_cast<ControlPart>(m_rareNonInheritedData->appearance); }
+ AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(m_rareNonInheritedData->aspectRatioType); }
+ float aspectRatioDenominator() const { return m_rareNonInheritedData->aspectRatioDenominator; }
+ float aspectRatioNumerator() const { return m_rareNonInheritedData->aspectRatioNumerator; }
+ EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); }
+ EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(m_inheritedFlags.boxDirection); }
+ float boxFlex() const { return m_rareNonInheritedData->deprecatedFlexibleBox->flex; }
+ unsigned boxFlexGroup() const { return m_rareNonInheritedData->deprecatedFlexibleBox->flexGroup; }
+ EBoxLines boxLines() const { return static_cast<EBoxLines>(m_rareNonInheritedData->deprecatedFlexibleBox->lines); }
+ unsigned boxOrdinalGroup() const { return m_rareNonInheritedData->deprecatedFlexibleBox->ordinalGroup; }
+ EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(m_rareNonInheritedData->deprecatedFlexibleBox->orient); }
+ EBoxPack boxPack() const { return static_cast<EBoxPack>(m_rareNonInheritedData->deprecatedFlexibleBox->pack); }
+
+ int order() const { return m_rareNonInheritedData->order; }
+ float flexGrow() const { return m_rareNonInheritedData->flexibleBox->flexGrow; }
+ float flexShrink() const { return m_rareNonInheritedData->flexibleBox->flexShrink; }
+ const Length& flexBasis() const { return m_rareNonInheritedData->flexibleBox->flexBasis; }
+ const StyleContentAlignmentData& alignContent() const { return m_rareNonInheritedData->alignContent; }
+ const StyleSelfAlignmentData& alignItems() const { return m_rareNonInheritedData->alignItems; }
+ const StyleSelfAlignmentData& alignSelf() const { return m_rareNonInheritedData->alignSelf; }
+ EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(m_rareNonInheritedData->flexibleBox->flexDirection); }
+ bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
+ bool isReverseFlexDirection() const { return flexDirection() == FlowRowReverse || flexDirection() == FlowColumnReverse; }
+ EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(m_rareNonInheritedData->flexibleBox->flexWrap); }
+ const StyleContentAlignmentData& justifyContent() const { return m_rareNonInheritedData->justifyContent; }
+ const StyleSelfAlignmentData& justifyItems() const { return m_rareNonInheritedData->justifyItems; }
+ const StyleSelfAlignmentData& justifySelf() const { return m_rareNonInheritedData->justifySelf; }
+
+#if ENABLE(CSS_GRID_LAYOUT)
+ const Vector<GridTrackSize>& gridColumns() const { return m_rareNonInheritedData->grid->gridColumns; }
+ const Vector<GridTrackSize>& gridRows() const { return m_rareNonInheritedData->grid->gridRows; }
+ const Vector<GridTrackSize>& gridAutoRepeatColumns() const { return m_rareNonInheritedData->grid->gridAutoRepeatColumns; }
+ const Vector<GridTrackSize>& gridAutoRepeatRows() const { return m_rareNonInheritedData->grid->gridAutoRepeatRows; }
+ unsigned gridAutoRepeatColumnsInsertionPoint() const { return m_rareNonInheritedData->grid->autoRepeatColumnsInsertionPoint; }
+ unsigned gridAutoRepeatRowsInsertionPoint() const { return m_rareNonInheritedData->grid->autoRepeatRowsInsertionPoint; }
+ AutoRepeatType gridAutoRepeatColumnsType() const { return m_rareNonInheritedData->grid->autoRepeatColumnsType; }
+ AutoRepeatType gridAutoRepeatRowsType() const { return m_rareNonInheritedData->grid->autoRepeatRowsType; }
+ const NamedGridLinesMap& namedGridColumnLines() const { return m_rareNonInheritedData->grid->namedGridColumnLines; }
+ const NamedGridLinesMap& namedGridRowLines() const { return m_rareNonInheritedData->grid->namedGridRowLines; }
+ const OrderedNamedGridLinesMap& orderedNamedGridColumnLines() const { return m_rareNonInheritedData->grid->orderedNamedGridColumnLines; }
+ const OrderedNamedGridLinesMap& orderedNamedGridRowLines() const { return m_rareNonInheritedData->grid->orderedNamedGridRowLines; }
+ const NamedGridLinesMap& autoRepeatNamedGridColumnLines() const { return m_rareNonInheritedData->grid->autoRepeatNamedGridColumnLines; }
+ const NamedGridLinesMap& autoRepeatNamedGridRowLines() const { return m_rareNonInheritedData->grid->autoRepeatNamedGridRowLines; }
+ const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridColumnLines() const { return m_rareNonInheritedData->grid->autoRepeatOrderedNamedGridColumnLines; }
+ const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridRowLines() const { return m_rareNonInheritedData->grid->autoRepeatOrderedNamedGridRowLines; }
+ const NamedGridAreaMap& namedGridArea() const { return m_rareNonInheritedData->grid->namedGridArea; }
+ size_t namedGridAreaRowCount() const { return m_rareNonInheritedData->grid->namedGridAreaRowCount; }
+ size_t namedGridAreaColumnCount() const { return m_rareNonInheritedData->grid->namedGridAreaColumnCount; }
+ GridAutoFlow gridAutoFlow() const { return static_cast<GridAutoFlow>(m_rareNonInheritedData->grid->gridAutoFlow); }
+ bool isGridAutoFlowDirectionRow() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowDirectionRow); }
+ bool isGridAutoFlowDirectionColumn() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowDirectionColumn); }
+ bool isGridAutoFlowAlgorithmSparse() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowAlgorithmSparse); }
+ bool isGridAutoFlowAlgorithmDense() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowAlgorithmDense); }
+ const Vector<GridTrackSize>& gridAutoColumns() const { return m_rareNonInheritedData->grid->gridAutoColumns; }
+ const Vector<GridTrackSize>& gridAutoRows() const { return m_rareNonInheritedData->grid->gridAutoRows; }
+ const Length& gridColumnGap() const { return m_rareNonInheritedData->grid->gridColumnGap; }
+ const Length& gridRowGap() const { return m_rareNonInheritedData->grid->gridRowGap; }
+
+ const GridPosition& gridItemColumnStart() const { return m_rareNonInheritedData->gridItem->gridColumnStart; }
+ const GridPosition& gridItemColumnEnd() const { return m_rareNonInheritedData->gridItem->gridColumnEnd; }
+ const GridPosition& gridItemRowStart() const { return m_rareNonInheritedData->gridItem->gridRowStart; }
+ const GridPosition& gridItemRowEnd() const { return m_rareNonInheritedData->gridItem->gridRowEnd; }
+#endif // ENABLE(CSS_GRID_LAYOUT)
+
+ const ShadowData* boxShadow() const { return m_rareNonInheritedData->boxShadow.get(); }
+ void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
+ LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); }
+ void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
+ void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
+ void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
+ void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
+
+#if ENABLE(CSS_BOX_DECORATION_BREAK)
+ EBoxDecorationBreak boxDecorationBreak() const { return m_boxData->boxDecorationBreak(); }
+#endif
+
+ StyleReflection* boxReflect() const { return m_rareNonInheritedData->boxReflect.get(); }
+ EBoxSizing boxSizing() const { return m_boxData->boxSizing(); }
+ const Length& marqueeIncrement() const { return m_rareNonInheritedData->marquee->increment; }
+ int marqueeSpeed() const { return m_rareNonInheritedData->marquee->speed; }
+ int marqueeLoopCount() const { return m_rareNonInheritedData->marquee->loops; }
+ EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(m_rareNonInheritedData->marquee->behavior); }
+ EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(m_rareNonInheritedData->marquee->direction); }
+ EUserModify userModify() const { return static_cast<EUserModify>(m_rareInheritedData->userModify); }
+ EUserDrag userDrag() const { return static_cast<EUserDrag>(m_rareNonInheritedData->userDrag); }
+ EUserSelect userSelect() const { return static_cast<EUserSelect>(m_rareInheritedData->userSelect); }
+ TextOverflow textOverflow() const { return static_cast<TextOverflow>(m_rareNonInheritedData->textOverflow); }
+ EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(m_rareNonInheritedData->marginBeforeCollapse); }
+ EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(m_rareNonInheritedData->marginAfterCollapse); }
+ EWordBreak wordBreak() const { return static_cast<EWordBreak>(m_rareInheritedData->wordBreak); }
+ EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(m_rareInheritedData->overflowWrap); }
+ ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(m_rareInheritedData->nbspMode); }
+ LineBreak lineBreak() const { return static_cast<LineBreak>(m_rareInheritedData->lineBreak); }
+ Hyphens hyphens() const { return static_cast<Hyphens>(m_rareInheritedData->hyphens); }
+ short hyphenationLimitBefore() const { return m_rareInheritedData->hyphenationLimitBefore; }
+ short hyphenationLimitAfter() const { return m_rareInheritedData->hyphenationLimitAfter; }
+ short hyphenationLimitLines() const { return m_rareInheritedData->hyphenationLimitLines; }
+ const AtomicString& hyphenationString() const { return m_rareInheritedData->hyphenationString; }
+ const AtomicString& locale() const { return fontDescription().locale(); }
+ EBorderFit borderFit() const { return static_cast<EBorderFit>(m_rareNonInheritedData->borderFit); }
+ EResize resize() const { return static_cast<EResize>(m_rareNonInheritedData->resize); }
+ ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(m_rareNonInheritedData->multiCol->axis); }
+ bool hasInlineColumnAxis() const;
+ ColumnProgression columnProgression() const { return static_cast<ColumnProgression>(m_rareNonInheritedData->multiCol->progression); }
+ float columnWidth() const { return m_rareNonInheritedData->multiCol->width; }
+ bool hasAutoColumnWidth() const { return m_rareNonInheritedData->multiCol->autoWidth; }
+ unsigned short columnCount() const { return m_rareNonInheritedData->multiCol->count; }
+ bool hasAutoColumnCount() const { return m_rareNonInheritedData->multiCol->autoCount; }
+ bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() || !hasInlineColumnAxis(); }
+ ColumnFill columnFill() const { return static_cast<ColumnFill>(m_rareNonInheritedData->multiCol->fill); }
+ float columnGap() const { return m_rareNonInheritedData->multiCol->gap; }
+ bool hasNormalColumnGap() const { return m_rareNonInheritedData->multiCol->normalGap; }
+ EBorderStyle columnRuleStyle() const { return m_rareNonInheritedData->multiCol->rule.style(); }
+ unsigned short columnRuleWidth() const { return m_rareNonInheritedData->multiCol->ruleWidth(); }
+ bool columnRuleIsTransparent() const { return m_rareNonInheritedData->multiCol->rule.isTransparent(); }
+ ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(m_rareNonInheritedData->multiCol->columnSpan); }
+
+ const TransformOperations& transform() const { return m_rareNonInheritedData->transform->operations; }
+ const Length& transformOriginX() const { return m_rareNonInheritedData->transform->x; }
+ const Length& transformOriginY() const { return m_rareNonInheritedData->transform->y; }
+ float transformOriginZ() const { return m_rareNonInheritedData->transform->z; }
+ bool hasTransform() const { return !m_rareNonInheritedData->transform->operations.operations().isEmpty(); }
+
+ TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(m_rareInheritedData->textEmphasisFill); }
+ TextEmphasisMark textEmphasisMark() const;
+ const AtomicString& textEmphasisCustomMark() const { return m_rareInheritedData->textEmphasisCustomMark; }
+ TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(m_rareInheritedData->textEmphasisPosition); }
+ const AtomicString& textEmphasisMarkString() const;
+
+ RubyPosition rubyPosition() const { return static_cast<RubyPosition>(m_rareInheritedData->rubyPosition); }
+
+ TextOrientation textOrientation() const { return static_cast<TextOrientation>(m_rareInheritedData->textOrientation); }
+
+ ObjectFit objectFit() const { return static_cast<ObjectFit>(m_rareNonInheritedData->objectFit); }
+ LengthPoint objectPosition() const { return m_rareNonInheritedData->objectPosition; }
+
+ // Return true if any transform related property (currently transform, transformStyle3D or perspective)
+ // indicates that we are transforming.
+ bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
+
+ enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
+ void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const;
+ void setPageScaleTransform(float);
+
+ bool hasMask() const { return m_rareNonInheritedData->mask.hasImage() || m_rareNonInheritedData->maskBoxImage.hasImage(); }
+
+ TextCombine textCombine() const { return static_cast<TextCombine>(m_rareNonInheritedData->textCombine); }
+ bool hasTextCombine() const { return textCombine() != TextCombineNone; }
+
+ unsigned tabSize() const { return m_rareInheritedData->tabSize; }
+
+ // End CSS3 Getters
+
+ bool hasFlowInto() const { return !m_rareNonInheritedData->flowThread.isNull(); }
+ const AtomicString& flowThread() const { return m_rareNonInheritedData->flowThread; }
+ bool hasFlowFrom() const { return !m_rareNonInheritedData->regionThread.isNull(); }
+ const AtomicString& regionThread() const { return m_rareNonInheritedData->regionThread; }
+ RegionFragment regionFragment() const { return static_cast<RegionFragment>(m_rareNonInheritedData->regionFragment); }
+
+ const AtomicString& lineGrid() const { return m_rareInheritedData->lineGrid; }
+ LineSnap lineSnap() const { return static_cast<LineSnap>(m_rareInheritedData->lineSnap); }
+ LineAlign lineAlign() const { return static_cast<LineAlign>(m_rareInheritedData->lineAlign); }
+
+ EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(m_inheritedFlags.pointerEvents); }
+ const AnimationList* animations() const { return m_rareNonInheritedData->animations.get(); }
+ const AnimationList* transitions() const { return m_rareNonInheritedData->transitions.get(); }
+
+ AnimationList* animations() { return m_rareNonInheritedData->animations.get(); }
+ AnimationList* transitions() { return m_rareNonInheritedData->transitions.get(); }
+
+ bool hasAnimationsOrTransitions() const { return m_rareNonInheritedData->hasAnimationsOrTransitions(); }
+
+ AnimationList& ensureAnimations();
+ AnimationList& ensureTransitions();
+
+ bool hasAnimations() const { return m_rareNonInheritedData->animations && m_rareNonInheritedData->animations->size() > 0; }
+ bool hasTransitions() const { return m_rareNonInheritedData->transitions && m_rareNonInheritedData->transitions->size() > 0; }
+
+ // Return the first found Animation (including 'all' transitions).
+ const Animation* transitionForProperty(CSSPropertyID) const;
+
+ ETransformStyle3D transformStyle3D() const { return static_cast<ETransformStyle3D>(m_rareNonInheritedData->transformStyle3D); }
+ bool preserves3D() const { return m_rareNonInheritedData->transformStyle3D == TransformStyle3DPreserve3D; }
+
+ EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(m_rareNonInheritedData->backfaceVisibility); }
+ float perspective() const { return m_rareNonInheritedData->perspective; }
+ bool hasPerspective() const { return m_rareNonInheritedData->perspective > 0; }
+ const Length& perspectiveOriginX() const { return m_rareNonInheritedData->perspectiveOriginX; }
+ const Length& perspectiveOriginY() const { return m_rareNonInheritedData->perspectiveOriginY; }
+ const LengthSize& pageSize() const { return m_rareNonInheritedData->pageSize; }
+ PageSizeType pageSizeType() const { return static_cast<PageSizeType>(m_rareNonInheritedData->pageSizeType); }
+
+ LineBoxContain lineBoxContain() const { return m_rareInheritedData->lineBoxContain; }
+ const LineClampValue& lineClamp() const { return m_rareNonInheritedData->lineClamp; }
+ const IntSize& initialLetter() const { return m_rareNonInheritedData->initialLetter; }
+ int initialLetterDrop() const { return initialLetter().width(); }
+ int initialLetterHeight() const { return initialLetter().height(); }
+
+#if ENABLE(TOUCH_EVENTS)
+ TouchAction touchAction() const { return static_cast<TouchAction>(m_rareNonInheritedData->touchAction); }
+#endif
+
+#if ENABLE(CSS_SCROLL_SNAP)
+ // Scroll snap port style.
+ const StyleScrollSnapPort& scrollSnapPort() const;
+ const ScrollSnapType& scrollSnapType() const;
+ const LengthBox& scrollPadding() const;
+ const Length& scrollPaddingTop() const;
+ const Length& scrollPaddingBottom() const;
+ const Length& scrollPaddingLeft() const;
+ const Length& scrollPaddingRight() const;
+
+ // Scroll snap area style.
+ const StyleScrollSnapArea& scrollSnapArea() const;
+ const ScrollSnapAlign& scrollSnapAlign() const;
+ const LengthBox& scrollSnapMargin() const;
+ const Length& scrollSnapMarginTop() const;
+ const Length& scrollSnapMarginBottom() const;
+ const Length& scrollSnapMarginLeft() const;
+ const Length& scrollSnapMarginRight() const;
+#endif
+
+#if ENABLE(TOUCH_EVENTS)
+ Color tapHighlightColor() const { return m_rareInheritedData->tapHighlightColor; }
+#endif
+
+#if PLATFORM(IOS)
+ bool touchCalloutEnabled() const { return m_rareInheritedData->touchCalloutEnabled; }
+#endif
+
+#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
+ bool useTouchOverflowScrolling() const { return m_rareInheritedData->useTouchOverflowScrolling; }
+#endif
+
+#if ENABLE(TEXT_AUTOSIZING)
+ TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; }
+#endif
+
+ ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(m_rareInheritedData->textSecurity); }
+
+ WritingMode writingMode() const { return static_cast<WritingMode>(m_inheritedFlags.writingMode); }
+ bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); }
+ bool isVerticalWritingMode() const { return WebCore::isVerticalWritingMode(writingMode()); }
+ bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); }
+ bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedWritingMode(writingMode()); }
+
+ ImageOrientationEnum imageOrientation() const;
+
+ EImageRendering imageRendering() const { return static_cast<EImageRendering>(m_rareInheritedData->imageRendering); }
+
+#if ENABLE(CSS_IMAGE_RESOLUTION)
+ ImageResolutionSource imageResolutionSource() const { return static_cast<ImageResolutionSource>(m_rareInheritedData->imageResolutionSource); }
+ ImageResolutionSnap imageResolutionSnap() const { return static_cast<ImageResolutionSnap>(m_rareInheritedData->imageResolutionSnap); }
+ float imageResolution() const { return m_rareInheritedData->imageResolution; }
+#endif
+
+ ESpeak speak() const { return static_cast<ESpeak>(m_rareInheritedData->speak); }
+
+ FilterOperations& mutableFilter() { return m_rareNonInheritedData.access().filter.access().operations; }
+ const FilterOperations& filter() const { return m_rareNonInheritedData->filter->operations; }
+ bool hasFilter() const { return !m_rareNonInheritedData->filter->operations.operations().isEmpty(); }
+ bool hasReferenceFilterOnly() const;
+
+#if ENABLE(FILTERS_LEVEL_2)
+ FilterOperations& mutableBackdropFilter() { return m_rareNonInheritedData.access().backdropFilter.access().operations; }
+ const FilterOperations& backdropFilter() const { return m_rareNonInheritedData->backdropFilter->operations; }
+ bool hasBackdropFilter() const { return !m_rareNonInheritedData->backdropFilter->operations.operations().isEmpty(); }
+#else
+ bool hasBackdropFilter() const { return false; }
+#endif
+
+#if ENABLE(CSS_COMPOSITING)
+ BlendMode blendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode); }
+ void setBlendMode(BlendMode mode) { SET_VAR(m_rareNonInheritedData, effectiveBlendMode, mode); }
+ bool hasBlendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode) != BlendModeNormal; }
+
+ Isolation isolation() const { return static_cast<Isolation>(m_rareNonInheritedData->isolation); }
+ void setIsolation(Isolation isolation) { SET_VAR(m_rareNonInheritedData, isolation, isolation); }
+ bool hasIsolation() const { return m_rareNonInheritedData->isolation != IsolationAuto; }
+#else
+ BlendMode blendMode() const { return BlendModeNormal; }
+ bool hasBlendMode() const { return false; }
+
+ Isolation isolation() const { return IsolationAuto; }
+ bool hasIsolation() const { return false; }
+#endif
+
+ bool shouldPlaceBlockDirectionScrollbarOnLeft() const;
+
+#if ENABLE(CSS_TRAILING_WORD)
+ TrailingWord trailingWord() const { return static_cast<TrailingWord>(m_rareInheritedData->trailingWord); }
+#endif
+
+#if ENABLE(APPLE_PAY)
+ ApplePayButtonStyle applePayButtonStyle() const { return static_cast<ApplePayButtonStyle>(m_rareNonInheritedData->applePayButtonStyle); }
+ ApplePayButtonType applePayButtonType() const { return static_cast<ApplePayButtonType>(m_rareNonInheritedData->applePayButtonType); }
+#endif
+
+ void checkVariablesInCustomProperties();
+
+// attribute setter methods
+
+ void setDisplay(EDisplay v) { m_nonInheritedFlags.setEffectiveDisplay(v); }
+ void setOriginalDisplay(EDisplay v) { m_nonInheritedFlags.setOriginalDisplay(v); }
+ void setPosition(EPosition v) { m_nonInheritedFlags.setPosition(v); }
+ void setFloating(EFloat v) { m_nonInheritedFlags.setFloating(v); }
+
+ void setLeft(Length&& length) { SET_VAR(m_surroundData, offset.left(), WTFMove(length)); }
+ void setRight(Length&& length) { SET_VAR(m_surroundData, offset.right(), WTFMove(length)); }
+ void setTop(Length&& length) { SET_VAR(m_surroundData, offset.top(), WTFMove(length)); }
+ void setBottom(Length&& length) { SET_VAR(m_surroundData, offset.bottom(), WTFMove(length)); }
+
+ void setWidth(Length&& length) { SET_VAR(m_boxData, m_width, WTFMove(length)); }
+ void setHeight(Length&& length) { SET_VAR(m_boxData, m_height, WTFMove(length)); }
+
+ void setLogicalWidth(Length&&);
+ void setLogicalHeight(Length&&);
+
+ void setMinWidth(Length&& length) { SET_VAR(m_boxData, m_minWidth, WTFMove(length)); }
+ void setMaxWidth(Length&& length) { SET_VAR(m_boxData, m_maxWidth, WTFMove(length)); }
+ void setMinHeight(Length&& length) { SET_VAR(m_boxData, m_minHeight, WTFMove(length)); }
+ void setMaxHeight(Length&& length) { SET_VAR(m_boxData, m_maxHeight, WTFMove(length)); }
+
+#if ENABLE(DASHBOARD_SUPPORT)
+ const Vector<StyleDashboardRegion>& dashboardRegions() const { return m_rareNonInheritedData->dashboardRegions; }
+ void setDashboardRegions(const Vector<StyleDashboardRegion>& regions) { SET_VAR(m_rareNonInheritedData, dashboardRegions, regions); }
+ void setDashboardRegion(int type, const String& label, Length&& top, Length&& right, Length&& bottom, Length&& left, bool append);
+#endif
+
+ void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
+ void resetBorderTop() { SET_VAR(m_surroundData, border.m_top, BorderValue()); }
+ void resetBorderRight() { SET_VAR(m_surroundData, border.m_right, BorderValue()); }
+ void resetBorderBottom() { SET_VAR(m_surroundData, border.m_bottom, BorderValue()); }
+ void resetBorderLeft() { SET_VAR(m_surroundData, border.m_left, BorderValue()); }
+ void resetBorderImage() { SET_VAR(m_surroundData, border.m_image, NinePieceImage()); }
+ void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
+ void resetBorderTopLeftRadius() { SET_VAR(m_surroundData, border.m_topLeft, initialBorderRadius()); }
+ void resetBorderTopRightRadius() { SET_VAR(m_surroundData, border.m_topRight, initialBorderRadius()); }
+ void resetBorderBottomLeftRadius() { SET_VAR(m_surroundData, border.m_bottomLeft, initialBorderRadius()); }
+ void resetBorderBottomRightRadius() { SET_VAR(m_surroundData, border.m_bottomRight, initialBorderRadius()); }
+
+ void setBackgroundColor(const Color& v) { SET_VAR(m_backgroundData, color, v); }
+
+ void setBackgroundXPosition(Length&& length) { SET_VAR(m_backgroundData, background.m_xPosition, WTFMove(length)); }
+ void setBackgroundYPosition(Length&& length) { SET_VAR(m_backgroundData, background.m_yPosition, WTFMove(length)); }
+ void setBackgroundSize(EFillSizeType b) { SET_VAR(m_backgroundData, background.m_sizeType, b); }
+ void setBackgroundSizeLength(LengthSize&& size) { SET_VAR(m_backgroundData, background.m_sizeLength, WTFMove(size)); }
+
+ void setBorderImage(const NinePieceImage& b) { SET_VAR(m_surroundData, border.m_image, b); }
+ void setBorderImageSource(RefPtr<StyleImage>&&);
+ void setBorderImageSlices(LengthBox&&);
+ void setBorderImageWidth(LengthBox&&);
+ void setBorderImageOutset(LengthBox&&);
+
+ void setBorderTopLeftRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_topLeft, WTFMove(size)); }
+ void setBorderTopRightRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_topRight, WTFMove(size)); }
+ void setBorderBottomLeftRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_bottomLeft, WTFMove(size)); }
+ void setBorderBottomRightRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_bottomRight, WTFMove(size)); }
+
+ void setBorderRadius(LengthSize&&);
+ void setBorderRadius(const IntSize&);
+
+ RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
+ RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
+
+ RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, LayoutUnit topWidth, LayoutUnit bottomWidth,
+ LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
+
+ void setBorderLeftWidth(float v) { SET_VAR(m_surroundData, border.m_left.m_width, v); }
+ void setBorderLeftStyle(EBorderStyle v) { SET_VAR(m_surroundData, border.m_left.m_style, v); }
+ void setBorderLeftColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_left, v); }
+ void setBorderRightWidth(float v) { SET_VAR(m_surroundData, border.m_right.m_width, v); }
+ void setBorderRightStyle(EBorderStyle v) { SET_VAR(m_surroundData, border.m_right.m_style, v); }
+ void setBorderRightColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_right, v); }
+ void setBorderTopWidth(float v) { SET_VAR(m_surroundData, border.m_top.m_width, v); }
+ void setBorderTopStyle(EBorderStyle v) { SET_VAR(m_surroundData, border.m_top.m_style, v); }
+ void setBorderTopColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_top, v); }
+ void setBorderBottomWidth(float v) { SET_VAR(m_surroundData, border.m_bottom.m_width, v); }
+ void setBorderBottomStyle(EBorderStyle v) { SET_VAR(m_surroundData, border.m_bottom.m_style, v); }
+ void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_bottom, v); }
+
+ void setOutlineWidth(float v) { SET_VAR(m_backgroundData, outline.m_width, v); }
+ void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_backgroundData, outline.m_isAuto, isAuto); }
+ void setOutlineStyle(EBorderStyle v) { SET_VAR(m_backgroundData, outline.m_style, v); }
+ void setOutlineColor(const Color& v) { SET_BORDERVALUE_COLOR(m_backgroundData, outline, v); }
+
+ void setOverflowX(EOverflow v) { m_nonInheritedFlags.setOverflowX(v); }
+ void setOverflowY(EOverflow v) { m_nonInheritedFlags.setOverflowY(v); }
+ void setVisibility(EVisibility v) { m_inheritedFlags.visibility = v; }
+ void setVerticalAlign(EVerticalAlign v) { m_nonInheritedFlags.setVerticalAlign(v); }
+ void setVerticalAlignLength(Length&& length) { setVerticalAlign(LENGTH); SET_VAR(m_boxData, m_verticalAlign, WTFMove(length)); }
+
+ void setHasClip(bool b = true) { SET_VAR(m_visualData, hasClip, b); }
+ void setClipLeft(Length&& length) { SET_VAR(m_visualData, clip.left(), WTFMove(length)); }
+ void setClipRight(Length&& length) { SET_VAR(m_visualData, clip.right(), WTFMove(length)); }
+ void setClipTop(Length&& length) { SET_VAR(m_visualData, clip.top(), WTFMove(length)); }
+ void setClipBottom(Length&& length) { SET_VAR(m_visualData, clip.bottom(), WTFMove(length)); }
+ void setClip(Length&& top, Length&& right, Length&& bottom, Length&& left);
+ void setClip(LengthBox&& box) { SET_VAR(m_visualData, clip, WTFMove(box)); }
+
+ void setUnicodeBidi(EUnicodeBidi b) { m_nonInheritedFlags.setUnicodeBidi(b); }
+
+ void setClear(EClear v) { m_nonInheritedFlags.setClear(v); }
+ void setTableLayout(ETableLayout v) { m_nonInheritedFlags.setTableLayout(v); }
+
+ bool setFontDescription(const FontCascadeDescription&);
+
+ // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
+ void setFontSize(float);
+
+#if ENABLE(VARIATION_FONTS)
+ void setFontVariationSettings(FontVariationSettings);
+#endif
+
+ void setColor(const Color&);
+ void setTextIndent(Length&& length) { SET_VAR(m_rareInheritedData, indent, WTFMove(length)); }
+ void setTextAlign(ETextAlign v) { m_inheritedFlags.textAlign = v; }
+ void setTextTransform(ETextTransform v) { m_inheritedFlags.textTransform = v; }
+ void addToTextDecorationsInEffect(TextDecoration v) { m_inheritedFlags.textDecorations |= v; }
+ void setTextDecorationsInEffect(TextDecoration v) { m_inheritedFlags.textDecorations = v; }
+ void setTextDecoration(TextDecoration v) { SET_VAR(m_visualData, textDecoration, v); }
+ void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(m_rareNonInheritedData, textDecorationStyle, v); }
+ void setTextDecorationSkip(TextDecorationSkip skip) { SET_VAR(m_rareInheritedData, textDecorationSkip, skip); }
+ void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(m_rareInheritedData, textUnderlinePosition, v); }
+ void setDirection(TextDirection v) { m_inheritedFlags.direction = v; }
+ void setHasExplicitlySetDirection(bool v) { m_nonInheritedFlags.setHasExplicitlySetDirection(v); }
+ void setLineHeight(Length&&);
+ bool setZoom(float);
+ void setZoomWithoutReturnValue(float f) { setZoom(f); }
+ bool setEffectiveZoom(float);
+ void setTextZoom(TextZoom v) { SET_VAR(m_rareInheritedData, textZoom, v); }
+
+#if ENABLE(CSS3_TEXT)
+ void setTextIndentLine(TextIndentLine v) { SET_VAR(m_rareInheritedData, textIndentLine, v); }
+ void setTextIndentType(TextIndentType v) { SET_VAR(m_rareInheritedData, textIndentType, v); }
+ void setTextAlignLast(TextAlignLast v) { SET_VAR(m_rareInheritedData, textAlignLast, v); }
+ void setTextJustify(TextJustify v) { SET_VAR(m_rareInheritedData, textJustify, v); }
+#endif
+
+#if ENABLE(TEXT_AUTOSIZING)
+ void setSpecifiedLineHeight(Length&&);
+#endif
+
+#if ENABLE(CSS_IMAGE_ORIENTATION)
+ void setImageOrientation(ImageOrientationEnum v) { SET_VAR(m_rareInheritedData, imageOrientation, static_cast<int>(v)); }
+#endif
+
+ void setImageRendering(EImageRendering v) { SET_VAR(m_rareInheritedData, imageRendering, v); }
+
+#if ENABLE(CSS_IMAGE_RESOLUTION)
+ void setImageResolutionSource(ImageResolutionSource v) { SET_VAR(m_rareInheritedData, imageResolutionSource, v); }
+ void setImageResolutionSnap(ImageResolutionSnap v) { SET_VAR(m_rareInheritedData, imageResolutionSnap, v); }
+ void setImageResolution(float f) { SET_VAR(m_rareInheritedData, imageResolution, f); }
+#endif
+
+ void setWhiteSpace(EWhiteSpace v) { m_inheritedFlags.whiteSpace = v; }
+
+ void setWordSpacing(Length&&);
+ void setLetterSpacing(float);
+
+ void clearBackgroundLayers() { m_backgroundData.access().background = FillLayer(BackgroundFillLayer); }
+ void inheritBackgroundLayers(const FillLayer& parent) { m_backgroundData.access().background = parent; }
+
+ void adjustBackgroundLayers();
+
+ void clearMaskLayers() { m_rareNonInheritedData.access().mask = FillLayer(MaskFillLayer); }
+ void inheritMaskLayers(const FillLayer& parent) { m_rareNonInheritedData.access().mask = parent; }
+
+ void adjustMaskLayers();
+
+ void setMaskImage(RefPtr<StyleImage>&& v) { m_rareNonInheritedData.access().mask.setImage(WTFMove(v)); }
+
+ void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(m_rareNonInheritedData, maskBoxImage, b); }
+ void setMaskBoxImageSource(RefPtr<StyleImage>&& v) { m_rareNonInheritedData.access().maskBoxImage.setImage(WTFMove(v)); }
+ void setMaskXPosition(Length&& length) { SET_VAR(m_rareNonInheritedData, mask.m_xPosition, WTFMove(length)); }
+ void setMaskYPosition(Length&& length) { SET_VAR(m_rareNonInheritedData, mask.m_yPosition, WTFMove(length)); }
+ void setMaskSize(LengthSize size) { SET_VAR(m_rareNonInheritedData, mask.m_sizeLength, WTFMove(size)); }
+
+ void setBorderCollapse(EBorderCollapse collapse) { m_inheritedFlags.borderCollapse = collapse; }
+ void setHorizontalBorderSpacing(float);
+ void setVerticalBorderSpacing(float);
+ void setEmptyCells(EEmptyCell v) { m_inheritedFlags.emptyCells = v; }
+ void setCaptionSide(ECaptionSide v) { m_inheritedFlags.captionSide = v; }
+
+ void setAspectRatioType(AspectRatioType aspectRatioType) { SET_VAR(m_rareNonInheritedData, aspectRatioType, aspectRatioType); }
+ void setAspectRatioDenominator(float v) { SET_VAR(m_rareNonInheritedData, aspectRatioDenominator, v); }
+ void setAspectRatioNumerator(float v) { SET_VAR(m_rareNonInheritedData, aspectRatioNumerator, v); }
+
+ void setListStyleType(EListStyleType v) { m_inheritedFlags.listStyleType = v; }
+ void setListStyleImage(RefPtr<StyleImage>&&);
+ void setListStylePosition(EListStylePosition v) { m_inheritedFlags.listStylePosition = v; }
+
+ void resetMargin() { SET_VAR(m_surroundData, margin, LengthBox(Fixed)); }
+ void setMarginTop(Length&& length) { SET_VAR(m_surroundData, margin.top(), WTFMove(length)); }
+ void setMarginBottom(Length&& length) { SET_VAR(m_surroundData, margin.bottom(), WTFMove(length)); }
+ void setMarginLeft(Length&& length) { SET_VAR(m_surroundData, margin.left(), WTFMove(length)); }
+ void setMarginRight(Length&& length) { SET_VAR(m_surroundData, margin.right(), WTFMove(length)); }
+ void setMarginStart(Length&&);
+ void setMarginEnd(Length&&);
+
+ void resetPadding() { SET_VAR(m_surroundData, padding, LengthBox(Auto)); }
+ void setPaddingBox(LengthBox&& box) { SET_VAR(m_surroundData, padding, WTFMove(box)); }
+ void setPaddingTop(Length&& length) { SET_VAR(m_surroundData, padding.top(), WTFMove(length)); }
+ void setPaddingBottom(Length&& length) { SET_VAR(m_surroundData, padding.bottom(), WTFMove(length)); }
+ void setPaddingLeft(Length&& length) { SET_VAR(m_surroundData, padding.left(), WTFMove(length)); }
+ void setPaddingRight(Length&& length) { SET_VAR(m_surroundData, padding.right(), WTFMove(length)); }
+
+ void setCursor(ECursor c) { m_inheritedFlags.cursor = c; }
+ void addCursor(RefPtr<StyleImage>&&, const IntPoint& hotSpot = IntPoint());
+ void setCursorList(RefPtr<CursorList>&&);
+ void clearCursorList();
+
+#if ENABLE(CURSOR_VISIBILITY)
+ void setCursorVisibility(CursorVisibility c) { m_inheritedFlags.cursorVisibility = c; }
+#endif
+
+ void setInsideLink(EInsideLink insideLink) { m_inheritedFlags.insideLink = insideLink; }
+ void setIsLink(bool b) { m_nonInheritedFlags.setIsLink(b); }
+
+ void setInsideDefaultButton(bool insideDefaultButton) { m_inheritedFlags.insideDefaultButton = insideDefaultButton; }
+
+ PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(m_inheritedFlags.printColorAdjust); }
+ void setPrintColorAdjust(PrintColorAdjust value) { m_inheritedFlags.printColorAdjust = value; }
+
+ bool hasAutoZIndex() const { return m_boxData->hasAutoZIndex(); }
+ void setHasAutoZIndex() { SET_VAR(m_boxData, m_hasAutoZIndex, true); SET_VAR(m_boxData, m_zIndex, 0); }
+ int zIndex() const { return m_boxData->zIndex(); }
+ void setZIndex(int v) { SET_VAR(m_boxData, m_hasAutoZIndex, false); SET_VAR(m_boxData, m_zIndex, v); }
+
+ void setHasAutoWidows() { SET_VAR(m_rareInheritedData, hasAutoWidows, true); SET_VAR(m_rareInheritedData, widows, initialWidows()); }
+ void setWidows(short w) { SET_VAR(m_rareInheritedData, hasAutoWidows, false); SET_VAR(m_rareInheritedData, widows, w); }
+
+ void setHasAutoOrphans() { SET_VAR(m_rareInheritedData, hasAutoOrphans, true); SET_VAR(m_rareInheritedData, orphans, initialOrphans()); }
+ void setOrphans(short o) { SET_VAR(m_rareInheritedData, hasAutoOrphans, false); SET_VAR(m_rareInheritedData, orphans, o); }
+
+ // CSS3 Setters
+ void setOutlineOffset(float v) { SET_VAR(m_backgroundData, outline.m_offset, v); }
+ void setTextShadow(std::unique_ptr<ShadowData>, bool add = false);
+ void setTextStrokeColor(const Color& c) { SET_VAR(m_rareInheritedData, textStrokeColor, c); }
+ void setTextStrokeWidth(float w) { SET_VAR(m_rareInheritedData, textStrokeWidth, w); }
+ void setTextFillColor(const Color& c) { SET_VAR(m_rareInheritedData, textFillColor, c); }
+ void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(m_rareNonInheritedData, opacity, v); }
+ void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, appearance, a); }
+ // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
+ void setBoxAlign(EBoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, align, a); }
+ void setBoxDirection(EBoxDirection d) { m_inheritedFlags.boxDirection = d; }
+ void setBoxFlex(float f) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, flex, f); }
+ void setBoxFlexGroup(unsigned group) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, flexGroup, group); }
+ void setBoxLines(EBoxLines lines) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, lines, lines); }
+ void setBoxOrdinalGroup(unsigned group) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, ordinalGroup, group); }
+ void setBoxOrient(EBoxOrient o) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, orient, o); }
+ void setBoxPack(EBoxPack p) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, pack, p); }
+ void setBoxShadow(std::unique_ptr<ShadowData>, bool add = false);
+ void setBoxReflect(RefPtr<StyleReflection>&&);
+ void setBoxSizing(EBoxSizing s) { SET_VAR(m_boxData, m_boxSizing, s); }
+ void setFlexGrow(float f) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexGrow, f); }
+ void setFlexShrink(float f) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexShrink, f); }
+ void setFlexBasis(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexBasis, WTFMove(length)); }
+ void setOrder(int o) { SET_VAR(m_rareNonInheritedData, order, o); }
+ void setAlignContent(const StyleContentAlignmentData& data) { SET_VAR(m_rareNonInheritedData, alignContent, data); }
+ void setAlignItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, alignItems, data); }
+ void setAlignItemsPosition(ItemPosition position) { m_rareNonInheritedData.access().alignItems.setPosition(position); }
+ void setAlignSelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, alignSelf, data); }
+ void setAlignSelfPosition(ItemPosition position) { m_rareNonInheritedData.access().alignSelf.setPosition(position); }
+ void setFlexDirection(EFlexDirection direction) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexDirection, direction); }
+ void setFlexWrap(EFlexWrap w) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexWrap, w); }
+ void setJustifyContent(const StyleContentAlignmentData& data) { SET_VAR(m_rareNonInheritedData, justifyContent, data); }
+ void setJustifyContentPosition(ContentPosition position) { m_rareNonInheritedData.access().justifyContent.setPosition(position); }
+ void setJustifyItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, justifyItems, data); }
+ void setJustifySelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, justifySelf, data); }
+
+#if ENABLE(CSS_BOX_DECORATION_BREAK)
+ void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_boxData, m_boxDecorationBreak, b); }
+#endif
+
+#if ENABLE(CSS_GRID_LAYOUT)
+ void setGridAutoColumns(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoColumns, trackSizeList); }
+ void setGridAutoRows(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoRows, trackSizeList); }
+ void setGridColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridColumns, lengths); }
+ void setGridRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridRows, lengths); }
+ void setGridAutoRepeatColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoRepeatColumns, lengths); }
+ void setGridAutoRepeatRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoRepeatRows, lengths); }
+ void setGridAutoRepeatColumnsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatColumnsInsertionPoint, insertionPoint); }
+ void setGridAutoRepeatRowsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatRowsInsertionPoint, insertionPoint); }
+ void setGridAutoRepeatColumnsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatColumnsType, autoRepeatType); }
+ void setGridAutoRepeatRowsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatRowsType, autoRepeatType); }
+ void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridColumnLines, namedGridColumnLines); }
+ void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridRowLines, namedGridRowLines); }
+ void setOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, orderedNamedGridColumnLines, orderedNamedGridColumnLines); }
+ void setOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, orderedNamedGridRowLines, orderedNamedGridRowLines); }
+ void setAutoRepeatNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatNamedGridColumnLines, namedGridColumnLines); }
+ void setAutoRepeatNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatNamedGridRowLines, namedGridRowLines); }
+ void setAutoRepeatOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatOrderedNamedGridColumnLines, orderedNamedGridColumnLines); }
+ void setAutoRepeatOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatOrderedNamedGridRowLines, orderedNamedGridRowLines); }
+ void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridArea, namedGridArea); }
+ void setNamedGridAreaRowCount(size_t rowCount) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridAreaRowCount, rowCount); }
+ void setNamedGridAreaColumnCount(size_t columnCount) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridAreaColumnCount, columnCount); }
+ void setGridAutoFlow(GridAutoFlow flow) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoFlow, flow); }
+ void setGridItemColumnStart(const GridPosition& columnStartPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridColumnStart, columnStartPosition); }
+ void setGridItemColumnEnd(const GridPosition& columnEndPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridColumnEnd, columnEndPosition); }
+ void setGridItemRowStart(const GridPosition& rowStartPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridRowStart, rowStartPosition); }
+ void setGridItemRowEnd(const GridPosition& rowEndPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridRowEnd, rowEndPosition); }
+ void setGridColumnGap(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridColumnGap, WTFMove(length)); }
+ void setGridRowGap(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridRowGap, WTFMove(length)); }
+#endif // ENABLE(CSS_GRID_LAYOUT)
+
+ void setMarqueeIncrement(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, increment, WTFMove(length)); }
+ void setMarqueeSpeed(int f) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, speed, f); }
+ void setMarqueeDirection(EMarqueeDirection d) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, direction, d); }
+ void setMarqueeBehavior(EMarqueeBehavior b) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, behavior, b); }
+ void setMarqueeLoopCount(int i) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, loops, i); }
+ void setUserModify(EUserModify u) { SET_VAR(m_rareInheritedData, userModify, u); }
+ void setUserDrag(EUserDrag d) { SET_VAR(m_rareNonInheritedData, userDrag, d); }
+ void setUserSelect(EUserSelect s) { SET_VAR(m_rareInheritedData, userSelect, s); }
+ void setTextOverflow(TextOverflow overflow) { SET_VAR(m_rareNonInheritedData, textOverflow, overflow); }
+ void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInheritedData, marginBeforeCollapse, c); }
+ void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInheritedData, marginAfterCollapse, c); }
+ void setWordBreak(EWordBreak b) { SET_VAR(m_rareInheritedData, wordBreak, b); }
+ void setOverflowWrap(EOverflowWrap b) { SET_VAR(m_rareInheritedData, overflowWrap, b); }
+ void setNBSPMode(ENBSPMode b) { SET_VAR(m_rareInheritedData, nbspMode, b); }
+ void setLineBreak(LineBreak b) { SET_VAR(m_rareInheritedData, lineBreak, b); }
+ void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, h); }
+ void setHyphenationLimitBefore(short limit) { SET_VAR(m_rareInheritedData, hyphenationLimitBefore, limit); }
+ void setHyphenationLimitAfter(short limit) { SET_VAR(m_rareInheritedData, hyphenationLimitAfter, limit); }
+ void setHyphenationLimitLines(short limit) { SET_VAR(m_rareInheritedData, hyphenationLimitLines, limit); }
+ void setHyphenationString(const AtomicString& h) { SET_VAR(m_rareInheritedData, hyphenationString, h); }
+ void setBorderFit(EBorderFit b) { SET_VAR(m_rareNonInheritedData, borderFit, b); }
+ void setResize(EResize r) { SET_VAR(m_rareNonInheritedData, resize, r); }
+ void setColumnAxis(ColumnAxis axis) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, axis, axis); }
+ void setColumnProgression(ColumnProgression progression) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, progression, progression); }
+ void setColumnWidth(float f) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoWidth, false); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, width, f); }
+ void setHasAutoColumnWidth() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoWidth, true); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, width, 0); }
+ void setColumnCount(unsigned short c) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoCount, false); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, count, c); }
+ void setHasAutoColumnCount() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoCount, true); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, count, 0); }
+ void setColumnFill(ColumnFill columnFill) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, fill, columnFill); }
+ void setColumnGap(float f) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, normalGap, false); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, gap, f); }
+ void setHasNormalColumnGap() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, normalGap, true); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, gap, 0); }
+ void setColumnRuleColor(const Color& c) { SET_BORDERVALUE_COLOR(m_rareNonInheritedData.access().multiCol, rule, c); }
+ void setColumnRuleStyle(EBorderStyle b) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, rule.m_style, b); }
+ void setColumnRuleWidth(unsigned short w) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, rule.m_width, w); }
+ void resetColumnRule() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, rule, BorderValue()); }
+ void setColumnSpan(ColumnSpan columnSpan) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, columnSpan, columnSpan); }
+ void inheritColumnPropertiesFrom(const RenderStyle& parent) { m_rareNonInheritedData.access().multiCol = parent.m_rareNonInheritedData->multiCol; }
+ void setTransform(const TransformOperations& ops) { SET_NESTED_VAR(m_rareNonInheritedData, transform, operations, ops); }
+ void setTransformOriginX(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, transform, x, WTFMove(length)); }
+ void setTransformOriginY(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, transform, y, WTFMove(length)); }
+ void setTransformOriginZ(float f) { SET_NESTED_VAR(m_rareNonInheritedData, transform, z, f); }
+ void setSpeak(ESpeak s) { SET_VAR(m_rareInheritedData, speak, s); }
+ void setTextCombine(TextCombine v) { SET_VAR(m_rareNonInheritedData, textCombine, v); }
+ void setTextDecorationColor(const Color& c) { SET_VAR(m_rareNonInheritedData, textDecorationColor, c); }
+ void setTextEmphasisColor(const Color& c) { SET_VAR(m_rareInheritedData, textEmphasisColor, c); }
+ void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(m_rareInheritedData, textEmphasisFill, fill); }
+ void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(m_rareInheritedData, textEmphasisMark, mark); }
+ void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(m_rareInheritedData, textEmphasisCustomMark, mark); }
+ void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(m_rareInheritedData, textEmphasisPosition, position); }
+ bool setTextOrientation(TextOrientation);
+
+ void setObjectFit(ObjectFit fit) { SET_VAR(m_rareNonInheritedData, objectFit, fit); }
+ void setObjectPosition(LengthPoint&& position) { SET_VAR(m_rareNonInheritedData, objectPosition, WTFMove(position)); }
+
+ void setRubyPosition(RubyPosition position) { SET_VAR(m_rareInheritedData, rubyPosition, position); }
+
+ void setFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareNonInheritedData, filter, operations, ops); }
+
+#if ENABLE(FILTERS_LEVEL_2)
+ void setBackdropFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareNonInheritedData, backdropFilter, operations, ops); }
+#endif
+
+ void setTabSize(unsigned size) { SET_VAR(m_rareInheritedData, tabSize, size); }
+
+ void setBreakBefore(BreakBetween breakBehavior) { SET_VAR(m_rareNonInheritedData, breakBefore, breakBehavior); }
+ void setBreakAfter(BreakBetween breakBehavior) { SET_VAR(m_rareNonInheritedData, breakAfter, breakBehavior); }
+ void setBreakInside(BreakInside breakBehavior) { SET_VAR(m_rareNonInheritedData, breakInside, breakBehavior); }
+
+ void setHangingPunctuation(HangingPunctuation punctuation) { SET_VAR(m_rareInheritedData, hangingPunctuation, punctuation); }
+
+ // End CSS3 Setters
+
+ void setLineGrid(const AtomicString& lineGrid) { SET_VAR(m_rareInheritedData, lineGrid, lineGrid); }
+ void setLineSnap(LineSnap lineSnap) { SET_VAR(m_rareInheritedData, lineSnap, lineSnap); }
+ void setLineAlign(LineAlign lineAlign) { SET_VAR(m_rareInheritedData, lineAlign, lineAlign); }
+
+ void setFlowThread(const AtomicString& flowThread) { SET_VAR(m_rareNonInheritedData, flowThread, flowThread); }
+ void setRegionThread(const AtomicString& regionThread) { SET_VAR(m_rareNonInheritedData, regionThread, regionThread); }
+ void setRegionFragment(RegionFragment regionFragment) { SET_VAR(m_rareNonInheritedData, regionFragment, regionFragment); }
+
+ void setPointerEvents(EPointerEvents p) { m_inheritedFlags.pointerEvents = p; }
+
+ void clearAnimations();
+ void clearTransitions();
+
+ void adjustAnimations();
+ void adjustTransitions();
+
+ void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(m_rareNonInheritedData, transformStyle3D, b); }
+ void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(m_rareNonInheritedData, backfaceVisibility, b); }
+ void setPerspective(float p) { SET_VAR(m_rareNonInheritedData, perspective, p); }
+ void setPerspectiveOriginX(Length&& length) { SET_VAR(m_rareNonInheritedData, perspectiveOriginX, WTFMove(length)); }
+ void setPerspectiveOriginY(Length&& length) { SET_VAR(m_rareNonInheritedData, perspectiveOriginY, WTFMove(length)); }
+ void setPageSize(LengthSize size) { SET_VAR(m_rareNonInheritedData, pageSize, WTFMove(size)); }
+ void setPageSizeType(PageSizeType t) { SET_VAR(m_rareNonInheritedData, pageSizeType, t); }
+ void resetPageSizeType() { SET_VAR(m_rareNonInheritedData, pageSizeType, PAGE_SIZE_AUTO); }
+
+ void setLineBoxContain(LineBoxContain c) { SET_VAR(m_rareInheritedData, lineBoxContain, c); }
+ void setLineClamp(LineClampValue c) { SET_VAR(m_rareNonInheritedData, lineClamp, c); }
+
+ void setInitialLetter(const IntSize& size) { SET_VAR(m_rareNonInheritedData, initialLetter, size); }
+
+#if ENABLE(TOUCH_EVENTS)
+ void setTouchAction(TouchAction touchAction) { SET_VAR(m_rareNonInheritedData, touchAction, static_cast<unsigned>(touchAction)); }
+#endif
+
+#if ENABLE(CSS_SCROLL_SNAP)
+ void setScrollSnapType(const ScrollSnapType&);
+ void setScrollPaddingTop(Length&&);
+ void setScrollPaddingBottom(Length&&);
+ void setScrollPaddingLeft(Length&&);
+ void setScrollPaddingRight(Length&&);
+
+ void setScrollSnapAlign(const ScrollSnapAlign&);
+ void setScrollSnapMarginTop(Length&&);
+ void setScrollSnapMarginBottom(Length&&);
+ void setScrollSnapMarginLeft(Length&&);
+ void setScrollSnapMarginRight(Length&&);
+#endif
+
+#if ENABLE(TOUCH_EVENTS)
+ void setTapHighlightColor(const Color& c) { SET_VAR(m_rareInheritedData, tapHighlightColor, c); }
+#endif
+
+#if PLATFORM(IOS)
+ void setTouchCalloutEnabled(bool v) { SET_VAR(m_rareInheritedData, touchCalloutEnabled, v); }
+#endif
+
+#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
+ void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); }
+#endif
+
+#if ENABLE(TEXT_AUTOSIZING)
+ void setTextSizeAdjust(TextSizeAdjustment adjustment) { SET_VAR(m_rareInheritedData, textSizeAdjust, adjustment); }
+#endif
+
+ void setTextSecurity(ETextSecurity security) { SET_VAR(m_rareInheritedData, textSecurity, security); }
+
+#if ENABLE(CSS_TRAILING_WORD)
+ void setTrailingWord(TrailingWord v) { SET_VAR(m_rareInheritedData, trailingWord, static_cast<unsigned>(v)); }
+#endif
+
+#if ENABLE(APPLE_PAY)
+ void setApplePayButtonStyle(ApplePayButtonStyle style) { SET_VAR(m_rareNonInheritedData, applePayButtonStyle, static_cast<unsigned>(style)); }
+ void setApplePayButtonType(ApplePayButtonType type) { SET_VAR(m_rareNonInheritedData, applePayButtonType, static_cast<unsigned>(type)); }
+#endif
+
+ const SVGRenderStyle& svgStyle() const { return m_svgStyle; }
+ SVGRenderStyle& accessSVGStyle() { return m_svgStyle.access(); }
+
+ const SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(); }
+ Color fillPaintColor() const { return svgStyle().fillPaintColor(); }
+ void setFillPaintColor(const Color& color) { accessSVGStyle().setFillPaint(SVG_PAINTTYPE_RGBCOLOR, color, emptyString()); }
+ float fillOpacity() const { return svgStyle().fillOpacity(); }
+ void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); }
+
+ const SVGPaintType& strokePaintType() const { return svgStyle().strokePaintType(); }
+ Color strokePaintColor() const { return svgStyle().strokePaintColor(); }
+ void setStrokePaintColor(const Color& color) { accessSVGStyle().setStrokePaint(SVG_PAINTTYPE_RGBCOLOR, color, emptyString()); }
+ float strokeOpacity() const { return svgStyle().strokeOpacity(); }
+ void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); }
+ const Length& strokeWidth() const { return svgStyle().strokeWidth(); }
+ void setStrokeWidth(Length&& w) { accessSVGStyle().setStrokeWidth(WTFMove(w)); }
+ Vector<SVGLengthValue> strokeDashArray() const { return svgStyle().strokeDashArray(); }
+ void setStrokeDashArray(Vector<SVGLengthValue> array) { accessSVGStyle().setStrokeDashArray(array); }
+ const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(); }
+ void setStrokeDashOffset(Length&& d) { accessSVGStyle().setStrokeDashOffset(WTFMove(d)); }
+ float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); }
+ void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); }
+
+ const Length& cx() const { return svgStyle().cx(); }
+ void setCx(Length&& cx) { accessSVGStyle().setCx(WTFMove(cx)); }
+ const Length& cy() const { return svgStyle().cy(); }
+ void setCy(Length&& cy) { accessSVGStyle().setCy(WTFMove(cy)); }
+ const Length& r() const { return svgStyle().r(); }
+ void setR(Length&& r) { accessSVGStyle().setR(WTFMove(r)); }
+ const Length& rx() const { return svgStyle().rx(); }
+ void setRx(Length&& rx) { accessSVGStyle().setRx(WTFMove(rx)); }
+ const Length& ry() const { return svgStyle().ry(); }
+ void setRy(Length&& ry) { accessSVGStyle().setRy(WTFMove(ry)); }
+ const Length& x() const { return svgStyle().x(); }
+ void setX(Length&& x) { accessSVGStyle().setX(WTFMove(x)); }
+ const Length& y() const { return svgStyle().y(); }
+ void setY(Length&& y) { accessSVGStyle().setY(WTFMove(y)); }
+
+ float floodOpacity() const { return svgStyle().floodOpacity(); }
+ void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); }
+
+ float stopOpacity() const { return svgStyle().stopOpacity(); }
+ void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); }
+
+ void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); }
+ void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); }
+ void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c); }
+
+ SVGLengthValue baselineShiftValue() const { return svgStyle().baselineShiftValue(); }
+ void setBaselineShiftValue(SVGLengthValue s) { accessSVGStyle().setBaselineShiftValue(s); }
+ SVGLengthValue kerning() const { return svgStyle().kerning(); }
+ void setKerning(SVGLengthValue k) { accessSVGStyle().setKerning(k); }
+
+ void setShapeOutside(RefPtr<ShapeValue>&&);
+ ShapeValue* shapeOutside() const { return m_rareNonInheritedData->shapeOutside.get(); }
+ static ShapeValue* initialShapeOutside() { return nullptr; }
+
+ const Length& shapeMargin() const { return m_rareNonInheritedData->shapeMargin; }
+ void setShapeMargin(Length&& shapeMargin) { SET_VAR(m_rareNonInheritedData, shapeMargin, WTFMove(shapeMargin)); }
+ static Length initialShapeMargin() { return Length(0, Fixed); }
+
+ float shapeImageThreshold() const { return m_rareNonInheritedData->shapeImageThreshold; }
+ void setShapeImageThreshold(float);
+ static float initialShapeImageThreshold() { return 0; }
+
+ void setClipPath(RefPtr<ClipPathOperation>&&);
+ ClipPathOperation* clipPath() const { return m_rareNonInheritedData->clipPath.get(); }
+ static ClipPathOperation* initialClipPath() { return nullptr; }
+
+ bool hasContent() const { return contentData(); }
+ const ContentData* contentData() const { return m_rareNonInheritedData->content.get(); }
+ bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->m_rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->m_rareNonInheritedData); }
+ void clearContent();
+ void setContent(const String&, bool add = false);
+ void setContent(RefPtr<StyleImage>&&, bool add = false);
+ void setContent(std::unique_ptr<CounterContent>, bool add = false);
+ void setContent(QuoteType, bool add = false);
+ void setContentAltText(const String&);
+ const String& contentAltText() const;
+ bool hasAttrContent() const { return m_rareNonInheritedData->hasAttrContent; }
+ void setHasAttrContent();
+
+ const CounterDirectiveMap* counterDirectives() const;
+ CounterDirectiveMap& accessCounterDirectives();
+ const CounterDirectives getCounterDirectives(const AtomicString& identifier) const;
+
+ QuotesData* quotes() const { return m_rareInheritedData->quotes.get(); }
+ void setQuotes(RefPtr<QuotesData>&&);
+
+ WillChangeData* willChange() const { return m_rareNonInheritedData->willChange.get(); }
+ void setWillChange(RefPtr<WillChangeData>&&);
+
+ bool willChangeCreatesStackingContext() const;
+
+ const AtomicString& hyphenString() const;
+
+ bool inheritedNotEqual(const RenderStyle*) const;
+ bool inheritedDataShared(const RenderStyle*) const;
+
+#if ENABLE(TEXT_AUTOSIZING)
+ uint32_t hashForTextAutosizing() const;
+ bool equalForTextAutosizing(const RenderStyle&) const;
+#endif
+
+ StyleDifference diff(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
+ bool diffRequiresLayerRepaint(const RenderStyle&, bool isComposited) const;
+
+ bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
+ bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
+ bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleOrGridBox(display()); }
+ bool isDisplayRegionType() const;
+
+ bool setWritingMode(WritingMode);
+
+ bool hasExplicitlySetWritingMode() const { return m_nonInheritedFlags.hasExplicitlySetWritingMode(); }
+ void setHasExplicitlySetWritingMode(bool v) { m_nonInheritedFlags.setHasExplicitlySetWritingMode(v); }
+
+ // A unique style is one that has matches something that makes it impossible to share.
+ bool unique() const { return m_nonInheritedFlags.isUnique(); }
+ void setUnique() { m_nonInheritedFlags.setIsUnique(); }
+
+ bool emptyState() const { return m_nonInheritedFlags.emptyState(); }
+ void setEmptyState(bool b) { setUnique(); m_nonInheritedFlags.setEmptyState(b); }
+ bool firstChildState() const { return m_nonInheritedFlags.firstChildState(); }
+ void setFirstChildState() { setUnique(); m_nonInheritedFlags.setFirstChildState(true); }
+ bool lastChildState() const { return m_nonInheritedFlags.lastChildState(); }
+ void setLastChildState() { setUnique(); m_nonInheritedFlags.setLastChildState(true); }
+
+ WEBCORE_EXPORT Color visitedDependentColor(int colorProperty) const;
+ bool backgroundColorEqualsToColorIgnoringVisited(const Color& color) const { return color == backgroundColor(); }
+
+ void setHasExplicitlyInheritedProperties() { m_nonInheritedFlags.setHasExplicitlyInheritedProperties(true); }
+ bool hasExplicitlyInheritedProperties() const { return m_nonInheritedFlags.hasExplicitlyInheritedProperties(); }
+
+ // Initial values for all the properties
+ static EOverflow initialOverflowX() { return OVISIBLE; }
+ static EOverflow initialOverflowY() { return OVISIBLE; }
+ static EClear initialClear() { return CNONE; }
+ static EDisplay initialDisplay() { return INLINE; }
+ static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
+ static EPosition initialPosition() { return StaticPosition; }
+ static EVerticalAlign initialVerticalAlign() { return BASELINE; }
+ static EFloat initialFloating() { return NoFloat; }
+ static BreakBetween initialBreakBetween() { return AutoBreakBetween; }
+ static BreakInside initialBreakInside() { return AutoBreakInside; }
+ static HangingPunctuation initialHangingPunctuation() { return NoHangingPunctuation; }
+ static ETableLayout initialTableLayout() { return TAUTO; }
+ static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
+ static EBorderStyle initialBorderStyle() { return BNONE; }
+ static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
+ static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
+ static LengthSize initialBorderRadius() { return { { 0, Fixed }, { 0, Fixed } }; }
+ static ECaptionSide initialCaptionSide() { return CAPTOP; }
+ static ColumnAxis initialColumnAxis() { return AutoColumnAxis; }
+ static ColumnProgression initialColumnProgression() { return NormalColumnProgression; }
+ static TextDirection initialDirection() { return LTR; }
+ static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
+ static TextCombine initialTextCombine() { return TextCombineNone; }
+ static TextOrientation initialTextOrientation() { return TextOrientation::Mixed; }
+ static ObjectFit initialObjectFit() { return ObjectFitFill; }
+ static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); }
+ static EEmptyCell initialEmptyCells() { return SHOW; }
+ static EListStylePosition initialListStylePosition() { return OUTSIDE; }
+ static EListStyleType initialListStyleType() { return Disc; }
+ static ETextTransform initialTextTransform() { return TTNONE; }
+ static EVisibility initialVisibility() { return VISIBLE; }
+ static EWhiteSpace initialWhiteSpace() { return NORMAL; }
+ static float initialHorizontalBorderSpacing() { return 0; }
+ static float initialVerticalBorderSpacing() { return 0; }
+ static ECursor initialCursor() { return CursorAuto; }
+ static Color initialColor() { return Color::black; }
+ static StyleImage* initialListStyleImage() { return 0; }
+ static float initialBorderWidth() { return 3; }
+ static unsigned short initialColumnRuleWidth() { return 3; }
+ static float initialOutlineWidth() { return 3; }
+ static float initialLetterSpacing() { return 0; }
+ static Length initialWordSpacing() { return Length(Fixed); }
+ static Length initialSize() { return Length(); }
+ static Length initialMinSize() { return Length(); }
+ static Length initialMaxSize() { return Length(Undefined); }
+ static Length initialOffset() { return Length(); }
+ static Length initialMargin() { return Length(Fixed); }
+ static Length initialPadding() { return Length(Fixed); }
+ static Length initialTextIndent() { return Length(Fixed); }
+ static Length initialZeroLength() { return Length(Fixed); }
+ static Length initialOneLength() { return Length(1, Fixed); }
+ static short initialWidows() { return 2; }
+ static short initialOrphans() { return 2; }
+ static Length initialLineHeight() { return Length(-100.0f, Percent); }
+ static ETextAlign initialTextAlign() { return TASTART; }
+ static TextDecoration initialTextDecoration() { return TextDecorationNone; }
+ static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
+ static TextDecorationSkip initialTextDecorationSkip() { return TextDecorationSkipAuto; }
+ static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; }
+ static float initialZoom() { return 1.0f; }
+ static TextZoom initialTextZoom() { return TextZoomNormal; }
+ static float initialOutlineOffset() { return 0; }
+ static float initialOpacity() { return 1.0f; }
+ static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
+ static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; }
+ static EBoxDirection initialBoxDirection() { return BNORMAL; }
+ static EBoxLines initialBoxLines() { return SINGLE; }
+ static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
+ static EBoxPack initialBoxPack() { return Start; }
+ static float initialBoxFlex() { return 0.0f; }
+ static unsigned initialBoxFlexGroup() { return 1; }
+ static unsigned initialBoxOrdinalGroup() { return 1; }
+ static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
+ static StyleReflection* initialBoxReflect() { return 0; }
+ static float initialFlexGrow() { return 0; }
+ static float initialFlexShrink() { return 1; }
+ static Length initialFlexBasis() { return Length(Auto); }
+ static int initialOrder() { return 0; }
+ static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); }
+ static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(isCSSGridLayoutEnabled() ? ItemPositionNormal : ItemPositionStretch, OverflowAlignmentDefault); }
+ static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAlignmentDefault); }
+ static EFlexDirection initialFlexDirection() { return FlowRow; }
+ static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
+ static int initialMarqueeLoopCount() { return -1; }
+ static int initialMarqueeSpeed() { return 85; }
+ static Length initialMarqueeIncrement() { return Length(6, Fixed); }
+ static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
+ static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
+ static EUserModify initialUserModify() { return READ_ONLY; }
+ static EUserDrag initialUserDrag() { return DRAG_AUTO; }
+ static EUserSelect initialUserSelect() { return SELECT_TEXT; }
+ static TextOverflow initialTextOverflow() { return TextOverflowClip; }
+ static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
+ static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
+ static EWordBreak initialWordBreak() { return NormalWordBreak; }
+ static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; }
+ static ENBSPMode initialNBSPMode() { return NBNORMAL; }
+ static LineBreak initialLineBreak() { return LineBreakAuto; }
+ static ESpeak initialSpeak() { return SpeakNormal; }
+ static Hyphens initialHyphens() { return HyphensManual; }
+ static short initialHyphenationLimitBefore() { return -1; }
+ static short initialHyphenationLimitAfter() { return -1; }
+ static short initialHyphenationLimitLines() { return -1; }
+ static const AtomicString& initialHyphenationString() { return nullAtom; }
+ static EBorderFit initialBorderFit() { return BorderFitBorder; }
+ static EResize initialResize() { return RESIZE_NONE; }
+ static ControlPart initialAppearance() { return NoControlPart; }
+ static AspectRatioType initialAspectRatioType() { return AspectRatioAuto; }
+ static float initialAspectRatioDenominator() { return 1; }
+ static float initialAspectRatioNumerator() { return 1; }
+ static Order initialRTLOrdering() { return LogicalOrder; }
+ static float initialTextStrokeWidth() { return 0; }
+ static unsigned short initialColumnCount() { return 1; }
+ static ColumnFill initialColumnFill() { return ColumnFillBalance; }
+ static ColumnSpan initialColumnSpan() { return ColumnSpanNone; }
+ static const TransformOperations& initialTransform() { static NeverDestroyed<TransformOperations> ops; return ops; }
+ static Length initialTransformOriginX() { return Length(50.0f, Percent); }
+ static Length initialTransformOriginY() { return Length(50.0f, Percent); }
+ static EPointerEvents initialPointerEvents() { return PE_AUTO; }
+ static float initialTransformOriginZ() { return 0; }
+ static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
+ static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
+ static float initialPerspective() { return 0; }
+ static Length initialPerspectiveOriginX() { return Length(50.0f, Percent); }
+ static Length initialPerspectiveOriginY() { return Length(50.0f, Percent); }
+ static Color initialBackgroundColor() { return Color::transparent; }
+ static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
+ static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
+ static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
+ static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
+ static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver | TextEmphasisPositionRight; }
+ static RubyPosition initialRubyPosition() { return RubyPositionBefore; }
+ static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
+ static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; }
+ static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
+ static ImageResolutionSource initialImageResolutionSource() { return ImageResolutionSpecified; }
+ static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionNoSnap; }
+ static float initialImageResolution() { return 1; }
+ static StyleImage* initialBorderImageSource() { return nullptr; }
+ static StyleImage* initialMaskBoxImageSource() { return nullptr; }
+ static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
+ static QuotesData* initialQuotes() { return nullptr; }
+ static const AtomicString& initialContentAltText() { return emptyAtom; }
+
+#if ENABLE(CSS3_TEXT)
+ static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; }
+ static TextIndentType initialTextIndentType() { return TextIndentNormal; }
+ static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
+ static TextJustify initialTextJustify() { return TextJustifyAuto; }
+#endif
+
+#if ENABLE(CURSOR_VISIBILITY)
+ static CursorVisibility initialCursorVisibility() { return CursorVisibilityAuto; }
+#endif
+
+#if ENABLE(TEXT_AUTOSIZING)
+ static Length initialSpecifiedLineHeight() { return Length(-100.0f, Percent); }
+ static TextSizeAdjustment initialTextSizeAdjust() { return TextSizeAdjustment(); }
+#endif
+
+ static bool isCSSGridLayoutEnabled();
+
+ static WillChangeData* initialWillChange() { return nullptr; }
+
+#if ENABLE(TOUCH_EVENTS)
+ static TouchAction initialTouchAction() { return TouchAction::Auto; }
+#endif
+
+#if ENABLE(CSS_SCROLL_SNAP)
+ static ScrollSnapType initialScrollSnapType();
+ static ScrollSnapAlign initialScrollSnapAlign();
+ static Length initialScrollSnapMargin() { return Length(Fixed); }
+ static Length initialScrollPadding() { return Length(Fixed); }
+#endif
+
+#if ENABLE(CSS_TRAILING_WORD)
+ static TrailingWord initialTrailingWord() { return TrailingWord::Auto; }
+#endif
+
+#if ENABLE(APPLE_PAY)
+ static ApplePayButtonStyle initialApplePayButtonStyle() { return ApplePayButtonStyle::Black; }
+ static ApplePayButtonType initialApplePayButtonType() { return ApplePayButtonType::Plain; }
+#endif
+
+#if ENABLE(CSS_GRID_LAYOUT)
+ // The initial value is 'none' for grid tracks.
+ static Vector<GridTrackSize> initialGridColumns() { return Vector<GridTrackSize>(); }
+ static Vector<GridTrackSize> initialGridRows() { return Vector<GridTrackSize>(); }
+
+ static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<GridTrackSize>(); }
+ static unsigned initialGridAutoRepeatInsertionPoint() { return 0; }
+ static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; }
+
+ static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; }
+
+ static Vector<GridTrackSize> initialGridAutoColumns() { return { GridTrackSize(Length(Auto)) }; }
+ static Vector<GridTrackSize> initialGridAutoRows() { return { GridTrackSize(Length(Auto)) }; }
+
+ static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap(); }
+ static size_t initialNamedGridAreaCount() { return 0; }
+
+ static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLinesMap(); }
+ static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesMap(); }
+
+ static OrderedNamedGridLinesMap initialOrderedNamedGridColumnLines() { return OrderedNamedGridLinesMap(); }
+ static OrderedNamedGridLinesMap initialOrderedNamedGridRowLines() { return OrderedNamedGridLinesMap(); }
+
+ static Length initialGridColumnGap() { return Length(Fixed); }
+ static Length initialGridRowGap() { return Length(Fixed); }
+
+ // 'auto' is the default.
+ static GridPosition initialGridItemColumnStart() { return GridPosition(); }
+ static GridPosition initialGridItemColumnEnd() { return GridPosition(); }
+ static GridPosition initialGridItemRowStart() { return GridPosition(); }
+ static GridPosition initialGridItemRowEnd() { return GridPosition(); }
+#endif // ENABLE(CSS_GRID_LAYOUT)
+
+ static unsigned initialTabSize() { return 8; }
+
+ static const AtomicString& initialLineGrid() { return nullAtom; }
+ static LineSnap initialLineSnap() { return LineSnapNone; }
+ static LineAlign initialLineAlign() { return LineAlignNone; }
+
+ static const AtomicString& initialFlowThread() { return nullAtom; }
+ static const AtomicString& initialRegionThread() { return nullAtom; }
+ static RegionFragment initialRegionFragment() { return AutoRegionFragment; }
+
+ static IntSize initialInitialLetter() { return IntSize(); }
+ static LineClampValue initialLineClamp() { return LineClampValue(); }
+ static ETextSecurity initialTextSecurity() { return TSNONE; }
+
+#if PLATFORM(IOS)
+ static bool initialTouchCalloutEnabled() { return true; }
+#endif
+
+#if ENABLE(TOUCH_EVENTS)
+ static Color initialTapHighlightColor();
+#endif
+
+#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
+ static bool initialUseTouchOverflowScrolling() { return false; }
+#endif
+
+#if ENABLE(DASHBOARD_SUPPORT)
+ static const Vector<StyleDashboardRegion>& initialDashboardRegions();
+ static const Vector<StyleDashboardRegion>& noneDashboardRegions();
+#endif
+
+ static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
+
+#if ENABLE(FILTERS_LEVEL_2)
+ static const FilterOperations& initialBackdropFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
+#endif
+
+#if ENABLE(CSS_COMPOSITING)
+ static BlendMode initialBlendMode() { return BlendModeNormal; }
+ static Isolation initialIsolation() { return IsolationAuto; }
+#endif
+
+ bool isPlaceholderStyle() const { return m_rareNonInheritedData->isPlaceholderStyle; }
+ void setIsPlaceholderStyle() { SET_VAR(m_rareNonInheritedData, isPlaceholderStyle, true); }
+
+ void setVisitedLinkColor(const Color&);
+ void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBackgroundColor, v); }
+ void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderLeftColor, v); }
+ void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderRightColor, v); }
+ void setVisitedLinkBorderBottomColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderBottomColor, v); }
+ void setVisitedLinkBorderTopColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderTopColor, v); }
+ void setVisitedLinkOutlineColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkOutlineColor, v); }
+ void setVisitedLinkColumnRuleColor(const Color& v) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, visitedLinkColumnRuleColor, v); }
+ void setVisitedLinkTextDecorationColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkTextDecorationColor, v); }
+ void setVisitedLinkTextEmphasisColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkTextEmphasisColor, v); }
+ void setVisitedLinkTextFillColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkTextFillColor, v); }
+ void setVisitedLinkTextStrokeColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkTextStrokeColor, v); }
+
+ void inheritUnicodeBidiFrom(const RenderStyle* parent) { m_nonInheritedFlags.setUnicodeBidi(parent->m_nonInheritedFlags.unicodeBidi()); }
+ void getShadowExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const;
+ void getShadowHorizontalExtent(const ShadowData*, LayoutUnit& left, LayoutUnit& right) const;
+ void getShadowVerticalExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& bottom) const;
+ void getShadowInlineDirectionExtent(const ShadowData*, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const;
+ void getShadowBlockDirectionExtent(const ShadowData*, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const;
+
+ static Color invalidColor() { return Color(); }
+ const Color& borderLeftColor() const { return m_surroundData->border.left().color(); }
+ const Color& borderRightColor() const { return m_surroundData->border.right().color(); }
+ const Color& borderTopColor() const { return m_surroundData->border.top().color(); }
+ const Color& borderBottomColor() const { return m_surroundData->border.bottom().color(); }
+ const Color& backgroundColor() const { return m_backgroundData->color; }
+ const Color& color() const;
+ const Color& columnRuleColor() const { return m_rareNonInheritedData->multiCol->rule.color(); }
+ const Color& outlineColor() const { return m_backgroundData->outline.color(); }
+ const Color& textEmphasisColor() const { return m_rareInheritedData->textEmphasisColor; }
+ const Color& textFillColor() const { return m_rareInheritedData->textFillColor; }
+ const Color& textStrokeColor() const { return m_rareInheritedData->textStrokeColor; }
+ const Color& visitedLinkColor() const;
+ const Color& visitedLinkBackgroundColor() const { return m_rareNonInheritedData->visitedLinkBackgroundColor; }
+ const Color& visitedLinkBorderLeftColor() const { return m_rareNonInheritedData->visitedLinkBorderLeftColor; }
+ const Color& visitedLinkBorderRightColor() const { return m_rareNonInheritedData->visitedLinkBorderRightColor; }
+ const Color& visitedLinkBorderBottomColor() const { return m_rareNonInheritedData->visitedLinkBorderBottomColor; }
+ const Color& visitedLinkBorderTopColor() const { return m_rareNonInheritedData->visitedLinkBorderTopColor; }
+ const Color& visitedLinkOutlineColor() const { return m_rareNonInheritedData->visitedLinkOutlineColor; }
+ const Color& visitedLinkColumnRuleColor() const { return m_rareNonInheritedData->multiCol->visitedLinkColumnRuleColor; }
+ const Color& textDecorationColor() const { return m_rareNonInheritedData->textDecorationColor; }
+ const Color& visitedLinkTextDecorationColor() const { return m_rareNonInheritedData->visitedLinkTextDecorationColor; }
+ const Color& visitedLinkTextEmphasisColor() const { return m_rareInheritedData->visitedLinkTextEmphasisColor; }
+ const Color& visitedLinkTextFillColor() const { return m_rareInheritedData->visitedLinkTextFillColor; }
+ const Color& visitedLinkTextStrokeColor() const { return m_rareInheritedData->visitedLinkTextStrokeColor; }
+
+ const Color& stopColor() const { return svgStyle().stopColor(); }
+ const Color& floodColor() const { return svgStyle().floodColor(); }
+ const Color& lightingColor() const { return svgStyle().lightingColor(); }
+
+private:
struct NonInheritedFlags {
- NonInheritedFlags()
- {
- // The default values should all be zero.
- ASSERT(!initialOverflowX());
- ASSERT(!initialOverflowY());
- ASSERT(!initialClear());
- ASSERT(!initialDisplay());
- ASSERT(!initialUnicodeBidi());
- ASSERT(!initialPosition());
- ASSERT(!initialVerticalAlign());
- ASSERT(!initialFloating());
- ASSERT(!initialTableLayout());
+ NonInheritedFlags();
- m_flags = 0;
- }
+ bool operator==(const NonInheritedFlags& other) const { return m_flags == other.m_flags; }
+ bool operator!=(const NonInheritedFlags& other) const { return m_flags != other.m_flags; }
- bool operator==(const NonInheritedFlags& other) const
- {
- return m_flags == other.m_flags;
- }
-
- bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
-
- void copyNonInheritedFrom(const NonInheritedFlags& other)
- {
- // Only a subset is copied because NonInheritedFlags contains a bunch of stuff other than real style data.
- uint64_t nonInheritedMask = overflowMask << overflowXOffset
- | overflowMask << overflowYOffset
- | clearMask << clearOffset
- | displayMask << effectiveDisplayOffset
- | positionMask << positionOffset
- | displayMask << originalDisplayOffset
- | unicodeBidiMask << unicodeBidiOffset
- | verticalAlignMask << verticalAlignOffset
- | floatingMask << floatingOffset
- | oneBitMask << explicitInheritanceOffset
- | tableLayoutBitMask << tableLayoutOffset
- | hasViewportUnitsBitMask << hasViewportUnitsOffset;
-
- m_flags = (m_flags & ~nonInheritedMask) | (other.m_flags & nonInheritedMask);
- }
+ void copyNonInheritedFrom(const NonInheritedFlags&);
EOverflow overflowX() const { return static_cast<EOverflow>(getValue(overflowMask, overflowXOffset)); }
void setOverflowX(EOverflow overflowX) { updateValue(overflowX, overflowMask, overflowXOffset); }
@@ -216,26 +1733,9 @@
void setFloating(EFloat floating) { updateValue(floating, floatingMask, floatingOffset); }
bool hasAnyPublicPseudoStyles() const { return PUBLIC_PSEUDOID_MASK & getValue(pseudoBitsMask, pseudoBitsOffset); }
- bool hasPseudoStyle(PseudoId pseudo) const
- {
- ASSERT(pseudo > NOPSEUDO);
- ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
- return (oneBitMask << (pseudoBitsOffset - 1 + pseudo)) & m_flags;
- }
- void setHasPseudoStyle(PseudoId pseudo)
- {
- ASSERT(pseudo > NOPSEUDO);
- ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
- m_flags |= oneBitMask << (pseudoBitsOffset - 1 + pseudo);
- }
- void setHasPseudoStyles(PseudoIdSet pseudoIdSet)
- {
- ASSERT(pseudoIdSet);
- uint64_t rawPseudoIdSet = pseudoIdSet.data();
- ASSERT((rawPseudoIdSet & PUBLIC_PSEUDOID_MASK) == rawPseudoIdSet);
- static_assert(pseudoBitsOffset >= 1, "(pseudoBitsOffset - 1) should be valid.");
- m_flags |= (static_cast<uint64_t>(rawPseudoIdSet) << (pseudoBitsOffset - 1));
- }
+ bool hasPseudoStyle(PseudoId) const;
+ void setHasPseudoStyle(PseudoId);
+ void setHasPseudoStyles(PseudoIdSet);
ETableLayout tableLayout() const { return static_cast<ETableLayout>(getValue(tableLayoutBitMask, tableLayoutOffset)); }
void setTableLayout(ETableLayout tableLayout) { updateValue(tableLayout, tableLayoutBitMask, tableLayoutOffset); }
@@ -279,31 +1779,12 @@
static uint64_t flagPseudoStyle(PseudoId pseudo) { return oneBitMask << (pseudoBitsOffset - 1 + pseudo); }
static uint64_t setFirstChildStateFlags() { return flagFirstChildState() | flagIsUnique(); }
static uint64_t setLastChildStateFlags() { return flagLastChildState() | flagIsUnique(); }
+
private:
- void updateBoolean(bool isSet, uint64_t offset)
- {
- if (isSet)
- m_flags |= (oneBitMask << offset);
- else
- m_flags &= ~(oneBitMask << offset);
- }
-
- bool getBoolean(uint64_t offset) const
- {
- return m_flags & (oneBitMask << offset);
- }
-
- void updateValue(uint8_t newValue, uint64_t positionIndependentMask, uint64_t offset)
- {
- ASSERT(!(newValue & ~positionIndependentMask));
- uint64_t positionDependentMask = positionIndependentMask << offset;
- m_flags = (m_flags & ~positionDependentMask) | (static_cast<uint64_t>(newValue) << offset);
- }
-
- unsigned getValue(uint64_t positionIndependentMask, uint64_t offset) const
- {
- return static_cast<unsigned>((m_flags >> offset) & positionIndependentMask);
- }
+ void updateBoolean(bool, uint64_t offset);
+ bool getBoolean(uint64_t offset) const;
+ void updateValue(uint8_t newValue, uint64_t positionIndependentMask, uint64_t offset);
+ unsigned getValue(uint64_t positionIndependentMask, uint64_t offset) const;
static uint64_t flagIsUnique() { return oneBitMask << isUniqueOffset; }
static uint64_t flagFirstChildState() { return oneBitMask << firstChildStateOffset; }
@@ -384,1807 +1865,64 @@
// 60 bits are assigned. There are 4 bits available currently used as padding to improve code generation.
// If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom().
- uint64_t m_flags;
+ uint64_t m_flags { 0 };
};
-protected:
-
- // non-inherited attributes
- DataRef<StyleBoxData> m_box;
- DataRef<StyleVisualData> visual;
- DataRef<StyleBackgroundData> m_background;
- DataRef<StyleSurroundData> surround;
- DataRef<StyleRareNonInheritedData> rareNonInheritedData;
-
- // inherited attributes
- DataRef<StyleRareInheritedData> rareInheritedData;
- DataRef<StyleInheritedData> inherited;
-
- // list of associated pseudo styles
- std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles;
-
- DataRef<SVGRenderStyle> m_svgStyle;
-
-// !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp
-
- // inherit
struct InheritedFlags {
- bool operator==(const InheritedFlags& other) const
- {
- return (_empty_cells == other._empty_cells)
- && (_caption_side == other._caption_side)
- && (_list_style_type == other._list_style_type)
- && (_list_style_position == other._list_style_position)
- && (_visibility == other._visibility)
- && (_text_align == other._text_align)
- && (_text_transform == other._text_transform)
- && (_text_decorations == other._text_decorations)
- && (_cursor_style == other._cursor_style)
-#if ENABLE(CURSOR_VISIBILITY)
- && (m_cursorVisibility == other.m_cursorVisibility)
-#endif
- && (_direction == other._direction)
- && (_white_space == other._white_space)
- && (_border_collapse == other._border_collapse)
- && (_box_direction == other._box_direction)
- && (m_rtlOrdering == other.m_rtlOrdering)
- && (m_printColorAdjust == other.m_printColorAdjust)
- && (_pointerEvents == other._pointerEvents)
- && (_insideLink == other._insideLink)
- && (_insideDefaultButton == other._insideDefaultButton)
- && (m_writingMode == other.m_writingMode);
- }
-
+ bool operator==(const InheritedFlags&) const;
bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
- unsigned _empty_cells : 1; // EEmptyCell
- unsigned _caption_side : 2; // ECaptionSide
- unsigned _list_style_type : 7; // EListStyleType
- unsigned _list_style_position : 1; // EListStylePosition
- unsigned _visibility : 2; // EVisibility
- unsigned _text_align : 4; // ETextAlign
- unsigned _text_transform : 2; // ETextTransform
- unsigned _text_decorations : TextDecorationBits;
- unsigned _cursor_style : 6; // ECursor
+ unsigned emptyCells : 1; // EEmptyCell
+ unsigned captionSide : 2; // ECaptionSide
+ unsigned listStyleType : 7; // EListStyleType
+ unsigned listStylePosition : 1; // EListStylePosition
+ unsigned visibility : 2; // EVisibility
+ unsigned textAlign : 4; // ETextAlign
+ unsigned textTransform : 2; // ETextTransform
+ unsigned textDecorations : TextDecorationBits;
+ unsigned cursor : 6; // ECursor
#if ENABLE(CURSOR_VISIBILITY)
- unsigned m_cursorVisibility : 1; // CursorVisibility
+ unsigned cursorVisibility : 1; // CursorVisibility
#endif
- unsigned _direction : 1; // TextDirection
- unsigned _white_space : 3; // EWhiteSpace
+ unsigned direction : 1; // TextDirection
+ unsigned whiteSpace : 3; // EWhiteSpace
// 32 bits
- unsigned _border_collapse : 1; // EBorderCollapse
- unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
+ unsigned borderCollapse : 1; // EBorderCollapse
+ unsigned boxDirection : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
// non CSS2 inherited
- unsigned m_rtlOrdering : 1; // Order
- unsigned m_printColorAdjust : PrintColorAdjustBits;
- unsigned _pointerEvents : 4; // EPointerEvents
- unsigned _insideLink : 2; // EInsideLink
- unsigned _insideDefaultButton : 1;
+ unsigned rtlOrdering : 1; // Order
+ unsigned printColorAdjust : PrintColorAdjustBits;
+ unsigned pointerEvents : 4; // EPointerEvents
+ unsigned insideLink : 2; // EInsideLink
+ unsigned insideDefaultButton : 1;
// 44 bits
// CSS Text Layout Module Level 3: Vertical writing support
- unsigned m_writingMode : 2; // WritingMode
+ unsigned writingMode : 2; // WritingMode
// 46 bits
- } inherited_flags;
+ };
-// don't inherit
- NonInheritedFlags noninherited_flags;
+ // This constructor is used to implement the replace operation.
+ RenderStyle(RenderStyle&, RenderStyle&&);
-#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
- bool m_deletionHasBegun { false };
-#endif
+ EDisplay originalDisplay() const { return m_nonInheritedFlags.originalDisplay(); }
-// !END SYNC!
-private:
- enum CreateDefaultStyleTag { CreateDefaultStyle };
- RenderStyle(CreateDefaultStyleTag);
-
- static RenderStyle& defaultStyle();
-
-public:
- RenderStyle(RenderStyle&&) = default;
- RenderStyle& operator=(RenderStyle&&) = default;
-
- // This is not a true copy constructor. It doesn't copy pseudo style caches for example.
- enum CloneTag { Clone };
- RenderStyle(const RenderStyle&, CloneTag);
-
- ~RenderStyle();
-
- static RenderStyle create();
- static std::unique_ptr<RenderStyle> createPtr();
-
- static RenderStyle clone(const RenderStyle&);
- static std::unique_ptr<RenderStyle> clonePtr(const RenderStyle&);
-
- static RenderStyle createAnonymousStyleWithDisplay(const RenderStyle& parentStyle, EDisplay);
- static RenderStyle createStyleInheritingFromPseudoStyle(const RenderStyle& pseudoStyle);
-
-#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
- bool deletionHasBegun() const { return m_deletionHasBegun; }
-#endif
-
- ContentPosition resolvedJustifyContentPosition(const StyleContentAlignmentData& normalValueBehavior) const;
- ContentDistributionType resolvedJustifyContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const;
- ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData& normalValueBehavior) const;
- ContentDistributionType resolvedAlignContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const;
- StyleSelfAlignmentData resolvedAlignItems(ItemPosition normalValueBehaviour) const;
- StyleSelfAlignmentData resolvedAlignSelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
- StyleSelfAlignmentData resolvedJustifyItems(ItemPosition normalValueBehaviour) const;
- StyleSelfAlignmentData resolvedJustifySelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
-
- void inheritFrom(const RenderStyle& inheritParent);
- void copyNonInheritedFrom(const RenderStyle*);
-
- PseudoId styleType() const { return noninherited_flags.styleType(); }
- void setStyleType(PseudoId styleType) { noninherited_flags.setStyleType(styleType); }
-
- RenderStyle* getCachedPseudoStyle(PseudoId) const;
- RenderStyle* addCachedPseudoStyle(std::unique_ptr<RenderStyle>);
- void removeCachedPseudoStyle(PseudoId);
-
- const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
-
- void setCustomPropertyValue(const AtomicString& name, const RefPtr<CSSCustomPropertyValue>& value) { rareInheritedData.access()->m_customProperties.access()->setCustomPropertyValue(name, value); }
- RefPtr<CSSCustomPropertyValue> getCustomPropertyValue(const AtomicString& name) const { return rareInheritedData->m_customProperties->getCustomPropertyValue(name); }
- bool hasCustomProperty(const AtomicString& name) const { return rareInheritedData->m_customProperties->hasCustomProperty(name); }
- const CustomPropertyValueMap& customProperties() const { return rareInheritedData->m_customProperties->m_values; }
-
- void setHasViewportUnits(bool hasViewportUnits = true) { noninherited_flags.setHasViewportUnits(hasViewportUnits); }
- bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits(); }
-
- bool affectedByHover() const { return noninherited_flags.affectedByHover(); }
- bool affectedByActive() const { return noninherited_flags.affectedByActive(); }
- bool affectedByDrag() const { return noninherited_flags.affectedByDrag(); }
-
- void setAffectedByHover() { noninherited_flags.setAffectedByHover(true); }
- void setAffectedByActive() { noninherited_flags.setAffectedByActive(true); }
- void setAffectedByDrag() { noninherited_flags.setAffectedByDrag(true); }
-
- void setColumnStylesFromPaginationMode(const Pagination::Mode&);
-
- bool operator==(const RenderStyle& other) const;
- bool operator!=(const RenderStyle& other) const { return !(*this == other); }
- bool isFloating() const { return noninherited_flags.isFloating(); }
- bool hasMargin() const { return !surround->margin.isZero(); }
- bool hasBorder() const { return surround->border.hasBorder(); }
- bool hasBorderFill() const { return surround->border.hasFill(); }
- bool hasVisibleBorderDecoration() const { return hasVisibleBorder() || hasBorderFill(); }
- bool hasVisibleBorder() const { return surround->border.hasVisibleBorder(); }
- bool hasPadding() const { return !surround->padding.isZero(); }
- bool hasOffset() const { return !surround->offset.isZero(); }
- bool hasMarginBeforeQuirk() const { return marginBefore().hasQuirk(); }
- bool hasMarginAfterQuirk() const { return marginAfter().hasQuirk(); }
-
- bool hasBackgroundImage() const { return m_background->background().hasImage(); }
- bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
-
- bool hasEntirelyFixedBackground() const;
-
- bool hasAppearance() const { return appearance() != NoControlPart; }
-
- bool hasBackground() const
- {
- Color color = visitedDependentColor(CSSPropertyBackgroundColor);
- if (color.isVisible())
- return true;
- return hasBackgroundImage();
- }
-
- LayoutBoxExtent imageOutsets(const NinePieceImage&) const;
- bool hasBorderImageOutsets() const
- {
- return borderImage().hasImage() && !borderImage().outset().isZero();
- }
- LayoutBoxExtent borderImageOutsets() const
- {
- return imageOutsets(borderImage());
- }
-
- LayoutBoxExtent maskBoxImageOutsets() const
- {
- return imageOutsets(maskBoxImage());
- }
-
- bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); }
- FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); }
-
- Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlOrdering); }
- void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; }
-
- bool isStyleAvailable() const;
-
- bool hasAnyPublicPseudoStyles() const;
- bool hasPseudoStyle(PseudoId pseudo) const;
- void setHasPseudoStyle(PseudoId pseudo);
- void setHasPseudoStyles(PseudoIdSet);
- bool hasUniquePseudoStyle() const;
-
- // attribute getter methods
-
- EDisplay display() const { return noninherited_flags.effectiveDisplay(); }
- EDisplay originalDisplay() const { return noninherited_flags.originalDisplay(); }
-
- const Length& left() const { return surround->offset.left(); }
- const Length& right() const { return surround->offset.right(); }
- const Length& top() const { return surround->offset.top(); }
- const Length& bottom() const { return surround->offset.bottom(); }
-
- // Accessors for positioned object edges that take into account writing mode.
- const Length& logicalLeft() const { return surround->offset.start(writingMode()); }
- const Length& logicalRight() const { return surround->offset.end(writingMode()); }
- const Length& logicalTop() const { return surround->offset.before(writingMode()); }
- const Length& logicalBottom() const { return surround->offset.after(writingMode()); }
-
- // Whether or not a positioned element requires normal flow x/y to be computed
- // to determine its position.
bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); }
bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); }
- bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
- bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
- EPosition position() const { return noninherited_flags.position(); }
- bool hasOutOfFlowPosition() const { return position() == AbsolutePosition || position() == FixedPosition; }
- bool hasInFlowPosition() const { return position() == RelativePosition || position() == StickyPosition; }
- bool hasViewportConstrainedPosition() const { return position() == FixedPosition || position() == StickyPosition; }
- EFloat floating() const { return noninherited_flags.floating(); }
+ void setContent(std::unique_ptr<ContentData>, bool add);
- const Length& width() const { return m_box->width(); }
- const Length& height() const { return m_box->height(); }
- const Length& minWidth() const { return m_box->minWidth(); }
- const Length& maxWidth() const { return m_box->maxWidth(); }
- const Length& minHeight() const { return m_box->minHeight(); }
- const Length& maxHeight() const { return m_box->maxHeight(); }
-
- const Length& logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
- const Length& logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
- const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
- const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
- const Length& logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
- const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
+ LayoutBoxExtent getShadowInsetExtent(const ShadowData*) const;
- const BorderData& border() const { return surround->border; }
- const BorderValue& borderLeft() const { return surround->border.left(); }
- const BorderValue& borderRight() const { return surround->border.right(); }
- const BorderValue& borderTop() const { return surround->border.top(); }
- const BorderValue& borderBottom() const { return surround->border.bottom(); }
+ static bool isDisplayReplacedType(EDisplay);
+ static bool isDisplayInlineType(EDisplay);
+ static bool isDisplayFlexibleBox(EDisplay);
+ static bool isDisplayGridBox(EDisplay);
+ static bool isDisplayFlexibleOrGridBox(EDisplay);
- const BorderValue& borderBefore() const;
- const BorderValue& borderAfter() const;
- const BorderValue& borderStart() const;
- const BorderValue& borderEnd() const;
-
- const NinePieceImage& borderImage() const { return surround->border.image(); }
- StyleImage* borderImageSource() const { return surround->border.image().image(); }
- const LengthBox& borderImageSlices() const { return surround->border.image().imageSlices(); }
- const LengthBox& borderImageWidth() const { return surround->border.image().borderSlices(); }
- const LengthBox& borderImageOutset() const { return surround->border.image().outset(); }
-
- const LengthSize& borderTopLeftRadius() const { return surround->border.topLeft(); }
- const LengthSize& borderTopRightRadius() const { return surround->border.topRight(); }
- const LengthSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
- const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
- bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
-
- float borderLeftWidth() const { return surround->border.borderLeftWidth(); }
- EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
- bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
- float borderRightWidth() const { return surround->border.borderRightWidth(); }
- EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
- bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
- float borderTopWidth() const { return surround->border.borderTopWidth(); }
- EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
- bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
- float borderBottomWidth() const { return surround->border.borderBottomWidth(); }
- EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
- bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
- FloatBoxExtent borderWidth() const { return surround->border.borderWidth(); }
-
- float borderBeforeWidth() const;
- float borderAfterWidth() const;
- float borderStartWidth() const;
- float borderEndWidth() const;
-
- float outlineSize() const { return std::max<float>(0, outlineWidth() + outlineOffset()); }
- float outlineWidth() const;
- bool hasOutline() const { return outlineStyle() > BHIDDEN && outlineWidth() > 0; }
- EBorderStyle outlineStyle() const { return m_background->outline().style(); }
- OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); }
- bool hasOutlineInVisualOverflow() const { return hasOutline() && outlineSize() > 0; }
-
- EOverflow overflowX() const { return noninherited_flags.overflowX(); }
- EOverflow overflowY() const { return noninherited_flags.overflowY(); }
-
- EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
- EVerticalAlign verticalAlign() const { return noninherited_flags.verticalAlign(); }
- const Length& verticalAlignLength() const { return m_box->verticalAlign(); }
-
- const Length& clipLeft() const { return visual->clip.left(); }
- const Length& clipRight() const { return visual->clip.right(); }
- const Length& clipTop() const { return visual->clip.top(); }
- const Length& clipBottom() const { return visual->clip.bottom(); }
- const LengthBox& clip() const { return visual->clip; }
- bool hasClip() const { return visual->hasClip; }
-
- EUnicodeBidi unicodeBidi() const { return noninherited_flags.unicodeBidi(); }
-
- EClear clear() const { return noninherited_flags.clear(); }
- ETableLayout tableLayout() const { return noninherited_flags.tableLayout(); }
-
- WEBCORE_EXPORT const FontCascade& fontCascade() const;
- WEBCORE_EXPORT const FontMetrics& fontMetrics() const;
- WEBCORE_EXPORT const FontCascadeDescription& fontDescription() const;
- float specifiedFontSize() const;
- float computedFontSize() const;
- int fontSize() const;
-#if ENABLE(VARIATION_FONTS)
- FontVariationSettings fontVariationSettings() const { return fontDescription().variationSettings(); }
-#endif
- std::pair<FontOrientation, NonCJKGlyphOrientation> fontAndGlyphOrientation();
-
- const Length& textIndent() const { return rareInheritedData->indent; }
-#if ENABLE(CSS3_TEXT)
- TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(rareInheritedData->m_textIndentLine); }
- TextIndentType textIndentType() const { return static_cast<TextIndentType>(rareInheritedData->m_textIndentType); }
-#endif
- ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
- ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
- TextDecoration textDecorationsInEffect() const { return static_cast<TextDecoration>(inherited_flags._text_decorations); }
- TextDecoration textDecoration() const { return static_cast<TextDecoration>(visual->textDecoration); }
-#if ENABLE(CSS3_TEXT)
- TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rareInheritedData->m_textAlignLast); }
- TextJustify textJustify() const { return static_cast<TextJustify>(rareInheritedData->m_textJustify); }
-#endif // CSS3_TEXT
- TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
- TextDecorationSkip textDecorationSkip() const { return static_cast<TextDecorationSkip>(rareInheritedData->m_textDecorationSkip); }
- TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
-
- const Length& wordSpacing() const;
- float letterSpacing() const;
-
- float zoom() const { return visual->m_zoom; }
- float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
-
- TextZoom textZoom() const { return static_cast<TextZoom>(rareInheritedData->m_textZoom); }
-
- TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
- bool isLeftToRightDirection() const { return direction() == LTR; }
- bool hasExplicitlySetDirection() const { return noninherited_flags.hasExplicitlySetDirection(); }
-
- const Length& specifiedLineHeight() const;
- WEBCORE_EXPORT Length lineHeight() const;
- WEBCORE_EXPORT int computedLineHeight() const;
-
- EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
- static bool autoWrap(EWhiteSpace ws)
- {
- // Nowrap and pre don't automatically wrap.
- return ws != NOWRAP && ws != PRE;
- }
-
- bool autoWrap() const
- {
- return autoWrap(whiteSpace());
- }
-
- static bool preserveNewline(EWhiteSpace ws)
- {
- // Normal and nowrap do not preserve newlines.
- return ws != NORMAL && ws != NOWRAP;
- }
-
- bool preserveNewline() const
- {
- return preserveNewline(whiteSpace());
- }
-
- static bool collapseWhiteSpace(EWhiteSpace ws)
- {
- // Pre and prewrap do not collapse whitespace.
- return ws != PRE && ws != PRE_WRAP;
- }
-
- bool collapseWhiteSpace() const
- {
- return collapseWhiteSpace(whiteSpace());
- }
-
- bool isCollapsibleWhiteSpace(UChar c) const
- {
- switch (c) {
- case ' ':
- case '\t':
- return collapseWhiteSpace();
- case '\n':
- return !preserveNewline();
- }
- return false;
- }
-
- bool breakOnlyAfterWhiteSpace() const
- {
- return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpace;
- }
-
- bool breakWords() const
- {
- return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowWrap;
- }
-
- EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
- EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
- CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
- EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
- EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
- EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
- const Length& backgroundXPosition() const { return m_background->background().xPosition(); }
- const Length& backgroundYPosition() const { return m_background->background().yPosition(); }
- EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
- const LengthSize& backgroundSizeLength() const { return m_background->background().sizeLength(); }
- FillLayer& ensureBackgroundLayers() { return m_background.access()->m_background; }
- const FillLayer* backgroundLayers() const { return &(m_background->background()); }
-
- StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
- EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
- EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
- CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
- EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
- EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
- const Length& maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
- const Length& maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
- EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
- const LengthSize& maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
- FillLayer& ensureMaskLayers() { return rareNonInheritedData.access()->m_mask; }
- const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
- const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
- StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
-
- EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
- float horizontalBorderSpacing() const;
- float verticalBorderSpacing() const;
- EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
- ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
-
- EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
- StyleImage* listStyleImage() const;
- EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
-
- const Length& marginTop() const { return surround->margin.top(); }
- const Length& marginBottom() const { return surround->margin.bottom(); }
- const Length& marginLeft() const { return surround->margin.left(); }
- const Length& marginRight() const { return surround->margin.right(); }
- const Length& marginBefore() const { return surround->margin.before(writingMode()); }
- const Length& marginAfter() const { return surround->margin.after(writingMode()); }
- const Length& marginStart() const { return surround->margin.start(writingMode(), direction()); }
- const Length& marginEnd() const { return surround->margin.end(writingMode(), direction()); }
- const Length& marginStartUsing(const RenderStyle* otherStyle) const { return surround->margin.start(otherStyle->writingMode(), otherStyle->direction()); }
- const Length& marginEndUsing(const RenderStyle* otherStyle) const { return surround->margin.end(otherStyle->writingMode(), otherStyle->direction()); }
- const Length& marginBeforeUsing(const RenderStyle* otherStyle) const { return surround->margin.before(otherStyle->writingMode()); }
- const Length& marginAfterUsing(const RenderStyle* otherStyle) const { return surround->margin.after(otherStyle->writingMode()); }
-
- const LengthBox& paddingBox() const { return surround->padding; }
- const Length& paddingTop() const { return surround->padding.top(); }
- const Length& paddingBottom() const { return surround->padding.bottom(); }
- const Length& paddingLeft() const { return surround->padding.left(); }
- const Length& paddingRight() const { return surround->padding.right(); }
- const Length& paddingBefore() const { return surround->padding.before(writingMode()); }
- const Length& paddingAfter() const { return surround->padding.after(writingMode()); }
- const Length& paddingStart() const { return surround->padding.start(writingMode(), direction()); }
- const Length& paddingEnd() const { return surround->padding.end(writingMode(), direction()); }
-
- ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
-#if ENABLE(CURSOR_VISIBILITY)
- CursorVisibility cursorVisibility() const { return static_cast<CursorVisibility>(inherited_flags.m_cursorVisibility); }
-#endif
-
- CursorList* cursors() const { return rareInheritedData->cursorData.get(); }
-
- EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
- bool isLink() const { return noninherited_flags.isLink(); }
-
- bool insideDefaultButton() const { return inherited_flags._insideDefaultButton; }
-
- short widows() const { return rareInheritedData->widows; }
- short orphans() const { return rareInheritedData->orphans; }
- bool hasAutoWidows() const { return rareInheritedData->m_hasAutoWidows; }
- bool hasAutoOrphans() const { return rareInheritedData->m_hasAutoOrphans; }
-
- // CSS3 Getter Methods
- BreakInside breakInside() const { return static_cast<BreakInside>(rareNonInheritedData->m_breakInside); }
- BreakBetween breakBefore() const { return static_cast<BreakBetween>(rareNonInheritedData->m_breakBefore); }
- BreakBetween breakAfter() const { return static_cast<BreakBetween>(rareNonInheritedData->m_breakAfter); }
-
- HangingPunctuation hangingPunctuation() const { return static_cast<HangingPunctuation>(rareInheritedData->m_hangingPunctuation); }
-
- float outlineOffset() const;
- const ShadowData* textShadow() const { return rareInheritedData->textShadow.get(); }
- void getTextShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
- void getTextShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
- void getTextShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
- void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
- void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
-
- float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
- float opacity() const { return rareNonInheritedData->m_opacity; }
- ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
- AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(rareNonInheritedData->m_aspectRatioType); }
- float aspectRatio() const { return aspectRatioNumerator() / aspectRatioDenominator(); }
- float aspectRatioDenominator() const { return rareNonInheritedData->m_aspectRatioDenominator; }
- float aspectRatioNumerator() const { return rareNonInheritedData->m_aspectRatioNumerator; }
- EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->m_deprecatedFlexibleBox->align); }
- EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
- float boxFlex() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex; }
- unsigned int boxFlexGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex_group; }
- EBoxLines boxLines() const { return static_cast<EBoxLines>(rareNonInheritedData->m_deprecatedFlexibleBox->lines); }
- unsigned int boxOrdinalGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->ordinal_group; }
- EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->m_deprecatedFlexibleBox->orient); }
- EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData->m_deprecatedFlexibleBox->pack); }
-
- int order() const { return rareNonInheritedData->m_order; }
- float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexGrow; }
- float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; }
- const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox->m_flexBasis; }
- const StyleContentAlignmentData& alignContent() const { return rareNonInheritedData->m_alignContent; }
- ContentPosition alignContentPosition() const { return rareNonInheritedData->m_alignContent.position(); }
- ContentDistributionType alignContentDistribution() const { return rareNonInheritedData->m_alignContent.distribution(); }
- OverflowAlignment alignContentOverflowAlignment() const { return rareNonInheritedData->m_alignContent.overflow(); }
- const StyleSelfAlignmentData& alignItems() const { return rareNonInheritedData->m_alignItems; }
- ItemPosition alignItemsPosition() const { return rareNonInheritedData->m_alignItems.position(); }
- OverflowAlignment alignItemsOverflowAlignment() const { return rareNonInheritedData->m_alignItems.overflow(); }
- const StyleSelfAlignmentData& alignSelf() const { return rareNonInheritedData->m_alignSelf; }
- ItemPosition alignSelfPosition() const { return rareNonInheritedData->m_alignSelf.position(); }
- OverflowAlignment alignSelfOverflowAlignment() const { return rareNonInheritedData->m_alignSelf.overflow(); }
- EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(rareNonInheritedData->m_flexibleBox->m_flexDirection); }
- bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
- bool isReverseFlexDirection() const { return flexDirection() == FlowRowReverse || flexDirection() == FlowColumnReverse; }
- EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); }
- const StyleContentAlignmentData& justifyContent() const { return rareNonInheritedData->m_justifyContent; }
- ContentPosition justifyContentPosition() const { return rareNonInheritedData->m_justifyContent.position(); }
- ContentDistributionType justifyContentDistribution() const { return rareNonInheritedData->m_justifyContent.distribution(); }
- OverflowAlignment justifyContentOverflowAlignment() const { return rareNonInheritedData->m_justifyContent.overflow(); }
- const StyleSelfAlignmentData& justifyItems() const { return rareNonInheritedData->m_justifyItems; }
- ItemPosition justifyItemsPosition() const { return rareNonInheritedData->m_justifyItems.position(); }
- OverflowAlignment justifyItemsOverflowAlignment() const { return rareNonInheritedData->m_justifyItems.overflow(); }
- ItemPositionType justifyItemsPositionType() const { return rareNonInheritedData->m_justifyItems.positionType(); }
- const StyleSelfAlignmentData& justifySelf() const { return rareNonInheritedData->m_justifySelf; }
- ItemPosition justifySelfPosition() const { return rareNonInheritedData->m_justifySelf.position(); }
- OverflowAlignment justifySelfOverflowAlignment() const { return rareNonInheritedData->m_justifySelf.overflow(); }
-
-#if ENABLE(CSS_GRID_LAYOUT)
- const Vector<GridTrackSize>& gridColumns() const { return rareNonInheritedData->m_grid->m_gridColumns; }
- const Vector<GridTrackSize>& gridRows() const { return rareNonInheritedData->m_grid->m_gridRows; }
- const Vector<GridTrackSize>& gridAutoRepeatColumns() const { return rareNonInheritedData->m_grid->m_gridAutoRepeatColumns; }
- const Vector<GridTrackSize>& gridAutoRepeatRows() const { return rareNonInheritedData->m_grid->m_gridAutoRepeatRows; }
- unsigned gridAutoRepeatColumnsInsertionPoint() const { return rareNonInheritedData->m_grid->m_autoRepeatColumnsInsertionPoint; }
- unsigned gridAutoRepeatRowsInsertionPoint() const { return rareNonInheritedData->m_grid->m_autoRepeatRowsInsertionPoint; }
- AutoRepeatType gridAutoRepeatColumnsType() const { return rareNonInheritedData->m_grid->m_autoRepeatColumnsType; }
- AutoRepeatType gridAutoRepeatRowsType() const { return rareNonInheritedData->m_grid->m_autoRepeatRowsType; }
- const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheritedData->m_grid->m_namedGridColumnLines; }
- const NamedGridLinesMap& namedGridRowLines() const { return rareNonInheritedData->m_grid->m_namedGridRowLines; }
- const OrderedNamedGridLinesMap& orderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridColumnLines; }
- const OrderedNamedGridLinesMap& orderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridRowLines; }
- const NamedGridLinesMap& autoRepeatNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_autoRepeatNamedGridColumnLines; }
- const NamedGridLinesMap& autoRepeatNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_autoRepeatNamedGridRowLines; }
- const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridColumnLines; }
- const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridRowLines; }
- const NamedGridAreaMap& namedGridArea() const { return rareNonInheritedData->m_grid->m_namedGridArea; }
- size_t namedGridAreaRowCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaRowCount; }
- size_t namedGridAreaColumnCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaColumnCount; }
- GridAutoFlow gridAutoFlow() const { return static_cast<GridAutoFlow>(rareNonInheritedData->m_grid->m_gridAutoFlow); }
- bool isGridAutoFlowDirectionRow() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowDirectionRow); }
- bool isGridAutoFlowDirectionColumn() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowDirectionColumn); }
- bool isGridAutoFlowAlgorithmSparse() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmSparse); }
- bool isGridAutoFlowAlgorithmDense() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmDense); }
- const Vector<GridTrackSize>& gridAutoColumns() const { return rareNonInheritedData->m_grid->m_gridAutoColumns; }
- const Vector<GridTrackSize>& gridAutoRows() const { return rareNonInheritedData->m_grid->m_gridAutoRows; }
- const Length& gridColumnGap() const { return rareNonInheritedData->m_grid->m_gridColumnGap; }
- const Length& gridRowGap() const { return rareNonInheritedData->m_grid->m_gridRowGap; }
-
-
- const GridPosition& gridItemColumnStart() const { return rareNonInheritedData->m_gridItem->m_gridColumnStart; }
- const GridPosition& gridItemColumnEnd() const { return rareNonInheritedData->m_gridItem->m_gridColumnEnd; }
- const GridPosition& gridItemRowStart() const { return rareNonInheritedData->m_gridItem->m_gridRowStart; }
- const GridPosition& gridItemRowEnd() const { return rareNonInheritedData->m_gridItem->m_gridRowEnd; }
-#endif /* ENABLE(CSS_GRID_LAYOUT) */
-
- const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
- void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
- LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); }
- void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
- void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
- void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
- void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
-
-#if ENABLE(CSS_BOX_DECORATION_BREAK)
- EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecorationBreak(); }
-#endif
- StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
- EBoxSizing boxSizing() const { return m_box->boxSizing(); }
- const Length& marqueeIncrement() const { return rareNonInheritedData->m_marquee->increment; }
- int marqueeSpeed() const { return rareNonInheritedData->m_marquee->speed; }
- int marqueeLoopCount() const { return rareNonInheritedData->m_marquee->loops; }
- EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(rareNonInheritedData->m_marquee->behavior); }
- EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(rareNonInheritedData->m_marquee->direction); }
- EUserModify userModify() const { return static_cast<EUserModify>(rareInheritedData->userModify); }
- EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
- EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
- TextOverflow textOverflow() const { return static_cast<TextOverflow>(rareNonInheritedData->textOverflow); }
- EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
- EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
- EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
- EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(rareInheritedData->overflowWrap); }
- ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
- LineBreak lineBreak() const { return static_cast<LineBreak>(rareInheritedData->lineBreak); }
- Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); }
- short hyphenationLimitBefore() const { return rareInheritedData->hyphenationLimitBefore; }
- short hyphenationLimitAfter() const { return rareInheritedData->hyphenationLimitAfter; }
- short hyphenationLimitLines() const { return rareInheritedData->hyphenationLimitLines; }
- const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
- const AtomicString& locale() const { return fontDescription().locale(); }
- EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
- EResize resize() const { return static_cast<EResize>(rareNonInheritedData->m_resize); }
- ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(rareNonInheritedData->m_multiCol->m_axis); }
- bool hasInlineColumnAxis() const {
- ColumnAxis axis = columnAxis();
- return axis == AutoColumnAxis || isHorizontalWritingMode() == (axis == HorizontalColumnAxis);
- }
- ColumnProgression columnProgression() const { return static_cast<ColumnProgression>(rareNonInheritedData->m_multiCol->m_progression); }
- float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
- bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
- unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
- bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
- bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() || !hasInlineColumnAxis(); }
- ColumnFill columnFill() const { return static_cast<ColumnFill>(rareNonInheritedData->m_multiCol->m_fill); }
- float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
- bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
- EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
- unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
- bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
- ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(rareNonInheritedData->m_multiCol->m_columnSpan); }
-
- const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
- const Length& transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
- const Length& transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
- float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
- bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
-
- TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(rareInheritedData->textEmphasisFill); }
- TextEmphasisMark textEmphasisMark() const;
- const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
- TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
- const AtomicString& textEmphasisMarkString() const;
-
- RubyPosition rubyPosition() const { return static_cast<RubyPosition>(rareInheritedData->m_rubyPosition); }
-
- TextOrientation textOrientation() const { return static_cast<TextOrientation>(rareInheritedData->m_textOrientation); }
-
- ObjectFit objectFit() const { return static_cast<ObjectFit>(rareNonInheritedData->m_objectFit); }
- LengthPoint objectPosition() const { return rareNonInheritedData->m_objectPosition; }
-
- // Return true if any transform related property (currently transform, transformStyle3D or perspective)
- // indicates that we are transforming
- bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
-
- enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
- void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const;
- void setPageScaleTransform(float);
-
- bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
-
- TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
- bool hasTextCombine() const { return textCombine() != TextCombineNone; }
-
- unsigned tabSize() const { return rareInheritedData->m_tabSize; }
-
- // End CSS3 Getters
-
- bool hasFlowInto() const { return !rareNonInheritedData->m_flowThread.isNull(); }
- const AtomicString& flowThread() const { return rareNonInheritedData->m_flowThread; }
- bool hasFlowFrom() const { return !rareNonInheritedData->m_regionThread.isNull(); }
- const AtomicString& regionThread() const { return rareNonInheritedData->m_regionThread; }
- RegionFragment regionFragment() const { return static_cast<RegionFragment>(rareNonInheritedData->m_regionFragment); }
-
- const AtomicString& lineGrid() const { return rareInheritedData->m_lineGrid; }
- LineSnap lineSnap() const { return static_cast<LineSnap>(rareInheritedData->m_lineSnap); }
- LineAlign lineAlign() const { return static_cast<LineAlign>(rareInheritedData->m_lineAlign); }
-
- // Apple-specific property getter methods
- EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); }
- const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); }
- const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
-
- AnimationList* animations() { return rareNonInheritedData->m_animations.get(); }
- AnimationList* transitions() { return rareNonInheritedData->m_transitions.get(); }
-
- bool hasAnimationsOrTransitions() const { return rareNonInheritedData->hasAnimationsOrTransitions(); }
-
- AnimationList& ensureAnimations();
- AnimationList& ensureTransitions();
-
- bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; }
- bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; }
-
- // return the first found Animation (including 'all' transitions)
- const Animation* transitionForProperty(CSSPropertyID) const;
-
- ETransformStyle3D transformStyle3D() const { return static_cast<ETransformStyle3D>(rareNonInheritedData->m_transformStyle3D); }
- bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
-
- EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(rareNonInheritedData->m_backfaceVisibility); }
- float perspective() const { return rareNonInheritedData->m_perspective; }
- bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
- const Length& perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
- const Length& perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
- const LengthSize& pageSize() const { return rareNonInheritedData->m_pageSize; }
- PageSizeType pageSizeType() const { return static_cast<PageSizeType>(rareNonInheritedData->m_pageSizeType); }
-
- LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; }
- const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
- const IntSize& initialLetter() const { return rareNonInheritedData->m_initialLetter; }
- int initialLetterDrop() const { return initialLetter().width(); }
- int initialLetterHeight() const { return initialLetter().height(); }
-
-#if ENABLE(TOUCH_EVENTS)
- TouchAction touchAction() const { return static_cast<TouchAction>(rareNonInheritedData->m_touchAction); }
-#endif
-
-#if ENABLE(CSS_SCROLL_SNAP)
- // Scroll snap port style.
- const StyleScrollSnapPort& scrollSnapPort() const;
- const ScrollSnapType& scrollSnapType() const;
- const LengthBox& scrollPadding() const;
- const Length& scrollPaddingTop() const;
- const Length& scrollPaddingBottom() const;
- const Length& scrollPaddingLeft() const;
- const Length& scrollPaddingRight() const;
-
- // Scroll snap area style.
- const StyleScrollSnapArea& scrollSnapArea() const;
- const ScrollSnapAlign& scrollSnapAlign() const;
- const LengthBox& scrollSnapMargin() const;
- const Length& scrollSnapMarginTop() const;
- const Length& scrollSnapMarginBottom() const;
- const Length& scrollSnapMarginLeft() const;
- const Length& scrollSnapMarginRight() const;
-#endif
-
-#if ENABLE(TOUCH_EVENTS)
- Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
-#endif
-
-#if PLATFORM(IOS)
- bool touchCalloutEnabled() const { return rareInheritedData->touchCalloutEnabled; }
-#endif
-
-#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
- bool useTouchOverflowScrolling() const { return rareInheritedData->useTouchOverflowScrolling; }
-#endif
-
-#if ENABLE(TEXT_AUTOSIZING)
- TextSizeAdjustment textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
-#endif
-
- ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
-
- WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
- bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); }
- bool isVerticalWritingMode() const { return WebCore::isVerticalWritingMode(writingMode()); }
- bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); }
- bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedWritingMode(writingMode()); }
-
- ImageOrientationEnum imageOrientation() const
- {
-#if ENABLE(CSS_IMAGE_ORIENTATION)
- return static_cast<ImageOrientationEnum>(rareInheritedData->m_imageOrientation);
-#else
- return DefaultImageOrientation;
-#endif
- }
-
- EImageRendering imageRendering() const { return static_cast<EImageRendering>(rareInheritedData->m_imageRendering); }
-
-#if ENABLE(CSS_IMAGE_RESOLUTION)
- ImageResolutionSource imageResolutionSource() const { return static_cast<ImageResolutionSource>(rareInheritedData->m_imageResolutionSource); }
- ImageResolutionSnap imageResolutionSnap() const { return static_cast<ImageResolutionSnap>(rareInheritedData->m_imageResolutionSnap); }
- float imageResolution() const { return rareInheritedData->m_imageResolution; }
-#endif
-
- ESpeak speak() const { return static_cast<ESpeak>(rareInheritedData->speak); }
-
- FilterOperations& mutableFilter() { return rareNonInheritedData.access()->m_filter.access()->m_operations; }
- const FilterOperations& filter() const { return rareNonInheritedData->m_filter->m_operations; }
- bool hasFilter() const { return !rareNonInheritedData->m_filter->m_operations.operations().isEmpty(); }
- bool hasReferenceFilterOnly() const;
-
-#if ENABLE(FILTERS_LEVEL_2)
- FilterOperations& mutableBackdropFilter() { return rareNonInheritedData.access()->m_backdropFilter.access()->m_operations; }
- const FilterOperations& backdropFilter() const { return rareNonInheritedData->m_backdropFilter->m_operations; }
- bool hasBackdropFilter() const { return !rareNonInheritedData->m_backdropFilter->m_operations.operations().isEmpty(); }
-#else
- bool hasBackdropFilter() const { return false; }
-#endif
-
-#if ENABLE(CSS_COMPOSITING)
- BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); }
- void setBlendMode(BlendMode blendMode) { SET_VAR(rareNonInheritedData, m_effectiveBlendMode, blendMode); }
- bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) != BlendModeNormal; }
-
- Isolation isolation() const { return static_cast<Isolation>(rareNonInheritedData->m_isolation); }
- void setIsolation(Isolation isolation) { SET_VAR(rareNonInheritedData, m_isolation, isolation); }
- bool hasIsolation() const { return rareNonInheritedData->m_isolation != IsolationAuto; }
-#else
- BlendMode blendMode() const { return BlendModeNormal; }
- bool hasBlendMode() const { return false; }
-
- Isolation isolation() const { return IsolationAuto; }
- bool hasIsolation() const { return false; }
-#endif
-
- bool shouldPlaceBlockDirectionScrollbarOnLeft() const;
-
-#if ENABLE(CSS_TRAILING_WORD)
- TrailingWord trailingWord() const { return static_cast<TrailingWord>(rareInheritedData->trailingWord); }
-#endif
-
-#if ENABLE(APPLE_PAY)
- ApplePayButtonStyle applePayButtonStyle() const { return static_cast<ApplePayButtonStyle>(rareNonInheritedData->m_applePayButtonStyle); }
- ApplePayButtonType applePayButtonType() const { return static_cast<ApplePayButtonType>(rareNonInheritedData->m_applePayButtonType); }
-#endif
-
- void checkVariablesInCustomProperties();
-
-// attribute setter methods
-
- void setDisplay(EDisplay v) { noninherited_flags.setEffectiveDisplay(v); }
- void setOriginalDisplay(EDisplay v) { noninherited_flags.setOriginalDisplay(v); }
- void setPosition(EPosition v) { noninherited_flags.setPosition(v); }
- void setFloating(EFloat v) { noninherited_flags.setFloating(v); }
-
- void setLeft(Length v) { SET_VAR(surround, offset.left(), WTFMove(v)); }
- void setRight(Length v) { SET_VAR(surround, offset.right(), WTFMove(v)); }
- void setTop(Length v) { SET_VAR(surround, offset.top(), WTFMove(v)); }
- void setBottom(Length v) { SET_VAR(surround, offset.bottom(), WTFMove(v)); }
-
- void setWidth(Length v) { SET_VAR(m_box, m_width, WTFMove(v)); }
- void setHeight(Length v) { SET_VAR(m_box, m_height, WTFMove(v)); }
-
- void setLogicalWidth(Length v)
- {
- if (isHorizontalWritingMode()) {
- SET_VAR(m_box, m_width, WTFMove(v));
- } else {
- SET_VAR(m_box, m_height, WTFMove(v));
- }
- }
-
- void setLogicalHeight(Length v)
- {
- if (isHorizontalWritingMode()) {
- SET_VAR(m_box, m_height, WTFMove(v));
- } else {
- SET_VAR(m_box, m_width, WTFMove(v));
- }
- }
-
- void setMinWidth(Length v) { SET_VAR(m_box, m_minWidth, WTFMove(v)); }
- void setMaxWidth(Length v) { SET_VAR(m_box, m_maxWidth, WTFMove(v)); }
- void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, WTFMove(v)); }
- void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, WTFMove(v)); }
-
-#if ENABLE(DASHBOARD_SUPPORT)
- Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
- void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(rareNonInheritedData, m_dashboardRegions, regions); }
-
- void setDashboardRegion(int type, const String& label, Length t, Length r, Length b, Length l, bool append)
- {
- StyleDashboardRegion region;
- region.label = label;
- region.offset.top() = WTFMove(t);
- region.offset.right() = WTFMove(r);
- region.offset.bottom() = WTFMove(b);
- region.offset.left() = WTFMove(l);
- region.type = type;
- if (!append)
- rareNonInheritedData.access()->m_dashboardRegions.clear();
- rareNonInheritedData.access()->m_dashboardRegions.append(region);
- }
-#endif
-
- void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
- void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()); }
- void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()); }
- void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()); }
- void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()); }
- void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()); }
- void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
- void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()); }
- void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()); }
- void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()); }
- void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()); }
-
- void setBackgroundColor(const Color& v) { SET_VAR(m_background, m_color, v); }
-
- void setBackgroundXPosition(Length length) { SET_VAR(m_background, m_background.m_xPosition, WTFMove(length)); }
- void setBackgroundYPosition(Length length) { SET_VAR(m_background, m_background.m_yPosition, WTFMove(length)); }
- void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b); }
- void setBackgroundSizeLength(LengthSize size) { SET_VAR(m_background, m_background.m_sizeLength, WTFMove(size)); }
-
- void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b); }
- void setBorderImageSource(RefPtr<StyleImage>&&);
- void setBorderImageSlices(LengthBox);
- void setBorderImageWidth(LengthBox);
- void setBorderImageOutset(LengthBox);
-
- void setBorderTopLeftRadius(LengthSize size) { SET_VAR(surround, border.m_topLeft, WTFMove(size)); }
- void setBorderTopRightRadius(LengthSize size) { SET_VAR(surround, border.m_topRight, WTFMove(size)); }
- void setBorderBottomLeftRadius(LengthSize size) { SET_VAR(surround, border.m_bottomLeft, WTFMove(size)); }
- void setBorderBottomRightRadius(LengthSize size) { SET_VAR(surround, border.m_bottomRight, WTFMove(size)); }
-
- void setBorderRadius(LengthSize s)
- {
- setBorderTopLeftRadius(s);
- setBorderTopRightRadius(s);
- setBorderBottomLeftRadius(s);
- setBorderBottomRightRadius(s);
- }
- void setBorderRadius(const IntSize& s)
- {
- setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
- }
-
- RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
- RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
-
- RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, LayoutUnit topWidth, LayoutUnit bottomWidth,
- LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
-
- void setBorderLeftWidth(float v) { SET_VAR(surround, border.m_left.m_width, v); }
- void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v); }
- void setBorderLeftColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_left, v); }
- void setBorderRightWidth(float v) { SET_VAR(surround, border.m_right.m_width, v); }
- void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v); }
- void setBorderRightColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_right, v); }
- void setBorderTopWidth(float v) { SET_VAR(surround, border.m_top.m_width, v); }
- void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v); }
- void setBorderTopColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_top, v); }
- void setBorderBottomWidth(float v) { SET_VAR(surround, border.m_bottom.m_width, v); }
- void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v); }
- void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v); }
-
- void setOutlineWidth(float v) { SET_VAR(m_background, m_outline.m_width, v); }
- void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_outline.m_isAuto, isAuto); }
- void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_style, v); }
- void setOutlineColor(const Color& v) { SET_BORDERVALUE_COLOR(m_background, m_outline, v); }
-
- void setOverflowX(EOverflow v) { noninherited_flags.setOverflowX(v); }
- void setOverflowY(EOverflow v) { noninherited_flags.setOverflowY(v); }
- void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
- void setVerticalAlign(EVerticalAlign v) { noninherited_flags.setVerticalAlign(v); }
- void setVerticalAlignLength(Length length) { setVerticalAlign(LENGTH); SET_VAR(m_box, m_verticalAlign, WTFMove(length)); }
-
- void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b); }
- void setClipLeft(Length length) { SET_VAR(visual, clip.left(), WTFMove(length)); }
- void setClipRight(Length length) { SET_VAR(visual, clip.right(), WTFMove(length)); }
- void setClipTop(Length length) { SET_VAR(visual, clip.top(), WTFMove(length)); }
- void setClipBottom(Length length) { SET_VAR(visual, clip.bottom(), WTFMove(length)); }
- void setClip(Length top, Length right, Length bottom, Length left);
- void setClip(LengthBox box) { SET_VAR(visual, clip, WTFMove(box)); }
-
- void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags.setUnicodeBidi(b); }
-
- void setClear(EClear v) { noninherited_flags.setClear(v); }
- void setTableLayout(ETableLayout v) { noninherited_flags.setTableLayout(v); }
-
- bool setFontDescription(const FontCascadeDescription&);
- // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
- void setFontSize(float);
-#if ENABLE(VARIATION_FONTS)
- void setFontVariationSettings(FontVariationSettings);
-#endif
-
- void setColor(const Color&);
- void setTextIndent(Length length) { SET_VAR(rareInheritedData, indent, WTFMove(length)); }
-#if ENABLE(CSS3_TEXT)
- void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_textIndentLine, v); }
- void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_textIndentType, v); }
-#endif
- void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
- void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
- void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations |= v; }
- void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations = v; }
- void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v); }
-#if ENABLE(CSS3_TEXT)
- void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v); }
- void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustify, v); }
-#endif
- void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
- void setTextDecorationSkip(TextDecorationSkip skip) { SET_VAR(rareInheritedData, m_textDecorationSkip, skip); }
- void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
- void setDirection(TextDirection v) { inherited_flags._direction = v; }
- void setHasExplicitlySetDirection(bool v) { noninherited_flags.setHasExplicitlySetDirection(v); }
-#if ENABLE(TEXT_AUTOSIZING)
- void setSpecifiedLineHeight(Length v);
-#endif
- void setLineHeight(Length specifiedLineHeight);
- bool setZoom(float);
- void setZoomWithoutReturnValue(float f) { setZoom(f); }
- bool setEffectiveZoom(float);
- void setTextZoom(TextZoom v) { SET_VAR(rareInheritedData, m_textZoom, v); }
-
-#if ENABLE(CSS_IMAGE_ORIENTATION)
- void setImageOrientation(ImageOrientationEnum v) { SET_VAR(rareInheritedData, m_imageOrientation, static_cast<int>(v)); }
-#endif
-
- void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_imageRendering, v); }
-
-#if ENABLE(CSS_IMAGE_RESOLUTION)
- void setImageResolutionSource(ImageResolutionSource v) { SET_VAR(rareInheritedData, m_imageResolutionSource, v); }
- void setImageResolutionSnap(ImageResolutionSnap v) { SET_VAR(rareInheritedData, m_imageResolutionSnap, v); }
- void setImageResolution(float f) { SET_VAR(rareInheritedData, m_imageResolution, f); }
-#endif
-
- void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
-
- void setWordSpacing(Length);
- void setLetterSpacing(float);
-
- void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
- void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
-
- void adjustBackgroundLayers()
- {
- if (backgroundLayers()->next()) {
- ensureBackgroundLayers().cullEmptyLayers();
- ensureBackgroundLayers().fillUnsetProperties();
- }
- }
-
- void clearMaskLayers() { rareNonInheritedData.access()->m_mask = FillLayer(MaskFillLayer); }
- void inheritMaskLayers(const FillLayer& parent) { rareNonInheritedData.access()->m_mask = parent; }
-
- void adjustMaskLayers()
- {
- if (maskLayers()->next()) {
- ensureMaskLayers().cullEmptyLayers();
- ensureMaskLayers().fillUnsetProperties();
- }
- }
-
- void setMaskImage(RefPtr<StyleImage>&& v) { rareNonInheritedData.access()->m_mask.setImage(WTFMove(v)); }
-
- void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b); }
- void setMaskBoxImageSource(RefPtr<StyleImage>&& v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(WTFMove(v)); }
- void setMaskXPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, WTFMove(length)); }
- void setMaskYPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, WTFMove(length)); }
- void setMaskSize(LengthSize size) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, WTFMove(size)); }
-
- void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_collapse = collapse; }
- void setHorizontalBorderSpacing(float);
- void setVerticalBorderSpacing(float);
- void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
- void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
-
- void setAspectRatioType(AspectRatioType aspectRatioType) { SET_VAR(rareNonInheritedData, m_aspectRatioType, aspectRatioType); }
- void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
- void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
-
- void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
- void setListStyleImage(RefPtr<StyleImage>&&);
- void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
-
- void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)); }
- void setMarginTop(Length length) { SET_VAR(surround, margin.top(), WTFMove(length)); }
- void setMarginBottom(Length length) { SET_VAR(surround, margin.bottom(), WTFMove(length)); }
- void setMarginLeft(Length length) { SET_VAR(surround, margin.left(), WTFMove(length)); }
- void setMarginRight(Length length) { SET_VAR(surround, margin.right(), WTFMove(length)); }
- void setMarginStart(Length);
- void setMarginEnd(Length);
-
- void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)); }
- void setPaddingBox(LengthBox box) { SET_VAR(surround, padding, WTFMove(box)); }
- void setPaddingTop(Length length) { SET_VAR(surround, padding.top(), WTFMove(length)); }
- void setPaddingBottom(Length length) { SET_VAR(surround, padding.bottom(), WTFMove(length)); }
- void setPaddingLeft(Length length) { SET_VAR(surround, padding.left(), WTFMove(length)); }
- void setPaddingRight(Length length) { SET_VAR(surround, padding.right(), WTFMove(length)); }
-
- void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
- void addCursor(RefPtr<StyleImage>&&, const IntPoint& hotSpot = IntPoint());
- void setCursorList(RefPtr<CursorList>&&);
- void clearCursorList();
-
-#if ENABLE(CURSOR_VISIBILITY)
- void setCursorVisibility(CursorVisibility c) { inherited_flags.m_cursorVisibility = c; }
-#endif
-
- void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
- void setIsLink(bool b) { noninherited_flags.setIsLink(b); }
-
- void setInsideDefaultButton(bool insideDefaultButton) { inherited_flags._insideDefaultButton = insideDefaultButton; }
-
- PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(inherited_flags.m_printColorAdjust); }
- void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printColorAdjust = value; }
-
- bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
- void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0); }
- int zIndex() const { return m_box->zIndex(); }
- void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v); }
-
- void setHasAutoWidows() { SET_VAR(rareInheritedData, m_hasAutoWidows, true); SET_VAR(rareInheritedData, widows, initialWidows()); }
- void setWidows(short w) { SET_VAR(rareInheritedData, m_hasAutoWidows, false); SET_VAR(rareInheritedData, widows, w); }
-
- void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true); SET_VAR(rareInheritedData, orphans, initialOrphans()); }
- void setOrphans(short o) { SET_VAR(rareInheritedData, m_hasAutoOrphans, false); SET_VAR(rareInheritedData, orphans, o); }
-
- // CSS3 Setters
- void setOutlineOffset(float v) { SET_VAR(m_background, m_outline.m_offset, v); }
- void setTextShadow(std::unique_ptr<ShadowData>, bool add = false);
- void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c); }
- void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w); }
- void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c); }
- void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(rareNonInheritedData, m_opacity, v); }
- void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
- // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
- void setBoxAlign(EBoxAlignment a) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, align, a); }
-#if ENABLE(CSS_BOX_DECORATION_BREAK)
- void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_box, m_boxDecorationBreak, b); }
-#endif
- void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
- void setBoxFlex(float f) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, flex, f); }
- void setBoxFlexGroup(unsigned int fg) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, flex_group, fg); }
- void setBoxLines(EBoxLines l) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, lines, l); }
- void setBoxOrdinalGroup(unsigned int og) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, ordinal_group, og); }
- void setBoxOrient(EBoxOrient o) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, orient, o); }
- void setBoxPack(EBoxPack p) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, pack, p); }
- void setBoxShadow(std::unique_ptr<ShadowData>, bool add = false);
- void setBoxReflect(RefPtr<StyleReflection>&& reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = WTFMove(reflect); }
- void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
- void setFlexGrow(float f) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexGrow, f); }
- void setFlexShrink(float f) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexShrink, f); }
- void setFlexBasis(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexBasis, WTFMove(length)); }
- void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, o); }
- void setAlignContent(const StyleContentAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignContent, data); }
- void setAlignContentPosition(ContentPosition position) { rareNonInheritedData.access()->m_alignContent.setPosition(position); }
- void setAlignContentOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_alignContent.setOverflow(overflow); }
- void setAlignContentDistribution(ContentDistributionType distribution) { rareNonInheritedData.access()->m_alignContent.setDistribution(distribution); }
- void setAlignItems(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignItems, data); }
- void setAlignItemsPosition(ItemPosition position) { rareNonInheritedData.access()->m_alignItems.setPosition(position); }
- void setAlignItemsOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_alignItems.setOverflow(overflow); }
- void setAlignSelf(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignSelf, data); }
- void setAlignSelfPosition(ItemPosition position) { rareNonInheritedData.access()->m_alignSelf.setPosition(position); }
- void setAlignSelfOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_alignSelf.setOverflow(overflow); }
- void setFlexDirection(EFlexDirection direction) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexDirection, direction); }
- void setFlexWrap(EFlexWrap w) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexWrap, w); }
- void setJustifyContent(const StyleContentAlignmentData& data) { SET_VAR(rareNonInheritedData, m_justifyContent, data); }
- void setJustifyContentPosition(ContentPosition position) { rareNonInheritedData.access()->m_justifyContent.setPosition(position); }
- void setJustifyContentOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_justifyContent.setOverflow(overflow); }
- void setJustifyContentDistribution(ContentDistributionType distribution) { rareNonInheritedData.access()->m_justifyContent.setDistribution(distribution); }
- void setJustifyItems(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_justifyItems, data); }
- void setJustifyItemsPosition(ItemPosition position) { rareNonInheritedData.access()->m_justifyItems.setPosition(position); }
- void setJustifyItemsOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_justifyItems.setOverflow(overflow); }
- void setJustifyItemsPositionType(ItemPositionType positionType) { rareNonInheritedData.access()->m_justifyItems.setPositionType(positionType); }
- void setJustifySelf(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_justifySelf, data); }
- void setJustifySelfPosition(ItemPosition position) { rareNonInheritedData.access()->m_justifySelf.setPosition(position); }
- void setJustifySelfOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_justifySelf.setOverflow(overflow); }
-#if ENABLE(CSS_GRID_LAYOUT)
- void setGridAutoColumns(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoColumns, trackSizeList); }
- void setGridAutoRows(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRows, trackSizeList); }
- void setGridColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridColumns, lengths); }
- void setGridRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridRows, lengths); }
- void setGridAutoRepeatColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRepeatColumns, lengths); }
- void setGridAutoRepeatRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRepeatRows, lengths); }
- void setGridAutoRepeatColumnsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatColumnsInsertionPoint, insertionPoint); }
- void setGridAutoRepeatRowsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatRowsInsertionPoint, insertionPoint); }
- void setGridAutoRepeatColumnsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatColumnsType, autoRepeatType); }
- void setGridAutoRepeatRowsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatRowsType, autoRepeatType); }
- void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridColumnLines, namedGridColumnLines); }
- void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridRowLines, namedGridRowLines); }
- void setOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_orderedNamedGridColumnLines, orderedNamedGridColumnLines); }
- void setOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_orderedNamedGridRowLines, orderedNamedGridRowLines); }
- void setAutoRepeatNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatNamedGridColumnLines, namedGridColumnLines); }
- void setAutoRepeatNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatNamedGridRowLines, namedGridRowLines); }
- void setAutoRepeatOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatOrderedNamedGridColumnLines, orderedNamedGridColumnLines); }
- void setAutoRepeatOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatOrderedNamedGridRowLines, orderedNamedGridRowLines); }
- void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridArea, namedGridArea); }
- void setNamedGridAreaRowCount(size_t rowCount) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridAreaRowCount, rowCount); }
- void setNamedGridAreaColumnCount(size_t columnCount) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridAreaColumnCount, columnCount); }
- void setGridAutoFlow(GridAutoFlow flow) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoFlow, flow); }
- void setGridItemColumnStart(const GridPosition& columnStartPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridColumnStart, columnStartPosition); }
- void setGridItemColumnEnd(const GridPosition& columnEndPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridColumnEnd, columnEndPosition); }
- void setGridItemRowStart(const GridPosition& rowStartPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridRowStart, rowStartPosition); }
- void setGridItemRowEnd(const GridPosition& rowEndPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridRowEnd, rowEndPosition); }
- void setGridColumnGap(const Length& v) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridColumnGap, v); }
- void setGridRowGap(const Length& v) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridRowGap, v); }
-#endif /* ENABLE(CSS_GRID_LAYOUT) */
- void setMarqueeIncrement(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, increment, WTFMove(length)); }
- void setMarqueeSpeed(int f) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, speed, f); }
- void setMarqueeDirection(EMarqueeDirection d) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, direction, d); }
- void setMarqueeBehavior(EMarqueeBehavior b) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, behavior, b); }
- void setMarqueeLoopCount(int i) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, loops, i); }
- void setUserModify(EUserModify u) { SET_VAR(rareInheritedData, userModify, u); }
- void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
- void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
- void setTextOverflow(TextOverflow overflow) { SET_VAR(rareNonInheritedData, textOverflow, overflow); }
- void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
- void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
- void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
- void setOverflowWrap(EOverflowWrap b) { SET_VAR(rareInheritedData, overflowWrap, b); }
- void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
- void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); }
- void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
- void setHyphenationLimitBefore(short limit) { SET_VAR(rareInheritedData, hyphenationLimitBefore, limit); }
- void setHyphenationLimitAfter(short limit) { SET_VAR(rareInheritedData, hyphenationLimitAfter, limit); }
- void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); }
- void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
- void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
- void setResize(EResize r) { SET_VAR(rareNonInheritedData, m_resize, r); }
- void setColumnAxis(ColumnAxis axis) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_axis, axis); }
- void setColumnProgression(ColumnProgression progression) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_progression, progression); }
- void setColumnWidth(float f) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoWidth, false); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_width, f); }
- void setHasAutoColumnWidth() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoWidth, true); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_width, 0); }
- void setColumnCount(unsigned short c) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoCount, false); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_count, c); }
- void setHasAutoColumnCount() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoCount, true); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_count, 0); }
- void setColumnFill(ColumnFill columnFill) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_fill, columnFill); }
- void setColumnGap(float f) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_normalGap, false); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_gap, f); }
- void setHasNormalColumnGap() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_normalGap, true); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_gap, 0); }
- void setColumnRuleColor(const Color& c) { SET_BORDERVALUE_COLOR(rareNonInheritedData.access()->m_multiCol, m_rule, c); }
- void setColumnRuleStyle(EBorderStyle b) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_rule.m_style, b); }
- void setColumnRuleWidth(unsigned short w) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_rule.m_width, w); }
- void resetColumnRule() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_rule, BorderValue()); }
- void setColumnSpan(ColumnSpan columnSpan) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_columnSpan, columnSpan); }
- void inheritColumnPropertiesFrom(const RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
- void setTransform(const TransformOperations& ops) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_operations, ops); }
- void setTransformOriginX(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_x, WTFMove(length)); }
- void setTransformOriginY(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_y, WTFMove(length)); }
- void setTransformOriginZ(float f) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_z, f); }
- void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
- void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
- void setTextDecorationColor(const Color& c) { SET_VAR(rareNonInheritedData, m_textDecorationColor, c); }
- void setTextEmphasisColor(const Color& c) { SET_VAR(rareInheritedData, textEmphasisColor, c); }
- void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
- void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
- void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
- void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
- bool setTextOrientation(TextOrientation);
-
- void setObjectFit(ObjectFit fit) { SET_VAR(rareNonInheritedData, m_objectFit, fit); }
- void setObjectPosition(const LengthPoint& position) { SET_VAR(rareNonInheritedData, m_objectPosition, position); }
-
- void setRubyPosition(RubyPosition position) { SET_VAR(rareInheritedData, m_rubyPosition, position); }
-
- void setFilter(const FilterOperations& ops) { SET_NESTED_VAR(rareNonInheritedData, m_filter, m_operations, ops); }
-#if ENABLE(FILTERS_LEVEL_2)
- void setBackdropFilter(const FilterOperations& ops) { SET_NESTED_VAR(rareNonInheritedData, m_backdropFilter, m_operations, ops); }
-#endif
-
- void setTabSize(unsigned size) { SET_VAR(rareInheritedData, m_tabSize, size); }
-
- void setBreakBefore(BreakBetween breakBehavior) { SET_VAR(rareNonInheritedData, m_breakBefore, breakBehavior); }
- void setBreakAfter(BreakBetween breakBehavior) { SET_VAR(rareNonInheritedData, m_breakAfter, breakBehavior); }
- void setBreakInside(BreakInside breakBehavior) { SET_VAR(rareNonInheritedData, m_breakInside, breakBehavior); }
-
- void setHangingPunctuation(HangingPunctuation punctuation) { SET_VAR(rareInheritedData, m_hangingPunctuation, punctuation); }
-
- // End CSS3 Setters
-
- void setLineGrid(const AtomicString& lineGrid) { SET_VAR(rareInheritedData, m_lineGrid, lineGrid); }
- void setLineSnap(LineSnap lineSnap) { SET_VAR(rareInheritedData, m_lineSnap, lineSnap); }
- void setLineAlign(LineAlign lineAlign) { SET_VAR(rareInheritedData, m_lineAlign, lineAlign); }
-
- void setFlowThread(const AtomicString& flowThread) { SET_VAR(rareNonInheritedData, m_flowThread, flowThread); }
- void setRegionThread(const AtomicString& regionThread) { SET_VAR(rareNonInheritedData, m_regionThread, regionThread); }
- void setRegionFragment(RegionFragment regionFragment) { SET_VAR(rareNonInheritedData, m_regionFragment, regionFragment); }
-
- // Apple-specific property setters
- void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; }
-
- void clearAnimations()
- {
- rareNonInheritedData.access()->m_animations = nullptr;
- }
-
- void clearTransitions()
- {
- rareNonInheritedData.access()->m_transitions = nullptr;
- }
-
- void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? std::make_unique<AnimationList>(*parent) : nullptr; }
- void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? std::make_unique<AnimationList>(*parent) : nullptr; }
- void adjustAnimations();
- void adjustTransitions();
-
- void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
- void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
- void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
- void setPerspectiveOriginX(Length length) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, WTFMove(length)); }
- void setPerspectiveOriginY(Length length) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, WTFMove(length)); }
- void setPageSize(LengthSize size) { SET_VAR(rareNonInheritedData, m_pageSize, WTFMove(size)); }
- void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageSizeType, t); }
- void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
-
- void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
- void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
-
- void setInitialLetter(const IntSize& size) { SET_VAR(rareNonInheritedData, m_initialLetter, size); }
-
-#if ENABLE(TOUCH_EVENTS)
- void setTouchAction(TouchAction touchAction) { SET_VAR(rareNonInheritedData, m_touchAction, static_cast<unsigned>(touchAction)); }
-#endif
-
-#if ENABLE(CSS_SCROLL_SNAP)
- // Scroll snap port style.
- void setScrollSnapType(const ScrollSnapType&);
- void setScrollPaddingTop(const Length&);
- void setScrollPaddingBottom(const Length&);
- void setScrollPaddingLeft(const Length&);
- void setScrollPaddingRight(const Length&);
-
- // Scroll snap area style.
- void setScrollSnapAlign(const ScrollSnapAlign&);
- void setScrollSnapMarginTop(const Length&);
- void setScrollSnapMarginBottom(const Length&);
- void setScrollSnapMarginLeft(const Length&);
- void setScrollSnapMarginRight(const Length&);
-#endif
-
-#if ENABLE(TOUCH_EVENTS)
- void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
-#endif
-
-#if PLATFORM(IOS)
- void setTouchCalloutEnabled(bool v) { SET_VAR(rareInheritedData, touchCalloutEnabled, v); }
-#endif
-
-#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
- void setUseTouchOverflowScrolling(bool v) { SET_VAR(rareInheritedData, useTouchOverflowScrolling, v); }
-#endif
-
-#if ENABLE(TEXT_AUTOSIZING)
- void setTextSizeAdjust(TextSizeAdjustment anAdjustment) { SET_VAR(rareInheritedData, textSizeAdjust, anAdjustment); }
-#endif
-
- void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
-
-#if ENABLE(CSS_TRAILING_WORD)
- void setTrailingWord(TrailingWord v) { SET_VAR(rareInheritedData, trailingWord, static_cast<unsigned>(v)); }
-#endif
-
-#if ENABLE(APPLE_PAY)
- void setApplePayButtonStyle(ApplePayButtonStyle v) { SET_VAR(rareNonInheritedData, m_applePayButtonStyle, static_cast<unsigned>(v)); }
- void setApplePayButtonType(ApplePayButtonType v) { SET_VAR(rareNonInheritedData, m_applePayButtonType, static_cast<unsigned>(v)); }
-#endif
-
- const SVGRenderStyle& svgStyle() const { return *m_svgStyle; }
- SVGRenderStyle& accessSVGStyle() { return *m_svgStyle.access(); }
-
- const SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(); }
- Color fillPaintColor() const { return svgStyle().fillPaintColor(); }
- void setFillPaintColor(const Color& c) { accessSVGStyle().setFillPaint(SVG_PAINTTYPE_RGBCOLOR, c, ""); }
- float fillOpacity() const { return svgStyle().fillOpacity(); }
- void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); }
-
- const SVGPaintType& strokePaintType() const { return svgStyle().strokePaintType(); }
- Color strokePaintColor() const { return svgStyle().strokePaintColor(); }
- void setStrokePaintColor(const Color& c) { accessSVGStyle().setStrokePaint(SVG_PAINTTYPE_RGBCOLOR, c, ""); }
- float strokeOpacity() const { return svgStyle().strokeOpacity(); }
- void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); }
- const Length& strokeWidth() const { return svgStyle().strokeWidth(); }
- void setStrokeWidth(Length w) { accessSVGStyle().setStrokeWidth(w); }
- Vector<SVGLengthValue> strokeDashArray() const { return svgStyle().strokeDashArray(); }
- void setStrokeDashArray(Vector<SVGLengthValue> array) { accessSVGStyle().setStrokeDashArray(array); }
- const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(); }
- void setStrokeDashOffset(Length d) { accessSVGStyle().setStrokeDashOffset(d); }
- float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); }
- void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); }
-
- const Length& cx() const { return svgStyle().cx(); }
- void setCx(Length cx) { accessSVGStyle().setCx(cx); }
- const Length& cy() const { return svgStyle().cy(); }
- void setCy(Length cy) { accessSVGStyle().setCy(cy); }
- const Length& r() const { return svgStyle().r(); }
- void setR(Length r) { accessSVGStyle().setR(r); }
- const Length& rx() const { return svgStyle().rx(); }
- void setRx(Length rx) { accessSVGStyle().setRx(rx); }
- const Length& ry() const { return svgStyle().ry(); }
- void setRy(Length ry) { accessSVGStyle().setRy(ry); }
- const Length& x() const { return svgStyle().x(); }
- void setX(Length x) { accessSVGStyle().setX(x); }
- const Length& y() const { return svgStyle().y(); }
- void setY(Length y) { accessSVGStyle().setY(y); }
-
- float floodOpacity() const { return svgStyle().floodOpacity(); }
- void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); }
-
- float stopOpacity() const { return svgStyle().stopOpacity(); }
- void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); }
-
- void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); }
- void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); }
- void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c); }
-
- SVGLengthValue baselineShiftValue() const { return svgStyle().baselineShiftValue(); }
- void setBaselineShiftValue(SVGLengthValue s) { accessSVGStyle().setBaselineShiftValue(s); }
- SVGLengthValue kerning() const { return svgStyle().kerning(); }
- void setKerning(SVGLengthValue k) { accessSVGStyle().setKerning(k); }
-
- void setShapeOutside(RefPtr<ShapeValue>&& value)
- {
- if (rareNonInheritedData->m_shapeOutside == value)
- return;
- rareNonInheritedData.access()->m_shapeOutside = WTFMove(value);
- }
- ShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
-
- static ShapeValue* initialShapeOutside() { return 0; }
-
- const Length& shapeMargin() const { return rareNonInheritedData->m_shapeMargin; }
- void setShapeMargin(Length shapeMargin) { SET_VAR(rareNonInheritedData, m_shapeMargin, WTFMove(shapeMargin)); }
- static Length initialShapeMargin() { return Length(0, Fixed); }
-
- float shapeImageThreshold() const { return rareNonInheritedData->m_shapeImageThreshold; }
- void setShapeImageThreshold(float shapeImageThreshold)
- {
- float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0, 1);
- SET_VAR(rareNonInheritedData, m_shapeImageThreshold, clampedShapeImageThreshold);
- }
- static float initialShapeImageThreshold() { return 0; }
-
- void setClipPath(RefPtr<ClipPathOperation>&& operation)
- {
- if (rareNonInheritedData->m_clipPath != operation)
- rareNonInheritedData.access()->m_clipPath = WTFMove(operation);
- }
- ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPath.get(); }
-
- static ClipPathOperation* initialClipPath() { return nullptr; }
-
- bool hasContent() const { return contentData(); }
- const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); }
- bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }
- void clearContent();
- void setContent(const String&, bool add = false);
- void setContent(RefPtr<StyleImage>&&, bool add = false);
- void setContent(std::unique_ptr<CounterContent>, bool add = false);
- void setContent(QuoteType, bool add = false);
- void setContentAltText(const String&);
- const String& contentAltText() const;
- bool hasAttrContent() const { return rareNonInheritedData->m_hasAttrContent; }
- void setHasAttrContent();
-
- const CounterDirectiveMap* counterDirectives() const;
- CounterDirectiveMap& accessCounterDirectives();
- const CounterDirectives getCounterDirectives(const AtomicString& identifier) const;
-
- QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
- void setQuotes(RefPtr<QuotesData>&&);
-
- WillChangeData* willChange() const { return rareNonInheritedData->m_willChange.get(); }
- void setWillChange(RefPtr<WillChangeData>&&);
-
- bool willChangeCreatesStackingContext() const
- {
- if (!willChange())
- return false;
-
- return willChange()->canCreateStackingContext();
- }
-
- const AtomicString& hyphenString() const;
-
- bool inheritedNotEqual(const RenderStyle*) const;
- bool inheritedDataShared(const RenderStyle*) const;
-
-#if ENABLE(TEXT_AUTOSIZING)
- uint32_t hashForTextAutosizing() const;
- bool equalForTextAutosizing(const RenderStyle&) const;
-#endif
-
- StyleDifference diff(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
- bool diffRequiresLayerRepaint(const RenderStyle&, bool isComposited) const;
-
- bool isDisplayReplacedType() const { return isDisplayReplacedType(display()); }
- bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
- bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
- bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleOrGridBox(display()); }
- bool isDisplayFlexibleBox() const { return isDisplayFlexibleBox(display()); }
- bool isDisplayRegionType() const
- {
- return display() == BLOCK || display() == INLINE_BLOCK
- || display() == TABLE_CELL || display() == TABLE_CAPTION
- || display() == LIST_ITEM;
- }
-
- bool setWritingMode(WritingMode v)
- {
- if (v == writingMode())
- return false;
-
- inherited_flags.m_writingMode = v;
- return true;
- }
-
- bool hasExplicitlySetWritingMode() const { return noninherited_flags.hasExplicitlySetWritingMode(); }
- void setHasExplicitlySetWritingMode(bool v) { noninherited_flags.setHasExplicitlySetWritingMode(v); }
-
- // A unique style is one that has matches something that makes it impossible to share.
- bool unique() const { return noninherited_flags.isUnique(); }
- void setUnique() { noninherited_flags.setIsUnique(); }
-
- bool emptyState() const { return noninherited_flags.emptyState(); }
- void setEmptyState(bool b) { setUnique(); noninherited_flags.setEmptyState(b); }
- bool firstChildState() const { return noninherited_flags.firstChildState(); }
- void setFirstChildState() { setUnique(); noninherited_flags.setFirstChildState(true); }
- bool lastChildState() const { return noninherited_flags.lastChildState(); }
- void setLastChildState() { setUnique(); noninherited_flags.setLastChildState(true); }
-
- WEBCORE_EXPORT Color visitedDependentColor(int colorProperty) const;
- bool backgroundColorEqualsToColorIgnoringVisited(const Color& color) const { return color == backgroundColor(); }
-
- void setHasExplicitlyInheritedProperties() { noninherited_flags.setHasExplicitlyInheritedProperties(true); }
- bool hasExplicitlyInheritedProperties() const { return noninherited_flags.hasExplicitlyInheritedProperties(); }
-
- // Initial values for all the properties
- static EOverflow initialOverflowX() { return OVISIBLE; }
- static EOverflow initialOverflowY() { return OVISIBLE; }
- static EClear initialClear() { return CNONE; }
- static EDisplay initialDisplay() { return INLINE; }
- static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
- static EPosition initialPosition() { return StaticPosition; }
- static EVerticalAlign initialVerticalAlign() { return BASELINE; }
- static EFloat initialFloating() { return NoFloat; }
- static BreakBetween initialBreakBetween() { return AutoBreakBetween; }
- static BreakInside initialBreakInside() { return AutoBreakInside; }
- static HangingPunctuation initialHangingPunctuation() { return NoHangingPunctuation; }
- static ETableLayout initialTableLayout() { return TAUTO; }
- static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
- static EBorderStyle initialBorderStyle() { return BNONE; }
- static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
- static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
- static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
- static ECaptionSide initialCaptionSide() { return CAPTOP; }
- static ColumnAxis initialColumnAxis() { return AutoColumnAxis; }
- static ColumnProgression initialColumnProgression() { return NormalColumnProgression; }
- static TextDirection initialDirection() { return LTR; }
- static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
- static TextCombine initialTextCombine() { return TextCombineNone; }
- static TextOrientation initialTextOrientation() { return TextOrientation::
- Mixed; }
- static ObjectFit initialObjectFit() { return ObjectFitFill; }
- static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); }
- static EEmptyCell initialEmptyCells() { return SHOW; }
- static EListStylePosition initialListStylePosition() { return OUTSIDE; }
- static EListStyleType initialListStyleType() { return Disc; }
- static ETextTransform initialTextTransform() { return TTNONE; }
- static EVisibility initialVisibility() { return VISIBLE; }
- static EWhiteSpace initialWhiteSpace() { return NORMAL; }
- static float initialHorizontalBorderSpacing() { return 0; }
- static float initialVerticalBorderSpacing() { return 0; }
- static ECursor initialCursor() { return CursorAuto; }
-#if ENABLE(CURSOR_VISIBILITY)
- static CursorVisibility initialCursorVisibility() { return CursorVisibilityAuto; }
-#endif
- static Color initialColor() { return Color::black; }
- static StyleImage* initialListStyleImage() { return 0; }
- static float initialBorderWidth() { return 3; }
- static unsigned short initialColumnRuleWidth() { return 3; }
- static float initialOutlineWidth() { return 3; }
- static float initialLetterSpacing() { return 0; }
- static Length initialWordSpacing() { return Length(Fixed); }
- static Length initialSize() { return Length(); }
- static Length initialMinSize() { return Length(); }
- static Length initialMaxSize() { return Length(Undefined); }
- static Length initialOffset() { return Length(); }
- static Length initialMargin() { return Length(Fixed); }
- static Length initialPadding() { return Length(Fixed); }
- static Length initialTextIndent() { return Length(Fixed); }
- static Length initialZeroLength() { return Length(Fixed); }
- static Length initialOneLength() { return Length(1, Fixed); }
-#if ENABLE(CSS3_TEXT)
- static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; }
- static TextIndentType initialTextIndentType() { return TextIndentNormal; }
-#endif
- static short initialWidows() { return 2; }
- static short initialOrphans() { return 2; }
- static Length initialLineHeight() { return Length(-100.0f, Percent); }
-#if ENABLE(TEXT_AUTOSIZING)
- static Length initialSpecifiedLineHeight() { return Length(-100.0f, Percent); }
-#endif
- static ETextAlign initialTextAlign() { return TASTART; }
- static TextDecoration initialTextDecoration() { return TextDecorationNone; }
-#if ENABLE(CSS3_TEXT)
- static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
- static TextJustify initialTextJustify() { return TextJustifyAuto; }
-#endif // CSS3_TEXT
- static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
- static TextDecorationSkip initialTextDecorationSkip() { return TextDecorationSkipAuto; }
- static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; }
- static float initialZoom() { return 1.0f; }
- static TextZoom initialTextZoom() { return TextZoomNormal; }
- static float initialOutlineOffset() { return 0; }
- static float initialOpacity() { return 1.0f; }
- static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
- static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; }
- static EBoxDirection initialBoxDirection() { return BNORMAL; }
- static EBoxLines initialBoxLines() { return SINGLE; }
- static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
- static EBoxPack initialBoxPack() { return Start; }
- static float initialBoxFlex() { return 0.0f; }
- static unsigned int initialBoxFlexGroup() { return 1; }
- static unsigned int initialBoxOrdinalGroup() { return 1; }
- static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
- static StyleReflection* initialBoxReflect() { return 0; }
- static float initialFlexGrow() { return 0; }
- static float initialFlexShrink() { return 1; }
- static Length initialFlexBasis() { return Length(Auto); }
- static int initialOrder() { return 0; }
- static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); }
- static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(isCSSGridLayoutEnabled() ? ItemPositionNormal : ItemPositionStretch, OverflowAlignmentDefault); }
- static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAlignmentDefault); }
- static EFlexDirection initialFlexDirection() { return FlowRow; }
- static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
- static int initialMarqueeLoopCount() { return -1; }
- static int initialMarqueeSpeed() { return 85; }
- static Length initialMarqueeIncrement() { return Length(6, Fixed); }
- static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
- static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
- static EUserModify initialUserModify() { return READ_ONLY; }
- static EUserDrag initialUserDrag() { return DRAG_AUTO; }
- static EUserSelect initialUserSelect() { return SELECT_TEXT; }
- static TextOverflow initialTextOverflow() { return TextOverflowClip; }
- static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
- static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
- static EWordBreak initialWordBreak() { return NormalWordBreak; }
- static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; }
- static ENBSPMode initialNBSPMode() { return NBNORMAL; }
- static LineBreak initialLineBreak() { return LineBreakAuto; }
- static ESpeak initialSpeak() { return SpeakNormal; }
- static Hyphens initialHyphens() { return HyphensManual; }
- static short initialHyphenationLimitBefore() { return -1; }
- static short initialHyphenationLimitAfter() { return -1; }
- static short initialHyphenationLimitLines() { return -1; }
- static const AtomicString& initialHyphenationString() { return nullAtom; }
- static EBorderFit initialBorderFit() { return BorderFitBorder; }
- static EResize initialResize() { return RESIZE_NONE; }
- static ControlPart initialAppearance() { return NoControlPart; }
- static AspectRatioType initialAspectRatioType() { return AspectRatioAuto; }
- static float initialAspectRatioDenominator() { return 1; }
- static float initialAspectRatioNumerator() { return 1; }
- static Order initialRTLOrdering() { return LogicalOrder; }
- static float initialTextStrokeWidth() { return 0; }
- static unsigned short initialColumnCount() { return 1; }
- static ColumnFill initialColumnFill() { return ColumnFillBalance; }
- static ColumnSpan initialColumnSpan() { return ColumnSpanNone; }
- static const TransformOperations& initialTransform() { static NeverDestroyed<TransformOperations> ops; return ops; }
- static Length initialTransformOriginX() { return Length(50.0f, Percent); }
- static Length initialTransformOriginY() { return Length(50.0f, Percent); }
- static EPointerEvents initialPointerEvents() { return PE_AUTO; }
- static float initialTransformOriginZ() { return 0; }
- static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
- static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
- static float initialPerspective() { return 0; }
- static Length initialPerspectiveOriginX() { return Length(50.0f, Percent); }
- static Length initialPerspectiveOriginY() { return Length(50.0f, Percent); }
- static Color initialBackgroundColor() { return Color::transparent; }
- static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
- static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
- static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
- static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
- static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver | TextEmphasisPositionRight; }
- static RubyPosition initialRubyPosition() { return RubyPositionBefore; }
- static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
- static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; }
- static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
- static ImageResolutionSource initialImageResolutionSource() { return ImageResolutionSpecified; }
- static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionNoSnap; }
- static float initialImageResolution() { return 1; }
- static StyleImage* initialBorderImageSource() { return nullptr; }
- static StyleImage* initialMaskBoxImageSource() { return nullptr; }
- static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
- static QuotesData* initialQuotes() { return nullptr; }
- static const AtomicString& initialContentAltText() { return emptyAtom; }
-
- static bool isCSSGridLayoutEnabled();
-
- static WillChangeData* initialWillChange() { return nullptr; }
-
-#if ENABLE(TOUCH_EVENTS)
- static TouchAction initialTouchAction() { return TouchAction::Auto; }
-#endif
-
-#if ENABLE(CSS_SCROLL_SNAP)
- static ScrollSnapType initialScrollSnapType();
- static ScrollSnapAlign initialScrollSnapAlign();
- static Length initialScrollSnapMargin() { return Length(Fixed); }
- static Length initialScrollPadding() { return Length(Fixed); }
-#endif
-
-#if ENABLE(CSS_TRAILING_WORD)
- static TrailingWord initialTrailingWord() { return TrailingWord::Auto; }
-#endif
-
-#if ENABLE(APPLE_PAY)
- static ApplePayButtonStyle initialApplePayButtonStyle() { return ApplePayButtonStyle::Black; }
- static ApplePayButtonType initialApplePayButtonType() { return ApplePayButtonType::Plain; }
-#endif
-
-#if ENABLE(CSS_GRID_LAYOUT)
- // The initial value is 'none' for grid tracks.
- static Vector<GridTrackSize> initialGridColumns() { return Vector<GridTrackSize>(); }
- static Vector<GridTrackSize> initialGridRows() { return Vector<GridTrackSize>(); }
-
- static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<GridTrackSize>(); }
- static unsigned initialGridAutoRepeatInsertionPoint() { return 0; }
- static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; }
-
- static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; }
-
- static Vector<GridTrackSize> initialGridAutoColumns() { return { GridTrackSize(Length(Auto)) }; }
- static Vector<GridTrackSize> initialGridAutoRows() { return { GridTrackSize(Length(Auto)) }; }
-
- static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap(); }
- static size_t initialNamedGridAreaCount() { return 0; }
-
- static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLinesMap(); }
- static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesMap(); }
-
- static OrderedNamedGridLinesMap initialOrderedNamedGridColumnLines() { return OrderedNamedGridLinesMap(); }
- static OrderedNamedGridLinesMap initialOrderedNamedGridRowLines() { return OrderedNamedGridLinesMap(); }
-
- static Length initialGridColumnGap() { return Length(Fixed); }
- static Length initialGridRowGap() { return Length(Fixed); }
-
- // 'auto' is the default.
- static GridPosition initialGridItemColumnStart() { return GridPosition(); }
- static GridPosition initialGridItemColumnEnd() { return GridPosition(); }
- static GridPosition initialGridItemRowStart() { return GridPosition(); }
- static GridPosition initialGridItemRowEnd() { return GridPosition(); }
-#endif /* ENABLE(CSS_GRID_LAYOUT) */
-
- static unsigned initialTabSize() { return 8; }
-
- static const AtomicString& initialLineGrid() { return nullAtom; }
- static LineSnap initialLineSnap() { return LineSnapNone; }
- static LineAlign initialLineAlign() { return LineAlignNone; }
-
- static const AtomicString& initialFlowThread() { return nullAtom; }
- static const AtomicString& initialRegionThread() { return nullAtom; }
- static RegionFragment initialRegionFragment() { return AutoRegionFragment; }
-
- // Keep these at the end.
- static IntSize initialInitialLetter() { return IntSize(); }
- static LineClampValue initialLineClamp() { return LineClampValue(); }
- static ETextSecurity initialTextSecurity() { return TSNONE; }
-#if ENABLE(TEXT_AUTOSIZING)
- static TextSizeAdjustment initialTextSizeAdjust() { return TextSizeAdjustment(); }
-#endif
-#if PLATFORM(IOS)
- static bool initialTouchCalloutEnabled() { return true; }
-#endif
-#if ENABLE(TOUCH_EVENTS)
- static Color initialTapHighlightColor();
-#endif
-#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
- static bool initialUseTouchOverflowScrolling() { return false; }
-#endif
-#if ENABLE(DASHBOARD_SUPPORT)
- static const Vector<StyleDashboardRegion>& initialDashboardRegions();
- static const Vector<StyleDashboardRegion>& noneDashboardRegions();
-#endif
- static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
-#if ENABLE(FILTERS_LEVEL_2)
- static const FilterOperations& initialBackdropFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
-#endif
-#if ENABLE(CSS_COMPOSITING)
- static BlendMode initialBlendMode() { return BlendModeNormal; }
- static Isolation initialIsolation() { return IsolationAuto; }
-#endif
-
- bool isPlaceholderStyle() const { return rareNonInheritedData->m_isPlaceholderStyle; }
- void setIsPlaceholderStyle() { SET_VAR(rareNonInheritedData, m_isPlaceholderStyle, true); }
-
- static ptrdiff_t noninheritedFlagsMemoryOffset() { return OBJECT_OFFSETOF(RenderStyle, noninherited_flags); }
+ Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
-private:
bool changeAffectsVisualOverflow(const RenderStyle&) const;
bool changeRequiresLayout(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
bool changeRequiresPositionedLayoutOnly(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
@@ -2193,103 +1931,144 @@
bool changeRequiresRepaintIfTextOrBorderOrOutline(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
bool changeRequiresRecompositeLayer(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
- void setVisitedLinkColor(const Color&);
- void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v); }
- void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v); }
- void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v); }
- void setVisitedLinkBorderBottomColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderBottomColor, v); }
- void setVisitedLinkBorderTopColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderTopColor, v); }
- void setVisitedLinkOutlineColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkOutlineColor, v); }
- void setVisitedLinkColumnRuleColor(const Color& v) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_visitedLinkColumnRuleColor, v); }
- void setVisitedLinkTextDecorationColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkTextDecorationColor, v); }
- void setVisitedLinkTextEmphasisColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextEmphasisColor, v); }
- void setVisitedLinkTextFillColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextFillColor, v); }
- void setVisitedLinkTextStrokeColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextStrokeColor, v); }
+ // non-inherited attributes
+ DataRef<StyleBoxData> m_boxData;
+ DataRef<StyleVisualData> m_visualData;
+ DataRef<StyleBackgroundData> m_backgroundData;
+ DataRef<StyleSurroundData> m_surroundData;
+ DataRef<StyleRareNonInheritedData> m_rareNonInheritedData;
+ NonInheritedFlags m_nonInheritedFlags;
- void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags.setUnicodeBidi(parent->noninherited_flags.unicodeBidi()); }
- void getShadowExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const;
- LayoutBoxExtent getShadowInsetExtent(const ShadowData*) const;
- void getShadowHorizontalExtent(const ShadowData*, LayoutUnit& left, LayoutUnit& right) const;
- void getShadowVerticalExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& bottom) const;
- void getShadowInlineDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const
- {
- return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
- }
- void getShadowBlockDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const
- {
- return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
- }
+ // inherited attributes
+ DataRef<StyleRareInheritedData> m_rareInheritedData;
+ DataRef<StyleInheritedData> m_inheritedData;
+ InheritedFlags m_inheritedFlags;
- bool isDisplayReplacedType(EDisplay display) const
- {
- return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_FLEX
-#if ENABLE(CSS_GRID_LAYOUT)
- || display == INLINE_GRID
+ // list of associated pseudo styles
+ std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles;
+
+ DataRef<SVGRenderStyle> m_svgStyle;
+
+#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
+ bool m_deletionHasBegun { false };
#endif
- || display == INLINE_TABLE;
- }
-
- bool isDisplayInlineType(EDisplay display) const
- {
- return display == INLINE || isDisplayReplacedType(display);
- }
-
- bool isDisplayFlexibleBox(EDisplay display) const
- {
- return display == FLEX || display == INLINE_FLEX;
- }
-
- bool isDisplayGridBox(EDisplay display) const
- {
-#if ENABLE(CSS_GRID_LAYOUT)
- return display == GRID || display == INLINE_GRID;
-#else
- UNUSED_PARAM(display);
- return false;
-#endif
- }
-
- bool isDisplayFlexibleOrGridBox(EDisplay display) const
- {
- return isDisplayFlexibleBox(display) || isDisplayGridBox(display);
- }
-
- // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
- static Color invalidColor() { return Color(); }
- const Color& borderLeftColor() const { return surround->border.left().color(); }
- const Color& borderRightColor() const { return surround->border.right().color(); }
- const Color& borderTopColor() const { return surround->border.top().color(); }
- const Color& borderBottomColor() const { return surround->border.bottom().color(); }
- const Color& backgroundColor() const { return m_background->color(); }
- const Color& color() const;
- const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
- const Color& outlineColor() const { return m_background->outline().color(); }
- const Color& textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
- const Color& textFillColor() const { return rareInheritedData->textFillColor; }
- const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
- const Color& visitedLinkColor() const;
- const Color& visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
- const Color& visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
- const Color& visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
- const Color& visitedLinkBorderBottomColor() const { return rareNonInheritedData->m_visitedLinkBorderBottomColor; }
- const Color& visitedLinkBorderTopColor() const { return rareNonInheritedData->m_visitedLinkBorderTopColor; }
- const Color& visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; }
- const Color& visitedLinkColumnRuleColor() const { return rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor; }
- const Color& textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; }
- const Color& visitedLinkTextDecorationColor() const { return rareNonInheritedData->m_visitedLinkTextDecorationColor; }
- const Color& visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor; }
- const Color& visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor; }
- const Color& visitedLinkTextStrokeColor() const { return rareInheritedData->visitedLinkTextStrokeColor; }
-
- Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
-
- const Color& stopColor() const { return svgStyle().stopColor(); }
- const Color& floodColor() const { return svgStyle().floodColor(); }
- const Color& lightingColor() const { return svgStyle().lightingColor(); }
-
- void appendContent(std::unique_ptr<ContentData>);
};
+int adjustForAbsoluteZoom(int, const RenderStyle&);
+float adjustFloatForAbsoluteZoom(float, const RenderStyle&);
+LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit, const RenderStyle&);
+
+EBorderStyle collapsedBorderStyle(EBorderStyle);
+
+bool pseudoElementRendererIsNeeded(const RenderStyle*);
+
+inline RenderStyle::NonInheritedFlags::NonInheritedFlags()
+{
+ // All these initial values need to be zero so that zero-initializing m_flags is correct.
+ ASSERT(!initialOverflowX());
+ ASSERT(!initialOverflowY());
+ ASSERT(!initialClear());
+ ASSERT(!initialDisplay());
+ ASSERT(!initialUnicodeBidi());
+ ASSERT(!initialPosition());
+ ASSERT(!initialVerticalAlign());
+ ASSERT(!initialFloating());
+ ASSERT(!initialTableLayout());
+}
+
+inline void RenderStyle::NonInheritedFlags::copyNonInheritedFrom(const NonInheritedFlags& other)
+{
+ // Only a subset is copied because NonInheritedFlags contains a bunch of stuff other than real style data.
+ uint64_t nonInheritedMask = overflowMask << overflowXOffset
+ | overflowMask << overflowYOffset
+ | clearMask << clearOffset
+ | displayMask << effectiveDisplayOffset
+ | positionMask << positionOffset
+ | displayMask << originalDisplayOffset
+ | unicodeBidiMask << unicodeBidiOffset
+ | verticalAlignMask << verticalAlignOffset
+ | floatingMask << floatingOffset
+ | oneBitMask << explicitInheritanceOffset
+ | tableLayoutBitMask << tableLayoutOffset
+ | hasViewportUnitsBitMask << hasViewportUnitsOffset;
+
+ m_flags = (m_flags & ~nonInheritedMask) | (other.m_flags & nonInheritedMask);
+}
+
+inline bool RenderStyle::NonInheritedFlags::hasPseudoStyle(PseudoId pseudo) const
+{
+ ASSERT(pseudo > NOPSEUDO);
+ ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
+ return (oneBitMask << (pseudoBitsOffset - 1 + pseudo)) & m_flags;
+}
+
+inline void RenderStyle::NonInheritedFlags::setHasPseudoStyle(PseudoId pseudo)
+{
+ ASSERT(pseudo > NOPSEUDO);
+ ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
+ m_flags |= oneBitMask << (pseudoBitsOffset - 1 + pseudo);
+}
+
+inline void RenderStyle::NonInheritedFlags::setHasPseudoStyles(PseudoIdSet pseudoIdSet)
+{
+ ASSERT(pseudoIdSet);
+ uint64_t rawPseudoIdSet = pseudoIdSet.data();
+ ASSERT((rawPseudoIdSet & PUBLIC_PSEUDOID_MASK) == rawPseudoIdSet);
+ static_assert(pseudoBitsOffset >= 1, "(pseudoBitsOffset - 1) should be valid.");
+ m_flags |= (static_cast<uint64_t>(rawPseudoIdSet) << (pseudoBitsOffset - 1));
+}
+
+inline void RenderStyle::NonInheritedFlags::updateBoolean(bool isSet, uint64_t offset)
+{
+ if (isSet)
+ m_flags |= (oneBitMask << offset);
+ else
+ m_flags &= ~(oneBitMask << offset);
+}
+
+inline bool RenderStyle::NonInheritedFlags::getBoolean(uint64_t offset) const
+{
+ return m_flags & (oneBitMask << offset);
+}
+
+inline void RenderStyle::NonInheritedFlags::updateValue(uint8_t newValue, uint64_t positionIndependentMask, uint64_t offset)
+{
+ ASSERT(!(newValue & ~positionIndependentMask));
+ uint64_t positionDependentMask = positionIndependentMask << offset;
+ m_flags = (m_flags & ~positionDependentMask) | (static_cast<uint64_t>(newValue) << offset);
+}
+
+inline bool RenderStyle::InheritedFlags::operator==(const InheritedFlags& other) const
+{
+ return emptyCells == other.emptyCells
+ && captionSide == other.captionSide
+ && listStyleType == other.listStyleType
+ && listStylePosition == other.listStylePosition
+ && visibility == other.visibility
+ && textAlign == other.textAlign
+ && textTransform == other.textTransform
+ && textDecorations == other.textDecorations
+ && cursor == other.cursor
+#if ENABLE(CURSOR_VISIBILITY)
+ && cursorVisibility == other.cursorVisibility
+#endif
+ && direction == other.direction
+ && whiteSpace == other.whiteSpace
+ && borderCollapse == other.borderCollapse
+ && boxDirection == other.boxDirection
+ && rtlOrdering == other.rtlOrdering
+ && printColorAdjust == other.printColorAdjust
+ && pointerEvents == other.pointerEvents
+ && insideLink == other.insideLink
+ && insideDefaultButton == other.insideDefaultButton
+ && writingMode == other.writingMode;
+}
+
+inline unsigned RenderStyle::NonInheritedFlags::getValue(uint64_t positionIndependentMask, uint64_t offset) const
+{
+ return static_cast<unsigned>((m_flags >> offset) & positionIndependentMask);
+}
+
inline int adjustForAbsoluteZoom(int value, const RenderStyle& style)
{
double zoomFactor = style.effectiveZoom();
@@ -2325,50 +2104,256 @@
return style;
}
-inline bool RenderStyle::setZoom(float f)
+inline bool RenderStyle::hasBackground() const
{
- setEffectiveZoom(effectiveZoom() * f);
- if (compareEqual(visual->m_zoom, f))
+ return visitedDependentColor(CSSPropertyBackgroundColor).isVisible() || hasBackgroundImage();
+}
+
+inline bool RenderStyle::autoWrap(EWhiteSpace whiteSpace)
+{
+ // Nowrap and pre don't automatically wrap.
+ return whiteSpace != NOWRAP && whiteSpace != PRE;
+}
+
+inline bool RenderStyle::preserveNewline(EWhiteSpace whiteSpace)
+{
+ // Normal and nowrap do not preserve newlines.
+ return whiteSpace != NORMAL && whiteSpace != NOWRAP;
+}
+
+inline bool RenderStyle::collapseWhiteSpace(EWhiteSpace ws)
+{
+ // Pre and prewrap do not collapse whitespace.
+ return ws != PRE && ws != PRE_WRAP;
+}
+
+inline bool RenderStyle::isCollapsibleWhiteSpace(UChar character) const
+{
+ switch (character) {
+ case ' ':
+ case '\t':
+ return collapseWhiteSpace();
+ case '\n':
+ return !preserveNewline();
+ default:
return false;
- visual.access()->m_zoom = f;
+ }
+}
+
+inline bool RenderStyle::breakOnlyAfterWhiteSpace() const
+{
+ return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpace;
+}
+
+inline bool RenderStyle::breakWords() const
+{
+ return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowWrap;
+}
+
+inline bool RenderStyle::hasInlineColumnAxis() const
+{
+ auto axis = columnAxis();
+ return axis == AutoColumnAxis || isHorizontalWritingMode() == (axis == HorizontalColumnAxis);
+}
+
+inline ImageOrientationEnum RenderStyle::imageOrientation() const
+{
+#if ENABLE(CSS_IMAGE_ORIENTATION)
+ return static_cast<ImageOrientationEnum>(m_rareInheritedData->imageOrientation);
+#else
+ return DefaultImageOrientation;
+#endif
+}
+
+inline void RenderStyle::setLogicalWidth(Length&& logicalWidth)
+{
+ if (isHorizontalWritingMode())
+ setWidth(WTFMove(logicalWidth));
+ else
+ setHeight(WTFMove(logicalWidth));
+}
+
+inline void RenderStyle::setLogicalHeight(Length&& logicalHeight)
+{
+ if (isHorizontalWritingMode())
+ setHeight(WTFMove(logicalHeight));
+ else
+ setWidth(WTFMove(logicalHeight));
+}
+
+inline void RenderStyle::setBorderRadius(LengthSize&& size)
+{
+ auto topLeft = size;
+ setBorderTopLeftRadius(WTFMove(topLeft));
+ auto topRight = size;
+ setBorderTopRightRadius(WTFMove(topRight));
+ auto bottomLeft = size;
+ setBorderBottomLeftRadius(WTFMove(bottomLeft));
+ setBorderBottomRightRadius(WTFMove(size));
+}
+
+inline void RenderStyle::setBorderRadius(const IntSize& size)
+{
+ setBorderRadius(LengthSize { { size.width(), Fixed }, { size.height(), Fixed } });
+}
+
+inline bool RenderStyle::setZoom(float zoomLevel)
+{
+ setEffectiveZoom(effectiveZoom() * zoomLevel);
+ if (compareEqual(m_visualData->zoom, zoomLevel))
+ return false;
+ m_visualData.access().zoom = zoomLevel;
return true;
}
-inline bool RenderStyle::setEffectiveZoom(float f)
+inline bool RenderStyle::setEffectiveZoom(float zoomLevel)
{
- if (compareEqual(rareInheritedData->m_effectiveZoom, f))
+ if (compareEqual(m_rareInheritedData->effectiveZoom, zoomLevel))
return false;
- rareInheritedData.access()->m_effectiveZoom = f;
+ m_rareInheritedData.access().effectiveZoom = zoomLevel;
return true;
}
inline bool RenderStyle::setTextOrientation(TextOrientation textOrientation)
{
- if (compareEqual(rareInheritedData->m_textOrientation, static_cast<unsigned>(textOrientation)))
+ if (compareEqual(m_rareInheritedData->textOrientation, static_cast<unsigned>(textOrientation)))
return false;
-
- rareInheritedData.access()->m_textOrientation = static_cast<unsigned>(textOrientation);
+ m_rareInheritedData.access().textOrientation = static_cast<unsigned>(textOrientation);
return true;
}
+inline void RenderStyle::adjustBackgroundLayers()
+{
+ if (backgroundLayers().next()) {
+ ensureBackgroundLayers().cullEmptyLayers();
+ ensureBackgroundLayers().fillUnsetProperties();
+ }
+}
+
+inline void RenderStyle::adjustMaskLayers()
+{
+ if (maskLayers().next()) {
+ ensureMaskLayers().cullEmptyLayers();
+ ensureMaskLayers().fillUnsetProperties();
+ }
+}
+
+inline void RenderStyle::clearAnimations()
+{
+ m_rareNonInheritedData.access().animations = nullptr;
+}
+
+inline void RenderStyle::clearTransitions()
+{
+ m_rareNonInheritedData.access().transitions = nullptr;
+}
+
+inline void RenderStyle::setShapeOutside(RefPtr<ShapeValue>&& value)
+{
+ if (m_rareNonInheritedData->shapeOutside == value)
+ return;
+ m_rareNonInheritedData.access().shapeOutside = WTFMove(value);
+}
+
+inline void RenderStyle::setShapeImageThreshold(float shapeImageThreshold)
+{
+ float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0, 1);
+ SET_VAR(m_rareNonInheritedData, shapeImageThreshold, clampedShapeImageThreshold);
+}
+
+inline void RenderStyle::setClipPath(RefPtr<ClipPathOperation>&& operation)
+{
+ if (m_rareNonInheritedData->clipPath != operation)
+ m_rareNonInheritedData.access().clipPath = WTFMove(operation);
+}
+
+inline bool RenderStyle::willChangeCreatesStackingContext() const
+{
+ return willChange() && willChange()->canCreateStackingContext();
+}
+
+inline bool RenderStyle::isDisplayRegionType() const
+{
+ return display() == BLOCK || display() == INLINE_BLOCK
+ || display() == TABLE_CELL || display() == TABLE_CAPTION
+ || display() == LIST_ITEM;
+}
+
+inline bool RenderStyle::setWritingMode(WritingMode v)
+{
+ if (v == writingMode())
+ return false;
+ m_inheritedFlags.writingMode = v;
+ return true;
+}
+
+inline void RenderStyle::getShadowInlineDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const
+{
+ return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
+}
+
+inline void RenderStyle::getShadowBlockDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const
+{
+ return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
+}
+
+inline bool RenderStyle::isDisplayReplacedType(EDisplay display)
+{
+ return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_FLEX
+#if ENABLE(CSS_GRID_LAYOUT)
+ || display == INLINE_GRID
+#endif
+ || display == INLINE_TABLE;
+}
+
+inline bool RenderStyle::isDisplayInlineType(EDisplay display)
+{
+ return display == INLINE || isDisplayReplacedType(display);
+}
+
+inline bool RenderStyle::isDisplayFlexibleBox(EDisplay display)
+{
+ return display == FLEX || display == INLINE_FLEX;
+}
+
+inline bool RenderStyle::isDisplayGridBox(EDisplay display)
+{
+#if ENABLE(CSS_GRID_LAYOUT)
+ return display == GRID || display == INLINE_GRID;
+#else
+ UNUSED_PARAM(display);
+ return false;
+#endif
+}
+
+inline bool RenderStyle::isDisplayFlexibleOrGridBox(EDisplay display)
+{
+ return isDisplayFlexibleBox(display) || isDisplayGridBox(display);
+}
+
inline bool RenderStyle::hasAnyPublicPseudoStyles() const
{
- return noninherited_flags.hasAnyPublicPseudoStyles();
+ return m_nonInheritedFlags.hasAnyPublicPseudoStyles();
}
inline bool RenderStyle::hasPseudoStyle(PseudoId pseudo) const
{
- return noninherited_flags.hasPseudoStyle(pseudo);
+ return m_nonInheritedFlags.hasPseudoStyle(pseudo);
}
inline void RenderStyle::setHasPseudoStyle(PseudoId pseudo)
{
- noninherited_flags.setHasPseudoStyle(pseudo);
+ m_nonInheritedFlags.setHasPseudoStyle(pseudo);
}
inline void RenderStyle::setHasPseudoStyles(PseudoIdSet pseudoIdSet)
{
- noninherited_flags.setHasPseudoStyles(pseudoIdSet);
+ m_nonInheritedFlags.setHasPseudoStyles(pseudoIdSet);
+}
+
+inline void RenderStyle::setBoxReflect(RefPtr<StyleReflection>&& reflect)
+{
+ SET_VAR(m_rareNonInheritedData, boxReflect, WTFMove(reflect));
}
inline bool pseudoElementRendererIsNeeded(const RenderStyle* style)
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.cpp b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
index 6c02e50..e468f89 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -49,46 +49,46 @@
}
SVGRenderStyle::SVGRenderStyle()
- : fill(defaultSVGStyle().fill)
- , stroke(defaultSVGStyle().stroke)
- , text(defaultSVGStyle().text)
- , inheritedResources(defaultSVGStyle().inheritedResources)
- , stops(defaultSVGStyle().stops)
- , misc(defaultSVGStyle().misc)
- , shadowSVG(defaultSVGStyle().shadowSVG)
- , layout(defaultSVGStyle().layout)
- , resources(defaultSVGStyle().resources)
+ : m_fillData(defaultSVGStyle().m_fillData)
+ , m_strokeData(defaultSVGStyle().m_strokeData)
+ , m_textData(defaultSVGStyle().m_textData)
+ , m_inheritedResourceData(defaultSVGStyle().m_inheritedResourceData)
+ , m_stopData(defaultSVGStyle().m_stopData)
+ , m_miscData(defaultSVGStyle().m_miscData)
+ , m_shadowData(defaultSVGStyle().m_shadowData)
+ , m_layoutData(defaultSVGStyle().m_layoutData)
+ , m_nonInheritedResourceData(defaultSVGStyle().m_nonInheritedResourceData)
{
setBitDefaults();
}
SVGRenderStyle::SVGRenderStyle(CreateDefaultType)
- : fill(StyleFillData::create())
- , stroke(StyleStrokeData::create())
- , text(StyleTextData::create())
- , inheritedResources(StyleInheritedResourceData::create())
- , stops(StyleStopData::create())
- , misc(StyleMiscData::create())
- , shadowSVG(StyleShadowSVGData::create())
- , layout(StyleLayoutData::create())
- , resources(StyleResourceData::create())
+ : m_fillData(StyleFillData::create())
+ , m_strokeData(StyleStrokeData::create())
+ , m_textData(StyleTextData::create())
+ , m_inheritedResourceData(StyleInheritedResourceData::create())
+ , m_stopData(StyleStopData::create())
+ , m_miscData(StyleMiscData::create())
+ , m_shadowData(StyleShadowSVGData::create())
+ , m_layoutData(StyleLayoutData::create())
+ , m_nonInheritedResourceData(StyleResourceData::create())
{
setBitDefaults();
}
inline SVGRenderStyle::SVGRenderStyle(const SVGRenderStyle& other)
: RefCounted<SVGRenderStyle>()
- , svg_inherited_flags(other.svg_inherited_flags)
- , svg_noninherited_flags(other.svg_noninherited_flags)
- , fill(other.fill)
- , stroke(other.stroke)
- , text(other.text)
- , inheritedResources(other.inheritedResources)
- , stops(other.stops)
- , misc(other.misc)
- , shadowSVG(other.shadowSVG)
- , layout(other.layout)
- , resources(other.resources)
+ , m_inheritedFlags(other.m_inheritedFlags)
+ , m_nonInheritedFlags(other.m_nonInheritedFlags)
+ , m_fillData(other.m_fillData)
+ , m_strokeData(other.m_strokeData)
+ , m_textData(other.m_textData)
+ , m_inheritedResourceData(other.m_inheritedResourceData)
+ , m_stopData(other.m_stopData)
+ , m_miscData(other.m_miscData)
+ , m_shadowData(other.m_shadowData)
+ , m_layoutData(other.m_layoutData)
+ , m_nonInheritedResourceData(other.m_nonInheritedResourceData)
{
}
@@ -103,49 +103,46 @@
bool SVGRenderStyle::operator==(const SVGRenderStyle& other) const
{
- return fill == other.fill
- && stroke == other.stroke
- && text == other.text
- && stops == other.stops
- && misc == other.misc
- && shadowSVG == other.shadowSVG
- && layout == other.layout
- && inheritedResources == other.inheritedResources
- && resources == other.resources
- && svg_inherited_flags == other.svg_inherited_flags
- && svg_noninherited_flags == other.svg_noninherited_flags;
+ return m_fillData == other.m_fillData
+ && m_strokeData == other.m_strokeData
+ && m_textData == other.m_textData
+ && m_stopData == other.m_stopData
+ && m_miscData == other.m_miscData
+ && m_shadowData == other.m_shadowData
+ && m_layoutData == other.m_layoutData
+ && m_inheritedResourceData == other.m_inheritedResourceData
+ && m_nonInheritedResourceData == other.m_nonInheritedResourceData
+ && m_inheritedFlags == other.m_inheritedFlags
+ && m_nonInheritedFlags == other.m_nonInheritedFlags;
}
-bool SVGRenderStyle::inheritedNotEqual(const SVGRenderStyle* other) const
+bool SVGRenderStyle::inheritedNotEqual(const SVGRenderStyle& other) const
{
- return fill != other->fill
- || stroke != other->stroke
- || text != other->text
- || inheritedResources != other->inheritedResources
- || svg_inherited_flags != other->svg_inherited_flags;
+ return m_fillData != other.m_fillData
+ || m_strokeData != other.m_strokeData
+ || m_textData != other.m_textData
+ || m_inheritedResourceData != other.m_inheritedResourceData
+ || m_inheritedFlags != other.m_inheritedFlags;
}
-void SVGRenderStyle::inheritFrom(const SVGRenderStyle* svgInheritParent)
+void SVGRenderStyle::inheritFrom(const SVGRenderStyle& other)
{
- if (!svgInheritParent)
- return;
+ m_fillData = other.m_fillData;
+ m_strokeData = other.m_strokeData;
+ m_textData = other.m_textData;
+ m_inheritedResourceData = other.m_inheritedResourceData;
- fill = svgInheritParent->fill;
- stroke = svgInheritParent->stroke;
- text = svgInheritParent->text;
- inheritedResources = svgInheritParent->inheritedResources;
-
- svg_inherited_flags = svgInheritParent->svg_inherited_flags;
+ m_inheritedFlags = other.m_inheritedFlags;
}
-void SVGRenderStyle::copyNonInheritedFrom(const SVGRenderStyle* other)
+void SVGRenderStyle::copyNonInheritedFrom(const SVGRenderStyle& other)
{
- svg_noninherited_flags = other->svg_noninherited_flags;
- stops = other->stops;
- misc = other->misc;
- shadowSVG = other->shadowSVG;
- layout = other->layout;
- resources = other->resources;
+ m_nonInheritedFlags = other.m_nonInheritedFlags;
+ m_stopData = other.m_stopData;
+ m_miscData = other.m_miscData;
+ m_shadowData = other.m_shadowData;
+ m_layoutData = other.m_layoutData;
+ m_nonInheritedResourceData = other.m_nonInheritedResourceData;
}
Vector<PaintType, 3> SVGRenderStyle::paintTypesForPaintOrder() const
@@ -188,104 +185,104 @@
return paintOrder;
}
-StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
+StyleDifference SVGRenderStyle::diff(const SVGRenderStyle& other) const
{
// NOTE: All comparisions that may return StyleDifferenceLayout have to go before those who return StyleDifferenceRepaint
// If kerning changes, we need a relayout, to force SVGCharacterData to be recalculated in the SVGRootInlineBox.
- if (text != other->text)
+ if (m_textData != other.m_textData)
return StyleDifferenceLayout;
// If resources change, we need a relayout, as the presence of resources influences the repaint rect.
- if (resources != other->resources)
+ if (m_nonInheritedResourceData != other.m_nonInheritedResourceData)
return StyleDifferenceLayout;
// If markers change, we need a relayout, as marker boundaries are cached in RenderSVGPath.
- if (inheritedResources != other->inheritedResources)
+ if (m_inheritedResourceData != other.m_inheritedResourceData)
return StyleDifferenceLayout;
// All text related properties influence layout.
- if (svg_inherited_flags._textAnchor != other->svg_inherited_flags._textAnchor
- || svg_inherited_flags._glyphOrientationHorizontal != other->svg_inherited_flags._glyphOrientationHorizontal
- || svg_inherited_flags._glyphOrientationVertical != other->svg_inherited_flags._glyphOrientationVertical
- || svg_noninherited_flags.f._alignmentBaseline != other->svg_noninherited_flags.f._alignmentBaseline
- || svg_noninherited_flags.f._dominantBaseline != other->svg_noninherited_flags.f._dominantBaseline
- || svg_noninherited_flags.f._baselineShift != other->svg_noninherited_flags.f._baselineShift)
+ if (m_inheritedFlags.textAnchor != other.m_inheritedFlags.textAnchor
+ || m_inheritedFlags.glyphOrientationHorizontal != other.m_inheritedFlags.glyphOrientationHorizontal
+ || m_inheritedFlags.glyphOrientationVertical != other.m_inheritedFlags.glyphOrientationVertical
+ || m_nonInheritedFlags.flagBits.alignmentBaseline != other.m_nonInheritedFlags.flagBits.alignmentBaseline
+ || m_nonInheritedFlags.flagBits.dominantBaseline != other.m_nonInheritedFlags.flagBits.dominantBaseline
+ || m_nonInheritedFlags.flagBits.baselineShift != other.m_nonInheritedFlags.flagBits.baselineShift)
return StyleDifferenceLayout;
// Text related properties influence layout.
- bool miscNotEqual = misc != other->misc;
- if (miscNotEqual && misc->baselineShiftValue != other->misc->baselineShiftValue)
+ bool miscNotEqual = m_miscData != other.m_miscData;
+ if (miscNotEqual && m_miscData->baselineShiftValue != other.m_miscData->baselineShiftValue)
return StyleDifferenceLayout;
// These properties affect the cached stroke bounding box rects.
- if (svg_inherited_flags._capStyle != other->svg_inherited_flags._capStyle
- || svg_inherited_flags._joinStyle != other->svg_inherited_flags._joinStyle)
+ if (m_inheritedFlags.capStyle != other.m_inheritedFlags.capStyle
+ || m_inheritedFlags.joinStyle != other.m_inheritedFlags.joinStyle)
return StyleDifferenceLayout;
// Shadow changes require relayouts, as they affect the repaint rects.
- if (shadowSVG != other->shadowSVG)
+ if (m_shadowData != other.m_shadowData)
return StyleDifferenceLayout;
// The x or y properties require relayout.
- if (layout != other->layout)
+ if (m_layoutData != other.m_layoutData)
return StyleDifferenceLayout;
// Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated.
- if (stroke != other->stroke) {
- if (stroke->width != other->stroke->width
- || stroke->paintType != other->stroke->paintType
- || stroke->paintColor != other->stroke->paintColor
- || stroke->paintUri != other->stroke->paintUri
- || stroke->miterLimit != other->stroke->miterLimit
- || stroke->dashArray != other->stroke->dashArray
- || stroke->dashOffset != other->stroke->dashOffset
- || stroke->visitedLinkPaintColor != other->stroke->visitedLinkPaintColor
- || stroke->visitedLinkPaintUri != other->stroke->visitedLinkPaintUri
- || stroke->visitedLinkPaintType != other->stroke->visitedLinkPaintType)
+ if (m_strokeData != other.m_strokeData) {
+ if (m_strokeData->width != other.m_strokeData->width
+ || m_strokeData->paintType != other.m_strokeData->paintType
+ || m_strokeData->paintColor != other.m_strokeData->paintColor
+ || m_strokeData->paintUri != other.m_strokeData->paintUri
+ || m_strokeData->miterLimit != other.m_strokeData->miterLimit
+ || m_strokeData->dashArray != other.m_strokeData->dashArray
+ || m_strokeData->dashOffset != other.m_strokeData->dashOffset
+ || m_strokeData->visitedLinkPaintColor != other.m_strokeData->visitedLinkPaintColor
+ || m_strokeData->visitedLinkPaintUri != other.m_strokeData->visitedLinkPaintUri
+ || m_strokeData->visitedLinkPaintType != other.m_strokeData->visitedLinkPaintType)
return StyleDifferenceLayout;
// Only the stroke-opacity case remains, where we only need a repaint.
- ASSERT(stroke->opacity != other->stroke->opacity);
+ ASSERT(m_strokeData->opacity != other.m_strokeData->opacity);
return StyleDifferenceRepaint;
}
// vector-effect changes require a re-layout.
- if (svg_noninherited_flags.f._vectorEffect != other->svg_noninherited_flags.f._vectorEffect)
+ if (m_nonInheritedFlags.flagBits.vectorEffect != other.m_nonInheritedFlags.flagBits.vectorEffect)
return StyleDifferenceLayout;
// NOTE: All comparisions below may only return StyleDifferenceRepaint
// Painting related properties only need repaints.
if (miscNotEqual) {
- if (misc->floodColor != other->misc->floodColor
- || misc->floodOpacity != other->misc->floodOpacity
- || misc->lightingColor != other->misc->lightingColor)
+ if (m_miscData->floodColor != other.m_miscData->floodColor
+ || m_miscData->floodOpacity != other.m_miscData->floodOpacity
+ || m_miscData->lightingColor != other.m_miscData->lightingColor)
return StyleDifferenceRepaint;
}
- // If fill changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderSVGPath contains.
- if (fill->paintType != other->fill->paintType || fill->paintColor != other->fill->paintColor
- || fill->paintUri != other->fill->paintUri || fill->opacity != other->fill->opacity)
+ // If fill data changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderSVGPath contains.
+ if (m_fillData->paintType != other.m_fillData->paintType || m_fillData->paintColor != other.m_fillData->paintColor
+ || m_fillData->paintUri != other.m_fillData->paintUri || m_fillData->opacity != other.m_fillData->opacity)
return StyleDifferenceRepaint;
// If gradient stops change, we just need to repaint. Style updates are already handled through RenderSVGGradientSTop.
- if (stops != other->stops)
+ if (m_stopData != other.m_stopData)
return StyleDifferenceRepaint;
// Changes of these flags only cause repaints.
- if (svg_inherited_flags._colorRendering != other->svg_inherited_flags._colorRendering
- || svg_inherited_flags._shapeRendering != other->svg_inherited_flags._shapeRendering
- || svg_inherited_flags._clipRule != other->svg_inherited_flags._clipRule
- || svg_inherited_flags._fillRule != other->svg_inherited_flags._fillRule
- || svg_inherited_flags._colorInterpolation != other->svg_inherited_flags._colorInterpolation
- || svg_inherited_flags._colorInterpolationFilters != other->svg_inherited_flags._colorInterpolationFilters)
+ if (m_inheritedFlags.colorRendering != other.m_inheritedFlags.colorRendering
+ || m_inheritedFlags.shapeRendering != other.m_inheritedFlags.shapeRendering
+ || m_inheritedFlags.clipRule != other.m_inheritedFlags.clipRule
+ || m_inheritedFlags.fillRule != other.m_inheritedFlags.fillRule
+ || m_inheritedFlags.colorInterpolation != other.m_inheritedFlags.colorInterpolation
+ || m_inheritedFlags.colorInterpolationFilters != other.m_inheritedFlags.colorInterpolationFilters)
return StyleDifferenceRepaint;
- if (svg_noninherited_flags.f.bufferedRendering != other->svg_noninherited_flags.f.bufferedRendering)
+ if (m_nonInheritedFlags.flagBits.bufferedRendering != other.m_nonInheritedFlags.flagBits.bufferedRendering)
return StyleDifferenceRepaint;
- if (svg_noninherited_flags.f.maskType != other->svg_noninherited_flags.f.maskType)
+ if (m_nonInheritedFlags.flagBits.maskType != other.m_nonInheritedFlags.flagBits.maskType)
return StyleDifferenceRepaint;
return StyleDifferenceEqual;
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.h b/Source/WebCore/rendering/style/SVGRenderStyle.h
index 391975a..669a2c0 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.h
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.h
@@ -1,7 +1,7 @@
/*
Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
2004, 2005 Rob Buis <buis@kde.org>
- Copyright (C) 2005, 2006 Apple Inc.
+ Copyright (C) 2005-2017 Apple Inc. All rights reserved.
Copyright (C) Research In Motion Limited 2010. All rights reserved.
Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
@@ -23,7 +23,6 @@
#pragma once
-#include "CSSValueList.h"
#include "DataRef.h"
#include "GraphicsTypes.h"
#include "Path.h"
@@ -32,25 +31,21 @@
namespace WebCore {
-class FloatRect;
-class IntRect;
-class RenderObject;
-
-class SVGRenderStyle : public RefCounted<SVGRenderStyle> {
+class SVGRenderStyle : public RefCounted<SVGRenderStyle> {
public:
static Ref<SVGRenderStyle> createDefaultStyle();
static Ref<SVGRenderStyle> create() { return adoptRef(*new SVGRenderStyle); }
Ref<SVGRenderStyle> copy() const;
~SVGRenderStyle();
- bool inheritedNotEqual(const SVGRenderStyle*) const;
- void inheritFrom(const SVGRenderStyle*);
- void copyNonInheritedFrom(const SVGRenderStyle*);
+ bool inheritedNotEqual(const SVGRenderStyle&) const;
+ void inheritFrom(const SVGRenderStyle&);
+ void copyNonInheritedFrom(const SVGRenderStyle&);
- StyleDifference diff(const SVGRenderStyle*) const;
+ StyleDifference diff(const SVGRenderStyle&) const;
bool operator==(const SVGRenderStyle&) const;
- bool operator!=(const SVGRenderStyle& o) const { return !(*this == o); }
+ bool operator!=(const SVGRenderStyle& other) const { return !(*this == other); }
// Initial values for all the properties
static EAlignmentBaseline initialAlignmentBaseline() { return AB_AUTO; }
@@ -84,7 +79,7 @@
static float initialFloodOpacity() { return 1; }
static Color initialFloodColor() { return Color(0, 0, 0); }
static Color initialLightingColor() { return Color(255, 255, 255); }
- static ShadowData* initialShadow() { return 0; }
+ static ShadowData* initialShadow() { return nullptr; }
static String initialClipperResource() { return String(); }
static String initialMaskerResource() { return String(); }
static String initialMarkerStartResource() { return String(); }
@@ -92,287 +87,122 @@
static String initialMarkerEndResource() { return String(); }
static EMaskType initialMaskType() { return MT_LUMINANCE; }
static PaintOrder initialPaintOrder() { return PaintOrderNormal; }
-
- static SVGLengthValue initialBaselineShiftValue()
- {
- SVGLengthValue length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 0);
- return length;
- }
-
- static SVGLengthValue initialKerning()
- {
- SVGLengthValue length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 0);
- return length;
- }
+ static SVGLengthValue initialBaselineShiftValue();
+ static SVGLengthValue initialKerning();
// SVG CSS Property setters
- void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f._alignmentBaseline = val; }
- void setDominantBaseline(EDominantBaseline val) { svg_noninherited_flags.f._dominantBaseline = val; }
- void setBaselineShift(EBaselineShift val) { svg_noninherited_flags.f._baselineShift = val; }
- void setVectorEffect(EVectorEffect val) { svg_noninherited_flags.f._vectorEffect = val; }
- void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f.bufferedRendering = val; }
- void setCapStyle(LineCap val) { svg_inherited_flags._capStyle = val; }
- void setClipRule(WindRule val) { svg_inherited_flags._clipRule = val; }
- void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags._colorInterpolation = val; }
- void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_flags._colorInterpolationFilters = val; }
- void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRendering = val; }
- void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; }
- void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; }
- void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRendering = val; }
- void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val; }
- void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationHorizontal = val; }
- void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationVertical = val; }
- void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; }
- void setPaintOrder(PaintOrder val) { svg_inherited_flags.paintOrder = val; }
- void setCx(const Length& obj)
- {
- if (!(layout->cx == obj))
- layout.access()->cx = obj;
- }
- void setCy(const Length& obj)
- {
- if (!(layout->cy == obj))
- layout.access()->cy = obj;
- }
- void setR(const Length& obj)
- {
- if (!(layout->r == obj))
- layout.access()->r = obj;
- }
- void setRx(const Length& obj)
- {
- if (!(layout->rx == obj))
- layout.access()->rx = obj;
- }
- void setRy(const Length& obj)
- {
- if (!(layout->ry == obj))
- layout.access()->ry = obj;
- }
- void setX(const Length& obj)
- {
- if (!(layout->x == obj))
- layout.access()->x = obj;
- }
- void setY(const Length& obj)
- {
- if (!(layout->y == obj))
- layout.access()->y = obj;
- }
+ void setAlignmentBaseline(EAlignmentBaseline val) { m_nonInheritedFlags.flagBits.alignmentBaseline = val; }
+ void setDominantBaseline(EDominantBaseline val) { m_nonInheritedFlags.flagBits.dominantBaseline = val; }
+ void setBaselineShift(EBaselineShift val) { m_nonInheritedFlags.flagBits.baselineShift = val; }
+ void setVectorEffect(EVectorEffect val) { m_nonInheritedFlags.flagBits.vectorEffect = val; }
+ void setBufferedRendering(EBufferedRendering val) { m_nonInheritedFlags.flagBits.bufferedRendering = val; }
+ void setCapStyle(LineCap val) { m_inheritedFlags.capStyle = val; }
+ void setClipRule(WindRule val) { m_inheritedFlags.clipRule = val; }
+ void setColorInterpolation(EColorInterpolation val) { m_inheritedFlags.colorInterpolation = val; }
+ void setColorInterpolationFilters(EColorInterpolation val) { m_inheritedFlags.colorInterpolationFilters = val; }
+ void setColorRendering(EColorRendering val) { m_inheritedFlags.colorRendering = val; }
+ void setFillRule(WindRule val) { m_inheritedFlags.fillRule = val; }
+ void setJoinStyle(LineJoin val) { m_inheritedFlags.joinStyle = val; }
+ void setShapeRendering(EShapeRendering val) { m_inheritedFlags.shapeRendering = val; }
+ void setTextAnchor(ETextAnchor val) { m_inheritedFlags.textAnchor = val; }
+ void setGlyphOrientationHorizontal(EGlyphOrientation val) { m_inheritedFlags.glyphOrientationHorizontal = val; }
+ void setGlyphOrientationVertical(EGlyphOrientation val) { m_inheritedFlags.glyphOrientationVertical = val; }
+ void setMaskType(EMaskType val) { m_nonInheritedFlags.flagBits.maskType = val; }
+ void setPaintOrder(PaintOrder val) { m_inheritedFlags.paintOrder = val; }
+ void setCx(const Length&);
+ void setCy(const Length&);
+ void setR(const Length&);
+ void setRx(const Length&);
+ void setRy(const Length&);
+ void setX(const Length&);
+ void setY(const Length&);
+ void setFillOpacity(float);
+ void setFillPaint(SVGPaintType, const Color&, const String& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false);
+ void setStrokeOpacity(float);
+ void setStrokePaint(SVGPaintType, const Color&, const String& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false);
- void setFillOpacity(float obj)
- {
- if (!(fill->opacity == obj))
- fill.access()->opacity = obj;
- }
+ void setStrokeDashArray(const Vector<SVGLengthValue>&);
+ void setStrokeMiterLimit(float);
+ void setStrokeWidth(const Length&);
+ void setStrokeDashOffset(const Length&);
+ void setKerning(const SVGLengthValue&);
+ void setStopOpacity(float);
+ void setStopColor(const Color&);
+ void setFloodOpacity(float);
+ void setFloodColor(const Color&);
+ void setLightingColor(const Color&);
+ void setBaselineShiftValue(const SVGLengthValue&);
- void setFillPaint(SVGPaintType type, const Color& color, const String& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false)
- {
- if (applyToRegularStyle) {
- if (!(fill->paintType == type))
- fill.access()->paintType = type;
- if (!(fill->paintColor == color))
- fill.access()->paintColor = color;
- if (!(fill->paintUri == uri))
- fill.access()->paintUri = uri;
- }
- if (applyToVisitedLinkStyle) {
- if (!(fill->visitedLinkPaintType == type))
- fill.access()->visitedLinkPaintType = type;
- if (!(fill->visitedLinkPaintColor == color))
- fill.access()->visitedLinkPaintColor = color;
- if (!(fill->visitedLinkPaintUri == uri))
- fill.access()->visitedLinkPaintUri = uri;
- }
- }
-
- void setStrokeOpacity(float obj)
- {
- if (!(stroke->opacity == obj))
- stroke.access()->opacity = obj;
- }
-
- void setStrokePaint(SVGPaintType type, const Color& color, const String& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false)
- {
- if (applyToRegularStyle) {
- if (!(stroke->paintType == type))
- stroke.access()->paintType = type;
- if (!(stroke->paintColor == color))
- stroke.access()->paintColor = color;
- if (!(stroke->paintUri == uri))
- stroke.access()->paintUri = uri;
- }
- if (applyToVisitedLinkStyle) {
- if (!(stroke->visitedLinkPaintType == type))
- stroke.access()->visitedLinkPaintType = type;
- if (!(stroke->visitedLinkPaintColor == color))
- stroke.access()->visitedLinkPaintColor = color;
- if (!(stroke->visitedLinkPaintUri == uri))
- stroke.access()->visitedLinkPaintUri = uri;
- }
- }
-
- void setStrokeDashArray(const Vector<SVGLengthValue>& obj)
- {
- if (!(stroke->dashArray == obj))
- stroke.access()->dashArray = obj;
- }
-
- void setStrokeMiterLimit(float obj)
- {
- if (!(stroke->miterLimit == obj))
- stroke.access()->miterLimit = obj;
- }
-
- void setStrokeWidth(const Length& obj)
- {
- if (!(stroke->width == obj))
- stroke.access()->width = obj;
- }
-
- void setStrokeDashOffset(const Length& obj)
- {
- if (!(stroke->dashOffset == obj))
- stroke.access()->dashOffset = obj;
- }
-
- void setKerning(const SVGLengthValue& obj)
- {
- if (!(text->kerning == obj))
- text.access()->kerning = obj;
- }
-
- void setStopOpacity(float obj)
- {
- if (!(stops->opacity == obj))
- stops.access()->opacity = obj;
- }
-
- void setStopColor(const Color& obj)
- {
- if (!(stops->color == obj))
- stops.access()->color = obj;
- }
-
- void setFloodOpacity(float obj)
- {
- if (!(misc->floodOpacity == obj))
- misc.access()->floodOpacity = obj;
- }
-
- void setFloodColor(const Color& obj)
- {
- if (!(misc->floodColor == obj))
- misc.access()->floodColor = obj;
- }
-
- void setLightingColor(const Color& obj)
- {
- if (!(misc->lightingColor == obj))
- misc.access()->lightingColor = obj;
- }
-
- void setBaselineShiftValue(const SVGLengthValue& obj)
- {
- if (!(misc->baselineShiftValue == obj))
- misc.access()->baselineShiftValue = obj;
- }
-
- void setShadow(std::unique_ptr<ShadowData> obj) { shadowSVG.access()->shadow = WTFMove(obj); }
+ void setShadow(std::unique_ptr<ShadowData>&& data) { m_shadowData.access().shadow = WTFMove(data); }
// Setters for non-inherited resources
- void setClipperResource(const String& obj)
- {
- if (!(resources->clipper == obj))
- resources.access()->clipper = obj;
- }
-
- void setMaskerResource(const String& obj)
- {
- if (!(resources->masker == obj))
- resources.access()->masker = obj;
- }
+ void setClipperResource(const String&);
+ void setMaskerResource(const String&);
// Setters for inherited resources
- void setMarkerStartResource(const String& obj)
- {
- if (!(inheritedResources->markerStart == obj))
- inheritedResources.access()->markerStart = obj;
- }
-
- void setMarkerMidResource(const String& obj)
- {
- if (!(inheritedResources->markerMid == obj))
- inheritedResources.access()->markerMid = obj;
- }
-
- void setMarkerEndResource(const String& obj)
- {
- if (!(inheritedResources->markerEnd == obj))
- inheritedResources.access()->markerEnd = obj;
- }
+ void setMarkerStartResource(const String&);
+ void setMarkerMidResource(const String&);
+ void setMarkerEndResource(const String&);
// Read accessors for all the properties
- EAlignmentBaseline alignmentBaseline() const { return (EAlignmentBaseline) svg_noninherited_flags.f._alignmentBaseline; }
- EDominantBaseline dominantBaseline() const { return (EDominantBaseline) svg_noninherited_flags.f._dominantBaseline; }
- EBaselineShift baselineShift() const { return (EBaselineShift) svg_noninherited_flags.f._baselineShift; }
- EVectorEffect vectorEffect() const { return (EVectorEffect) svg_noninherited_flags.f._vectorEffect; }
- EBufferedRendering bufferedRendering() const { return (EBufferedRendering) svg_noninherited_flags.f.bufferedRendering; }
- LineCap capStyle() const { return (LineCap) svg_inherited_flags._capStyle; }
- WindRule clipRule() const { return (WindRule) svg_inherited_flags._clipRule; }
- EColorInterpolation colorInterpolation() const { return (EColorInterpolation) svg_inherited_flags._colorInterpolation; }
- EColorInterpolation colorInterpolationFilters() const { return (EColorInterpolation) svg_inherited_flags._colorInterpolationFilters; }
- EColorRendering colorRendering() const { return (EColorRendering) svg_inherited_flags._colorRendering; }
- WindRule fillRule() const { return (WindRule) svg_inherited_flags._fillRule; }
- LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyle; }
- EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inherited_flags._shapeRendering; }
- ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._textAnchor; }
- EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationHorizontal; }
- EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationVertical; }
- float fillOpacity() const { return fill->opacity; }
- const SVGPaintType& fillPaintType() const { return fill->paintType; }
- const Color& fillPaintColor() const { return fill->paintColor; }
- const String& fillPaintUri() const { return fill->paintUri; }
- float strokeOpacity() const { return stroke->opacity; }
- const SVGPaintType& strokePaintType() const { return stroke->paintType; }
- const Color& strokePaintColor() const { return stroke->paintColor; }
- const String& strokePaintUri() const { return stroke->paintUri; }
- Vector<SVGLengthValue> strokeDashArray() const { return stroke->dashArray; }
- float strokeMiterLimit() const { return stroke->miterLimit; }
- const Length& strokeWidth() const { return stroke->width; }
- const Length& strokeDashOffset() const { return stroke->dashOffset; }
- SVGLengthValue kerning() const { return text->kerning; }
- float stopOpacity() const { return stops->opacity; }
- const Color& stopColor() const { return stops->color; }
- float floodOpacity() const { return misc->floodOpacity; }
- const Color& floodColor() const { return misc->floodColor; }
- const Color& lightingColor() const { return misc->lightingColor; }
- SVGLengthValue baselineShiftValue() const { return misc->baselineShiftValue; }
- ShadowData* shadow() const { return shadowSVG->shadow.get(); }
- const Length& cx() const { return layout->cx; }
- const Length& cy() const { return layout->cy; }
- const Length& r() const { return layout->r; }
- const Length& rx() const { return layout->rx; }
- const Length& ry() const { return layout->ry; }
- const Length& x() const { return layout->x; }
- const Length& y() const { return layout->y; }
- String clipperResource() const { return resources->clipper; }
- String maskerResource() const { return resources->masker; }
- String markerStartResource() const { return inheritedResources->markerStart; }
- String markerMidResource() const { return inheritedResources->markerMid; }
- String markerEndResource() const { return inheritedResources->markerEnd; }
- EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.maskType; }
- PaintOrder paintOrder() const { return (PaintOrder) svg_inherited_flags.paintOrder; }
+ EAlignmentBaseline alignmentBaseline() const { return (EAlignmentBaseline) m_nonInheritedFlags.flagBits.alignmentBaseline; }
+ EDominantBaseline dominantBaseline() const { return (EDominantBaseline) m_nonInheritedFlags.flagBits.dominantBaseline; }
+ EBaselineShift baselineShift() const { return (EBaselineShift) m_nonInheritedFlags.flagBits.baselineShift; }
+ EVectorEffect vectorEffect() const { return (EVectorEffect) m_nonInheritedFlags.flagBits.vectorEffect; }
+ EBufferedRendering bufferedRendering() const { return (EBufferedRendering) m_nonInheritedFlags.flagBits.bufferedRendering; }
+ LineCap capStyle() const { return (LineCap) m_inheritedFlags.capStyle; }
+ WindRule clipRule() const { return (WindRule) m_inheritedFlags.clipRule; }
+ EColorInterpolation colorInterpolation() const { return (EColorInterpolation) m_inheritedFlags.colorInterpolation; }
+ EColorInterpolation colorInterpolationFilters() const { return (EColorInterpolation) m_inheritedFlags.colorInterpolationFilters; }
+ EColorRendering colorRendering() const { return (EColorRendering) m_inheritedFlags.colorRendering; }
+ WindRule fillRule() const { return (WindRule) m_inheritedFlags.fillRule; }
+ LineJoin joinStyle() const { return (LineJoin) m_inheritedFlags.joinStyle; }
+ EShapeRendering shapeRendering() const { return (EShapeRendering) m_inheritedFlags.shapeRendering; }
+ ETextAnchor textAnchor() const { return (ETextAnchor) m_inheritedFlags.textAnchor; }
+ EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) m_inheritedFlags.glyphOrientationHorizontal; }
+ EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) m_inheritedFlags.glyphOrientationVertical; }
+ float fillOpacity() const { return m_fillData->opacity; }
+ const SVGPaintType& fillPaintType() const { return m_fillData->paintType; }
+ const Color& fillPaintColor() const { return m_fillData->paintColor; }
+ const String& fillPaintUri() const { return m_fillData->paintUri; }
+ float strokeOpacity() const { return m_strokeData->opacity; }
+ const SVGPaintType& strokePaintType() const { return m_strokeData->paintType; }
+ const Color& strokePaintColor() const { return m_strokeData->paintColor; }
+ const String& strokePaintUri() const { return m_strokeData->paintUri; }
+ Vector<SVGLengthValue> strokeDashArray() const { return m_strokeData->dashArray; }
+ float strokeMiterLimit() const { return m_strokeData->miterLimit; }
+ const Length& strokeWidth() const { return m_strokeData->width; }
+ const Length& strokeDashOffset() const { return m_strokeData->dashOffset; }
+ SVGLengthValue kerning() const { return m_textData->kerning; }
+ float stopOpacity() const { return m_stopData->opacity; }
+ const Color& stopColor() const { return m_stopData->color; }
+ float floodOpacity() const { return m_miscData->floodOpacity; }
+ const Color& floodColor() const { return m_miscData->floodColor; }
+ const Color& lightingColor() const { return m_miscData->lightingColor; }
+ SVGLengthValue baselineShiftValue() const { return m_miscData->baselineShiftValue; }
+ ShadowData* shadow() const { return m_shadowData->shadow.get(); }
+ const Length& cx() const { return m_layoutData->cx; }
+ const Length& cy() const { return m_layoutData->cy; }
+ const Length& r() const { return m_layoutData->r; }
+ const Length& rx() const { return m_layoutData->rx; }
+ const Length& ry() const { return m_layoutData->ry; }
+ const Length& x() const { return m_layoutData->x; }
+ const Length& y() const { return m_layoutData->y; }
+ const String& clipperResource() const { return m_nonInheritedResourceData->clipper; }
+ const String& maskerResource() const { return m_nonInheritedResourceData->masker; }
+ const String& markerStartResource() const { return m_inheritedResourceData->markerStart; }
+ const String& markerMidResource() const { return m_inheritedResourceData->markerMid; }
+ const String& markerEndResource() const { return m_inheritedResourceData->markerEnd; }
+ EMaskType maskType() const { return (EMaskType) m_nonInheritedFlags.flagBits.maskType; }
+ PaintOrder paintOrder() const { return (PaintOrder) m_inheritedFlags.paintOrder; }
Vector<PaintType, 3> paintTypesForPaintOrder() const;
- const SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedLinkPaintType; }
- const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPaintColor; }
- const String& visitedLinkFillPaintUri() const { return fill->visitedLinkPaintUri; }
- const SVGPaintType& visitedLinkStrokePaintType() const { return stroke->visitedLinkPaintType; }
- const Color& visitedLinkStrokePaintColor() const { return stroke->visitedLinkPaintColor; }
- const String& visitedLinkStrokePaintUri() const { return stroke->visitedLinkPaintUri; }
+ const SVGPaintType& visitedLinkFillPaintType() const { return m_fillData->visitedLinkPaintType; }
+ const Color& visitedLinkFillPaintColor() const { return m_fillData->visitedLinkPaintColor; }
+ const String& visitedLinkFillPaintUri() const { return m_fillData->visitedLinkPaintUri; }
+ const SVGPaintType& visitedLinkStrokePaintType() const { return m_strokeData->visitedLinkPaintType; }
+ const Color& visitedLinkStrokePaintColor() const { return m_strokeData->visitedLinkPaintColor; }
+ const String& visitedLinkStrokePaintUri() const { return m_strokeData->visitedLinkPaintUri; }
// convenience
bool hasClipper() const { return !clipperResource().isEmpty(); }
@@ -383,107 +213,311 @@
bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; }
bool isolatesBlending() const { return hasMasker() || shadow(); }
-protected:
- // inherit
+private:
+ SVGRenderStyle();
+ SVGRenderStyle(const SVGRenderStyle&);
+
+ enum CreateDefaultType { CreateDefault };
+ SVGRenderStyle(CreateDefaultType); // Used to create the default style.
+
+ void setBitDefaults();
+
struct InheritedFlags {
- bool operator==(const InheritedFlags& other) const
- {
- return (_colorRendering == other._colorRendering)
- && (_shapeRendering == other._shapeRendering)
- && (_clipRule == other._clipRule)
- && (_fillRule == other._fillRule)
- && (_capStyle == other._capStyle)
- && (_joinStyle == other._joinStyle)
- && (_textAnchor == other._textAnchor)
- && (_colorInterpolation == other._colorInterpolation)
- && (_colorInterpolationFilters == other._colorInterpolationFilters)
- && (_glyphOrientationHorizontal == other._glyphOrientationHorizontal)
- && (_glyphOrientationVertical == other._glyphOrientationVertical)
- && (paintOrder == other.paintOrder);
- }
+ bool operator==(const InheritedFlags&) const;
+ bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
- bool operator!=(const InheritedFlags& other) const
- {
- return !(*this == other);
- }
-
- unsigned _colorRendering : 2; // EColorRendering
- unsigned _shapeRendering : 2; // EShapeRendering
- unsigned _clipRule : 1; // WindRule
- unsigned _fillRule : 1; // WindRule
- unsigned _capStyle : 2; // LineCap
- unsigned _joinStyle : 2; // LineJoin
- unsigned _textAnchor : 2; // ETextAnchor
- unsigned _colorInterpolation : 2; // EColorInterpolation
- unsigned _colorInterpolationFilters : 2; // EColorInterpolation
- unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation
- unsigned _glyphOrientationVertical : 3; // EGlyphOrientation
+ unsigned colorRendering : 2; // EColorRendering
+ unsigned shapeRendering : 2; // EShapeRendering
+ unsigned clipRule : 1; // WindRule
+ unsigned fillRule : 1; // WindRule
+ unsigned capStyle : 2; // LineCap
+ unsigned joinStyle : 2; // LineJoin
+ unsigned textAnchor : 2; // ETextAnchor
+ unsigned colorInterpolation : 2; // EColorInterpolation
+ unsigned colorInterpolationFilters : 2; // EColorInterpolation
+ unsigned glyphOrientationHorizontal : 3; // EGlyphOrientation
+ unsigned glyphOrientationVertical : 3; // EGlyphOrientation
unsigned paintOrder : 3; // PaintOrder
- } svg_inherited_flags;
+ };
- // don't inherit
struct NonInheritedFlags {
// 32 bit non-inherited, don't add to the struct, or the operator will break.
- bool operator==(const NonInheritedFlags &other) const { return _niflags == other._niflags; }
- bool operator!=(const NonInheritedFlags &other) const { return _niflags != other._niflags; }
+ bool operator==(const NonInheritedFlags& other) const { return flags == other.flags; }
+ bool operator!=(const NonInheritedFlags& other) const { return flags != other.flags; }
union {
struct {
- unsigned _alignmentBaseline : 4; // EAlignmentBaseline
- unsigned _dominantBaseline : 4; // EDominantBaseline
- unsigned _baselineShift : 2; // EBaselineShift
- unsigned _vectorEffect: 1; // EVectorEffect
+ unsigned alignmentBaseline : 4; // EAlignmentBaseline
+ unsigned dominantBaseline : 4; // EDominantBaseline
+ unsigned baselineShift : 2; // EBaselineShift
+ unsigned vectorEffect: 1; // EVectorEffect
unsigned bufferedRendering: 2; // EBufferedRendering
unsigned maskType: 1; // EMaskType
// 18 bits unused
- } f;
- uint32_t _niflags;
+ } flagBits;
+ uint32_t flags;
};
- } svg_noninherited_flags;
+ };
+
+ InheritedFlags m_inheritedFlags;
+ NonInheritedFlags m_nonInheritedFlags;
// inherited attributes
- DataRef<StyleFillData> fill;
- DataRef<StyleStrokeData> stroke;
- DataRef<StyleTextData> text;
- DataRef<StyleInheritedResourceData> inheritedResources;
+ DataRef<StyleFillData> m_fillData;
+ DataRef<StyleStrokeData> m_strokeData;
+ DataRef<StyleTextData> m_textData;
+ DataRef<StyleInheritedResourceData> m_inheritedResourceData;
// non-inherited attributes
- DataRef<StyleStopData> stops;
- DataRef<StyleMiscData> misc;
- DataRef<StyleShadowSVGData> shadowSVG;
- DataRef<StyleLayoutData> layout;
- DataRef<StyleResourceData> resources;
-
-private:
- enum CreateDefaultType { CreateDefault };
-
- SVGRenderStyle();
- SVGRenderStyle(const SVGRenderStyle&);
- SVGRenderStyle(CreateDefaultType); // Used to create the default style.
-
- void setBitDefaults()
- {
- svg_inherited_flags._clipRule = initialClipRule();
- svg_inherited_flags._colorRendering = initialColorRendering();
- svg_inherited_flags._fillRule = initialFillRule();
- svg_inherited_flags._shapeRendering = initialShapeRendering();
- svg_inherited_flags._textAnchor = initialTextAnchor();
- svg_inherited_flags._capStyle = initialCapStyle();
- svg_inherited_flags._joinStyle = initialJoinStyle();
- svg_inherited_flags._colorInterpolation = initialColorInterpolation();
- svg_inherited_flags._colorInterpolationFilters = initialColorInterpolationFilters();
- svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientationHorizontal();
- svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationVertical();
- svg_inherited_flags.paintOrder = initialPaintOrder();
-
- svg_noninherited_flags._niflags = 0;
- svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline();
- svg_noninherited_flags.f._dominantBaseline = initialDominantBaseline();
- svg_noninherited_flags.f._baselineShift = initialBaselineShift();
- svg_noninherited_flags.f._vectorEffect = initialVectorEffect();
- svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering();
- svg_noninherited_flags.f.maskType = initialMaskType();
- }
+ DataRef<StyleStopData> m_stopData;
+ DataRef<StyleMiscData> m_miscData;
+ DataRef<StyleShadowSVGData> m_shadowData;
+ DataRef<StyleLayoutData> m_layoutData;
+ DataRef<StyleResourceData> m_nonInheritedResourceData;
};
+inline SVGLengthValue SVGRenderStyle::initialBaselineShiftValue()
+{
+ SVGLengthValue length;
+ length.newValueSpecifiedUnits(LengthTypeNumber, 0);
+ return length;
+}
+
+inline SVGLengthValue SVGRenderStyle::initialKerning()
+{
+ SVGLengthValue length;
+ length.newValueSpecifiedUnits(LengthTypeNumber, 0);
+ return length;
+}
+
+inline void SVGRenderStyle::setCx(const Length& length)
+{
+ if (!(m_layoutData->cx == length))
+ m_layoutData.access().cx = length;
+}
+
+inline void SVGRenderStyle::setCy(const Length& length)
+{
+ if (!(m_layoutData->cy == length))
+ m_layoutData.access().cy = length;
+}
+
+inline void SVGRenderStyle::setR(const Length& length)
+{
+ if (!(m_layoutData->r == length))
+ m_layoutData.access().r = length;
+}
+
+inline void SVGRenderStyle::setRx(const Length& length)
+{
+ if (!(m_layoutData->rx == length))
+ m_layoutData.access().rx = length;
+}
+
+inline void SVGRenderStyle::setRy(const Length& length)
+{
+ if (!(m_layoutData->ry == length))
+ m_layoutData.access().ry = length;
+}
+
+inline void SVGRenderStyle::setX(const Length& length)
+{
+ if (!(m_layoutData->x == length))
+ m_layoutData.access().x = length;
+}
+
+inline void SVGRenderStyle::setY(const Length& length)
+{
+ if (!(m_layoutData->y == length))
+ m_layoutData.access().y = length;
+}
+
+inline void SVGRenderStyle::setFillOpacity(float opacity)
+{
+ if (!(m_fillData->opacity == opacity))
+ m_fillData.access().opacity = opacity;
+}
+
+inline void SVGRenderStyle::setFillPaint(SVGPaintType type, const Color& color, const String& uri, bool applyToRegularStyle, bool applyToVisitedLinkStyle)
+{
+ if (applyToRegularStyle) {
+ if (!(m_fillData->paintType == type))
+ m_fillData.access().paintType = type;
+ if (!(m_fillData->paintColor == color))
+ m_fillData.access().paintColor = color;
+ if (!(m_fillData->paintUri == uri))
+ m_fillData.access().paintUri = uri;
+ }
+ if (applyToVisitedLinkStyle) {
+ if (!(m_fillData->visitedLinkPaintType == type))
+ m_fillData.access().visitedLinkPaintType = type;
+ if (!(m_fillData->visitedLinkPaintColor == color))
+ m_fillData.access().visitedLinkPaintColor = color;
+ if (!(m_fillData->visitedLinkPaintUri == uri))
+ m_fillData.access().visitedLinkPaintUri = uri;
+ }
+}
+
+inline void SVGRenderStyle::setStrokeOpacity(float opacity)
+{
+ if (!(m_strokeData->opacity == opacity))
+ m_strokeData.access().opacity = opacity;
+}
+
+inline void SVGRenderStyle::setStrokePaint(SVGPaintType type, const Color& color, const String& uri, bool applyToRegularStyle, bool applyToVisitedLinkStyle)
+{
+ if (applyToRegularStyle) {
+ if (!(m_strokeData->paintType == type))
+ m_strokeData.access().paintType = type;
+ if (!(m_strokeData->paintColor == color))
+ m_strokeData.access().paintColor = color;
+ if (!(m_strokeData->paintUri == uri))
+ m_strokeData.access().paintUri = uri;
+ }
+ if (applyToVisitedLinkStyle) {
+ if (!(m_strokeData->visitedLinkPaintType == type))
+ m_strokeData.access().visitedLinkPaintType = type;
+ if (!(m_strokeData->visitedLinkPaintColor == color))
+ m_strokeData.access().visitedLinkPaintColor = color;
+ if (!(m_strokeData->visitedLinkPaintUri == uri))
+ m_strokeData.access().visitedLinkPaintUri = uri;
+ }
+}
+
+inline void SVGRenderStyle::setStrokeDashArray(const Vector<SVGLengthValue>& array)
+{
+ if (!(m_strokeData->dashArray == array))
+ m_strokeData.access().dashArray = array;
+}
+
+inline void SVGRenderStyle::setStrokeMiterLimit(float limit)
+{
+ if (!(m_strokeData->miterLimit == limit))
+ m_strokeData.access().miterLimit = limit;
+}
+
+inline void SVGRenderStyle::setStrokeWidth(const Length& width)
+{
+ if (!(m_strokeData->width == width))
+ m_strokeData.access().width = width;
+}
+
+inline void SVGRenderStyle::setStrokeDashOffset(const Length& offset)
+{
+ if (!(m_strokeData->dashOffset == offset))
+ m_strokeData.access().dashOffset = offset;
+}
+
+inline void SVGRenderStyle::setKerning(const SVGLengthValue& kerning)
+{
+ if (!(m_textData->kerning == kerning))
+ m_textData.access().kerning = kerning;
+}
+
+inline void SVGRenderStyle::setStopOpacity(float opacity)
+{
+ if (!(m_stopData->opacity == opacity))
+ m_stopData.access().opacity = opacity;
+}
+
+inline void SVGRenderStyle::setStopColor(const Color& color)
+{
+ if (!(m_stopData->color == color))
+ m_stopData.access().color = color;
+}
+
+inline void SVGRenderStyle::setFloodOpacity(float opacity)
+{
+ if (!(m_miscData->floodOpacity == opacity))
+ m_miscData.access().floodOpacity = opacity;
+}
+
+inline void SVGRenderStyle::setFloodColor(const Color& color)
+{
+ if (!(m_miscData->floodColor == color))
+ m_miscData.access().floodColor = color;
+}
+
+inline void SVGRenderStyle::setLightingColor(const Color& color)
+{
+ if (!(m_miscData->lightingColor == color))
+ m_miscData.access().lightingColor = color;
+}
+
+inline void SVGRenderStyle::setBaselineShiftValue(const SVGLengthValue& shiftValue)
+{
+ if (!(m_miscData->baselineShiftValue == shiftValue))
+ m_miscData.access().baselineShiftValue = shiftValue;
+}
+
+inline void SVGRenderStyle::setClipperResource(const String& resource)
+{
+ if (!(m_nonInheritedResourceData->clipper == resource))
+ m_nonInheritedResourceData.access().clipper = resource;
+}
+
+inline void SVGRenderStyle::setMaskerResource(const String& resource)
+{
+ if (!(m_nonInheritedResourceData->masker == resource))
+ m_nonInheritedResourceData.access().masker = resource;
+}
+
+inline void SVGRenderStyle::setMarkerStartResource(const String& resource)
+{
+ if (!(m_inheritedResourceData->markerStart == resource))
+ m_inheritedResourceData.access().markerStart = resource;
+}
+
+inline void SVGRenderStyle::setMarkerMidResource(const String& resource)
+{
+ if (!(m_inheritedResourceData->markerMid == resource))
+ m_inheritedResourceData.access().markerMid = resource;
+}
+
+inline void SVGRenderStyle::setMarkerEndResource(const String& resource)
+{
+ if (!(m_inheritedResourceData->markerEnd == resource))
+ m_inheritedResourceData.access().markerEnd = resource;
+}
+
+inline void SVGRenderStyle::setBitDefaults()
+{
+ m_inheritedFlags.clipRule = initialClipRule();
+ m_inheritedFlags.colorRendering = initialColorRendering();
+ m_inheritedFlags.fillRule = initialFillRule();
+ m_inheritedFlags.shapeRendering = initialShapeRendering();
+ m_inheritedFlags.textAnchor = initialTextAnchor();
+ m_inheritedFlags.capStyle = initialCapStyle();
+ m_inheritedFlags.joinStyle = initialJoinStyle();
+ m_inheritedFlags.colorInterpolation = initialColorInterpolation();
+ m_inheritedFlags.colorInterpolationFilters = initialColorInterpolationFilters();
+ m_inheritedFlags.glyphOrientationHorizontal = initialGlyphOrientationHorizontal();
+ m_inheritedFlags.glyphOrientationVertical = initialGlyphOrientationVertical();
+ m_inheritedFlags.paintOrder = initialPaintOrder();
+
+ m_nonInheritedFlags.flags = 0;
+ m_nonInheritedFlags.flagBits.alignmentBaseline = initialAlignmentBaseline();
+ m_nonInheritedFlags.flagBits.dominantBaseline = initialDominantBaseline();
+ m_nonInheritedFlags.flagBits.baselineShift = initialBaselineShift();
+ m_nonInheritedFlags.flagBits.vectorEffect = initialVectorEffect();
+ m_nonInheritedFlags.flagBits.bufferedRendering = initialBufferedRendering();
+ m_nonInheritedFlags.flagBits.maskType = initialMaskType();
+}
+
+inline bool SVGRenderStyle::InheritedFlags::operator==(const InheritedFlags& other) const
+{
+ return colorRendering == other.colorRendering
+ && shapeRendering == other.shapeRendering
+ && clipRule == other.clipRule
+ && fillRule == other.fillRule
+ && capStyle == other.capStyle
+ && joinStyle == other.joinStyle
+ && textAnchor == other.textAnchor
+ && colorInterpolation == other.colorInterpolation
+ && colorInterpolationFilters == other.colorInterpolationFilters
+ && glyphOrientationHorizontal == other.glyphOrientationHorizontal
+ && glyphOrientationVertical == other.glyphOrientationVertical
+ && paintOrder == other.paintOrder;
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/ShapeValue.h b/Source/WebCore/rendering/style/ShapeValue.h
index 6d767ae..b749a26 100644
--- a/Source/WebCore/rendering/style/ShapeValue.h
+++ b/Source/WebCore/rendering/style/ShapeValue.h
@@ -37,7 +37,7 @@
class ShapeValue : public RefCounted<ShapeValue> {
public:
- static Ref<ShapeValue> create(RefPtr<BasicShape>&& shape, CSSBoxType cssBox)
+ static Ref<ShapeValue> create(Ref<BasicShape>&& shape, CSSBoxType cssBox)
{
return adoptRef(*new ShapeValue(WTFMove(shape), cssBox));
}
@@ -47,7 +47,7 @@
return adoptRef(*new ShapeValue(boxShape));
}
- static Ref<ShapeValue> create(RefPtr<StyleImage>&& image)
+ static Ref<ShapeValue> create(Ref<StyleImage>&& image)
{
return adoptRef(*new ShapeValue(WTFMove(image)));
}
@@ -72,14 +72,14 @@
}
private:
- ShapeValue(RefPtr<BasicShape>&& shape, CSSBoxType cssBox)
+ ShapeValue(Ref<BasicShape>&& shape, CSSBoxType cssBox)
: m_type(Type::Shape)
, m_shape(WTFMove(shape))
, m_cssBox(cssBox)
{
}
- explicit ShapeValue(RefPtr<StyleImage>&& image)
+ explicit ShapeValue(Ref<StyleImage>&& image)
: m_type(Type::Image)
, m_image(WTFMove(image))
{
diff --git a/Source/WebCore/rendering/style/StyleBackgroundData.cpp b/Source/WebCore/rendering/style/StyleBackgroundData.cpp
index 1ba36c4..ae3835c 100644
--- a/Source/WebCore/rendering/style/StyleBackgroundData.cpp
+++ b/Source/WebCore/rendering/style/StyleBackgroundData.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -28,16 +28,16 @@
namespace WebCore {
StyleBackgroundData::StyleBackgroundData()
- : m_background(BackgroundFillLayer)
- , m_color(RenderStyle::initialBackgroundColor())
+ : background(BackgroundFillLayer)
+ , color(RenderStyle::initialBackgroundColor())
{
}
-inline StyleBackgroundData::StyleBackgroundData(const StyleBackgroundData& o)
+inline StyleBackgroundData::StyleBackgroundData(const StyleBackgroundData& other)
: RefCounted<StyleBackgroundData>()
- , m_background(o.m_background)
- , m_color(o.m_color)
- , m_outline(o.m_outline)
+ , background(other.background)
+ , color(other.color)
+ , outline(other.outline)
{
}
@@ -46,18 +46,18 @@
return adoptRef(*new StyleBackgroundData(*this));
}
-bool StyleBackgroundData::operator==(const StyleBackgroundData& o) const
+bool StyleBackgroundData::operator==(const StyleBackgroundData& other) const
{
- return m_background == o.m_background && m_color == o.m_color && m_outline == o.m_outline;
+ return background == other.background && color == other.color && outline == other.outline;
}
bool StyleBackgroundData::isEquivalentForPainting(const StyleBackgroundData& other) const
{
- if (m_background != other.m_background || m_color != other.m_color)
+ if (background != other.background || color != other.color)
return false;
- if (!m_outline.isVisible() && !other.m_outline.isVisible())
+ if (!outline.isVisible() && !other.outline.isVisible())
return true;
- return m_outline == other.m_outline;
+ return outline == other.outline;
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleBackgroundData.h b/Source/WebCore/rendering/style/StyleBackgroundData.h
index 144777a..9b95ee0 100644
--- a/Source/WebCore/rendering/style/StyleBackgroundData.h
+++ b/Source/WebCore/rendering/style/StyleBackgroundData.h
@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -36,29 +36,19 @@
public:
static Ref<StyleBackgroundData> create() { return adoptRef(*new StyleBackgroundData); }
Ref<StyleBackgroundData> copy() const;
- ~StyleBackgroundData() { }
- bool operator==(const StyleBackgroundData& o) const;
- bool operator!=(const StyleBackgroundData& o) const
- {
- return !(*this == o);
- }
+ bool operator==(const StyleBackgroundData&) const;
+ bool operator!=(const StyleBackgroundData& other) const { return !(*this == other); }
bool isEquivalentForPainting(const StyleBackgroundData&) const;
- const FillLayer& background() const { return m_background; }
- const Color& color() const { return m_color; }
- const OutlineValue& outline() const { return m_outline; }
+ FillLayer background;
+ Color color;
+ OutlineValue outline;
private:
- friend class RenderStyle;
-
StyleBackgroundData();
- StyleBackgroundData(const StyleBackgroundData&);
-
- FillLayer m_background;
- Color m_color;
- OutlineValue m_outline;
+ StyleBackgroundData(const StyleBackgroundData&);
};
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleCachedImage.cpp b/Source/WebCore/rendering/style/StyleCachedImage.cpp
index f70691b..692395b 100644
--- a/Source/WebCore/rendering/style/StyleCachedImage.cpp
+++ b/Source/WebCore/rendering/style/StyleCachedImage.cpp
@@ -98,7 +98,7 @@
Ref<CSSValue> StyleCachedImage::cssValue() const
{
- return const_cast<CSSValue&>(m_cssValue.get());
+ return m_cssValue.copyRef();
}
bool StyleCachedImage::canRender(const RenderElement* renderer, float multiplier) const
diff --git a/Source/WebCore/rendering/style/StyleCustomPropertyData.h b/Source/WebCore/rendering/style/StyleCustomPropertyData.h
index c6ffa75..88f1831 100644
--- a/Source/WebCore/rendering/style/StyleCustomPropertyData.h
+++ b/Source/WebCore/rendering/style/StyleCustomPropertyData.h
@@ -35,50 +35,41 @@
static Ref<StyleCustomPropertyData> create() { return adoptRef(*new StyleCustomPropertyData); }
Ref<StyleCustomPropertyData> copy() const { return adoptRef(*new StyleCustomPropertyData(*this)); }
- bool operator==(const StyleCustomPropertyData& o) const
+ bool operator==(const StyleCustomPropertyData& other) const
{
- if (m_containsVariables != o.m_containsVariables)
+ if (containsVariables != other.containsVariables)
return false;
-
- if (m_values.size() != o.m_values.size())
+
+ if (values.size() != other.values.size())
return false;
-
- for (WTF::KeyValuePair<AtomicString, RefPtr<CSSCustomPropertyValue>> entry : m_values) {
- RefPtr<CSSCustomPropertyValue> other = o.m_values.get(entry.key);
- if (!other || !entry.value->equals(*other))
+
+ for (auto& entry : values) {
+ auto otherEntry = other.values.find(entry.key);
+ if (otherEntry == other.values.end() || !entry.value->equals(*otherEntry->value))
return false;
}
+
return true;
}
- bool operator!=(const StyleCustomPropertyData &o) const { return !(*this == o); }
+ bool operator!=(const StyleCustomPropertyData& other) const { return !(*this == other); }
- void setCustomPropertyValue(const AtomicString& name, const RefPtr<CSSCustomPropertyValue>& value)
+ void setCustomPropertyValue(const AtomicString& name, Ref<CSSCustomPropertyValue>&& value)
{
- m_values.set(name, value);
if (value->containsVariables())
- m_containsVariables = true;
+ containsVariables = true;
+ values.set(name, WTFMove(value));
}
- RefPtr<CSSCustomPropertyValue> getCustomPropertyValue(const AtomicString& name) const { return m_values.get(name); }
- CustomPropertyValueMap& values() { return m_values; }
-
- bool hasCustomProperty(const AtomicString& name) const { return m_values.contains(name); }
-
- bool containsVariables() const { return m_containsVariables; }
- void setContainsVariables(bool containsVariables) { m_containsVariables = containsVariables; }
-
- CustomPropertyValueMap m_values;
- bool m_containsVariables { false };
+ CustomPropertyValueMap values;
+ bool containsVariables { false };
private:
- explicit StyleCustomPropertyData()
- : RefCounted<StyleCustomPropertyData>()
- { }
+ StyleCustomPropertyData() = default;
StyleCustomPropertyData(const StyleCustomPropertyData& other)
: RefCounted<StyleCustomPropertyData>()
- , m_values(CustomPropertyValueMap(other.m_values))
- , m_containsVariables(other.m_containsVariables)
+ , values(other.values)
+ , containsVariables(other.containsVariables)
{ }
};
diff --git a/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.cpp b/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.cpp
index 32f7805..1fafa2d 100644
--- a/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.cpp
+++ b/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.cpp
@@ -28,8 +28,8 @@
StyleDeprecatedFlexibleBoxData::StyleDeprecatedFlexibleBoxData()
: flex(RenderStyle::initialBoxFlex())
- , flex_group(RenderStyle::initialBoxFlexGroup())
- , ordinal_group(RenderStyle::initialBoxOrdinalGroup())
+ , flexGroup(RenderStyle::initialBoxFlexGroup())
+ , ordinalGroup(RenderStyle::initialBoxOrdinalGroup())
, align(RenderStyle::initialBoxAlign())
, pack(RenderStyle::initialBoxPack())
, orient(RenderStyle::initialBoxOrient())
@@ -37,15 +37,15 @@
{
}
-inline StyleDeprecatedFlexibleBoxData::StyleDeprecatedFlexibleBoxData(const StyleDeprecatedFlexibleBoxData& o)
+inline StyleDeprecatedFlexibleBoxData::StyleDeprecatedFlexibleBoxData(const StyleDeprecatedFlexibleBoxData& other)
: RefCounted<StyleDeprecatedFlexibleBoxData>()
- , flex(o.flex)
- , flex_group(o.flex_group)
- , ordinal_group(o.ordinal_group)
- , align(o.align)
- , pack(o.pack)
- , orient(o.orient)
- , lines(o.lines)
+ , flex(other.flex)
+ , flexGroup(other.flexGroup)
+ , ordinalGroup(other.ordinalGroup)
+ , align(other.align)
+ , pack(other.pack)
+ , orient(other.orient)
+ , lines(other.lines)
{
}
@@ -54,11 +54,11 @@
return adoptRef(*new StyleDeprecatedFlexibleBoxData(*this));
}
-bool StyleDeprecatedFlexibleBoxData::operator==(const StyleDeprecatedFlexibleBoxData& o) const
+bool StyleDeprecatedFlexibleBoxData::operator==(const StyleDeprecatedFlexibleBoxData& other) const
{
- return flex == o.flex && flex_group == o.flex_group &&
- ordinal_group == o.ordinal_group && align == o.align &&
- pack == o.pack && orient == o.orient && lines == o.lines;
+ return flex == other.flex && flexGroup == other.flexGroup
+ && ordinalGroup == other.ordinalGroup && align == other.align
+ && pack == other.pack && orient == other.orient && lines == other.lines;
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.h b/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.h
index 7f000bb..330cf64 100644
--- a/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.h
+++ b/Source/WebCore/rendering/style/StyleDeprecatedFlexibleBoxData.h
@@ -35,14 +35,14 @@
Ref<StyleDeprecatedFlexibleBoxData> copy() const;
bool operator==(const StyleDeprecatedFlexibleBoxData&) const;
- bool operator!=(const StyleDeprecatedFlexibleBoxData& o) const
+ bool operator!=(const StyleDeprecatedFlexibleBoxData& other) const
{
- return !(*this == o);
+ return !(*this == other);
}
float flex;
- unsigned int flex_group;
- unsigned int ordinal_group;
+ unsigned flexGroup;
+ unsigned ordinalGroup;
unsigned align : 3; // EBoxAlignment
unsigned pack: 2; // EBoxPack
diff --git a/Source/WebCore/rendering/style/StyleFilterData.cpp b/Source/WebCore/rendering/style/StyleFilterData.cpp
index b0d3be1..20dbc08 100644
--- a/Source/WebCore/rendering/style/StyleFilterData.cpp
+++ b/Source/WebCore/rendering/style/StyleFilterData.cpp
@@ -26,19 +26,15 @@
#include "config.h"
#include "StyleFilterData.h"
-#include "FEGaussianBlur.h"
-#include "RenderStyle.h"
-
namespace WebCore {
StyleFilterData::StyleFilterData()
- : m_operations()
{
}
-inline StyleFilterData::StyleFilterData(const StyleFilterData& o)
+inline StyleFilterData::StyleFilterData(const StyleFilterData& other)
: RefCounted<StyleFilterData>()
- , m_operations(o.m_operations)
+ , operations(other.operations)
{
}
@@ -47,9 +43,9 @@
return adoptRef(*new StyleFilterData(*this));
}
-bool StyleFilterData::operator==(const StyleFilterData& o) const
+bool StyleFilterData::operator==(const StyleFilterData& other) const
{
- return m_operations == o.m_operations;
+ return operations == other.operations;
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleFilterData.h b/Source/WebCore/rendering/style/StyleFilterData.h
index c96e31e..a8ba831 100644
--- a/Source/WebCore/rendering/style/StyleFilterData.h
+++ b/Source/WebCore/rendering/style/StyleFilterData.h
@@ -42,7 +42,7 @@
return !(*this == o);
}
- FilterOperations m_operations;
+ FilterOperations operations;
private:
StyleFilterData();
diff --git a/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp b/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
index 99e55eb..a821844 100644
--- a/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
+++ b/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
@@ -31,21 +31,21 @@
namespace WebCore {
StyleFlexibleBoxData::StyleFlexibleBoxData()
- : m_flexGrow(RenderStyle::initialFlexGrow())
- , m_flexShrink(RenderStyle::initialFlexShrink())
- , m_flexBasis(RenderStyle::initialFlexBasis())
- , m_flexDirection(RenderStyle::initialFlexDirection())
- , m_flexWrap(RenderStyle::initialFlexWrap())
+ : flexGrow(RenderStyle::initialFlexGrow())
+ , flexShrink(RenderStyle::initialFlexShrink())
+ , flexBasis(RenderStyle::initialFlexBasis())
+ , flexDirection(RenderStyle::initialFlexDirection())
+ , flexWrap(RenderStyle::initialFlexWrap())
{
}
-inline StyleFlexibleBoxData::StyleFlexibleBoxData(const StyleFlexibleBoxData& o)
+inline StyleFlexibleBoxData::StyleFlexibleBoxData(const StyleFlexibleBoxData& other)
: RefCounted<StyleFlexibleBoxData>()
- , m_flexGrow(o.m_flexGrow)
- , m_flexShrink(o.m_flexShrink)
- , m_flexBasis(o.m_flexBasis)
- , m_flexDirection(o.m_flexDirection)
- , m_flexWrap(o.m_flexWrap)
+ , flexGrow(other.flexGrow)
+ , flexShrink(other.flexShrink)
+ , flexBasis(other.flexBasis)
+ , flexDirection(other.flexDirection)
+ , flexWrap(other.flexWrap)
{
}
@@ -54,10 +54,10 @@
return adoptRef(*new StyleFlexibleBoxData(*this));
}
-bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& o) const
+bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& other) const
{
- return m_flexGrow == o.m_flexGrow && m_flexShrink == o.m_flexShrink && m_flexBasis == o.m_flexBasis
- && m_flexDirection == o.m_flexDirection && m_flexWrap == o.m_flexWrap;
+ return flexGrow == other.flexGrow && flexShrink == other.flexShrink && flexBasis == other.flexBasis
+ && flexDirection == other.flexDirection && flexWrap == other.flexWrap;
}
}
diff --git a/Source/WebCore/rendering/style/StyleFlexibleBoxData.h b/Source/WebCore/rendering/style/StyleFlexibleBoxData.h
index 3238b86..f54d859 100644
--- a/Source/WebCore/rendering/style/StyleFlexibleBoxData.h
+++ b/Source/WebCore/rendering/style/StyleFlexibleBoxData.h
@@ -42,12 +42,12 @@
return !(*this == o);
}
- float m_flexGrow;
- float m_flexShrink;
- Length m_flexBasis;
+ float flexGrow;
+ float flexShrink;
+ Length flexBasis;
- unsigned m_flexDirection : 2; // EFlexDirection
- unsigned m_flexWrap : 2; // EFlexWrap
+ unsigned flexDirection : 2; // EFlexDirection
+ unsigned flexWrap : 2; // EFlexWrap
private:
StyleFlexibleBoxData();
diff --git a/Source/WebCore/rendering/style/StyleGeneratedImage.cpp b/Source/WebCore/rendering/style/StyleGeneratedImage.cpp
index 2c84b2f..b006378 100644
--- a/Source/WebCore/rendering/style/StyleGeneratedImage.cpp
+++ b/Source/WebCore/rendering/style/StyleGeneratedImage.cpp
@@ -39,7 +39,7 @@
Ref<CSSValue> StyleGeneratedImage::cssValue() const
{
- return const_cast<CSSImageGeneratorValue&>(m_imageGeneratorValue.get());
+ return m_imageGeneratorValue.copyRef();
}
bool StyleGeneratedImage::isPending() const
@@ -56,7 +56,7 @@
{
ASSERT(renderer);
if (m_fixedSize) {
- FloatSize fixedSize = const_cast<CSSImageGeneratorValue&>(m_imageGeneratorValue.get()).fixedSize(*renderer);
+ FloatSize fixedSize = m_imageGeneratorValue->fixedSize(*renderer);
if (multiplier == 1.0f)
return fixedSize;
@@ -101,7 +101,7 @@
RefPtr<Image> StyleGeneratedImage::image(RenderElement* renderer, const FloatSize& size) const
{
ASSERT(renderer);
- return const_cast<CSSImageGeneratorValue&>(m_imageGeneratorValue.get()).image(*renderer, size);
+ return m_imageGeneratorValue->image(*renderer, size);
}
bool StyleGeneratedImage::knownToBeOpaque(const RenderElement* renderer) const
diff --git a/Source/WebCore/rendering/style/StyleGridData.cpp b/Source/WebCore/rendering/style/StyleGridData.cpp
index 5480604..c141ef7 100644
--- a/Source/WebCore/rendering/style/StyleGridData.cpp
+++ b/Source/WebCore/rendering/style/StyleGridData.cpp
@@ -33,59 +33,59 @@
namespace WebCore {
StyleGridData::StyleGridData()
- : m_gridColumns(RenderStyle::initialGridColumns())
- , m_gridRows(RenderStyle::initialGridRows())
- , m_namedGridColumnLines(RenderStyle::initialNamedGridColumnLines())
- , m_namedGridRowLines(RenderStyle::initialNamedGridRowLines())
- , m_orderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines())
- , m_orderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines())
- , m_autoRepeatNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines())
- , m_autoRepeatNamedGridRowLines(RenderStyle::initialNamedGridRowLines())
- , m_autoRepeatOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines())
- , m_autoRepeatOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines())
- , m_gridAutoFlow(RenderStyle::initialGridAutoFlow())
- , m_gridAutoRows(RenderStyle::initialGridAutoRows())
- , m_gridAutoColumns(RenderStyle::initialGridAutoColumns())
- , m_namedGridArea(RenderStyle::initialNamedGridArea())
- , m_namedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount())
- , m_namedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount())
- , m_gridColumnGap(RenderStyle::initialGridColumnGap())
- , m_gridRowGap(RenderStyle::initialGridRowGap())
- , m_gridAutoRepeatColumns(RenderStyle::initialGridAutoRepeatTracks())
- , m_gridAutoRepeatRows(RenderStyle::initialGridAutoRepeatTracks())
- , m_autoRepeatColumnsInsertionPoint(RenderStyle::initialGridAutoRepeatInsertionPoint())
- , m_autoRepeatRowsInsertionPoint(RenderStyle::initialGridAutoRepeatInsertionPoint())
- , m_autoRepeatColumnsType(RenderStyle::initialGridAutoRepeatType())
- , m_autoRepeatRowsType(RenderStyle::initialGridAutoRepeatType())
+ : gridColumns(RenderStyle::initialGridColumns())
+ , gridRows(RenderStyle::initialGridRows())
+ , namedGridColumnLines(RenderStyle::initialNamedGridColumnLines())
+ , namedGridRowLines(RenderStyle::initialNamedGridRowLines())
+ , orderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines())
+ , orderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines())
+ , autoRepeatNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines())
+ , autoRepeatNamedGridRowLines(RenderStyle::initialNamedGridRowLines())
+ , autoRepeatOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines())
+ , autoRepeatOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines())
+ , gridAutoFlow(RenderStyle::initialGridAutoFlow())
+ , gridAutoRows(RenderStyle::initialGridAutoRows())
+ , gridAutoColumns(RenderStyle::initialGridAutoColumns())
+ , namedGridArea(RenderStyle::initialNamedGridArea())
+ , namedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount())
+ , namedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount())
+ , gridColumnGap(RenderStyle::initialGridColumnGap())
+ , gridRowGap(RenderStyle::initialGridRowGap())
+ , gridAutoRepeatColumns(RenderStyle::initialGridAutoRepeatTracks())
+ , gridAutoRepeatRows(RenderStyle::initialGridAutoRepeatTracks())
+ , autoRepeatColumnsInsertionPoint(RenderStyle::initialGridAutoRepeatInsertionPoint())
+ , autoRepeatRowsInsertionPoint(RenderStyle::initialGridAutoRepeatInsertionPoint())
+ , autoRepeatColumnsType(RenderStyle::initialGridAutoRepeatType())
+ , autoRepeatRowsType(RenderStyle::initialGridAutoRepeatType())
{
}
inline StyleGridData::StyleGridData(const StyleGridData& o)
: RefCounted<StyleGridData>()
- , m_gridColumns(o.m_gridColumns)
- , m_gridRows(o.m_gridRows)
- , m_namedGridColumnLines(o.m_namedGridColumnLines)
- , m_namedGridRowLines(o.m_namedGridRowLines)
- , m_orderedNamedGridColumnLines(o.m_orderedNamedGridColumnLines)
- , m_orderedNamedGridRowLines(o.m_orderedNamedGridRowLines)
- , m_autoRepeatNamedGridColumnLines(o.m_autoRepeatNamedGridColumnLines)
- , m_autoRepeatNamedGridRowLines(o.m_autoRepeatNamedGridRowLines)
- , m_autoRepeatOrderedNamedGridColumnLines(o.m_autoRepeatOrderedNamedGridColumnLines)
- , m_autoRepeatOrderedNamedGridRowLines(o.m_autoRepeatOrderedNamedGridRowLines)
- , m_gridAutoFlow(o.m_gridAutoFlow)
- , m_gridAutoRows(o.m_gridAutoRows)
- , m_gridAutoColumns(o.m_gridAutoColumns)
- , m_namedGridArea(o.m_namedGridArea)
- , m_namedGridAreaRowCount(o.m_namedGridAreaRowCount)
- , m_namedGridAreaColumnCount(o.m_namedGridAreaColumnCount)
- , m_gridColumnGap(o.m_gridColumnGap)
- , m_gridRowGap(o.m_gridRowGap)
- , m_gridAutoRepeatColumns(o.m_gridAutoRepeatColumns)
- , m_gridAutoRepeatRows(o.m_gridAutoRepeatRows)
- , m_autoRepeatColumnsInsertionPoint(o.m_autoRepeatColumnsInsertionPoint)
- , m_autoRepeatRowsInsertionPoint(o.m_autoRepeatRowsInsertionPoint)
- , m_autoRepeatColumnsType(o.m_autoRepeatColumnsType)
- , m_autoRepeatRowsType(o.m_autoRepeatRowsType)
+ , gridColumns(o.gridColumns)
+ , gridRows(o.gridRows)
+ , namedGridColumnLines(o.namedGridColumnLines)
+ , namedGridRowLines(o.namedGridRowLines)
+ , orderedNamedGridColumnLines(o.orderedNamedGridColumnLines)
+ , orderedNamedGridRowLines(o.orderedNamedGridRowLines)
+ , autoRepeatNamedGridColumnLines(o.autoRepeatNamedGridColumnLines)
+ , autoRepeatNamedGridRowLines(o.autoRepeatNamedGridRowLines)
+ , autoRepeatOrderedNamedGridColumnLines(o.autoRepeatOrderedNamedGridColumnLines)
+ , autoRepeatOrderedNamedGridRowLines(o.autoRepeatOrderedNamedGridRowLines)
+ , gridAutoFlow(o.gridAutoFlow)
+ , gridAutoRows(o.gridAutoRows)
+ , gridAutoColumns(o.gridAutoColumns)
+ , namedGridArea(o.namedGridArea)
+ , namedGridAreaRowCount(o.namedGridAreaRowCount)
+ , namedGridAreaColumnCount(o.namedGridAreaColumnCount)
+ , gridColumnGap(o.gridColumnGap)
+ , gridRowGap(o.gridRowGap)
+ , gridAutoRepeatColumns(o.gridAutoRepeatColumns)
+ , gridAutoRepeatRows(o.gridAutoRepeatRows)
+ , autoRepeatColumnsInsertionPoint(o.autoRepeatColumnsInsertionPoint)
+ , autoRepeatRowsInsertionPoint(o.autoRepeatRowsInsertionPoint)
+ , autoRepeatColumnsType(o.autoRepeatColumnsType)
+ , autoRepeatRowsType(o.autoRepeatRowsType)
{
}
diff --git a/Source/WebCore/rendering/style/StyleGridData.h b/Source/WebCore/rendering/style/StyleGridData.h
index 144efab..b11f30a 100644
--- a/Source/WebCore/rendering/style/StyleGridData.h
+++ b/Source/WebCore/rendering/style/StyleGridData.h
@@ -48,18 +48,18 @@
bool operator==(const StyleGridData& o) const
{
// FIXME: comparing two hashes doesn't look great for performance. Something to keep in mind going forward.
- return m_gridColumns == o.m_gridColumns && m_gridRows == o.m_gridRows
- && m_gridAutoFlow == o.m_gridAutoFlow && m_gridAutoRows == o.m_gridAutoRows && m_gridAutoColumns == o.m_gridAutoColumns
- && m_namedGridColumnLines == o.m_namedGridColumnLines && m_namedGridRowLines == o.m_namedGridRowLines
- && m_autoRepeatNamedGridColumnLines == o.m_autoRepeatNamedGridColumnLines && m_autoRepeatNamedGridRowLines == o.m_autoRepeatNamedGridRowLines
- && m_autoRepeatOrderedNamedGridColumnLines == o.m_autoRepeatOrderedNamedGridColumnLines && m_autoRepeatOrderedNamedGridRowLines == o.m_autoRepeatOrderedNamedGridRowLines
- && m_namedGridArea == o.m_namedGridArea && m_namedGridArea == o.m_namedGridArea
- && m_namedGridAreaRowCount == o.m_namedGridAreaRowCount && m_namedGridAreaColumnCount == o.m_namedGridAreaColumnCount
- && m_orderedNamedGridRowLines == o.m_orderedNamedGridRowLines && m_orderedNamedGridColumnLines == o.m_orderedNamedGridColumnLines
- && m_gridColumnGap == o.m_gridColumnGap && m_gridRowGap == o.m_gridRowGap
- && m_gridAutoRepeatColumns == o.m_gridAutoRepeatColumns && m_gridAutoRepeatRows == o.m_gridAutoRepeatRows
- && m_autoRepeatColumnsInsertionPoint == o.m_autoRepeatColumnsInsertionPoint && m_autoRepeatRowsInsertionPoint == o.m_autoRepeatRowsInsertionPoint
- && m_autoRepeatColumnsType == o.m_autoRepeatColumnsType && m_autoRepeatRowsType == o.m_autoRepeatRowsType;
+ return gridColumns == o.gridColumns && gridRows == o.gridRows
+ && gridAutoFlow == o.gridAutoFlow && gridAutoRows == o.gridAutoRows && gridAutoColumns == o.gridAutoColumns
+ && namedGridColumnLines == o.namedGridColumnLines && namedGridRowLines == o.namedGridRowLines
+ && autoRepeatNamedGridColumnLines == o.autoRepeatNamedGridColumnLines && autoRepeatNamedGridRowLines == o.autoRepeatNamedGridRowLines
+ && autoRepeatOrderedNamedGridColumnLines == o.autoRepeatOrderedNamedGridColumnLines && autoRepeatOrderedNamedGridRowLines == o.autoRepeatOrderedNamedGridRowLines
+ && namedGridArea == o.namedGridArea && namedGridArea == o.namedGridArea
+ && namedGridAreaRowCount == o.namedGridAreaRowCount && namedGridAreaColumnCount == o.namedGridAreaColumnCount
+ && orderedNamedGridRowLines == o.orderedNamedGridRowLines && orderedNamedGridColumnLines == o.orderedNamedGridColumnLines
+ && gridColumnGap == o.gridColumnGap && gridRowGap == o.gridRowGap
+ && gridAutoRepeatColumns == o.gridAutoRepeatColumns && gridAutoRepeatRows == o.gridAutoRepeatRows
+ && autoRepeatColumnsInsertionPoint == o.autoRepeatColumnsInsertionPoint && autoRepeatRowsInsertionPoint == o.autoRepeatRowsInsertionPoint
+ && autoRepeatColumnsType == o.autoRepeatColumnsType && autoRepeatRowsType == o.autoRepeatRowsType;
}
bool operator!=(const StyleGridData& o) const
@@ -67,43 +67,42 @@
return !(*this == o);
}
- // FIXME: Update the naming of the following variables.
- Vector<GridTrackSize> m_gridColumns;
- Vector<GridTrackSize> m_gridRows;
+ Vector<GridTrackSize> gridColumns;
+ Vector<GridTrackSize> gridRows;
- NamedGridLinesMap m_namedGridColumnLines;
- NamedGridLinesMap m_namedGridRowLines;
+ NamedGridLinesMap namedGridColumnLines;
+ NamedGridLinesMap namedGridRowLines;
- OrderedNamedGridLinesMap m_orderedNamedGridColumnLines;
- OrderedNamedGridLinesMap m_orderedNamedGridRowLines;
+ OrderedNamedGridLinesMap orderedNamedGridColumnLines;
+ OrderedNamedGridLinesMap orderedNamedGridRowLines;
- NamedGridLinesMap m_autoRepeatNamedGridColumnLines;
- NamedGridLinesMap m_autoRepeatNamedGridRowLines;
- OrderedNamedGridLinesMap m_autoRepeatOrderedNamedGridColumnLines;
- OrderedNamedGridLinesMap m_autoRepeatOrderedNamedGridRowLines;
+ NamedGridLinesMap autoRepeatNamedGridColumnLines;
+ NamedGridLinesMap autoRepeatNamedGridRowLines;
+ OrderedNamedGridLinesMap autoRepeatOrderedNamedGridColumnLines;
+ OrderedNamedGridLinesMap autoRepeatOrderedNamedGridRowLines;
- unsigned m_gridAutoFlow : GridAutoFlowBits;
+ unsigned gridAutoFlow : GridAutoFlowBits;
- Vector<GridTrackSize> m_gridAutoRows;
- Vector<GridTrackSize> m_gridAutoColumns;
+ Vector<GridTrackSize> gridAutoRows;
+ Vector<GridTrackSize> gridAutoColumns;
- NamedGridAreaMap m_namedGridArea;
- // Because m_namedGridArea doesn't store the unnamed grid areas, we need to keep track
+ NamedGridAreaMap namedGridArea;
+ // Because namedGridArea doesn't store the unnamed grid areas, we need to keep track
// of the explicit grid size defined by both named and unnamed grid areas.
- unsigned m_namedGridAreaRowCount;
- unsigned m_namedGridAreaColumnCount;
+ unsigned namedGridAreaRowCount;
+ unsigned namedGridAreaColumnCount;
- Length m_gridColumnGap;
- Length m_gridRowGap;
+ Length gridColumnGap;
+ Length gridRowGap;
- Vector<GridTrackSize> m_gridAutoRepeatColumns;
- Vector<GridTrackSize> m_gridAutoRepeatRows;
+ Vector<GridTrackSize> gridAutoRepeatColumns;
+ Vector<GridTrackSize> gridAutoRepeatRows;
- unsigned m_autoRepeatColumnsInsertionPoint;
- unsigned m_autoRepeatRowsInsertionPoint;
+ unsigned autoRepeatColumnsInsertionPoint;
+ unsigned autoRepeatRowsInsertionPoint;
- AutoRepeatType m_autoRepeatColumnsType;
- AutoRepeatType m_autoRepeatRowsType;
+ AutoRepeatType autoRepeatColumnsType;
+ AutoRepeatType autoRepeatRowsType;
private:
StyleGridData();
diff --git a/Source/WebCore/rendering/style/StyleGridItemData.cpp b/Source/WebCore/rendering/style/StyleGridItemData.cpp
index 102be90..c2db8e7 100644
--- a/Source/WebCore/rendering/style/StyleGridItemData.cpp
+++ b/Source/WebCore/rendering/style/StyleGridItemData.cpp
@@ -27,6 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "config.h"
#include "StyleGridItemData.h"
@@ -37,19 +38,19 @@
namespace WebCore {
StyleGridItemData::StyleGridItemData()
- : m_gridColumnStart(RenderStyle::initialGridItemColumnStart())
- , m_gridColumnEnd(RenderStyle::initialGridItemColumnEnd())
- , m_gridRowStart(RenderStyle::initialGridItemRowStart())
- , m_gridRowEnd(RenderStyle::initialGridItemRowEnd())
+ : gridColumnStart(RenderStyle::initialGridItemColumnStart())
+ , gridColumnEnd(RenderStyle::initialGridItemColumnEnd())
+ , gridRowStart(RenderStyle::initialGridItemRowStart())
+ , gridRowEnd(RenderStyle::initialGridItemRowEnd())
{
}
inline StyleGridItemData::StyleGridItemData(const StyleGridItemData& o)
: RefCounted<StyleGridItemData>()
- , m_gridColumnStart(o.m_gridColumnStart)
- , m_gridColumnEnd(o.m_gridColumnEnd)
- , m_gridRowStart(o.m_gridRowStart)
- , m_gridRowEnd(o.m_gridRowEnd)
+ , gridColumnStart(o.gridColumnStart)
+ , gridColumnEnd(o.gridColumnEnd)
+ , gridRowStart(o.gridRowStart)
+ , gridRowEnd(o.gridRowEnd)
{
}
@@ -60,4 +61,4 @@
} // namespace WebCore
-#endif /* ENABLE(CSS_GRID_LAYOUT) */
+#endif
diff --git a/Source/WebCore/rendering/style/StyleGridItemData.h b/Source/WebCore/rendering/style/StyleGridItemData.h
index 8b28d94..80c84fc 100644
--- a/Source/WebCore/rendering/style/StyleGridItemData.h
+++ b/Source/WebCore/rendering/style/StyleGridItemData.h
@@ -45,8 +45,8 @@
bool operator==(const StyleGridItemData& o) const
{
- return m_gridColumnStart == o.m_gridColumnStart && m_gridColumnEnd == o.m_gridColumnEnd
- && m_gridRowStart == o.m_gridRowStart && m_gridRowEnd == o.m_gridRowEnd;
+ return gridColumnStart == o.gridColumnStart && gridColumnEnd == o.gridColumnEnd
+ && gridRowStart == o.gridRowStart && gridRowEnd == o.gridRowEnd;
}
bool operator!=(const StyleGridItemData& o) const
@@ -54,10 +54,10 @@
return !(*this == o);
}
- GridPosition m_gridColumnStart;
- GridPosition m_gridColumnEnd;
- GridPosition m_gridRowStart;
- GridPosition m_gridRowEnd;
+ GridPosition gridColumnStart;
+ GridPosition gridColumnEnd;
+ GridPosition gridRowStart;
+ GridPosition gridRowEnd;
private:
StyleGridItemData();
diff --git a/Source/WebCore/rendering/style/StyleInheritedData.cpp b/Source/WebCore/rendering/style/StyleInheritedData.cpp
index 6339f6d..a5e357e 100644
--- a/Source/WebCore/rendering/style/StyleInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleInheritedData.cpp
@@ -27,9 +27,9 @@
namespace WebCore {
StyleInheritedData::StyleInheritedData()
- : horizontal_border_spacing(RenderStyle::initialHorizontalBorderSpacing())
- , vertical_border_spacing(RenderStyle::initialVerticalBorderSpacing())
- , line_height(RenderStyle::initialLineHeight())
+ : horizontalBorderSpacing(RenderStyle::initialHorizontalBorderSpacing())
+ , verticalBorderSpacing(RenderStyle::initialVerticalBorderSpacing())
+ , lineHeight(RenderStyle::initialLineHeight())
#if ENABLE(TEXT_AUTOSIZING)
, specifiedLineHeight(RenderStyle::initialLineHeight())
#endif
@@ -38,15 +38,11 @@
{
}
-StyleInheritedData::~StyleInheritedData()
-{
-}
-
inline StyleInheritedData::StyleInheritedData(const StyleInheritedData& o)
: RefCounted<StyleInheritedData>()
- , horizontal_border_spacing(o.horizontal_border_spacing)
- , vertical_border_spacing(o.vertical_border_spacing)
- , line_height(o.line_height)
+ , horizontalBorderSpacing(o.horizontalBorderSpacing)
+ , verticalBorderSpacing(o.verticalBorderSpacing)
+ , lineHeight(o.lineHeight)
#if ENABLE(TEXT_AUTOSIZING)
, specifiedLineHeight(o.specifiedLineHeight)
#endif
@@ -63,15 +59,15 @@
bool StyleInheritedData::operator==(const StyleInheritedData& o) const
{
- return line_height == o.line_height
+ return lineHeight == o.lineHeight
#if ENABLE(TEXT_AUTOSIZING)
&& specifiedLineHeight == o.specifiedLineHeight
#endif
&& fontCascade == o.fontCascade
&& color == o.color
&& visitedLinkColor == o.visitedLinkColor
- && horizontal_border_spacing == o.horizontal_border_spacing
- && vertical_border_spacing == o.vertical_border_spacing;
+ && horizontalBorderSpacing == o.horizontalBorderSpacing
+ && verticalBorderSpacing == o.verticalBorderSpacing;
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleInheritedData.h b/Source/WebCore/rendering/style/StyleInheritedData.h
index 29bfcb4..d655583 100644
--- a/Source/WebCore/rendering/style/StyleInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleInheritedData.h
@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -27,9 +27,6 @@
#include "Color.h"
#include "FontCascade.h"
#include "Length.h"
-#include <wtf/Ref.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
namespace WebCore {
@@ -37,20 +34,14 @@
public:
static Ref<StyleInheritedData> create() { return adoptRef(*new StyleInheritedData); }
Ref<StyleInheritedData> copy() const;
- ~StyleInheritedData();
- bool operator==(const StyleInheritedData& o) const;
- bool operator!=(const StyleInheritedData& o) const
- {
- return !(*this == o);
- }
+ bool operator==(const StyleInheritedData&) const;
+ bool operator!=(const StyleInheritedData& other) const { return !(*this == other); }
- float horizontal_border_spacing;
- float vertical_border_spacing;
+ float horizontalBorderSpacing;
+ float verticalBorderSpacing;
- // could be packed in a short but doesn't
- // make a difference currently because of padding
- Length line_height;
+ Length lineHeight;
#if ENABLE(TEXT_AUTOSIZING)
Length specifiedLineHeight;
#endif
@@ -62,6 +53,7 @@
private:
StyleInheritedData();
StyleInheritedData(const StyleInheritedData&);
+ void operator=(const StyleInheritedData&) = delete;
};
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleMultiColData.cpp b/Source/WebCore/rendering/style/StyleMultiColData.cpp
index 5c90e20..b7e794f 100644
--- a/Source/WebCore/rendering/style/StyleMultiColData.cpp
+++ b/Source/WebCore/rendering/style/StyleMultiColData.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2013 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -27,33 +27,31 @@
namespace WebCore {
StyleMultiColData::StyleMultiColData()
- : m_width(0)
- , m_count(RenderStyle::initialColumnCount())
- , m_gap(0)
- , m_autoWidth(true)
- , m_autoCount(true)
- , m_normalGap(true)
- , m_fill(RenderStyle::initialColumnFill())
- , m_columnSpan(false)
- , m_axis(RenderStyle::initialColumnAxis())
- , m_progression(RenderStyle::initialColumnProgression())
+ : count(RenderStyle::initialColumnCount())
+ , autoWidth(true)
+ , autoCount(true)
+ , normalGap(true)
+ , fill(RenderStyle::initialColumnFill())
+ , columnSpan(false)
+ , axis(RenderStyle::initialColumnAxis())
+ , progression(RenderStyle::initialColumnProgression())
{
}
-inline StyleMultiColData::StyleMultiColData(const StyleMultiColData& o)
+inline StyleMultiColData::StyleMultiColData(const StyleMultiColData& other)
: RefCounted<StyleMultiColData>()
- , m_width(o.m_width)
- , m_count(o.m_count)
- , m_gap(o.m_gap)
- , m_rule(o.m_rule)
- , m_visitedLinkColumnRuleColor(o.m_visitedLinkColumnRuleColor)
- , m_autoWidth(o.m_autoWidth)
- , m_autoCount(o.m_autoCount)
- , m_normalGap(o.m_normalGap)
- , m_fill(o.m_fill)
- , m_columnSpan(o.m_columnSpan)
- , m_axis(o.m_axis)
- , m_progression(o.m_progression)
+ , width(other.width)
+ , count(other.count)
+ , gap(other.gap)
+ , rule(other.rule)
+ , visitedLinkColumnRuleColor(other.visitedLinkColumnRuleColor)
+ , autoWidth(other.autoWidth)
+ , autoCount(other.autoCount)
+ , normalGap(other.normalGap)
+ , fill(other.fill)
+ , columnSpan(other.columnSpan)
+ , axis(other.axis)
+ , progression(other.progression)
{
}
@@ -62,13 +60,13 @@
return adoptRef(*new StyleMultiColData(*this));
}
-bool StyleMultiColData::operator==(const StyleMultiColData& o) const
+bool StyleMultiColData::operator==(const StyleMultiColData& other) const
{
- return m_width == o.m_width && m_count == o.m_count && m_gap == o.m_gap
- && m_rule == o.m_rule && m_visitedLinkColumnRuleColor == o.m_visitedLinkColumnRuleColor
- && m_autoWidth == o.m_autoWidth && m_autoCount == o.m_autoCount && m_normalGap == o.m_normalGap
- && m_fill == o.m_fill && m_columnSpan == o.m_columnSpan
- && m_axis == o.m_axis && m_progression == o.m_progression;
+ return width == other.width && count == other.count && gap == other.gap
+ && rule == other.rule && visitedLinkColumnRuleColor == other.visitedLinkColumnRuleColor
+ && autoWidth == other.autoWidth && autoCount == other.autoCount && normalGap == other.normalGap
+ && fill == other.fill && columnSpan == other.columnSpan
+ && axis == other.axis && progression == other.progression;
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleMultiColData.h b/Source/WebCore/rendering/style/StyleMultiColData.h
index 2934f98..5bdf81d 100644
--- a/Source/WebCore/rendering/style/StyleMultiColData.h
+++ b/Source/WebCore/rendering/style/StyleMultiColData.h
@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -38,32 +38,29 @@
static Ref<StyleMultiColData> create() { return adoptRef(*new StyleMultiColData); }
Ref<StyleMultiColData> copy() const;
- bool operator==(const StyleMultiColData& o) const;
- bool operator!=(const StyleMultiColData &o) const
- {
- return !(*this == o);
- }
+ bool operator==(const StyleMultiColData&) const;
+ bool operator!=(const StyleMultiColData& other) const { return !(*this == other); }
unsigned short ruleWidth() const
{
- if (m_rule.style() == BNONE || m_rule.style() == BHIDDEN)
+ if (rule.style() == BNONE || rule.style() == BHIDDEN)
return 0;
- return m_rule.width();
+ return rule.width();
}
- float m_width;
- unsigned short m_count;
- float m_gap;
- BorderValue m_rule;
- Color m_visitedLinkColumnRuleColor;
+ float width { 0 };
+ unsigned short count;
+ float gap { 0 };
+ BorderValue rule;
+ Color visitedLinkColumnRuleColor;
- bool m_autoWidth : 1;
- bool m_autoCount : 1;
- bool m_normalGap : 1;
- unsigned m_fill : 1; // ColumnFill
- unsigned m_columnSpan : 1;
- unsigned m_axis : 2; // ColumnAxis
- unsigned m_progression : 2; // ColumnProgression
+ bool autoWidth : 1;
+ bool autoCount : 1;
+ bool normalGap : 1;
+ unsigned fill : 1; // ColumnFill
+ unsigned columnSpan : 1;
+ unsigned axis : 2; // ColumnAxis
+ unsigned progression : 2; // ColumnProgression
private:
StyleMultiColData();
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
index fa29af0..fc605d4 100644
--- a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
@@ -44,7 +44,7 @@
void* refPtrs[2];
Length lengths[2];
float secondFloat;
- unsigned m_bitfields[4];
+ unsigned bitfields[4];
short pagedMediaShorts[2];
unsigned unsigneds[1];
short hyphenationShorts[3];
@@ -73,12 +73,12 @@
: listStyleImage(RenderStyle::initialListStyleImage())
, textStrokeWidth(RenderStyle::initialTextStrokeWidth())
, indent(RenderStyle::initialTextIndent())
- , m_effectiveZoom(RenderStyle::initialZoom())
- , m_customProperties(StyleCustomPropertyData::create())
+ , effectiveZoom(RenderStyle::initialZoom())
+ , customProperties(StyleCustomPropertyData::create())
, widows(RenderStyle::initialWidows())
, orphans(RenderStyle::initialOrphans())
- , m_hasAutoWidows(true)
- , m_hasAutoOrphans(true)
+ , hasAutoWidows(true)
+ , hasAutoOrphans(true)
, textSecurity(RenderStyle::initialTextSecurity())
, userModify(READ_ONLY)
, wordBreak(RenderStyle::initialWordBreak())
@@ -91,50 +91,50 @@
, textEmphasisFill(TextEmphasisFillFilled)
, textEmphasisMark(TextEmphasisMarkNone)
, textEmphasisPosition(TextEmphasisPositionOver | TextEmphasisPositionRight)
- , m_textOrientation(static_cast<unsigned>(TextOrientation::Mixed))
+ , textOrientation(static_cast<unsigned>(TextOrientation::Mixed))
#if ENABLE(CSS3_TEXT)
- , m_textIndentLine(RenderStyle::initialTextIndentLine())
- , m_textIndentType(RenderStyle::initialTextIndentType())
+ , textIndentLine(RenderStyle::initialTextIndentLine())
+ , textIndentType(RenderStyle::initialTextIndentType())
#endif
- , m_lineBoxContain(RenderStyle::initialLineBoxContain())
+ , lineBoxContain(RenderStyle::initialLineBoxContain())
#if ENABLE(CSS_IMAGE_ORIENTATION)
- , m_imageOrientation(RenderStyle::initialImageOrientation())
+ , imageOrientation(RenderStyle::initialImageOrientation())
#endif
- , m_imageRendering(RenderStyle::initialImageRendering())
- , m_lineSnap(RenderStyle::initialLineSnap())
- , m_lineAlign(RenderStyle::initialLineAlign())
+ , imageRendering(RenderStyle::initialImageRendering())
+ , lineSnap(RenderStyle::initialLineSnap())
+ , lineAlign(RenderStyle::initialLineAlign())
#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
, useTouchOverflowScrolling(RenderStyle::initialUseTouchOverflowScrolling())
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
- , m_imageResolutionSource(RenderStyle::initialImageResolutionSource())
- , m_imageResolutionSnap(RenderStyle::initialImageResolutionSnap())
+ , imageResolutionSource(RenderStyle::initialImageResolutionSource())
+ , imageResolutionSnap(RenderStyle::initialImageResolutionSnap())
#endif
#if ENABLE(CSS3_TEXT)
- , m_textAlignLast(RenderStyle::initialTextAlignLast())
- , m_textJustify(RenderStyle::initialTextJustify())
-#endif // CSS3_TEXT
- , m_textDecorationSkip(RenderStyle::initialTextDecorationSkip())
- , m_textUnderlinePosition(RenderStyle::initialTextUnderlinePosition())
- , m_rubyPosition(RenderStyle::initialRubyPosition())
- , m_textZoom(RenderStyle::initialTextZoom())
+ , textAlignLast(RenderStyle::initialTextAlignLast())
+ , textJustify(RenderStyle::initialTextJustify())
+#endif
+ , textDecorationSkip(RenderStyle::initialTextDecorationSkip())
+ , textUnderlinePosition(RenderStyle::initialTextUnderlinePosition())
+ , rubyPosition(RenderStyle::initialRubyPosition())
+ , textZoom(RenderStyle::initialTextZoom())
#if PLATFORM(IOS)
, touchCalloutEnabled(RenderStyle::initialTouchCalloutEnabled())
#endif
#if ENABLE(CSS_TRAILING_WORD)
, trailingWord(static_cast<unsigned>(RenderStyle::initialTrailingWord()))
#endif
- , m_hangingPunctuation(RenderStyle::initialHangingPunctuation())
+ , hangingPunctuation(RenderStyle::initialHangingPunctuation())
, hyphenationLimitBefore(-1)
, hyphenationLimitAfter(-1)
, hyphenationLimitLines(-1)
- , m_lineGrid(RenderStyle::initialLineGrid())
- , m_tabSize(RenderStyle::initialTabSize())
+ , lineGrid(RenderStyle::initialLineGrid())
+ , tabSize(RenderStyle::initialTabSize())
#if ENABLE(TEXT_AUTOSIZING)
, textSizeAdjust(RenderStyle::initialTextSizeAdjust())
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
- , m_imageResolution(RenderStyle::initialImageResolution())
+ , imageResolution(RenderStyle::initialImageResolution())
#endif
#if ENABLE(TOUCH_EVENTS)
, tapHighlightColor(RenderStyle::initialTapHighlightColor())
@@ -155,12 +155,12 @@
, textShadow(o.textShadow ? std::make_unique<ShadowData>(*o.textShadow) : nullptr)
, cursorData(o.cursorData)
, indent(o.indent)
- , m_effectiveZoom(o.m_effectiveZoom)
- , m_customProperties(o.m_customProperties)
+ , effectiveZoom(o.effectiveZoom)
+ , customProperties(o.customProperties)
, widows(o.widows)
, orphans(o.orphans)
- , m_hasAutoWidows(o.m_hasAutoWidows)
- , m_hasAutoOrphans(o.m_hasAutoOrphans)
+ , hasAutoWidows(o.hasAutoWidows)
+ , hasAutoOrphans(o.hasAutoOrphans)
, textSecurity(o.textSecurity)
, userModify(o.userModify)
, wordBreak(o.wordBreak)
@@ -173,52 +173,52 @@
, textEmphasisFill(o.textEmphasisFill)
, textEmphasisMark(o.textEmphasisMark)
, textEmphasisPosition(o.textEmphasisPosition)
- , m_textOrientation(o.m_textOrientation)
+ , textOrientation(o.textOrientation)
#if ENABLE(CSS3_TEXT)
- , m_textIndentLine(o.m_textIndentLine)
- , m_textIndentType(o.m_textIndentType)
+ , textIndentLine(o.textIndentLine)
+ , textIndentType(o.textIndentType)
#endif
- , m_lineBoxContain(o.m_lineBoxContain)
+ , lineBoxContain(o.lineBoxContain)
#if ENABLE(CSS_IMAGE_ORIENTATION)
- , m_imageOrientation(o.m_imageOrientation)
+ , imageOrientation(o.imageOrientation)
#endif
- , m_imageRendering(o.m_imageRendering)
- , m_lineSnap(o.m_lineSnap)
- , m_lineAlign(o.m_lineAlign)
+ , imageRendering(o.imageRendering)
+ , lineSnap(o.lineSnap)
+ , lineAlign(o.lineAlign)
#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
, useTouchOverflowScrolling(o.useTouchOverflowScrolling)
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
- , m_imageResolutionSource(o.m_imageResolutionSource)
- , m_imageResolutionSnap(o.m_imageResolutionSnap)
+ , imageResolutionSource(o.imageResolutionSource)
+ , imageResolutionSnap(o.imageResolutionSnap)
#endif
#if ENABLE(CSS3_TEXT)
- , m_textAlignLast(o.m_textAlignLast)
- , m_textJustify(o.m_textJustify)
-#endif // CSS3_TEXT
- , m_textDecorationSkip(o.m_textDecorationSkip)
- , m_textUnderlinePosition(o.m_textUnderlinePosition)
- , m_rubyPosition(o.m_rubyPosition)
- , m_textZoom(o.m_textZoom)
+ , textAlignLast(o.textAlignLast)
+ , textJustify(o.textJustify)
+#endif
+ , textDecorationSkip(o.textDecorationSkip)
+ , textUnderlinePosition(o.textUnderlinePosition)
+ , rubyPosition(o.rubyPosition)
+ , textZoom(o.textZoom)
#if PLATFORM(IOS)
, touchCalloutEnabled(o.touchCalloutEnabled)
#endif
#if ENABLE(CSS_TRAILING_WORD)
, trailingWord(o.trailingWord)
#endif
- , m_hangingPunctuation(o.m_hangingPunctuation)
+ , hangingPunctuation(o.hangingPunctuation)
, hyphenationString(o.hyphenationString)
, hyphenationLimitBefore(o.hyphenationLimitBefore)
, hyphenationLimitAfter(o.hyphenationLimitAfter)
, hyphenationLimitLines(o.hyphenationLimitLines)
, textEmphasisCustomMark(o.textEmphasisCustomMark)
- , m_lineGrid(o.m_lineGrid)
- , m_tabSize(o.m_tabSize)
+ , lineGrid(o.lineGrid)
+ , tabSize(o.tabSize)
#if ENABLE(TEXT_AUTOSIZING)
, textSizeAdjust(o.textSizeAdjust)
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
- , m_imageResolution(o.m_imageResolution)
+ , imageResolution(o.imageResolution)
#endif
#if ENABLE(TOUCH_EVENTS)
, tapHighlightColor(o.tapHighlightColor)
@@ -250,11 +250,11 @@
&& arePointingToEqualData(textShadow, o.textShadow)
&& arePointingToEqualData(cursorData, o.cursorData)
&& indent == o.indent
- && m_effectiveZoom == o.m_effectiveZoom
+ && effectiveZoom == o.effectiveZoom
&& widows == o.widows
&& orphans == o.orphans
- && m_hasAutoWidows == o.m_hasAutoWidows
- && m_hasAutoOrphans == o.m_hasAutoOrphans
+ && hasAutoWidows == o.hasAutoWidows
+ && hasAutoOrphans == o.hasAutoOrphans
&& textSecurity == o.textSecurity
&& userModify == o.userModify
&& wordBreak == o.wordBreak
@@ -276,44 +276,44 @@
&& textEmphasisFill == o.textEmphasisFill
&& textEmphasisMark == o.textEmphasisMark
&& textEmphasisPosition == o.textEmphasisPosition
- && m_textOrientation == o.m_textOrientation
+ && textOrientation == o.textOrientation
#if ENABLE(CSS3_TEXT)
- && m_textIndentLine == o.m_textIndentLine
- && m_textIndentType == o.m_textIndentType
+ && textIndentLine == o.textIndentLine
+ && textIndentType == o.textIndentType
#endif
- && m_lineBoxContain == o.m_lineBoxContain
+ && lineBoxContain == o.lineBoxContain
#if PLATFORM(IOS)
&& touchCalloutEnabled == o.touchCalloutEnabled
#endif
&& hyphenationString == o.hyphenationString
&& textEmphasisCustomMark == o.textEmphasisCustomMark
&& arePointingToEqualData(quotes, o.quotes)
- && m_tabSize == o.m_tabSize
- && m_lineGrid == o.m_lineGrid
+ && tabSize == o.tabSize
+ && lineGrid == o.lineGrid
#if ENABLE(CSS_IMAGE_ORIENTATION)
- && m_imageOrientation == o.m_imageOrientation
+ && imageOrientation == o.imageOrientation
#endif
- && m_imageRendering == o.m_imageRendering
+ && imageRendering == o.imageRendering
#if ENABLE(CSS_IMAGE_RESOLUTION)
- && m_imageResolutionSource == o.m_imageResolutionSource
- && m_imageResolutionSnap == o.m_imageResolutionSnap
- && m_imageResolution == o.m_imageResolution
+ && imageResolutionSource == o.imageResolutionSource
+ && imageResolutionSnap == o.imageResolutionSnap
+ && imageResolution == o.imageResolution
#endif
#if ENABLE(CSS3_TEXT)
- && m_textAlignLast == o.m_textAlignLast
- && m_textJustify == o.m_textJustify
+ && textAlignLast == o.textAlignLast
+ && textJustify == o.textJustify
#endif // CSS3_TEXT
- && m_textDecorationSkip == o.m_textDecorationSkip
- && m_textUnderlinePosition == o.m_textUnderlinePosition
- && m_rubyPosition == o.m_rubyPosition
- && m_textZoom == o.m_textZoom
- && m_lineSnap == o.m_lineSnap
- && m_lineAlign == o.m_lineAlign
+ && textDecorationSkip == o.textDecorationSkip
+ && textUnderlinePosition == o.textUnderlinePosition
+ && rubyPosition == o.rubyPosition
+ && textZoom == o.textZoom
+ && lineSnap == o.lineSnap
+ && lineAlign == o.lineAlign
#if ENABLE(CSS_TRAILING_WORD)
&& trailingWord == o.trailingWord
#endif
- && m_hangingPunctuation == o.m_hangingPunctuation
- && m_customProperties == o.m_customProperties
+ && hangingPunctuation == o.hangingPunctuation
+ && customProperties == o.customProperties
&& arePointingToEqualData(listStyleImage, o.listStyleImage);
}
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.h b/Source/WebCore/rendering/style/StyleRareInheritedData.h
index 12b7e39..2ff27c9 100644
--- a/Source/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareInheritedData.h
@@ -72,17 +72,17 @@
RefPtr<CursorList> cursorData;
Length indent;
- float m_effectiveZoom;
+ float effectiveZoom;
Length wordSpacing;
- DataRef<StyleCustomPropertyData> m_customProperties;
+ DataRef<StyleCustomPropertyData> customProperties;
// Paged media properties.
short widows;
short orphans;
- unsigned m_hasAutoWidows : 1;
- unsigned m_hasAutoOrphans : 1;
+ unsigned hasAutoWidows : 1;
+ unsigned hasAutoOrphans : 1;
unsigned textSecurity : 2; // ETextSecurity
unsigned userModify : 2; // EUserModify (editing)
@@ -97,34 +97,34 @@
unsigned textEmphasisFill : 1; // TextEmphasisFill
unsigned textEmphasisMark : 3; // TextEmphasisMark
unsigned textEmphasisPosition : 4; // TextEmphasisPosition
- unsigned m_textOrientation : 2; // TextOrientation
+ unsigned textOrientation : 2; // TextOrientation
#if ENABLE(CSS3_TEXT)
- unsigned m_textIndentLine : 1; // TextIndentLine
- unsigned m_textIndentType : 1; // TextIndentType
+ unsigned textIndentLine : 1; // TextIndentLine
+ unsigned textIndentType : 1; // TextIndentType
#endif
- unsigned m_lineBoxContain: 7; // LineBoxContain
+ unsigned lineBoxContain: 7; // LineBoxContain
// CSS Image Values Level 3
#if ENABLE(CSS_IMAGE_ORIENTATION)
- unsigned m_imageOrientation : 4; // ImageOrientationEnum
+ unsigned imageOrientation : 4; // ImageOrientationEnum
#endif
- unsigned m_imageRendering : 3; // EImageRendering
- unsigned m_lineSnap : 2; // LineSnap
- unsigned m_lineAlign : 1; // LineAlign
+ unsigned imageRendering : 3; // EImageRendering
+ unsigned lineSnap : 2; // LineSnap
+ unsigned lineAlign : 1; // LineAlign
#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
unsigned useTouchOverflowScrolling: 1;
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
- unsigned m_imageResolutionSource : 1; // ImageResolutionSource
- unsigned m_imageResolutionSnap : 1; // ImageResolutionSnap
+ unsigned imageResolutionSource : 1; // ImageResolutionSource
+ unsigned imageResolutionSnap : 1; // ImageResolutionSnap
#endif
#if ENABLE(CSS3_TEXT)
- unsigned m_textAlignLast : 3; // TextAlignLast
- unsigned m_textJustify : 2; // TextJustify
-#endif // CSS3_TEXT
- unsigned m_textDecorationSkip : 5; // TextDecorationSkip
- unsigned m_textUnderlinePosition : 3; // TextUnderlinePosition
- unsigned m_rubyPosition : 2; // RubyPosition
- unsigned m_textZoom: 1; // TextZoom
+ unsigned textAlignLast : 3; // TextAlignLast
+ unsigned textJustify : 2; // TextJustify
+#endif
+ unsigned textDecorationSkip : 5; // TextDecorationSkip
+ unsigned textUnderlinePosition : 3; // TextUnderlinePosition
+ unsigned rubyPosition : 2; // RubyPosition
+ unsigned textZoom: 1; // TextZoom
#if PLATFORM(IOS)
unsigned touchCalloutEnabled : 1;
@@ -134,7 +134,7 @@
unsigned trailingWord : 1;
#endif
- unsigned m_hangingPunctuation : 4;
+ unsigned hangingPunctuation : 4;
AtomicString hyphenationString;
short hyphenationLimitBefore;
@@ -144,15 +144,15 @@
AtomicString textEmphasisCustomMark;
RefPtr<QuotesData> quotes;
- AtomicString m_lineGrid;
- unsigned m_tabSize;
+ AtomicString lineGrid;
+ unsigned tabSize;
#if ENABLE(TEXT_AUTOSIZING)
TextSizeAdjustment textSizeAdjust;
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
- float m_imageResolution;
+ float imageResolution;
#endif
#if ENABLE(TOUCH_EVENTS)
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
index 4a7f7e6..6514200 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -37,174 +37,174 @@
namespace WebCore {
StyleRareNonInheritedData::StyleRareNonInheritedData()
- : m_opacity(RenderStyle::initialOpacity())
- , m_aspectRatioDenominator(RenderStyle::initialAspectRatioDenominator())
- , m_aspectRatioNumerator(RenderStyle::initialAspectRatioNumerator())
- , m_perspective(RenderStyle::initialPerspective())
- , m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
- , m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
+ : opacity(RenderStyle::initialOpacity())
+ , aspectRatioDenominator(RenderStyle::initialAspectRatioDenominator())
+ , aspectRatioNumerator(RenderStyle::initialAspectRatioNumerator())
+ , perspective(RenderStyle::initialPerspective())
+ , perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
+ , perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
, lineClamp(RenderStyle::initialLineClamp())
- , m_initialLetter(RenderStyle::initialInitialLetter())
- , m_deprecatedFlexibleBox(StyleDeprecatedFlexibleBoxData::create())
- , m_flexibleBox(StyleFlexibleBoxData::create())
- , m_marquee(StyleMarqueeData::create())
- , m_multiCol(StyleMultiColData::create())
- , m_transform(StyleTransformData::create())
- , m_filter(StyleFilterData::create())
+ , initialLetter(RenderStyle::initialInitialLetter())
+ , deprecatedFlexibleBox(StyleDeprecatedFlexibleBoxData::create())
+ , flexibleBox(StyleFlexibleBoxData::create())
+ , marquee(StyleMarqueeData::create())
+ , multiCol(StyleMultiColData::create())
+ , transform(StyleTransformData::create())
+ , filter(StyleFilterData::create())
#if ENABLE(FILTERS_LEVEL_2)
- , m_backdropFilter(StyleFilterData::create())
+ , backdropFilter(StyleFilterData::create())
#endif
#if ENABLE(CSS_GRID_LAYOUT)
- , m_grid(StyleGridData::create())
- , m_gridItem(StyleGridItemData::create())
+ , grid(StyleGridData::create())
+ , gridItem(StyleGridItemData::create())
#endif
#if ENABLE(CSS_SCROLL_SNAP)
- , m_scrollSnapPort(StyleScrollSnapPort::create())
- , m_scrollSnapArea(StyleScrollSnapArea::create())
+ , scrollSnapPort(StyleScrollSnapPort::create())
+ , scrollSnapArea(StyleScrollSnapArea::create())
#endif
- , m_willChange(RenderStyle::initialWillChange())
- , m_mask(FillLayer(MaskFillLayer))
- , m_objectPosition(RenderStyle::initialObjectPosition())
- , m_shapeOutside(RenderStyle::initialShapeOutside())
- , m_shapeMargin(RenderStyle::initialShapeMargin())
- , m_shapeImageThreshold(RenderStyle::initialShapeImageThreshold())
- , m_clipPath(RenderStyle::initialClipPath())
- , m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
- , m_order(RenderStyle::initialOrder())
- , m_flowThread(RenderStyle::initialFlowThread())
- , m_regionThread(RenderStyle::initialRegionThread())
- , m_alignContent(RenderStyle::initialContentAlignment())
- , m_alignItems(RenderStyle::initialDefaultAlignment())
- , m_alignSelf(RenderStyle::initialSelfAlignment())
- , m_justifyContent(RenderStyle::initialContentAlignment())
- , m_justifyItems(RenderStyle::initialSelfAlignment())
- , m_justifySelf(RenderStyle::initialSelfAlignment())
+ , willChange(RenderStyle::initialWillChange())
+ , mask(FillLayer(MaskFillLayer))
+ , objectPosition(RenderStyle::initialObjectPosition())
+ , shapeOutside(RenderStyle::initialShapeOutside())
+ , shapeMargin(RenderStyle::initialShapeMargin())
+ , shapeImageThreshold(RenderStyle::initialShapeImageThreshold())
+ , clipPath(RenderStyle::initialClipPath())
+ , visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
+ , order(RenderStyle::initialOrder())
+ , flowThread(RenderStyle::initialFlowThread())
+ , regionThread(RenderStyle::initialRegionThread())
+ , alignContent(RenderStyle::initialContentAlignment())
+ , alignItems(RenderStyle::initialDefaultAlignment())
+ , alignSelf(RenderStyle::initialSelfAlignment())
+ , justifyContent(RenderStyle::initialContentAlignment())
+ , justifyItems(RenderStyle::initialSelfAlignment())
+ , justifySelf(RenderStyle::initialSelfAlignment())
#if ENABLE(TOUCH_EVENTS)
- , m_touchAction(static_cast<unsigned>(RenderStyle::initialTouchAction()))
+ , touchAction(static_cast<unsigned>(RenderStyle::initialTouchAction()))
#endif
- , m_regionFragment(RenderStyle::initialRegionFragment())
- , m_pageSizeType(PAGE_SIZE_AUTO)
- , m_transformStyle3D(RenderStyle::initialTransformStyle3D())
- , m_backfaceVisibility(RenderStyle::initialBackfaceVisibility())
+ , regionFragment(RenderStyle::initialRegionFragment())
+ , pageSizeType(PAGE_SIZE_AUTO)
+ , transformStyle3D(RenderStyle::initialTransformStyle3D())
+ , backfaceVisibility(RenderStyle::initialBackfaceVisibility())
, userDrag(RenderStyle::initialUserDrag())
, textOverflow(RenderStyle::initialTextOverflow())
, marginBeforeCollapse(MCOLLAPSE)
, marginAfterCollapse(MCOLLAPSE)
- , m_appearance(RenderStyle::initialAppearance())
- , m_borderFit(RenderStyle::initialBorderFit())
- , m_textCombine(RenderStyle::initialTextCombine())
- , m_textDecorationStyle(RenderStyle::initialTextDecorationStyle())
- , m_aspectRatioType(RenderStyle::initialAspectRatioType())
+ , appearance(RenderStyle::initialAppearance())
+ , borderFit(RenderStyle::initialBorderFit())
+ , textCombine(RenderStyle::initialTextCombine())
+ , textDecorationStyle(RenderStyle::initialTextDecorationStyle())
+ , aspectRatioType(RenderStyle::initialAspectRatioType())
#if ENABLE(CSS_COMPOSITING)
- , m_effectiveBlendMode(RenderStyle::initialBlendMode())
- , m_isolation(RenderStyle::initialIsolation())
+ , effectiveBlendMode(RenderStyle::initialBlendMode())
+ , isolation(RenderStyle::initialIsolation())
#endif
#if ENABLE(APPLE_PAY)
- , m_applePayButtonStyle(static_cast<unsigned>(RenderStyle::initialApplePayButtonStyle()))
- , m_applePayButtonType(static_cast<unsigned>(RenderStyle::initialApplePayButtonType()))
+ , applePayButtonStyle(static_cast<unsigned>(RenderStyle::initialApplePayButtonStyle()))
+ , applePayButtonType(static_cast<unsigned>(RenderStyle::initialApplePayButtonType()))
#endif
- , m_objectFit(RenderStyle::initialObjectFit())
- , m_breakBefore(RenderStyle::initialBreakBetween())
- , m_breakAfter(RenderStyle::initialBreakBetween())
- , m_breakInside(RenderStyle::initialBreakInside())
- , m_resize(RenderStyle::initialResize())
- , m_hasAttrContent(false)
- , m_isPlaceholderStyle(false)
+ , objectFit(RenderStyle::initialObjectFit())
+ , breakBefore(RenderStyle::initialBreakBetween())
+ , breakAfter(RenderStyle::initialBreakBetween())
+ , breakInside(RenderStyle::initialBreakInside())
+ , resize(RenderStyle::initialResize())
+ , hasAttrContent(false)
+ , isPlaceholderStyle(false)
{
- m_maskBoxImage.setMaskDefaults();
+ maskBoxImage.setMaskDefaults();
}
inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInheritedData& o)
: RefCounted<StyleRareNonInheritedData>()
- , m_opacity(o.m_opacity)
- , m_aspectRatioDenominator(o.m_aspectRatioDenominator)
- , m_aspectRatioNumerator(o.m_aspectRatioNumerator)
- , m_perspective(o.m_perspective)
- , m_perspectiveOriginX(o.m_perspectiveOriginX)
- , m_perspectiveOriginY(o.m_perspectiveOriginY)
+ , opacity(o.opacity)
+ , aspectRatioDenominator(o.aspectRatioDenominator)
+ , aspectRatioNumerator(o.aspectRatioNumerator)
+ , perspective(o.perspective)
+ , perspectiveOriginX(o.perspectiveOriginX)
+ , perspectiveOriginY(o.perspectiveOriginY)
, lineClamp(o.lineClamp)
- , m_initialLetter(o.m_initialLetter)
- , m_deprecatedFlexibleBox(o.m_deprecatedFlexibleBox)
- , m_flexibleBox(o.m_flexibleBox)
- , m_marquee(o.m_marquee)
- , m_multiCol(o.m_multiCol)
- , m_transform(o.m_transform)
- , m_filter(o.m_filter)
+ , initialLetter(o.initialLetter)
+ , deprecatedFlexibleBox(o.deprecatedFlexibleBox)
+ , flexibleBox(o.flexibleBox)
+ , marquee(o.marquee)
+ , multiCol(o.multiCol)
+ , transform(o.transform)
+ , filter(o.filter)
#if ENABLE(FILTERS_LEVEL_2)
- , m_backdropFilter(o.m_backdropFilter)
+ , backdropFilter(o.backdropFilter)
#endif
#if ENABLE(CSS_GRID_LAYOUT)
- , m_grid(o.m_grid)
- , m_gridItem(o.m_gridItem)
+ , grid(o.grid)
+ , gridItem(o.gridItem)
#endif
#if ENABLE(CSS_SCROLL_SNAP)
- , m_scrollSnapPort(o.m_scrollSnapPort)
- , m_scrollSnapArea(o.m_scrollSnapArea)
+ , scrollSnapPort(o.scrollSnapPort)
+ , scrollSnapArea(o.scrollSnapArea)
#endif
- , m_content(o.m_content ? o.m_content->clone() : nullptr)
- , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
- , m_altText(o.m_altText)
- , m_boxShadow(o.m_boxShadow ? std::make_unique<ShadowData>(*o.m_boxShadow) : nullptr)
- , m_willChange(o.m_willChange)
- , m_boxReflect(o.m_boxReflect)
- , m_animations(o.m_animations ? std::make_unique<AnimationList>(*o.m_animations) : nullptr)
- , m_transitions(o.m_transitions ? std::make_unique<AnimationList>(*o.m_transitions) : nullptr)
- , m_mask(o.m_mask)
- , m_maskBoxImage(o.m_maskBoxImage)
- , m_pageSize(o.m_pageSize)
- , m_objectPosition(o.m_objectPosition)
- , m_shapeOutside(o.m_shapeOutside)
- , m_shapeMargin(o.m_shapeMargin)
- , m_shapeImageThreshold(o.m_shapeImageThreshold)
- , m_clipPath(o.m_clipPath)
- , m_textDecorationColor(o.m_textDecorationColor)
- , m_visitedLinkTextDecorationColor(o.m_visitedLinkTextDecorationColor)
- , m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor)
- , m_visitedLinkOutlineColor(o.m_visitedLinkOutlineColor)
- , m_visitedLinkBorderLeftColor(o.m_visitedLinkBorderLeftColor)
- , m_visitedLinkBorderRightColor(o.m_visitedLinkBorderRightColor)
- , m_visitedLinkBorderTopColor(o.m_visitedLinkBorderTopColor)
- , m_visitedLinkBorderBottomColor(o.m_visitedLinkBorderBottomColor)
- , m_order(o.m_order)
- , m_flowThread(o.m_flowThread)
- , m_regionThread(o.m_regionThread)
- , m_alignContent(o.m_alignContent)
- , m_alignItems(o.m_alignItems)
- , m_alignSelf(o.m_alignSelf)
- , m_justifyContent(o.m_justifyContent)
- , m_justifyItems(o.m_justifyItems)
- , m_justifySelf(o.m_justifySelf)
+ , content(o.content ? o.content->clone() : nullptr)
+ , counterDirectives(o.counterDirectives ? clone(*o.counterDirectives) : nullptr)
+ , altText(o.altText)
+ , boxShadow(o.boxShadow ? std::make_unique<ShadowData>(*o.boxShadow) : nullptr)
+ , willChange(o.willChange)
+ , boxReflect(o.boxReflect)
+ , animations(o.animations ? std::make_unique<AnimationList>(*o.animations) : nullptr)
+ , transitions(o.transitions ? std::make_unique<AnimationList>(*o.transitions) : nullptr)
+ , mask(o.mask)
+ , maskBoxImage(o.maskBoxImage)
+ , pageSize(o.pageSize)
+ , objectPosition(o.objectPosition)
+ , shapeOutside(o.shapeOutside)
+ , shapeMargin(o.shapeMargin)
+ , shapeImageThreshold(o.shapeImageThreshold)
+ , clipPath(o.clipPath)
+ , textDecorationColor(o.textDecorationColor)
+ , visitedLinkTextDecorationColor(o.visitedLinkTextDecorationColor)
+ , visitedLinkBackgroundColor(o.visitedLinkBackgroundColor)
+ , visitedLinkOutlineColor(o.visitedLinkOutlineColor)
+ , visitedLinkBorderLeftColor(o.visitedLinkBorderLeftColor)
+ , visitedLinkBorderRightColor(o.visitedLinkBorderRightColor)
+ , visitedLinkBorderTopColor(o.visitedLinkBorderTopColor)
+ , visitedLinkBorderBottomColor(o.visitedLinkBorderBottomColor)
+ , order(o.order)
+ , flowThread(o.flowThread)
+ , regionThread(o.regionThread)
+ , alignContent(o.alignContent)
+ , alignItems(o.alignItems)
+ , alignSelf(o.alignSelf)
+ , justifyContent(o.justifyContent)
+ , justifyItems(o.justifyItems)
+ , justifySelf(o.justifySelf)
#if ENABLE(TOUCH_EVENTS)
- , m_touchAction(o.m_touchAction)
+ , touchAction(o.touchAction)
#endif
- , m_regionFragment(o.m_regionFragment)
- , m_pageSizeType(o.m_pageSizeType)
- , m_transformStyle3D(o.m_transformStyle3D)
- , m_backfaceVisibility(o.m_backfaceVisibility)
+ , regionFragment(o.regionFragment)
+ , pageSizeType(o.pageSizeType)
+ , transformStyle3D(o.transformStyle3D)
+ , backfaceVisibility(o.backfaceVisibility)
, userDrag(o.userDrag)
, textOverflow(o.textOverflow)
, marginBeforeCollapse(o.marginBeforeCollapse)
, marginAfterCollapse(o.marginAfterCollapse)
- , m_appearance(o.m_appearance)
- , m_borderFit(o.m_borderFit)
- , m_textCombine(o.m_textCombine)
- , m_textDecorationStyle(o.m_textDecorationStyle)
- , m_aspectRatioType(o.m_aspectRatioType)
+ , appearance(o.appearance)
+ , borderFit(o.borderFit)
+ , textCombine(o.textCombine)
+ , textDecorationStyle(o.textDecorationStyle)
+ , aspectRatioType(o.aspectRatioType)
#if ENABLE(CSS_COMPOSITING)
- , m_effectiveBlendMode(o.m_effectiveBlendMode)
- , m_isolation(o.m_isolation)
+ , effectiveBlendMode(o.effectiveBlendMode)
+ , isolation(o.isolation)
#endif
#if ENABLE(APPLE_PAY)
- , m_applePayButtonStyle(o.m_applePayButtonStyle)
- , m_applePayButtonType(o.m_applePayButtonType)
+ , applePayButtonStyle(o.applePayButtonStyle)
+ , applePayButtonType(o.applePayButtonType)
#endif
- , m_objectFit(o.m_objectFit)
- , m_breakBefore(o.m_breakBefore)
- , m_breakAfter(o.m_breakAfter)
- , m_breakInside(o.m_breakInside)
- , m_resize(o.m_resize)
- , m_hasAttrContent(o.m_hasAttrContent)
- , m_isPlaceholderStyle(o.m_isPlaceholderStyle)
+ , objectFit(o.objectFit)
+ , breakBefore(o.breakBefore)
+ , breakAfter(o.breakAfter)
+ , breakInside(o.breakInside)
+ , resize(o.resize)
+ , hasAttrContent(o.hasAttrContent)
+ , isPlaceholderStyle(o.isPlaceholderStyle)
{
}
@@ -219,123 +219,123 @@
bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) const
{
- return m_opacity == o.m_opacity
- && m_aspectRatioDenominator == o.m_aspectRatioDenominator
- && m_aspectRatioNumerator == o.m_aspectRatioNumerator
- && m_perspective == o.m_perspective
- && m_perspectiveOriginX == o.m_perspectiveOriginX
- && m_perspectiveOriginY == o.m_perspectiveOriginY
+ return opacity == o.opacity
+ && aspectRatioDenominator == o.aspectRatioDenominator
+ && aspectRatioNumerator == o.aspectRatioNumerator
+ && perspective == o.perspective
+ && perspectiveOriginX == o.perspectiveOriginX
+ && perspectiveOriginY == o.perspectiveOriginY
&& lineClamp == o.lineClamp
- && m_initialLetter == o.m_initialLetter
+ && initialLetter == o.initialLetter
#if ENABLE(DASHBOARD_SUPPORT)
- && m_dashboardRegions == o.m_dashboardRegions
+ && dashboardRegions == o.dashboardRegions
#endif
- && m_deprecatedFlexibleBox == o.m_deprecatedFlexibleBox
- && m_flexibleBox == o.m_flexibleBox
- && m_marquee == o.m_marquee
- && m_multiCol == o.m_multiCol
- && m_transform == o.m_transform
- && m_filter == o.m_filter
+ && deprecatedFlexibleBox == o.deprecatedFlexibleBox
+ && flexibleBox == o.flexibleBox
+ && marquee == o.marquee
+ && multiCol == o.multiCol
+ && transform == o.transform
+ && filter == o.filter
#if ENABLE(FILTERS_LEVEL_2)
- && m_backdropFilter == o.m_backdropFilter
+ && backdropFilter == o.backdropFilter
#endif
#if ENABLE(CSS_GRID_LAYOUT)
- && m_grid == o.m_grid
- && m_gridItem == o.m_gridItem
+ && grid == o.grid
+ && gridItem == o.gridItem
#endif
#if ENABLE(CSS_SCROLL_SNAP)
- && m_scrollSnapPort == o.m_scrollSnapPort
- && m_scrollSnapArea == o.m_scrollSnapArea
+ && scrollSnapPort == o.scrollSnapPort
+ && scrollSnapArea == o.scrollSnapArea
#endif
&& contentDataEquivalent(o)
- && arePointingToEqualData(m_counterDirectives, o.m_counterDirectives)
- && m_altText == o.m_altText
- && arePointingToEqualData(m_boxShadow, o.m_boxShadow)
- && arePointingToEqualData(m_willChange, o.m_willChange)
- && arePointingToEqualData(m_boxReflect, o.m_boxReflect)
- && arePointingToEqualData(m_animations, o.m_animations)
- && arePointingToEqualData(m_transitions, o.m_transitions)
- && m_mask == o.m_mask
- && m_maskBoxImage == o.m_maskBoxImage
- && m_pageSize == o.m_pageSize
- && m_objectPosition == o.m_objectPosition
- && arePointingToEqualData(m_shapeOutside, o.m_shapeOutside)
- && m_shapeMargin == o.m_shapeMargin
- && m_shapeImageThreshold == o.m_shapeImageThreshold
- && arePointingToEqualData(m_clipPath, o.m_clipPath)
- && m_textDecorationColor == o.m_textDecorationColor
- && m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColor
- && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor
- && m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor
- && m_visitedLinkBorderLeftColor == o.m_visitedLinkBorderLeftColor
- && m_visitedLinkBorderRightColor == o.m_visitedLinkBorderRightColor
- && m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor
- && m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor
- && m_order == o.m_order
- && m_flowThread == o.m_flowThread
- && m_alignContent == o.m_alignContent
- && m_alignItems == o.m_alignItems
- && m_alignSelf == o.m_alignSelf
- && m_justifyContent == o.m_justifyContent
- && m_justifyItems == o.m_justifyItems
- && m_justifySelf == o.m_justifySelf
- && m_regionThread == o.m_regionThread
- && m_regionFragment == o.m_regionFragment
- && m_pageSizeType == o.m_pageSizeType
- && m_transformStyle3D == o.m_transformStyle3D
- && m_backfaceVisibility == o.m_backfaceVisibility
+ && arePointingToEqualData(counterDirectives, o.counterDirectives)
+ && altText == o.altText
+ && arePointingToEqualData(boxShadow, o.boxShadow)
+ && arePointingToEqualData(willChange, o.willChange)
+ && arePointingToEqualData(boxReflect, o.boxReflect)
+ && arePointingToEqualData(animations, o.animations)
+ && arePointingToEqualData(transitions, o.transitions)
+ && mask == o.mask
+ && maskBoxImage == o.maskBoxImage
+ && pageSize == o.pageSize
+ && objectPosition == o.objectPosition
+ && arePointingToEqualData(shapeOutside, o.shapeOutside)
+ && shapeMargin == o.shapeMargin
+ && shapeImageThreshold == o.shapeImageThreshold
+ && arePointingToEqualData(clipPath, o.clipPath)
+ && textDecorationColor == o.textDecorationColor
+ && visitedLinkTextDecorationColor == o.visitedLinkTextDecorationColor
+ && visitedLinkBackgroundColor == o.visitedLinkBackgroundColor
+ && visitedLinkOutlineColor == o.visitedLinkOutlineColor
+ && visitedLinkBorderLeftColor == o.visitedLinkBorderLeftColor
+ && visitedLinkBorderRightColor == o.visitedLinkBorderRightColor
+ && visitedLinkBorderTopColor == o.visitedLinkBorderTopColor
+ && visitedLinkBorderBottomColor == o.visitedLinkBorderBottomColor
+ && order == o.order
+ && flowThread == o.flowThread
+ && alignContent == o.alignContent
+ && alignItems == o.alignItems
+ && alignSelf == o.alignSelf
+ && justifyContent == o.justifyContent
+ && justifyItems == o.justifyItems
+ && justifySelf == o.justifySelf
+ && regionThread == o.regionThread
+ && regionFragment == o.regionFragment
+ && pageSizeType == o.pageSizeType
+ && transformStyle3D == o.transformStyle3D
+ && backfaceVisibility == o.backfaceVisibility
&& userDrag == o.userDrag
&& textOverflow == o.textOverflow
&& marginBeforeCollapse == o.marginBeforeCollapse
&& marginAfterCollapse == o.marginAfterCollapse
- && m_appearance == o.m_appearance
- && m_borderFit == o.m_borderFit
- && m_textCombine == o.m_textCombine
- && m_textDecorationStyle == o.m_textDecorationStyle
+ && appearance == o.appearance
+ && borderFit == o.borderFit
+ && textCombine == o.textCombine
+ && textDecorationStyle == o.textDecorationStyle
#if ENABLE(TOUCH_EVENTS)
- && m_touchAction == o.m_touchAction
+ && touchAction == o.touchAction
#endif
#if ENABLE(CSS_COMPOSITING)
- && m_effectiveBlendMode == o.m_effectiveBlendMode
- && m_isolation == o.m_isolation
+ && effectiveBlendMode == o.effectiveBlendMode
+ && isolation == o.isolation
#endif
#if ENABLE(APPLE_PAY)
- && m_applePayButtonStyle == o.m_applePayButtonStyle
- && m_applePayButtonType == o.m_applePayButtonType
+ && applePayButtonStyle == o.applePayButtonStyle
+ && applePayButtonType == o.applePayButtonType
#endif
- && m_aspectRatioType == o.m_aspectRatioType
- && m_objectFit == o.m_objectFit
- && m_breakAfter == o.m_breakAfter
- && m_breakBefore == o.m_breakBefore
- && m_breakInside == o.m_breakInside
- && m_resize == o.m_resize
- && m_hasAttrContent == o.m_hasAttrContent
- && m_isPlaceholderStyle == o.m_isPlaceholderStyle;
+ && aspectRatioType == o.aspectRatioType
+ && objectFit == o.objectFit
+ && breakAfter == o.breakAfter
+ && breakBefore == o.breakBefore
+ && breakInside == o.breakInside
+ && resize == o.resize
+ && hasAttrContent == o.hasAttrContent
+ && isPlaceholderStyle == o.isPlaceholderStyle;
}
-bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const
+bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& other) const
{
- ContentData* a = m_content.get();
- ContentData* b = o.m_content.get();
-
+ auto* a = content.get();
+ auto* b = other.content.get();
while (a && b && *a == *b) {
a = a->next();
b = b->next();
}
-
return !a && !b;
}
bool StyleRareNonInheritedData::hasFilters() const
{
- return m_filter.get() && !m_filter->m_operations.isEmpty();
+ return !filter->operations.isEmpty();
}
#if ENABLE(FILTERS_LEVEL_2)
+
bool StyleRareNonInheritedData::hasBackdropFilters() const
{
- return m_backdropFilter.get() && !m_backdropFilter->m_operations.isEmpty();
+ return !backdropFilter->operations.isEmpty();
}
+
#endif
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
index 04c09ba..bf9ba20 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -44,34 +44,27 @@
namespace WebCore {
class AnimationList;
+class ContentData;
class ShadowData;
class StyleDeprecatedFlexibleBoxData;
class StyleFilterData;
class StyleFlexibleBoxData;
-#if ENABLE(CSS_GRID_LAYOUT)
class StyleGridData;
class StyleGridItemData;
-#endif
class StyleMarqueeData;
class StyleMultiColData;
class StyleReflection;
class StyleResolver;
-class StyleTransformData;
-#if ENABLE(CSS_SCROLL_SNAP)
-class StyleScrollSnapPort;
class StyleScrollSnapArea;
-#endif
+class StyleScrollSnapPort;
+class StyleTransformData;
-class ContentData;
struct LengthSize;
-
-#if ENABLE(DASHBOARD_SUPPORT)
struct StyleDashboardRegion;
-#endif
// Page size type.
-// StyleRareNonInheritedData::m_pageSize is meaningful only when
-// StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED.
+// StyleRareNonInheritedData::pageSize is meaningful only when
+// StyleRareNonInheritedData::pageSizeType is PAGE_SIZE_RESOLVED.
enum PageSizeType {
PAGE_SIZE_AUTO, // size: auto
PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape
@@ -89,144 +82,147 @@
~StyleRareNonInheritedData();
bool operator==(const StyleRareNonInheritedData&) const;
- bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); }
+ bool operator!=(const StyleRareNonInheritedData& other) const { return !(*this == other); }
bool contentDataEquivalent(const StyleRareNonInheritedData&) const;
bool hasFilters() const;
+
#if ENABLE(FILTERS_LEVEL_2)
bool hasBackdropFilters() const;
#endif
- bool hasOpacity() const { return m_opacity < 1; }
- bool hasAnimationsOrTransitions() const { return m_animations || m_transitions; }
+ bool hasOpacity() const { return opacity < 1; }
- float m_opacity;
+ bool hasAnimationsOrTransitions() const { return animations || transitions; }
- float m_aspectRatioDenominator;
- float m_aspectRatioNumerator;
+ float opacity;
- float m_perspective;
- Length m_perspectiveOriginX;
- Length m_perspectiveOriginY;
+ float aspectRatioDenominator;
+ float aspectRatioNumerator;
+
+ float perspective;
+ Length perspectiveOriginX;
+ Length perspectiveOriginY;
LineClampValue lineClamp; // An Apple extension.
- IntSize m_initialLetter;
+ IntSize initialLetter;
#if ENABLE(DASHBOARD_SUPPORT)
- Vector<StyleDashboardRegion> m_dashboardRegions;
+ Vector<StyleDashboardRegion> dashboardRegions;
#endif
- DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
- DataRef<StyleFlexibleBoxData> m_flexibleBox;
- DataRef<StyleMarqueeData> m_marquee; // Marquee properties
- DataRef<StyleMultiColData> m_multiCol; // CSS3 multicol properties
- DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.)
- DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.)
+ DataRef<StyleDeprecatedFlexibleBoxData> deprecatedFlexibleBox; // Flexible box properties
+ DataRef<StyleFlexibleBoxData> flexibleBox;
+ DataRef<StyleMarqueeData> marquee; // Marquee properties
+ DataRef<StyleMultiColData> multiCol; // CSS3 multicol properties
+ DataRef<StyleTransformData> transform; // Transform properties (rotate, scale, skew, etc.)
+ DataRef<StyleFilterData> filter; // Filter operations (url, sepia, blur, etc.)
+
#if ENABLE(FILTERS_LEVEL_2)
- DataRef<StyleFilterData> m_backdropFilter; // Filter operations (url, sepia, blur, etc.)
+ DataRef<StyleFilterData> backdropFilter; // Filter operations (url, sepia, blur, etc.)
#endif
#if ENABLE(CSS_GRID_LAYOUT)
- DataRef<StyleGridData> m_grid;
- DataRef<StyleGridItemData> m_gridItem;
+ DataRef<StyleGridData> grid;
+ DataRef<StyleGridItemData> gridItem;
#endif
#if ENABLE(CSS_SCROLL_SNAP)
- DataRef<StyleScrollSnapPort> m_scrollSnapPort;
- DataRef<StyleScrollSnapArea> m_scrollSnapArea;
+ DataRef<StyleScrollSnapPort> scrollSnapPort;
+ DataRef<StyleScrollSnapArea> scrollSnapArea;
#endif
- std::unique_ptr<ContentData> m_content;
- std::unique_ptr<CounterDirectiveMap> m_counterDirectives;
- String m_altText;
+ std::unique_ptr<ContentData> content;
+ std::unique_ptr<CounterDirectiveMap> counterDirectives;
+ String altText;
- std::unique_ptr<ShadowData> m_boxShadow; // For box-shadow decorations.
+ std::unique_ptr<ShadowData> boxShadow; // For box-shadow decorations.
- RefPtr<WillChangeData> m_willChange; // Null indicates 'auto'.
+ RefPtr<WillChangeData> willChange; // Null indicates 'auto'.
- RefPtr<StyleReflection> m_boxReflect;
+ RefPtr<StyleReflection> boxReflect;
- std::unique_ptr<AnimationList> m_animations;
- std::unique_ptr<AnimationList> m_transitions;
+ std::unique_ptr<AnimationList> animations;
+ std::unique_ptr<AnimationList> transitions;
- FillLayer m_mask;
- NinePieceImage m_maskBoxImage;
+ FillLayer mask;
+ NinePieceImage maskBoxImage;
- LengthSize m_pageSize;
- LengthPoint m_objectPosition;
+ LengthSize pageSize;
+ LengthPoint objectPosition;
- RefPtr<ShapeValue> m_shapeOutside;
- Length m_shapeMargin;
- float m_shapeImageThreshold;
+ RefPtr<ShapeValue> shapeOutside;
+ Length shapeMargin;
+ float shapeImageThreshold;
- RefPtr<ClipPathOperation> m_clipPath;
+ RefPtr<ClipPathOperation> clipPath;
- Color m_textDecorationColor;
- Color m_visitedLinkTextDecorationColor;
- Color m_visitedLinkBackgroundColor;
- Color m_visitedLinkOutlineColor;
- Color m_visitedLinkBorderLeftColor;
- Color m_visitedLinkBorderRightColor;
- Color m_visitedLinkBorderTopColor;
- Color m_visitedLinkBorderBottomColor;
+ Color textDecorationColor;
+ Color visitedLinkTextDecorationColor;
+ Color visitedLinkBackgroundColor;
+ Color visitedLinkOutlineColor;
+ Color visitedLinkBorderLeftColor;
+ Color visitedLinkBorderRightColor;
+ Color visitedLinkBorderTopColor;
+ Color visitedLinkBorderBottomColor;
- int m_order;
+ int order;
- AtomicString m_flowThread;
- AtomicString m_regionThread;
+ AtomicString flowThread;
+ AtomicString regionThread;
- StyleContentAlignmentData m_alignContent;
- StyleSelfAlignmentData m_alignItems;
- StyleSelfAlignmentData m_alignSelf;
- StyleContentAlignmentData m_justifyContent;
- StyleSelfAlignmentData m_justifyItems;
- StyleSelfAlignmentData m_justifySelf;
+ StyleContentAlignmentData alignContent;
+ StyleSelfAlignmentData alignItems;
+ StyleSelfAlignmentData alignSelf;
+ StyleContentAlignmentData justifyContent;
+ StyleSelfAlignmentData justifyItems;
+ StyleSelfAlignmentData justifySelf;
#if ENABLE(TOUCH_EVENTS)
- unsigned m_touchAction : 1; // TouchAction
+ unsigned touchAction : 1; // TouchAction
#endif
- unsigned m_regionFragment : 1; // RegionFragment
+ unsigned regionFragment : 1; // RegionFragment
- unsigned m_pageSizeType : 2; // PageSizeType
- unsigned m_transformStyle3D : 1; // ETransformStyle3D
- unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
+ unsigned pageSizeType : 2; // PageSizeType
+ unsigned transformStyle3D : 1; // ETransformStyle3D
+ unsigned backfaceVisibility : 1; // EBackfaceVisibility
unsigned userDrag : 2; // EUserDrag
unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
unsigned marginBeforeCollapse : 2; // EMarginCollapse
unsigned marginAfterCollapse : 2; // EMarginCollapse
- unsigned m_appearance : 6; // EAppearance
- unsigned m_borderFit : 1; // EBorderFit
- unsigned m_textCombine : 1; // CSS3 text-combine properties
+ unsigned appearance : 6; // EAppearance
+ unsigned borderFit : 1; // EBorderFit
+ unsigned textCombine : 1; // CSS3 text-combine properties
- unsigned m_textDecorationStyle : 3; // TextDecorationStyle
+ unsigned textDecorationStyle : 3; // TextDecorationStyle
- unsigned m_aspectRatioType : 2;
+ unsigned aspectRatioType : 2;
#if ENABLE(CSS_COMPOSITING)
- unsigned m_effectiveBlendMode: 5; // EBlendMode
- unsigned m_isolation : 1; // Isolation
+ unsigned effectiveBlendMode: 5; // EBlendMode
+ unsigned isolation : 1; // Isolation
#endif
#if ENABLE(APPLE_PAY)
- unsigned m_applePayButtonStyle : 2;
- unsigned m_applePayButtonType : 3;
+ unsigned applePayButtonStyle : 2;
+ unsigned applePayButtonType : 3;
#endif
- unsigned m_objectFit : 3; // ObjectFit
+ unsigned objectFit : 3; // ObjectFit
- unsigned m_breakBefore : 4; // BreakBetween
- unsigned m_breakAfter : 4;
- unsigned m_breakInside : 3; // BreakInside
- unsigned m_resize : 2; // EResize
+ unsigned breakBefore : 4; // BreakBetween
+ unsigned breakAfter : 4;
+ unsigned breakInside : 3; // BreakInside
+ unsigned resize : 2; // EResize
- unsigned m_hasAttrContent : 1;
+ unsigned hasAttrContent : 1;
- unsigned m_isPlaceholderStyle : 1;
+ unsigned isPlaceholderStyle : 1;
private:
StyleRareNonInheritedData();
diff --git a/Source/WebCore/rendering/style/StyleTransformData.cpp b/Source/WebCore/rendering/style/StyleTransformData.cpp
index eaf310b..eaf7a6a 100644
--- a/Source/WebCore/rendering/style/StyleTransformData.cpp
+++ b/Source/WebCore/rendering/style/StyleTransformData.cpp
@@ -27,19 +27,19 @@
namespace WebCore {
StyleTransformData::StyleTransformData()
- : m_operations(RenderStyle::initialTransform())
- , m_x(RenderStyle::initialTransformOriginX())
- , m_y(RenderStyle::initialTransformOriginY())
- , m_z(RenderStyle::initialTransformOriginZ())
+ : operations(RenderStyle::initialTransform())
+ , x(RenderStyle::initialTransformOriginX())
+ , y(RenderStyle::initialTransformOriginY())
+ , z(RenderStyle::initialTransformOriginZ())
{
}
-inline StyleTransformData::StyleTransformData(const StyleTransformData& o)
+inline StyleTransformData::StyleTransformData(const StyleTransformData& other)
: RefCounted<StyleTransformData>()
- , m_operations(o.m_operations)
- , m_x(o.m_x)
- , m_y(o.m_y)
- , m_z(o.m_z)
+ , operations(other.operations)
+ , x(other.x)
+ , y(other.y)
+ , z(other.z)
{
}
@@ -48,9 +48,9 @@
return adoptRef(*new StyleTransformData(*this));
}
-bool StyleTransformData::operator==(const StyleTransformData& o) const
+bool StyleTransformData::operator==(const StyleTransformData& other) const
{
- return m_x == o.m_x && m_y == o.m_y && m_z == o.m_z && m_operations == o.m_operations;
+ return x == other.x && y == other.y && z == other.z && operations == other.operations;
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/StyleTransformData.h b/Source/WebCore/rendering/style/StyleTransformData.h
index 2ea0795..6b46a35 100644
--- a/Source/WebCore/rendering/style/StyleTransformData.h
+++ b/Source/WebCore/rendering/style/StyleTransformData.h
@@ -36,18 +36,18 @@
static Ref<StyleTransformData> create() { return adoptRef(*new StyleTransformData); }
Ref<StyleTransformData> copy() const;
- bool operator==(const StyleTransformData& o) const;
- bool operator!=(const StyleTransformData& o) const
+ bool operator==(const StyleTransformData&) const;
+ bool operator!=(const StyleTransformData& other) const
{
- return !(*this == o);
+ return !(*this == other);
}
- bool hasTransform() const { return m_operations.size(); }
+ bool hasTransform() const { return operations.size(); }
- TransformOperations m_operations;
- Length m_x;
- Length m_y;
- float m_z;
+ TransformOperations operations;
+ Length x;
+ Length y;
+ float z;
private:
StyleTransformData();
diff --git a/Source/WebCore/rendering/style/StyleVisualData.cpp b/Source/WebCore/rendering/style/StyleVisualData.cpp
index 256c154..10fd588 100644
--- a/Source/WebCore/rendering/style/StyleVisualData.cpp
+++ b/Source/WebCore/rendering/style/StyleVisualData.cpp
@@ -29,7 +29,7 @@
StyleVisualData::StyleVisualData()
: hasClip(false)
, textDecoration(RenderStyle::initialTextDecoration())
- , m_zoom(RenderStyle::initialZoom())
+ , zoom(RenderStyle::initialZoom())
{
}
@@ -37,12 +37,12 @@
{
}
-inline StyleVisualData::StyleVisualData(const StyleVisualData& o)
+inline StyleVisualData::StyleVisualData(const StyleVisualData& other)
: RefCounted<StyleVisualData>()
- , clip(o.clip)
- , hasClip(o.hasClip)
- , textDecoration(o.textDecoration)
- , m_zoom(RenderStyle::initialZoom())
+ , clip(other.clip)
+ , hasClip(other.hasClip)
+ , textDecoration(other.textDecoration)
+ , zoom(RenderStyle::initialZoom())
{
}
diff --git a/Source/WebCore/rendering/style/StyleVisualData.h b/Source/WebCore/rendering/style/StyleVisualData.h
index a6f68ef..d418acb 100644
--- a/Source/WebCore/rendering/style/StyleVisualData.h
+++ b/Source/WebCore/rendering/style/StyleVisualData.h
@@ -37,19 +37,19 @@
Ref<StyleVisualData> copy() const;
~StyleVisualData();
- bool operator==(const StyleVisualData& o) const
+ bool operator==(const StyleVisualData& other) const
{
- return clip == o.clip
- && hasClip == o.hasClip
- && textDecoration == o.textDecoration
- && m_zoom == o.m_zoom;
+ return clip == other.clip
+ && hasClip == other.hasClip
+ && textDecoration == other.textDecoration
+ && zoom == other.zoom;
}
- bool operator!=(const StyleVisualData& o) const { return !(*this == o); }
+ bool operator!=(const StyleVisualData& other) const { return !(*this == other); }
LengthBox clip;
bool hasClip : 1;
unsigned textDecoration : TextDecorationBits; // Text decorations defined *only* by this element.
- float m_zoom;
+ float zoom;
private:
StyleVisualData();
diff --git a/Source/WebCore/style/StylePendingResources.cpp b/Source/WebCore/style/StylePendingResources.cpp
index f749339..10319f8 100644
--- a/Source/WebCore/style/StylePendingResources.cpp
+++ b/Source/WebCore/style/StylePendingResources.cpp
@@ -62,7 +62,7 @@
void loadPendingResources(RenderStyle& style, Document& document, const Element* element)
{
- for (auto* backgroundLayer = style.backgroundLayers(); backgroundLayer; backgroundLayer = backgroundLayer->next())
+ for (auto* backgroundLayer = &style.backgroundLayers(); backgroundLayer; backgroundLayer = backgroundLayer->next())
loadPendingImage(document, backgroundLayer->image(), element);
for (auto* contentData = style.contentData(); contentData; contentData = contentData->next()) {
@@ -84,7 +84,7 @@
if (auto* reflection = style.boxReflect())
loadPendingImage(document, reflection->mask().image(), element);
- for (auto* maskLayer = style.maskLayers(); maskLayer; maskLayer = maskLayer->next())
+ for (auto* maskLayer = &style.maskLayers(); maskLayer; maskLayer = maskLayer->next())
loadPendingImage(document, maskLayer->image(), element);
if (style.shapeOutside())
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index d906f50..a8e5d95 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,16 @@
+2017-01-11 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr from more of "platform"
+ https://bugs.webkit.org/show_bug.cgi?id=166809
+
+ Reviewed by Sam Weinig.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (NetscapePluginWidget::handleEvent): Pass a reference.
+ * WebView/WebView.mm:
+ (-[WebView _addScrollerDashboardRegionsForFrameView:dashboardRegions:]):
+ Updated since the children set now contains Ref instead of RefPtr.
+
2017-01-13 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for DeviceMotionEvent and DeviceOrientationEvent
diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index fe28fd4..4e9b2e2 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1849,7 +1849,7 @@
virtual void handleEvent(Event* event)
{
- Frame* frame = Frame::frameForWidget(this);
+ Frame* frame = Frame::frameForWidget(*this);
if (!frame)
return;
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm
index d4e50b8..4d1170b 100644
--- a/Source/WebKit/mac/WebView/WebView.mm
+++ b/Source/WebKit/mac/WebView/WebView.mm
@@ -3470,8 +3470,8 @@
NSView *documentView = [[kit(&frameView->frame()) frameView] documentView];
for (const auto& widget: frameView->children()) {
- if (is<FrameView>(*widget)) {
- [self _addScrollerDashboardRegionsForFrameView:downcast<FrameView>(widget.get()) dashboardRegions:regions];
+ if (is<FrameView>(widget)) {
+ [self _addScrollerDashboardRegionsForFrameView:&downcast<FrameView>(widget.get()) dashboardRegions:regions];
continue;
}
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index cd7b124..58962de 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,19 @@
+2017-01-11 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr from more of "platform"
+ https://bugs.webkit.org/show_bug.cgi?id=166809
+
+ Reviewed by Sam Weinig.
+
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
+ (IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
+ returns a raw pointer.
+ (IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
+ setters now takes an rvalue reference.
+
+ * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
+ (WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.
+
2017-01-13 Chris Dumez <cdumez@apple.com>
[WK2] Add diagnostic logging to measure WebGL usage
diff --git a/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp b/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
index 9a87358..df1a57b 100644
--- a/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
+++ b/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
@@ -457,7 +457,7 @@
encoder << static_cast<uint32_t>(animationObject->fillMode());
encoder << animationObject->duration();
encoder << animationObject->iterationCount();
- encodeTimingFunction(encoder, animationObject->timingFunction().get());
+ encodeTimingFunction(encoder, animationObject->timingFunction());
const KeyframeValueList& keyframes = animation.keyframes();
encoder.encodeEnum(keyframes.property());
@@ -527,7 +527,7 @@
animationObject->setDuration(duration);
animationObject->setIterationCount(iterationCount);
if (timingFunction)
- animationObject->setTimingFunction(timingFunction);
+ animationObject->setTimingFunction(WTFMove(timingFunction));
AnimatedPropertyID property;
if (!decoder.decodeEnum(property))
diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm b/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
index bae96b6..8509ae6 100644
--- a/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
+++ b/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
@@ -666,7 +666,7 @@
scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
}
}
- pluginView()->frame()->view()->addChild(widget.ptr());
+ pluginView()->frame()->view()->addChild(widget);
return widget;
}