WebKit Bugzilla
Attachment 341230 Details for
Bug 185963
: Reduce copying of FontCascadeDescription objects by moving them around
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185963-20180524155603.patch (text/plain), 54.23 KB, created by
Chris Dumez
on 2018-05-24 15:56:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-24 15:56:04 PDT
Size:
54.23 KB
patch
obsolete
>Subversion Revision: 232156 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a2b43d66ac8d88b7c8ae63784ce27470b2933180..13db1a1fd8be620bf4c3a99b91880fddf9762601 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,95 @@ >+2018-05-24 Chris Dumez <cdumez@apple.com> >+ >+ Reduce copying of FontCascadeDescription objects by moving them around >+ https://bugs.webkit.org/show_bug.cgi?id=185963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Reduce copying of FontCascadeDescription objects by moving them around when possible. >+ >+ * css/StyleBuilderCustom.h: >+ (WebCore::StyleBuilderCustom::applyValueWebkitLocale): >+ (WebCore::StyleBuilderCustom::applyInitialFontFamily): >+ (WebCore::StyleBuilderCustom::applyInheritFontFamily): >+ (WebCore::StyleBuilderCustom::applyValueFontFamily): >+ (WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures): >+ (WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures): >+ (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures): >+ (WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric): >+ (WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric): >+ (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric): >+ (WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian): >+ (WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian): >+ (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian): >+ (WebCore::StyleBuilderCustom::applyInitialFontSize): >+ (WebCore::StyleBuilderCustom::applyInheritFontSize): >+ (WebCore::StyleBuilderCustom::applyInitialFontStyle): >+ (WebCore::StyleBuilderCustom::applyInheritFontStyle): >+ (WebCore::StyleBuilderCustom::applyValueFontStyle): >+ (WebCore::StyleBuilderCustom::applyValueFontSize): >+ * css/StyleResolver.cpp: >+ (WebCore::checkForOrientationChange): >+ (WebCore::StyleResolver::checkForTextSizeAdjust): >+ (WebCore::StyleResolver::checkForZoomChange): >+ (WebCore::StyleResolver::checkForGenericFamilyChange): >+ (WebCore::StyleResolver::initializeFontStyle): >+ * css/StyleResolver.h: >+ (WebCore::StyleResolver::State::setFontDescription): >+ (WebCore::StyleResolver::setFontDescription): >+ * css/makeprop.pl: >+ (generateInitialValueSetter): >+ (generateInheritValueSetter): >+ (generateValueSetter): >+ * html/canvas/CanvasRenderingContext2D.cpp: >+ (WebCore::CanvasRenderingContext2D::setFont): >+ * page/DebugPageOverlays.cpp: >+ (WebCore::NonFastScrollableRegionOverlay::drawRect): >+ * page/linux/ResourceUsageOverlayLinux.cpp: >+ * platform/graphics/FontCascade.cpp: >+ (WebCore::FontCascade::FontCascade): >+ * platform/graphics/FontCascade.h: >+ * platform/graphics/ca/win/PlatformCALayerWin.cpp: >+ (PlatformCALayerWin::drawTextAtPoint const): >+ * platform/mock/MockRealtimeVideoSource.cpp: >+ (WebCore::MockRealtimeVideoSource::drawText): >+ * platform/win/DragImageWin.cpp: >+ (WebCore::dragLabelFont): >+ * platform/win/PopupMenuWin.cpp: >+ (WebCore::PopupMenuWin::calculatePositionAndSize): >+ (WebCore::PopupMenuWin::paint): >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::styleDidChange): >+ * rendering/RenderCombineText.cpp: >+ (WebCore::RenderCombineText::combineTextIfNeeded): >+ * rendering/RenderEmbeddedObject.cpp: >+ (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const): >+ * rendering/RenderListBox.cpp: >+ (WebCore::bolder): >+ (WebCore::RenderListBox::paintItemForeground): >+ * rendering/RenderListItem.cpp: >+ (WebCore::RenderListItem::computeMarkerStyle const): >+ * rendering/RenderTheme.cpp: >+ (WebCore::RenderTheme::adjustStyle): >+ * rendering/RenderThemeMac.mm: >+ (WebCore::RenderThemeMac::setFontFromControlSize const): >+ * rendering/TextAutoSizing.cpp: >+ (WebCore::TextAutoSizingValue::adjustTextNodeSizes): >+ (WebCore::TextAutoSizingValue::reset): >+ * rendering/style/RenderStyle.cpp: >+ (WebCore::RenderStyle::setFontDescription): >+ (WebCore::RenderStyle::setFontSize): >+ (WebCore::RenderStyle::setFontVariationSettings): >+ (WebCore::RenderStyle::setFontWeight): >+ (WebCore::RenderStyle::setFontStretch): >+ (WebCore::RenderStyle::setFontItalic): >+ * rendering/style/RenderStyle.h: >+ * rendering/svg/RenderSVGInlineText.cpp: >+ (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): >+ * rendering/updating/RenderTreeBuilderFirstLetter.cpp: >+ (WebCore::styleForFirstLetter): >+ * style/StyleResolveForDocument.cpp: >+ (WebCore::Style::resolveForDocument): >+ > 2018-05-24 Chris Dumez <cdumez@apple.com> > > [iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html is a flaky failure >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 74953be9afc52bb1f5b4d2d416b6a3eae4cee82d..a4cf83bb725a5f9697b43784037b0d7d5a24213d 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-24 Chris Dumez <cdumez@apple.com> >+ >+ Reduce copying of FontCascadeDescription objects by moving them around >+ https://bugs.webkit.org/show_bug.cgi?id=185963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Reduce copying of FontCascadeDescription objects by moving them around when possible. >+ >+ * FullscreenVideoController.cpp: >+ (FullscreenVideoController::draw): >+ > 2018-05-15 Antoine Quint <graouts@apple.com> > > [Web Animations] Expose Web Animations CSS integration as an experimental feature >diff --git a/Source/WebCore/css/StyleBuilderCustom.h b/Source/WebCore/css/StyleBuilderCustom.h >index a74f9315800c0927f1f1f4c6cb48489a29e1a090..f8dd0f00a80db9cb25a1d3a6c955e4be4c9c0b57 100644 >--- a/Source/WebCore/css/StyleBuilderCustom.h >+++ b/Source/WebCore/css/StyleBuilderCustom.h >@@ -782,7 +782,7 @@ inline void StyleBuilderCustom::applyValueWebkitLocale(StyleResolver& styleResol > fontDescription.setLocale(nullAtom()); > else > fontDescription.setLocale(primitiveValue.stringValue()); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyValueWritingMode(StyleResolver& styleResolver, CSSValue& value) >@@ -914,7 +914,7 @@ inline void StyleBuilderCustom::applyInitialFontFamily(StyleResolver& styleResol > if (!initialDesc.firstFamily().isEmpty()) > fontDescription.setFamilies(initialDesc.families()); > >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInheritFontFamily(StyleResolver& styleResolver) >@@ -924,7 +924,7 @@ inline void StyleBuilderCustom::applyInheritFontFamily(StyleResolver& styleResol > > fontDescription.setFamilies(parentFontDescription.families()); > fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont()); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyValueFontFamily(StyleResolver& styleResolver, CSSValue& value) >@@ -1001,7 +1001,7 @@ inline void StyleBuilderCustom::applyValueFontFamily(StyleResolver& styleResolve > styleResolver.setFontSize(fontDescription, Style::fontSizeForKeyword(sizeIdentifier, !oldFamilyUsedFixedDefaultSize, styleResolver.document())); > } > >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline bool StyleBuilderCustom::isValidDisplayValue(StyleResolver& styleResolver, EDisplay display) >@@ -1468,7 +1468,7 @@ inline void StyleBuilderCustom::applyInheritFontVariantLigatures(StyleResolver& > fontDescription.setVariantDiscretionaryLigatures(styleResolver.parentFontDescription().variantDiscretionaryLigatures()); > fontDescription.setVariantHistoricalLigatures(styleResolver.parentFontDescription().variantHistoricalLigatures()); > fontDescription.setVariantContextualAlternates(styleResolver.parentFontDescription().variantContextualAlternates()); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInitialFontVariantLigatures(StyleResolver& styleResolver) >@@ -1478,7 +1478,7 @@ inline void StyleBuilderCustom::applyInitialFontVariantLigatures(StyleResolver& > fontDescription.setVariantDiscretionaryLigatures(FontVariantLigatures::Normal); > fontDescription.setVariantHistoricalLigatures(FontVariantLigatures::Normal); > fontDescription.setVariantContextualAlternates(FontVariantLigatures::Normal); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyValueFontVariantLigatures(StyleResolver& styleResolver, CSSValue& value) >@@ -1489,7 +1489,7 @@ inline void StyleBuilderCustom::applyValueFontVariantLigatures(StyleResolver& st > fontDescription.setVariantDiscretionaryLigatures(variantLigatures.discretionaryLigatures); > fontDescription.setVariantHistoricalLigatures(variantLigatures.historicalLigatures); > fontDescription.setVariantContextualAlternates(variantLigatures.contextualAlternates); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInheritFontVariantNumeric(StyleResolver& styleResolver) >@@ -1500,7 +1500,7 @@ inline void StyleBuilderCustom::applyInheritFontVariantNumeric(StyleResolver& st > fontDescription.setVariantNumericFraction(styleResolver.parentFontDescription().variantNumericFraction()); > fontDescription.setVariantNumericOrdinal(styleResolver.parentFontDescription().variantNumericOrdinal()); > fontDescription.setVariantNumericSlashedZero(styleResolver.parentFontDescription().variantNumericSlashedZero()); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInitialFontVariantNumeric(StyleResolver& styleResolver) >@@ -1511,7 +1511,7 @@ inline void StyleBuilderCustom::applyInitialFontVariantNumeric(StyleResolver& st > fontDescription.setVariantNumericFraction(FontVariantNumericFraction::Normal); > fontDescription.setVariantNumericOrdinal(FontVariantNumericOrdinal::Normal); > fontDescription.setVariantNumericSlashedZero(FontVariantNumericSlashedZero::Normal); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyValueFontVariantNumeric(StyleResolver& styleResolver, CSSValue& value) >@@ -1523,7 +1523,7 @@ inline void StyleBuilderCustom::applyValueFontVariantNumeric(StyleResolver& styl > fontDescription.setVariantNumericFraction(variantNumeric.fraction); > fontDescription.setVariantNumericOrdinal(variantNumeric.ordinal); > fontDescription.setVariantNumericSlashedZero(variantNumeric.slashedZero); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInheritFontVariantEastAsian(StyleResolver& styleResolver) >@@ -1532,7 +1532,7 @@ inline void StyleBuilderCustom::applyInheritFontVariantEastAsian(StyleResolver& > fontDescription.setVariantEastAsianVariant(styleResolver.parentFontDescription().variantEastAsianVariant()); > fontDescription.setVariantEastAsianWidth(styleResolver.parentFontDescription().variantEastAsianWidth()); > fontDescription.setVariantEastAsianRuby(styleResolver.parentFontDescription().variantEastAsianRuby()); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInitialFontVariantEastAsian(StyleResolver& styleResolver) >@@ -1541,7 +1541,7 @@ inline void StyleBuilderCustom::applyInitialFontVariantEastAsian(StyleResolver& > fontDescription.setVariantEastAsianVariant(FontVariantEastAsianVariant::Normal); > fontDescription.setVariantEastAsianWidth(FontVariantEastAsianWidth::Normal); > fontDescription.setVariantEastAsianRuby(FontVariantEastAsianRuby::Normal); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyValueFontVariantEastAsian(StyleResolver& styleResolver, CSSValue& value) >@@ -1551,7 +1551,7 @@ inline void StyleBuilderCustom::applyValueFontVariantEastAsian(StyleResolver& st > fontDescription.setVariantEastAsianVariant(variantEastAsian.variant); > fontDescription.setVariantEastAsianWidth(variantEastAsian.width); > fontDescription.setVariantEastAsianRuby(variantEastAsian.ruby); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInitialFontSize(StyleResolver& styleResolver) >@@ -1564,7 +1564,7 @@ inline void StyleBuilderCustom::applyInitialFontSize(StyleResolver& styleResolve > > fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium); > styleResolver.setFontSize(fontDescription, size); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInheritFontSize(StyleResolver& styleResolver) >@@ -1578,7 +1578,7 @@ inline void StyleBuilderCustom::applyInheritFontSize(StyleResolver& styleResolve > auto fontDescription = styleResolver.style()->fontDescription(); > fontDescription.setKeywordSize(parentFontDescription.keywordSize()); > styleResolver.setFontSize(fontDescription, size); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > // When the CSS keyword "larger" is used, this function will attempt to match within the keyword >@@ -1620,7 +1620,7 @@ inline void StyleBuilderCustom::applyInitialFontStyle(StyleResolver& styleResolv > auto fontDescription = styleResolver.fontDescription(); > fontDescription.setItalic(FontCascadeDescription::initialItalic()); > fontDescription.setFontStyleAxis(FontCascadeDescription::initialFontStyleAxis()); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInheritFontStyle(StyleResolver& styleResolver) >@@ -1628,7 +1628,7 @@ inline void StyleBuilderCustom::applyInheritFontStyle(StyleResolver& styleResolv > auto fontDescription = styleResolver.fontDescription(); > fontDescription.setItalic(styleResolver.parentFontDescription().italic()); > fontDescription.setFontStyleAxis(styleResolver.parentFontDescription().fontStyleAxis()); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyValueFontStyle(StyleResolver& styleResolver, CSSValue& value) >@@ -1637,7 +1637,7 @@ inline void StyleBuilderCustom::applyValueFontStyle(StyleResolver& styleResolver > auto fontDescription = styleResolver.fontDescription(); > fontDescription.setItalic(StyleBuilderConverter::convertFontStyleFromValue(fontStyleValue)); > fontDescription.setFontStyleAxis(fontStyleValue.fontStyleValue->valueID() == CSSValueItalic ? FontStyleAxis::ital : FontStyleAxis::slnt); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyValueFontSize(StyleResolver& styleResolver, CSSValue& value) >@@ -1701,7 +1701,7 @@ inline void StyleBuilderCustom::applyValueFontSize(StyleResolver& styleResolver, > return; > > styleResolver.setFontSize(fontDescription, std::min(maximumAllowedFontSize, size)); >- styleResolver.setFontDescription(fontDescription); >+ styleResolver.setFontDescription(WTFMove(fontDescription)); > } > > inline void StyleBuilderCustom::applyInitialGridTemplateAreas(StyleResolver& styleResolver) >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index f567416381c606af25f164ed5acae1ae4a385e70..b038ae7a59160dbf7a21e6fc87c681a3bb32a2f0 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -1089,7 +1089,7 @@ static void checkForOrientationChange(RenderStyle* style) > auto newFontDescription = fontDescription; > newFontDescription.setNonCJKGlyphOrientation(glyphOrientation); > newFontDescription.setOrientation(fontOrientation); >- style->setFontDescription(newFontDescription); >+ style->setFontDescription(WTFMove(newFontDescription)); > } > > void StyleResolver::updateFont() >@@ -1736,7 +1736,7 @@ void StyleResolver::checkForTextSizeAdjust(RenderStyle* style) > newFontDescription.setComputedSize(newFontDescription.specifiedSize() * style->textSizeAdjust().multiplier()); > else > newFontDescription.setComputedSize(newFontDescription.specifiedSize()); >- style->setFontDescription(newFontDescription); >+ style->setFontDescription(WTFMove(newFontDescription)); > } > #endif > >@@ -1751,7 +1751,7 @@ void StyleResolver::checkForZoomChange(RenderStyle* style, const RenderStyle* pa > const auto& childFont = style->fontDescription(); > auto newFontDescription = childFont; > setFontSize(newFontDescription, childFont.specifiedSize()); >- style->setFontDescription(newFontDescription); >+ style->setFontDescription(WTFMove(newFontDescription)); > } > > void StyleResolver::checkForGenericFamilyChange(RenderStyle* style, const RenderStyle* parentStyle) >@@ -1782,7 +1782,7 @@ void StyleResolver::checkForGenericFamilyChange(RenderStyle* style, const Render > > auto newFontDescription = childFont; > setFontSize(newFontDescription, size); >- style->setFontDescription(newFontDescription); >+ style->setFontDescription(WTFMove(newFontDescription)); > } > > void StyleResolver::initializeFontStyle() >@@ -1793,7 +1793,7 @@ void StyleResolver::initializeFontStyle() > fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium); > setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueMedium, false, document())); > fontDescription.setShouldAllowUserInstalledFonts(settings().shouldAllowUserInstalledFonts() ? AllowUserInstalledFonts::Yes : AllowUserInstalledFonts::No); >- setFontDescription(fontDescription); >+ setFontDescription(WTFMove(fontDescription)); > } > > void StyleResolver::setFontSize(FontCascadeDescription& fontDescription, float size) >diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h >index 6d66a625ba440dc09bac63a80e4109e1325ff73b..bc912dbaec8dfc8f823a69b710217c228469af67 100644 >--- a/Source/WebCore/css/StyleResolver.h >+++ b/Source/WebCore/css/StyleResolver.h >@@ -377,7 +377,7 @@ public: > > const FontCascadeDescription& fontDescription() { return m_style->fontDescription(); } > const FontCascadeDescription& parentFontDescription() { return m_parentStyle->fontDescription(); } >- void setFontDescription(const FontCascadeDescription& fontDescription) { m_fontDirty |= m_style->setFontDescription(fontDescription); } >+ void setFontDescription(FontCascadeDescription&& fontDescription) { m_fontDirty |= m_style->setFontDescription(WTFMove(fontDescription)); } > void setZoom(float f) { m_fontDirty |= m_style->setZoom(f); } > void setEffectiveZoom(float f) { m_fontDirty |= m_style->setEffectiveZoom(f); } > void setWritingMode(WritingMode writingMode) { m_fontDirty |= m_style->setWritingMode(writingMode); } >@@ -448,7 +448,7 @@ public: > InspectorCSSOMWrappers& inspectorCSSOMWrappers() { return m_inspectorCSSOMWrappers; } > const FontCascadeDescription& fontDescription() { return m_state.fontDescription(); } > const FontCascadeDescription& parentFontDescription() { return m_state.parentFontDescription(); } >- void setFontDescription(const FontCascadeDescription& fontDescription) { m_state.setFontDescription(fontDescription); } >+ void setFontDescription(FontCascadeDescription&& fontDescription) { m_state.setFontDescription(WTFMove(fontDescription)); } > void setZoom(float f) { m_state.setZoom(f); } > void setEffectiveZoom(float f) { m_state.setEffectiveZoom(f); } > void setWritingMode(WritingMode writingMode) { m_state.setWritingMode(writingMode); } >diff --git a/Source/WebCore/css/makeprop.pl b/Source/WebCore/css/makeprop.pl >index a8b46b0e3386a50848680285abff29223efcd883..3e36b1987453db2981809119356223b7403934f9 100755 >--- a/Source/WebCore/css/makeprop.pl >+++ b/Source/WebCore/css/makeprop.pl >@@ -853,7 +853,7 @@ sub generateInitialValueSetter { > } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"font-property"}) { > $setterContent .= $indent . " auto fontDescription = styleResolver.fontDescription();\n"; > $setterContent .= $indent . " fontDescription." . $setter . "(FontCascadeDescription::" . $initial . "());\n"; >- $setterContent .= $indent . " styleResolver.setFontDescription(fontDescription);\n"; >+ $setterContent .= $indent . " styleResolver.setFontDescription(WTFMove(fontDescription));\n"; > } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"fill-layer-property"}) { > $setterContent .= generateFillLayerPropertyInitialValueSetter($name, $indent . " "); > } else { >@@ -897,7 +897,7 @@ sub generateInheritValueSetter { > } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"font-property"}) { > $setterContent .= $indent . " auto fontDescription = styleResolver.fontDescription();\n"; > $setterContent .= $indent . " fontDescription." . $setter . "(styleResolver.parentFontDescription()." . $getter . "());\n"; >- $setterContent .= $indent . " styleResolver.setFontDescription(fontDescription);\n"; >+ $setterContent .= $indent . " styleResolver.setFontDescription(WTFMove(fontDescription));\n"; > $didCallSetValue = 1; > } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"fill-layer-property"}) { > $setterContent .= generateFillLayerPropertyInheritValueSetter($name, $indent . " "); >@@ -951,7 +951,7 @@ sub generateValueSetter { > } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"font-property"}) { > $setterContent .= $indent . " auto fontDescription = styleResolver.fontDescription();\n"; > $setterContent .= $indent . " fontDescription." . $setter . "(" . $convertedValue . ");\n"; >- $setterContent .= $indent . " styleResolver.setFontDescription(fontDescription);\n"; >+ $setterContent .= $indent . " styleResolver.setFontDescription(WTFMove(fontDescription));\n"; > $didCallSetValue = 1; > } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"fill-layer-property"}) { > $setterContent .= generateFillLayerPropertyValueSetter($name, $indent . " "); >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >index 77635a6b289617cb9ac4ea6d6ab8081a40e22172..e9ae63c4980d53925222f41959482e98145d77e6 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >@@ -150,14 +150,14 @@ void CanvasRenderingContext2D::setFont(const String& newFont) > document.updateStyleIfNeeded(); > > if (auto* computedStyle = canvas().computedStyle()) >- newStyle->setFontDescription(computedStyle->fontDescription()); >+ newStyle->setFontDescription(FontCascadeDescription { computedStyle->fontDescription() }); > else { > FontCascadeDescription defaultFontDescription; > defaultFontDescription.setOneFamily(DefaultFontFamily); > defaultFontDescription.setSpecifiedSize(DefaultFontSize); > defaultFontDescription.setComputedSize(DefaultFontSize); > >- newStyle->setFontDescription(defaultFontDescription); >+ newStyle->setFontDescription(WTFMove(defaultFontDescription)); > } > > newStyle->fontCascade().update(&document.fontSelector()); >diff --git a/Source/WebCore/page/DebugPageOverlays.cpp b/Source/WebCore/page/DebugPageOverlays.cpp >index 0255463b675bce2571c678637ad76b0b72c0d902..a979f657622d1b5501a96b561cbef491cf4456b8 100644 >--- a/Source/WebCore/page/DebugPageOverlays.cpp >+++ b/Source/WebCore/page/DebugPageOverlays.cpp >@@ -189,7 +189,7 @@ void NonFastScrollableRegionOverlay::drawRect(PageOverlay& pageOverlay, Graphics > fontDescription.setSpecifiedSize(12); > fontDescription.setComputedSize(12); > fontDescription.setWeight(FontSelectionValue(500)); >- FontCascade font(fontDescription, 0, 0); >+ FontCascade font(WTFMove(fontDescription), 0, 0); > font.update(nullptr); > > #if ENABLE(TOUCH_EVENTS) >diff --git a/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp b/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp >index 9643d9c05edb5d4ab1eb7e9e329352dd069005a7..4c52d988a9e3c38277f807c96d23d84787c48ba2 100644 >--- a/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp >+++ b/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp >@@ -76,7 +76,7 @@ public: > FontCascadeDescription fontDescription; > RenderTheme::singleton().systemFont(CSSValueMessageBox, fontDescription); > fontDescription.setComputedSize(gFontSize); >- m_textFont = FontCascade(fontDescription, 0, 0); >+ m_textFont = FontCascade(WTFMove(fontDescription), 0, 0); > m_textFont.update(nullptr); > } > >diff --git a/Source/WebCore/platform/graphics/FontCascade.cpp b/Source/WebCore/platform/graphics/FontCascade.cpp >index 847861f6bcb7ff1c5920d83a1630e85c16e8ed7b..bfbcb837d1c7a314c5fa41ef4d7007ec253a995e 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.cpp >+++ b/Source/WebCore/platform/graphics/FontCascade.cpp >@@ -77,11 +77,11 @@ FontCascade::FontCascade() > { > } > >-FontCascade::FontCascade(const FontCascadeDescription& fd, float letterSpacing, float wordSpacing) >- : m_fontDescription(fd) >+FontCascade::FontCascade(FontCascadeDescription&& fd, float letterSpacing, float wordSpacing) >+ : m_fontDescription(WTFMove(fd)) > , m_letterSpacing(letterSpacing) > , m_wordSpacing(wordSpacing) >- , m_useBackslashAsYenSymbol(useBackslashAsYenSignForFamily(fd.firstFamily())) >+ , m_useBackslashAsYenSymbol(useBackslashAsYenSignForFamily(m_fontDescription.firstFamily())) > , m_enableKerning(computeEnableKerning()) > , m_requiresShaping(computeRequiresShaping()) > { >diff --git a/Source/WebCore/platform/graphics/FontCascade.h b/Source/WebCore/platform/graphics/FontCascade.h >index e1e1b5222556ba96bcb4c24720c491e67d248aa0..3529a9569781652e794831e8231a82bfcd455b7c 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.h >+++ b/Source/WebCore/platform/graphics/FontCascade.h >@@ -101,7 +101,7 @@ public: > class FontCascade { > public: > WEBCORE_EXPORT FontCascade(); >- WEBCORE_EXPORT FontCascade(const FontCascadeDescription&, float letterSpacing = 0, float wordSpacing = 0); >+ WEBCORE_EXPORT FontCascade(FontCascadeDescription&&, float letterSpacing = 0, float wordSpacing = 0); > // This constructor is only used if the platform wants to start with a native font. > WEBCORE_EXPORT FontCascade(const FontPlatformData&, FontSmoothingMode = AutoSmoothing); > >diff --git a/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp b/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp >index c000b43c740a5b699f8ef7e42c92d1428218599f..9700bb763b5624dd8c677af2e0da0e9da2fecf44 100644 >--- a/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp >+++ b/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp >@@ -963,7 +963,7 @@ void PlatformCALayerWin::drawTextAtPoint(CGContextRef context, CGFloat x, CGFloa > > desc.setComputedSize(scale.width * fontSize); > >- FontCascade font = FontCascade(desc, 0, 0); >+ FontCascade font = FontCascade(WTFMove(desc), 0, 0); > font.update(nullptr); > > GraphicsContext cg(context); >diff --git a/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp b/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp >index 40aae99c425b464de54f9edb92026db00a97c584..ea153c93ad97299adaea5912caf319201339351a 100644 >--- a/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp >+++ b/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp >@@ -336,17 +336,17 @@ void MockRealtimeVideoSource::drawText(GraphicsContext& context) > > fontDescription.setSpecifiedSize(m_baseFontSize); > fontDescription.setComputedSize(m_baseFontSize); >- FontCascade timeFont { fontDescription, 0, 0 }; >+ FontCascade timeFont { FontCascadeDescription { fontDescription }, 0, 0 }; > timeFont.update(nullptr); > > fontDescription.setSpecifiedSize(m_bipBopFontSize); > fontDescription.setComputedSize(m_bipBopFontSize); >- FontCascade bipBopFont { fontDescription, 0, 0 }; >+ FontCascade bipBopFont { FontCascadeDescription { fontDescription }, 0, 0 }; > bipBopFont.update(nullptr); > > fontDescription.setSpecifiedSize(m_statsFontSize); > fontDescription.setComputedSize(m_statsFontSize); >- FontCascade statsFont { fontDescription, 0, 0 }; >+ FontCascade statsFont { WTFMove(fontDescription), 0, 0 }; > statsFont.update(nullptr); > > IntSize size = this->size(); >diff --git a/Source/WebCore/platform/win/DragImageWin.cpp b/Source/WebCore/platform/win/DragImageWin.cpp >index f9971e6e5decec0e5903a2f546415cc8d042d2d2..1dfa50b532dd8b5af66675f8449fe54191174eff 100644 >--- a/Source/WebCore/platform/win/DragImageWin.cpp >+++ b/Source/WebCore/platform/win/DragImageWin.cpp >@@ -116,7 +116,7 @@ static FontCascade dragLabelFont(int size, bool bold, FontRenderingMode renderin > description.setSpecifiedSize((float)size); > description.setComputedSize((float)size); > description.setRenderingMode(renderingMode); >- result = FontCascade(description, 0, 0); >+ result = FontCascade(WTFMove(description), 0, 0); > result.update(0); > return result; > } >diff --git a/Source/WebCore/platform/win/PopupMenuWin.cpp b/Source/WebCore/platform/win/PopupMenuWin.cpp >index 58433c50df5accb18262e694acb680ee469bf12f..f29406a97fa4132eb1303461b48ef47e34b069ef 100644 >--- a/Source/WebCore/platform/win/PopupMenuWin.cpp >+++ b/Source/WebCore/platform/win/PopupMenuWin.cpp >@@ -322,7 +322,7 @@ void PopupMenuWin::calculatePositionAndSize(const IntRect& r, FrameView* v) > m_font = client()->menuStyle().font(); > auto d = m_font.fontDescription(); > d.setComputedSize(d.computedSize() * m_scaleFactor); >- m_font = FontCascade(d, m_font.letterSpacing(), m_font.wordSpacing()); >+ m_font = FontCascade(WTFMove(d), m_font.letterSpacing(), m_font.wordSpacing()); > m_font.update(m_popupClient->fontSelector()); > > // First, determine the popup's height >@@ -345,7 +345,7 @@ void PopupMenuWin::calculatePositionAndSize(const IntRect& r, FrameView* v) > if (client()->itemIsLabel(i)) { > auto d = itemFont.fontDescription(); > d.setWeight(d.bolderWeight()); >- itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing()); >+ itemFont = FontCascade(WTFMove(d), itemFont.letterSpacing(), itemFont.wordSpacing()); > itemFont.update(m_popupClient->fontSelector()); > } > >@@ -650,7 +650,7 @@ void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc) > if (client()->itemIsLabel(index)) { > auto d = itemFont.fontDescription(); > d.setWeight(d.bolderWeight()); >- itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing()); >+ itemFont = FontCascade(WTFMove(d), itemFont.letterSpacing(), itemFont.wordSpacing()); > itemFont.update(m_popupClient->fontSelector()); > } > >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index 192373d5ec64596c0aa66e296701d46ea9e337b8..d34319154be43d2d0bf555c538c93bbb137a3d33 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -392,7 +392,7 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle > // Propagate the body font back up to the RenderView and use it as > // the basis of the grid. > if (newStyle.fontDescription() != view().style().fontDescription()) { >- view().mutableStyle().setFontDescription(newStyle.fontDescription()); >+ view().mutableStyle().setFontDescription(FontCascadeDescription { newStyle.fontDescription() }); > view().mutableStyle().fontCascade().update(&document().fontSelector()); > } > } >diff --git a/Source/WebCore/rendering/RenderCombineText.cpp b/Source/WebCore/rendering/RenderCombineText.cpp >index 9cf4fb8edc2a258737d4300617f8e9b362186e2d..d6163294a7967f6614d67cb71aa8506705c6548b 100644 >--- a/Source/WebCore/rendering/RenderCombineText.cpp >+++ b/Source/WebCore/rendering/RenderCombineText.cpp >@@ -124,7 +124,7 @@ void RenderCombineText::combineTextIfNeeded() > > description.setOrientation(Horizontal); // We are going to draw combined text horizontally. > >- FontCascade horizontalFont(description, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing()); >+ FontCascade horizontalFont(FontCascadeDescription { description }, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing()); > horizontalFont.update(fontSelector); > > GlyphOverflow glyphOverflow; >@@ -137,14 +137,14 @@ void RenderCombineText::combineTextIfNeeded() > m_isCombined = combinedTextWidth <= emWidth; > > if (m_isCombined) >- shouldUpdateFont = m_combineFontStyle->setFontDescription(description); // Need to change font orientation to horizontal. >+ shouldUpdateFont = m_combineFontStyle->setFontDescription(WTFMove(description)); // Need to change font orientation to horizontal. > else { > // Need to try compressed glyphs. > static const FontWidthVariant widthVariants[] = { HalfWidth, ThirdWidth, QuarterWidth }; > for (auto widthVariant : widthVariants) { > description.setWidthVariant(widthVariant); // When modifying this, make sure to keep it in sync with FontPlatformData::isForTextCombine()! > >- FontCascade compressedFont(description, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing()); >+ FontCascade compressedFont(FontCascadeDescription { description }, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing()); > compressedFont.update(fontSelector); > > glyphOverflow.left = glyphOverflow.top = glyphOverflow.right = glyphOverflow.bottom = 0; >@@ -154,7 +154,7 @@ void RenderCombineText::combineTextIfNeeded() > m_isCombined = true; > > // Replace my font with the new one. >- shouldUpdateFont = m_combineFontStyle->setFontDescription(description); >+ shouldUpdateFont = m_combineFontStyle->setFontDescription(WTFMove(description)); > break; > } > >@@ -172,9 +172,9 @@ void RenderCombineText::combineTextIfNeeded() > do { > float computedSize = originalSize * scaleFactor; > bestFitDescription.setComputedSize(computedSize); >- shouldUpdateFont = m_combineFontStyle->setFontDescription(bestFitDescription); >+ shouldUpdateFont = m_combineFontStyle->setFontDescription(FontCascadeDescription { bestFitDescription }); > >- FontCascade compressedFont(bestFitDescription, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing()); >+ FontCascade compressedFont(WTFMove(bestFitDescription), style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing()); > compressedFont.update(fontSelector); > > glyphOverflow.left = glyphOverflow.top = glyphOverflow.right = glyphOverflow.bottom = 0; >diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.cpp b/Source/WebCore/rendering/RenderEmbeddedObject.cpp >index cd1cb99770156cbb30e4f5621a35db74597a8b31..b982504a7627d498950f081f32ff77edc2dc6ed7 100644 >--- a/Source/WebCore/rendering/RenderEmbeddedObject.cpp >+++ b/Source/WebCore/rendering/RenderEmbeddedObject.cpp >@@ -378,7 +378,7 @@ void RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul > fontDescription.setWeight(boldWeightValue()); > fontDescription.setRenderingMode(settings().fontRenderingMode()); > fontDescription.setComputedSize(12); >- font = FontCascade(fontDescription, 0, 0); >+ font = FontCascade(WTFMove(fontDescription), 0, 0); > font.update(0); > > run = TextRun(m_unavailablePluginReplacementText); >diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp >index 94f7d52f7df1663c101db1c3843264537c7e6d25..101064c6ee54c28dbb6dc17b26a0df611620d551 100644 >--- a/Source/WebCore/rendering/RenderListBox.cpp >+++ b/Source/WebCore/rendering/RenderListBox.cpp >@@ -120,7 +120,7 @@ static FontCascade bolder(Document& document, const FontCascade& font) > { > auto description = font.fontDescription(); > description.setWeight(description.bolderWeight()); >- auto result = FontCascade { description, font.letterSpacing(), font.wordSpacing() }; >+ auto result = FontCascade { WTFMove(description), font.letterSpacing(), font.wordSpacing() }; > result.update(&document.fontSelector()); > return result; > } >@@ -441,7 +441,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint& > if (is<HTMLOptGroupElement>(*listItemElement)) { > auto description = itemFont.fontDescription(); > description.setWeight(description.bolderWeight()); >- itemFont = FontCascade(description, itemFont.letterSpacing(), itemFont.wordSpacing()); >+ itemFont = FontCascade(WTFMove(description), itemFont.letterSpacing(), itemFont.wordSpacing()); > itemFont.update(&document().fontSelector()); > } > >diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp >index c738a9be468b6d765e13ea02f8624e4a09202fef..4be23306a709527404e859f147888eceaf2f5d28 100644 >--- a/Source/WebCore/rendering/RenderListItem.cpp >+++ b/Source/WebCore/rendering/RenderListItem.cpp >@@ -69,7 +69,7 @@ RenderStyle RenderListItem::computeMarkerStyle() const > RenderStyle parentStyle = RenderStyle::clone(style()); > auto fontDescription = style().fontDescription(); > fontDescription.setVariantNumericSpacing(FontVariantNumericSpacing::TabularNumbers); >- parentStyle.setFontDescription(fontDescription); >+ parentStyle.setFontDescription(WTFMove(fontDescription)); > parentStyle.fontCascade().update(&document().fontSelector()); > if (auto markerStyle = getCachedPseudoStyle(MARKER, &parentStyle)) > return RenderStyle::clone(*markerStyle); >diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp >index 424d2d5a58e49eed2f4466426923c9d46f2fa9f7..af539f2b5140ad6f40081d66620508a500839268 100644 >--- a/Source/WebCore/rendering/RenderTheme.cpp >+++ b/Source/WebCore/rendering/RenderTheme.cpp >@@ -176,7 +176,7 @@ void RenderTheme::adjustStyle(StyleResolver& styleResolver, RenderStyle& style, > if (auto themeFont = Theme::singleton().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. > style.setLineHeight(RenderStyle::initialLineHeight()); >- if (style.setFontDescription(themeFont.value())) >+ if (style.setFontDescription(WTFMove(themeFont.value()))) > style.fontCascade().update(nullptr); > } > >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 9cf608296b9733fc05d197074f3ef77be49c24f9..33b22b928f5c712edf2cdb0c539889824f0ef58a 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -791,7 +791,7 @@ void RenderThemeMac::setFontFromControlSize(StyleResolver&, RenderStyle& style, > // Reset line height > style.setLineHeight(RenderStyle::initialLineHeight()); > >- if (style.setFontDescription(fontDescription)) >+ if (style.setFontDescription(WTFMove(fontDescription))) > style.fontCascade().update(0); > } > >diff --git a/Source/WebCore/rendering/TextAutoSizing.cpp b/Source/WebCore/rendering/TextAutoSizing.cpp >index b7a9079d158ecd4c9d6a830557ca938114f96a73..3ba130d4559d7292d891f553cf1480f866bb2bad 100644 >--- a/Source/WebCore/rendering/TextAutoSizing.cpp >+++ b/Source/WebCore/rendering/TextAutoSizing.cpp >@@ -122,7 +122,7 @@ auto TextAutoSizingValue::adjustTextNodeSizes() -> StillHasNodes > auto style = cloneRenderStyleWithState(renderer.style()); > auto fontDescription = style.fontDescription(); > fontDescription.setComputedSize(averageSize); >- style.setFontDescription(fontDescription); >+ style.setFontDescription(FontCascadeDescription { fontDescription }); > style.fontCascade().update(&node->document().fontSelector()); > parentRenderer->setStyle(WTFMove(style)); > >@@ -133,7 +133,7 @@ auto TextAutoSizingValue::adjustTextNodeSizes() -> StillHasNodes > if (is<RenderListMarker>(*parentRenderer->firstChild())) { > auto& listMarkerRenderer = downcast<RenderListMarker>(*parentRenderer->firstChild()); > auto style = cloneRenderStyleWithState(listMarkerRenderer.style()); >- style.setFontDescription(fontDescription); >+ style.setFontDescription(FontCascadeDescription { fontDescription }); > style.fontCascade().update(&node->document().fontSelector()); > listMarkerRenderer.setStyle(WTFMove(style)); > } >@@ -156,7 +156,7 @@ auto TextAutoSizingValue::adjustTextNodeSizes() -> StillHasNodes > auto newParentStyle = cloneRenderStyleWithState(parentStyle); > newParentStyle.setLineHeight(Length(lineHeight, Fixed)); > newParentStyle.setSpecifiedLineHeight(Length { lineHeightLength }); >- newParentStyle.setFontDescription(fontDescription); >+ newParentStyle.setFontDescription(WTFMove(fontDescription)); > newParentStyle.fontCascade().update(&node->document().fontSelector()); > parentRenderer->setStyle(WTFMove(newParentStyle)); > >@@ -198,7 +198,7 @@ void TextAutoSizingValue::reset() > if (fontDescription.computedSize() != originalSize) { > fontDescription.setComputedSize(originalSize); > auto style = cloneRenderStyleWithState(renderer->style()); >- style.setFontDescription(fontDescription); >+ style.setFontDescription(FontCascadeDescription { fontDescription }); > style.fontCascade().update(&node->document().fontSelector()); > parentRenderer->setStyle(WTFMove(style)); > } >@@ -214,7 +214,7 @@ void TextAutoSizingValue::reset() > > auto newParentStyle = cloneRenderStyleWithState(parentStyle); > newParentStyle.setLineHeight(Length { originalLineHeight }); >- newParentStyle.setFontDescription(fontDescription); >+ newParentStyle.setFontDescription(WTFMove(fontDescription)); > newParentStyle.fontCascade().update(&node->document().fontSelector()); > parentRenderer->setStyle(WTFMove(newParentStyle)); > } >diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp >index 4cfea843acbfd524781ba5734fa1b1d4f7fec27b..00d2d814024e08359335f5936a864499152e95d9 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.cpp >+++ b/Source/WebCore/rendering/style/RenderStyle.cpp >@@ -1548,12 +1548,12 @@ float RenderStyle::letterSpacing() const > return m_inheritedData->fontCascade.letterSpacing(); > } > >-bool RenderStyle::setFontDescription(const FontCascadeDescription& description) >+bool RenderStyle::setFontDescription(FontCascadeDescription&& description) > { > if (m_inheritedData->fontCascade.fontDescription() == description) > return false; > auto& cascade = m_inheritedData.access().fontCascade; >- cascade = { description, cascade.letterSpacing(), cascade.wordSpacing() }; >+ cascade = { WTFMove(description), cascade.letterSpacing(), cascade.wordSpacing() }; > return true; > } > >@@ -1642,7 +1642,7 @@ void RenderStyle::setFontSize(float size) > description.setSpecifiedSize(size); > description.setComputedSize(size); > >- setFontDescription(description); >+ setFontDescription(WTFMove(description)); > fontCascade().update(currentFontSelector); > } > >@@ -1653,7 +1653,7 @@ void RenderStyle::setFontVariationSettings(FontVariationSettings settings) > auto description = fontDescription(); > description.setVariationSettings(WTFMove(settings)); > >- setFontDescription(description); >+ setFontDescription(WTFMove(description)); > fontCascade().update(currentFontSelector); > } > #endif >@@ -1664,7 +1664,7 @@ void RenderStyle::setFontWeight(FontSelectionValue value) > auto description = fontDescription(); > description.setWeight(value); > >- setFontDescription(description); >+ setFontDescription(WTFMove(description)); > fontCascade().update(currentFontSelector); > } > >@@ -1674,7 +1674,7 @@ void RenderStyle::setFontStretch(FontSelectionValue value) > auto description = fontDescription(); > description.setStretch(value); > >- setFontDescription(description); >+ setFontDescription(WTFMove(description)); > fontCascade().update(currentFontSelector); > } > >@@ -1684,7 +1684,7 @@ void RenderStyle::setFontItalic(FontSelectionValue value) > auto description = fontDescription(); > description.setItalic(value); > >- setFontDescription(description); >+ setFontDescription(WTFMove(description)); > fontCascade().update(currentFontSelector); > } > >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index 66a8f0713ad14ec18106e69d7a216e9884ad1f0a..b471c4847b9e774c33dc532a54549ea2db423eaf 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -899,7 +899,7 @@ public: > void setClear(Clear v) { m_nonInheritedFlags.clear = static_cast<unsigned>(v); } > void setTableLayout(TableLayoutType v) { m_nonInheritedFlags.tableLayout = static_cast<unsigned>(v); } > >- bool setFontDescription(const FontCascadeDescription&); >+ bool setFontDescription(FontCascadeDescription&&); > > // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing. > void setFontSize(float); >diff --git a/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp b/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp >index a9a1669908c8dd7dcee5bae7cb630c109b38e6eb..fd8f5cc9dd260ec73254ec81e16b64530b9ee335 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp >@@ -247,7 +247,7 @@ void RenderSVGInlineText::computeNewScaledFontForStyle(const RenderObject& rende > if (fontDescription.orientation() != FontOrientation::Horizontal) > fontDescription.setOrientation(FontOrientation::Horizontal); > >- scaledFont = FontCascade(fontDescription, 0, 0); >+ scaledFont = FontCascade(WTFMove(fontDescription), 0, 0); > scaledFont.update(&renderer.document().fontSelector()); > } > >diff --git a/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp b/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp >index 643dda3f31283c84de852716400583cc967b4a2a..a7eafa8d219440117f841386a382943d50fb2703 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp >+++ b/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp >@@ -66,7 +66,7 @@ static RenderStyle styleForFirstLetter(const RenderBlock& firstLetterBlock, cons > float startingFontSize = ((firstLetterStyle.initialLetterHeight() - 1) * lineHeight + paragraph->style().fontMetrics().capHeight()) / capRatio; > newFontDescription.setSpecifiedSize(startingFontSize); > newFontDescription.setComputedSize(startingFontSize); >- firstLetterStyle.setFontDescription(newFontDescription); >+ firstLetterStyle.setFontDescription(WTFMove(newFontDescription)); > firstLetterStyle.fontCascade().update(firstLetterStyle.fontCascade().fontSelector()); > > int desiredCapHeight = (firstLetterStyle.initialLetterHeight() - 1) * lineHeight + paragraph->style().fontMetrics().capHeight(); >@@ -75,7 +75,7 @@ static RenderStyle styleForFirstLetter(const RenderBlock& firstLetterBlock, cons > auto newFontDescription = firstLetterStyle.fontDescription(); > newFontDescription.setSpecifiedSize(newFontDescription.specifiedSize() - 1); > newFontDescription.setComputedSize(newFontDescription.computedSize() -1); >- firstLetterStyle.setFontDescription(newFontDescription); >+ firstLetterStyle.setFontDescription(WTFMove(newFontDescription)); > firstLetterStyle.fontCascade().update(firstLetterStyle.fontCascade().fontSelector()); > actualCapHeight = firstLetterStyle.fontMetrics().capHeight(); > } >diff --git a/Source/WebCore/style/StyleResolveForDocument.cpp b/Source/WebCore/style/StyleResolveForDocument.cpp >index 3a9db1821115422e9880f2d2ff4af7c0e58b22e5..dafc9a601d48e3e69aef657c9a0855f0d9c8dc49 100644 >--- a/Source/WebCore/style/StyleResolveForDocument.cpp >+++ b/Source/WebCore/style/StyleResolveForDocument.cpp >@@ -123,7 +123,7 @@ RenderStyle resolveForDocument(const Document& document) > fontDescription.setOrientation(fontOrientation); > fontDescription.setNonCJKGlyphOrientation(glyphOrientation); > >- documentStyle.setFontDescription(fontDescription); >+ documentStyle.setFontDescription(WTFMove(fontDescription)); > > documentStyle.fontCascade().update(&const_cast<Document&>(document).fontSelector()); > >diff --git a/Source/WebKitLegacy/win/FullscreenVideoController.cpp b/Source/WebKitLegacy/win/FullscreenVideoController.cpp >index 318f1a696bcc86d828d067a85ebbc4a5dd070dd0..f81cfefbbf8d02fc0bf3be63e8f35165bf34bb3f 100644 >--- a/Source/WebKitLegacy/win/FullscreenVideoController.cpp >+++ b/Source/WebKitLegacy/win/FullscreenVideoController.cpp >@@ -520,7 +520,7 @@ void FullscreenVideoController::draw() > desc.setOneFamily(metrics.lfSmCaptionFont.lfFaceName); > > desc.setComputedSize(textSize); >- FontCascade font = FontCascade(desc, 0, 0); >+ FontCascade font = FontCascade(WTFMove(desc), 0, 0); > font.update(0); > > String s; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index fbee6d508f5bc770d8daec169fbdf9a031691e87..a2fc778909a549611cdcf3b67db3d90ad9f65993 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-24 Chris Dumez <cdumez@apple.com> >+ >+ Reduce copying of FontCascadeDescription objects by moving them around >+ https://bugs.webkit.org/show_bug.cgi?id=185963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Reduce copying of FontCascadeDescription objects by moving them around when possible. >+ >+ * TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp: >+ (TestWebKitAPI::TEST_F): >+ > 2018-05-24 Carlos Garcia Campos <cgarcia@igalia.com> > > WebDriver: implement maximize, minimize and fullscreen window commands >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp b/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp >index 8af81584e19f198d597b4af1125a9431bb452914..7595fe20e53c0426bf3664a7309319b7931a2ba6 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp >@@ -49,7 +49,7 @@ TEST_F(ComplexTextControllerTest, InitialAdvanceWithLeftRunInRTL) > FontCascadeDescription description; > description.setOneFamily("Times"); > description.setComputedSize(80); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > auto spaceWidth = font.primaryFont().spaceWidth(); > >@@ -96,7 +96,7 @@ TEST_F(ComplexTextControllerTest, InitialAdvanceInRTL) > FontCascadeDescription description; > description.setOneFamily("Times"); > description.setComputedSize(80); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > > Vector<FloatSize> advances = { FloatSize(), FloatSize(21.640625, 0.0), FloatSize(42.3046875, 0.0), FloatSize(55.8984375, 0.0), FloatSize(22.34375, 0.0) }; >@@ -140,7 +140,7 @@ TEST_F(ComplexTextControllerTest, InitialAdvanceWithLeftRunInLTR) > FontCascadeDescription description; > description.setOneFamily("LucidaGrande"); > description.setComputedSize(80); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > auto spaceWidth = font.primaryFont().spaceWidth(); > >@@ -183,7 +183,7 @@ TEST_F(ComplexTextControllerTest, InitialAdvanceInLTR) > FontCascadeDescription description; > description.setOneFamily("LucidaGrande"); > description.setComputedSize(80); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > > Vector<FloatSize> advances = { FloatSize(76.347656, 0.000000), FloatSize(0.000000, 0.000000) }; >@@ -220,7 +220,7 @@ TEST_F(ComplexTextControllerTest, InitialAdvanceInRTLNoOrigins) > FontCascadeDescription description; > description.setOneFamily("Times"); > description.setComputedSize(48); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > > FloatSize initialAdvance = FloatSize(4.33996383363472, 12.368896925859); >@@ -266,7 +266,7 @@ TEST_F(ComplexTextControllerTest, LeadingExpansion) > FontCascadeDescription description; > description.setOneFamily("Times"); > description.setComputedSize(48); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > > UChar characters[] = { 'a' }; >@@ -296,7 +296,7 @@ TEST_F(ComplexTextControllerTest, VerticalAdvances) > FontCascadeDescription description; > description.setOneFamily("Times"); > description.setComputedSize(48); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > > UChar characters[] = { 'a', 'b', 'c', 'd' }; >@@ -340,7 +340,7 @@ TEST_F(ComplexTextControllerTest, TotalWidthWithJustification) > FontCascadeDescription description; > description.setOneFamily("Times"); > description.setComputedSize(80); >- FontCascade font(description); >+ FontCascade font(WTFMove(description)); > font.update(); > > Vector<FloatSize> advances = { FloatSize(1, 0), FloatSize(2, 0), FloatSize(4, 0), FloatSize(8, 0), FloatSize(16, 0) };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185963
: 341230