Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 10cdfef718dbe350058930473d7fcfe4beaba92e
      
https://github.com/WebKit/WebKit/commit/10cdfef718dbe350058930473d7fcfe4beaba92e
  Author: Sammy Gill <[email protected]>
  Date:   2025-10-28 (Tue, 28 Oct 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-computed-style-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-computed-style.html
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/wpe/TestExpectations
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp
    M Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp
    M Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderBoxModelObjectInlines.h
    M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm
    M Source/WebCore/rendering/ios/RenderThemeIOS.mm
    M Source/WebCore/rendering/mac/RenderThemeMac.mm
    M Source/WebCore/style/values/box/StylePadding.h

  Log Message:
  -----------
  [CSS Zoom] Pass in zoom when evaluating padding during use time.
https://bugs.webkit.org/show_bug.cgi?id=301537
rdar://problem/163518723

Reviewed by Tim Nguyen and Lily Spiniolas.

This patch moves the PaddingEdge type to become Unzoomed. As part of
this process, any type we evaluate a PaddingEdge in the code we need to
supply a zoom factor. Most of this patch is passing in the used zoom
factor any time this happens.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-computed-style-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-computed-style.html:
* Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp:
(WebCore::Layout::FormattingGeometry::computedPadding const):
* Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp:
(WebCore::Layout::BlockFormattingGeometry::intrinsicWidthConstraints const):
* Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
* Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp:
(WebCore::LayoutIntegration::usedValueOrZero):
(WebCore::LayoutIntegration::BoxGeometryUpdater::logicalPadding):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::borderMarginOrPaddingWidth):
(WebCore::getBorderPaddingMargin):
* Source/WebCore/rendering/RenderBoxModelObjectInlines.h:
(WebCore::RenderBoxModelObject::computedCSSPaddingAfter const):
(WebCore::RenderBoxModelObject::computedCSSPaddingBefore const):
(WebCore::RenderBoxModelObject::computedCSSPaddingBottom const):
(WebCore::RenderBoxModelObject::computedCSSPaddingEnd const):
(WebCore::RenderBoxModelObject::computedCSSPaddingLeft const):
(WebCore::RenderBoxModelObject::computedCSSPaddingRight const):
(WebCore::RenderBoxModelObject::computedCSSPaddingStart const):
(WebCore::RenderBoxModelObject::computedCSSPaddingTop const):
* Source/WebCore/rendering/adwaita/RenderThemeAdwaita.cpp:
(WebCore::RenderThemeAdwaita::popupInternalPaddingBox const):
* Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm:
Much of the form control code computes the padding based off of the em
size, which is an already zoomed value since font size is zoomed.

One option would be to force the code which computes the em size to use the
"unzoomedComputedSize," on FontDescription by using the appropriate
conversion data. However, this is not ideal because we may get a
different value than what we previous got. For example, a font size of
11px with a used zoom of 3 would previously give us a value of 16px, after
some rounding when computing a 1em size. If we took the approach I just
described, this would give us a size of 5px, which would then get
evaluated to 15px.

In order to maintain behavior, I opted to take a different approach.
Instead, we continue to compute the padding sizes in the same way we
were previously, but instead divide out the used zoom right before we apply
it to the RenderStyle. This gives allows us to continue to get the same
values we were previously computing while also still using the correct
size during use time.

(WebCore::applyEmPadding):
(WebCore::applyCommonButtonPaddingToStyleForVectorBasedControls):
(WebCore::RenderThemeCocoa::adjustButtonStyleForVectorBasedControls const):
(WebCore::RenderThemeCocoa::paintMenuListButtonDecorationsForVectorBasedControls):
(WebCore::RenderThemeCocoa::adjustSearchFieldCancelButtonStyleForVectorBasedControls
 const):
(WebCore::RenderThemeCocoa::adjustedMaximumLogicalWidthForControl const):
* Source/WebCore/rendering/ios/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::popupInternalPaddingBox const):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
(WebCore::RenderThemeIOS::paintListButton):
* Source/WebCore/rendering/mac/RenderThemeMac.mm:
(WebCore::RenderThemeMac::popupInternalPaddingBox const):
* Source/WebCore/style/values/box/StylePadding.h:

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



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

Reply via email to