[webkit-changes] [WebKit/WebKit] 68c055: Callers of RenderStyle::setFontDescription() shoul...

Simon Fraser noreply at github.com
Fri Dec 6 15:52:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 68c05597505a5eb712c742bfed10d35be8db2654
      https://github.com/WebKit/WebKit/commit/68c05597505a5eb712c742bfed10d35be8db2654
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-12-06 (Fri, 06 Dec 2024)

  Changed paths:
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/query/MediaQueryEvaluator.cpp
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/rendering/RenderCombineText.cpp
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderListItem.cpp
    M Source/WebCore/rendering/RenderTheme.cpp
    M Source/WebCore/rendering/TextAutoSizing.cpp
    M Source/WebCore/rendering/mac/RenderThemeMac.mm
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp
    M Source/WebCore/style/StyleAdjuster.cpp
    M Source/WebCore/style/StyleAdjuster.h
    M Source/WebCore/style/StyleBuilderState.cpp
    M Source/WebCore/style/StyleBuilderStateInlines.h
    M Source/WebCore/style/StyleResolveForDocument.cpp
    M Source/WebCore/style/StyleResolver.cpp

  Log Message:
  -----------
  Callers of RenderStyle::setFontDescription() should not have to manually call fontCascade().update()
https://bugs.webkit.org/show_bug.cgi?id=284139
rdar://141019117

Reviewed by Alan Baradlay.

`RenderStyle::setFontDescription()` is written in a way that requires callers to
subsequently call `fontCascade().update()`, because `setFontDescription` computes a new
FontCascade that is lacking a FontCascadeFonts. A call to update() is needed to compute
the fonts, and in addition the callers has to get a FontSelector from somewhere to pass
in.

Fix by having `RenderStyle::setFontDescription()` call FontCascade::update() internally.

There is only one caller who cares about batching, which is Style::BuilderState. For it,
we expose `setFontDescriptionWithoutUpdate()` which has the old behavior.

We also need to ensure that `Style::resolveForDocument()` builds a FontCascade in a way
that provides the fontSelector.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
* Source/WebCore/css/query/MediaQueryEvaluator.cpp:
(WebCore::MQ::MediaQueryEvaluator::evaluate const):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::recomputeTextAutoSizingInAllFrames):
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::operator<<):
* Source/WebCore/rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::logStyleDifference):
* Source/WebCore/rendering/RenderListItem.cpp:
(WebCore::RenderListItem::computeMarkerStyle const):
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustButtonOrCheckboxOrColorWellOrInnerSpinButtonOrRadioStyle const):
* Source/WebCore/rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustTextNodeSizes):
(WebCore::TextAutoSizingValue::reset):
* Source/WebCore/rendering/mac/RenderThemeMac.mm:
(WebCore::setFontFromControlSize):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontDescription):
(WebCore::RenderStyle::setFontDescriptionWithoutUpdate):
(WebCore::RenderStyle::setLetterSpacing):
(WebCore::RenderStyle::setTextSpacingTrim):
(WebCore::RenderStyle::setTextAutospace):
(WebCore::RenderStyle::setFontSize):
(WebCore::RenderStyle::setFontSizeAdjust):
(WebCore::RenderStyle::setFontOpticalSizing):
(WebCore::RenderStyle::setFontVariationSettings):
(WebCore::RenderStyle::setFontWeight):
(WebCore::RenderStyle::setFontStretch):
(WebCore::RenderStyle::setFontItalic):
(WebCore::RenderStyle::setFontPalette):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::styleForFirstLetter):
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustForTextAutosizing):
* Source/WebCore/style/StyleAdjuster.h:
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::updateFontForTextSizeAdjust):
(WebCore::Style::BuilderState::updateFontForZoomChange):
(WebCore::Style::BuilderState::updateFontForGenericFamilyChange):
(WebCore::Style::BuilderState::updateFontForOrientationChange):
* Source/WebCore/style/StyleBuilderStateInlines.h:
(WebCore::Style::BuilderState::setFontDescription):
* Source/WebCore/style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::defaultStyleForElement):

Canonical link: https://commits.webkit.org/287465@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list