Title: [246755] trunk/Source/WebCore
- Revision
- 246755
- Author
- [email protected]
- Date
- 2019-06-24 12:37:59 -0700 (Mon, 24 Jun 2019)
Log Message
[StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related functions.
https://bugs.webkit.org/show_bug.cgi?id=199167
<rdar://problem/52062669>
Reviewed by Antti Koivisto.
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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (246754 => 246755)
--- trunk/Source/WebCore/ChangeLog 2019-06-24 19:32:03 UTC (rev 246754)
+++ trunk/Source/WebCore/ChangeLog 2019-06-24 19:37:59 UTC (rev 246755)
@@ -1,3 +1,21 @@
+2019-06-24 Zalan Bujtas <[email protected]>
+
+ [StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related functions.
+ https://bugs.webkit.org/show_bug.cgi?id=199167
+ <rdar://problem/52062669>
+
+ Reviewed by Antti Koivisto.
+
+ 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-24 Antoine Quint <[email protected]>
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (246754 => 246755)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2019-06-24 19:32:03 UTC (rev 246754)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2019-06-24 19:37:59 UTC (rev 246755)
@@ -1174,13 +1174,13 @@
}
}
-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;
@@ -1187,7 +1187,7 @@
auto newFontDescription = fontDescription;
newFontDescription.setNonCJKGlyphOrientation(glyphOrientation);
newFontDescription.setOrientation(fontOrientation);
- style->setFontDescription(WTFMove(newFontDescription));
+ style.setFontDescription(WTFMove(newFontDescription));
}
void StyleResolver::updateFont()
@@ -1195,7 +1195,7 @@
if (!m_state.fontDirty())
return;
- RenderStyle* style = m_state.style();
+ auto& style = *m_state.style();
#if ENABLE(TEXT_AUTOSIZING)
checkForTextSizeAdjust(style);
#endif
@@ -1202,9 +1202,9 @@
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 @@
}
#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 @@
auto newFontDescription = childFont;
setFontSize(newFontDescription, size);
- style->setFontDescription(WTFMove(newFontDescription));
+ style.setFontDescription(WTFMove(newFontDescription));
}
void StyleResolver::initializeFontStyle()
Modified: trunk/Source/WebCore/css/StyleResolver.h (246754 => 246755)
--- trunk/Source/WebCore/css/StyleResolver.h 2019-06-24 19:32:03 UTC (rev 246754)
+++ trunk/Source/WebCore/css/StyleResolver.h 2019-06-24 19:37:59 UTC (rev 246755)
@@ -312,10 +312,10 @@
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*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes