WebKit Bugzilla
Attachment 372777 Details for
Bug 199167
: [StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related functions.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199167-20190624113655.patch (text/plain), 6.79 KB, created by
zalan
on 2019-06-24 11:36:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-24 11:36:56 PDT
Size:
6.79 KB
patch
obsolete
>Subversion Revision: 246680 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 83a6a9542c40cb72aba998323989cdc3285d7e04..156243d238101275a90c9dd8d19c41ac0a4fbc7c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-06-24 Zalan Bujtas <zalan@apple.com> >+ >+ [StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related functions. >+ https://bugs.webkit.org/show_bug.cgi?id=199167 >+ <rdar://problem/52062669> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ It is expected to have a valid RenderStyle object here (and existing code relies on it). >+ >+ * css/StyleResolver.cpp: >+ (WebCore::checkForOrientationChange): >+ (WebCore::StyleResolver::updateFont): >+ (WebCore::StyleResolver::checkForTextSizeAdjust): >+ (WebCore::StyleResolver::checkForZoomChange): >+ (WebCore::StyleResolver::checkForGenericFamilyChange): >+ * css/StyleResolver.h: >+ > 2019-06-21 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Adjust baseline top when the baseline moves. >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index 6441004698be35cfc8d7ea61c1407a8b00f790c6..0248790eeb0a8823eaaa6a926046bbc488b01569 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -1174,20 +1174,20 @@ void StyleResolver::adjustRenderStyleForSiteSpecificQuirks(RenderStyle& style, c > } > } > >-static void checkForOrientationChange(RenderStyle* style) >+static void checkForOrientationChange(RenderStyle& style) > { > FontOrientation fontOrientation; > NonCJKGlyphOrientation glyphOrientation; >- std::tie(fontOrientation, glyphOrientation) = style->fontAndGlyphOrientation(); >+ std::tie(fontOrientation, glyphOrientation) = style.fontAndGlyphOrientation(); > >- const auto& fontDescription = style->fontDescription(); >+ const auto& fontDescription = style.fontDescription(); > if (fontDescription.orientation() == fontOrientation && fontDescription.nonCJKGlyphOrientation() == glyphOrientation) > return; > > auto newFontDescription = fontDescription; > newFontDescription.setNonCJKGlyphOrientation(glyphOrientation); > newFontDescription.setOrientation(fontOrientation); >- style->setFontDescription(WTFMove(newFontDescription)); >+ style.setFontDescription(WTFMove(newFontDescription)); > } > > void StyleResolver::updateFont() >@@ -1195,16 +1195,16 @@ void StyleResolver::updateFont() > if (!m_state.fontDirty()) > return; > >- RenderStyle* style = m_state.style(); >+ auto& style = *m_state.style(); > #if ENABLE(TEXT_AUTOSIZING) > checkForTextSizeAdjust(style); > #endif > checkForGenericFamilyChange(style, m_state.parentStyle()); > checkForZoomChange(style, m_state.parentStyle()); > checkForOrientationChange(style); >- style->fontCascade().update(&document().fontSelector()); >+ style.fontCascade().update(&document().fontSelector()); > if (m_state.fontSizeHasViewportUnits()) >- style->setHasViewportUnits(true); >+ style.setHasViewportUnits(true); > m_state.setFontDirty(false); > } > >@@ -1848,38 +1848,37 @@ RefPtr<StyleImage> StyleResolver::styleImage(CSSValue& value) > } > > #if ENABLE(TEXT_AUTOSIZING) >-void StyleResolver::checkForTextSizeAdjust(RenderStyle* style) >+void StyleResolver::checkForTextSizeAdjust(RenderStyle& style) > { >- ASSERT(style); >- if (style->textSizeAdjust().isAuto() || (settings().textAutosizingUsesIdempotentMode() && !style->textSizeAdjust().isNone())) >+ if (style.textSizeAdjust().isAuto() || (settings().textAutosizingUsesIdempotentMode() && !style.textSizeAdjust().isNone())) > return; > >- auto newFontDescription = style->fontDescription(); >- if (!style->textSizeAdjust().isNone()) >- newFontDescription.setComputedSize(newFontDescription.specifiedSize() * style->textSizeAdjust().multiplier()); >+ auto newFontDescription = style.fontDescription(); >+ if (!style.textSizeAdjust().isNone()) >+ newFontDescription.setComputedSize(newFontDescription.specifiedSize() * style.textSizeAdjust().multiplier()); > else > newFontDescription.setComputedSize(newFontDescription.specifiedSize()); >- style->setFontDescription(WTFMove(newFontDescription)); >+ style.setFontDescription(WTFMove(newFontDescription)); > } > #endif > >-void StyleResolver::checkForZoomChange(RenderStyle* style, const RenderStyle* parentStyle) >+void StyleResolver::checkForZoomChange(RenderStyle& style, const RenderStyle* parentStyle) > { > if (!parentStyle) > return; > >- if (style->effectiveZoom() == parentStyle->effectiveZoom() && style->textZoom() == parentStyle->textZoom()) >+ if (style.effectiveZoom() == parentStyle->effectiveZoom() && style.textZoom() == parentStyle->textZoom()) > return; > >- const auto& childFont = style->fontDescription(); >+ const auto& childFont = style.fontDescription(); > auto newFontDescription = childFont; > setFontSize(newFontDescription, childFont.specifiedSize()); >- style->setFontDescription(WTFMove(newFontDescription)); >+ style.setFontDescription(WTFMove(newFontDescription)); > } > >-void StyleResolver::checkForGenericFamilyChange(RenderStyle* style, const RenderStyle* parentStyle) >+void StyleResolver::checkForGenericFamilyChange(RenderStyle& style, const RenderStyle* parentStyle) > { >- const auto& childFont = style->fontDescription(); >+ const auto& childFont = style.fontDescription(); > > if (childFont.isAbsoluteSize() || !parentStyle) > return; >@@ -1905,7 +1904,7 @@ void StyleResolver::checkForGenericFamilyChange(RenderStyle* style, const Render > > auto newFontDescription = childFont; > setFontSize(newFontDescription, size); >- style->setFontDescription(WTFMove(newFontDescription)); >+ style.setFontDescription(WTFMove(newFontDescription)); > } > > void StyleResolver::initializeFontStyle() >diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h >index 01bb8fbb3dc1230c0f39184e19a1fea64410a295..8c88da8d5c7fa42ed9d812a08f14ea0d40a11cec 100644 >--- a/Source/WebCore/css/StyleResolver.h >+++ b/Source/WebCore/css/StyleResolver.h >@@ -312,10 +312,10 @@ public: > > private: > // This function fixes up the default font size if it detects that the current generic font family has changed. -dwh >- void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyle); >- void checkForZoomChange(RenderStyle*, const RenderStyle* parentStyle); >+ void checkForGenericFamilyChange(RenderStyle&, const RenderStyle* parentStyle); >+ void checkForZoomChange(RenderStyle&, const RenderStyle* parentStyle); > #if ENABLE(TEXT_AUTOSIZING) >- void checkForTextSizeAdjust(RenderStyle*); >+ void checkForTextSizeAdjust(RenderStyle&); > #endif > > void adjustRenderStyle(RenderStyle&, const RenderStyle& parentStyle, const RenderStyle* parentBoxStyle, const Element*);
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 199167
: 372777