Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f63720f2dec605554eeae62488bc05f4d4b9f9f1
      
https://github.com/WebKit/WebKit/commit/f63720f2dec605554eeae62488bc05f4d4b9f9f1
  Author: Antti Koivisto <[email protected]>
  Date:   2026-10-13 (Tue, 13 Oct 2026)

  Changed paths:
    M Source/WebCore/css/CSSProperties.json
    M 
Source/WebCore/layout/formattingContexts/inline/SVGTextDisplayContentBuilder.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp
    M Source/WebCore/page/InteractionRegion.cpp
    M Source/WebCore/page/SpatialNavigation.cpp
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    M Source/WebCore/rendering/BorderEdge.cpp
    M Source/WebCore/rendering/BorderShape.cpp
    M Source/WebCore/rendering/NinePieceImagePainter.cpp
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBoxModelObject.cpp
    M Source/WebCore/rendering/RenderBoxModelObject.h
    M Source/WebCore/rendering/RenderBoxModelObjectInlines.h
    M Source/WebCore/rendering/RenderTableRow.cpp
    M Source/WebCore/rendering/RenderTheme.cpp
    M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm
    M Source/WebCore/rendering/ios/RenderThemeIOS.mm
    M Source/WebCore/rendering/style/UsedStyle.h
    M Source/WebCore/style/StyleChangedAnimatableProperties.cpp
    M Source/WebCore/style/StyleDifference.cpp
    M Source/WebCore/style/StyleExtractorCustom.h
    M Source/WebCore/style/computed/StyleComputedStyle+GettersInlines.h
    M Source/WebCore/style/computed/StyleComputedStyle.cpp
    M Source/WebCore/style/computed/StyleComputedStyle.h
    M Source/WebKitLegacy/mac/DOM/DOM.mm

  Log Message:
  -----------
  [UsedStyle] Handle border widths
https://bugs.webkit.org/show_bug.cgi?id=327372
rdar://189885806

Reviewed by Alan Baradlay.

Move the used border widths from ComputedStyle to UsedStyle, which returns them 
zoomed and snapped
to device pixels. Zoom-dependent values belong in UsedStyle since the device 
scale factor should come
from the rendering context rather than the style. The zero width for 
border-style none or hidden is
also a used-value effect (css-backgrounds-3, csswg-drafts#11494).

Formatting-context adjustments, like collapsed table borders and fieldset 
legends, stay in
RenderBoxModelObject::borderTop() and friends. Code without a renderer, like 
style comparisons and
painting helpers and themes that take a style, uses 
Style::effectiveBorderWidths().

* Source/WebCore/css/CSSProperties.json:

Mark the border width longhands as custom used-style properties.

* 
Source/WebCore/layout/formattingContexts/inline/SVGTextDisplayContentBuilder.cpp:
(WebCore::Layout::hasInlineDirectionMarginBorderOrPadding):
* Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp:
(WebCore::LayoutIntegration::BoxGeometryUpdater::logicalBorder):
* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::hasTransparentContainerStyle):
* Source/WebCore/page/SpatialNavigation.cpp:
(WebCore::nodeRectInAbsoluteCoordinates):
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::hasVisuallyDistinctStyling):
* Source/WebCore/rendering/BorderEdge.cpp:
(WebCore::borderEdges):
* Source/WebCore/rendering/BorderShape.cpp:
(WebCore::BorderShape::shapeForBorderRect):
* Source/WebCore/rendering/NinePieceImagePainter.cpp:
(WebCore::paintNinePieceImage):
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::contentBoxLogicalWidthChanged):
(WebCore::RenderBlock::paddingBoxLogicalHeightChanged):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::absoluteInteractionBounds):
* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::borderWidths const):
(WebCore::RenderBoxModelObject::borderTop const):
(WebCore::RenderBoxModelObject::borderBottom const):
(WebCore::RenderBoxModelObject::borderLeft const):
(WebCore::RenderBoxModelObject::borderRight const):
(WebCore::RenderBoxModelObject::borderBefore const):
(WebCore::RenderBoxModelObject::borderAfter const):
(WebCore::RenderBoxModelObject::borderStart const):
(WebCore::RenderBoxModelObject::borderEnd const):

Out-of-line, like the padding getters, to keep UsedStyle.h out of 
RenderBoxModelObjectInlines.h.

* Source/WebCore/rendering/RenderBoxModelObject.h:
* Source/WebCore/rendering/RenderBoxModelObjectInlines.h:
(WebCore::RenderBoxModelObject::borderAfter const): Deleted.
(WebCore::RenderBoxModelObject::borderBefore const): Deleted.
(WebCore::RenderBoxModelObject::borderBottom const): Deleted.
(WebCore::RenderBoxModelObject::borderEnd const): Deleted.
(WebCore::RenderBoxModelObject::borderLeft const): Deleted.
(WebCore::RenderBoxModelObject::borderRight const): Deleted.
(WebCore::RenderBoxModelObject::borderStart const): Deleted.
(WebCore::RenderBoxModelObject::borderTop const): Deleted.
(WebCore::RenderBoxModelObject::borderWidths const): Deleted.
* Source/WebCore/rendering/RenderTableRow.cpp:
(WebCore::borderWidthChanged):
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::extractControlStyleForRenderer const):
(WebCore::RenderTheme::adjustButtonOrCheckboxOrColorWellOrInnerSpinButtonOrRadioStyle
 const):
* Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::paintMenuListButtonDecorationsForVectorBasedControls):
* Source/WebCore/rendering/ios/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::platformPopupInternalPaddingBox const):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
* Source/WebCore/rendering/style/UsedStyle.h:
(WebCore::UsedStyle::borderWidths const):

Border widths zoomed and snapped to device pixels, as LayoutUnit or float.

* Source/WebCore/style/StyleChangedAnimatableProperties.cpp:
(WebCore::Style::conservativelyCollectChangedAnimatableProperties):
* Source/WebCore/style/StyleDifference.cpp:
* Source/WebCore/style/StyleExtractorCustom.h:
(WebCore::Style::PropertyExtractorAdaptor<CSSPropertyBorderTopWidth>::computedValue
 const):
(WebCore::Style::PropertyExtractorAdaptor<CSSPropertyBorderRightWidth>::computedValue
 const):
(WebCore::Style::PropertyExtractorAdaptor<CSSPropertyBorderBottomWidth>::computedValue
 const):
(WebCore::Style::PropertyExtractorAdaptor<CSSPropertyBorderLeftWidth>::computedValue
 const):

The resolved value of border-width is the used value. The extractor style can 
be a pseudo-element style, so read it directly.

* Source/WebCore/style/computed/StyleComputedStyle+GettersInlines.h:
(WebCore::Style::effectiveBorderWidths):

Was ComputedStyle::usedBorderWidths(). Unzoomed style values, for code without 
a renderer.

(WebCore::Style::ComputedStyle::usedBorderWidths const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderBottomWidth const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderLeftWidth const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderRightWidth const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderTopWidth const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderWidthStart const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderWidthEnd const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderWidthBefore const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderWidthAfter const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderWidthLogicalLeft const): Deleted.
(WebCore::Style::ComputedStyle::usedBorderWidthLogicalRight const): Deleted.
* Source/WebCore/style/computed/StyleComputedStyle.cpp:
(WebCore::Style::ComputedStyle::imageOutsets const):
* Source/WebCore/style/computed/StyleComputedStyle.h:
* Source/WebKitLegacy/mac/DOM/DOM.mm:
(-[DOMNode innerFrameQuad]):

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



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

Reply via email to