Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e3276268feac295db37cc2f3c842bb81a87bdff5
      
https://github.com/WebKit/WebKit/commit/e3276268feac295db37cc2f3c842bb81a87bdff5
  Author: Sam Weinig <[email protected]>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/viewport-units-extreme-scale-expected.txt
    M Source/WebCore/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations
    M Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations
    M Source/WebCore/css/CSSToLengthConversionData.cpp
    M Source/WebCore/css/CSSToLengthConversionData.h
    M Source/WebCore/css/calc/CSSCalcTree+Simplification.cpp
    M Source/WebCore/css/calc/CSSCalcValue.cpp
    M Source/WebCore/css/parser/SizesAttributeParser.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
    M Source/WebCore/style/StyleResolveForFont.cpp
    M Source/WebCore/style/calc/StyleCalculationTree+Conversion.cpp
    M Source/WebCore/style/values/primitives/StyleLengthResolution.cpp
    M Source/WebCore/style/values/primitives/StyleLengthResolution.h
    M 
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Conversions.cpp
    M Source/WebCore/svg/SVGLengthContext.cpp

  Log Message:
  -----------
  [Cleanup] Factor length unit conversion into standalone functions
https://bugs.webkit.org/show_bug.cgi?id=320566

Reviewed by Darin Adler.

Does a little cleanup in StyleLengthResolution.h/cpp

- Factors relative unit conversions into standalone functions
  with links to their spec definitions.
- Renames Style::computeNonCalcLengthDouble to Style::resolveLength
- Removes unnecessary alias Style::computeCanonicalNonCalcLengthDouble,
  callers can call Style::resolveLength now.
- Updates comment for Style::resolveLength to account for required
  FontCascade argument and more accurately describe the viewport-percentage
  unit results.
- Makes all arguments to Style::resolveLength required.
- Removes viewport factor getters from  CSSToLengthConversionData as these
  were only used by Style::resolveLength.
- Exposes setUsesViewportUnits along side setUsesContainerUnits for use by
  Style::resolveLength now that the viewport factor getters are not used.
- Uses a consistent style of "return value * ..." for each unit, removing
  all uses of break from the switch statements. The fact that some units
  returned early and some didn't was a source of confusion.

The newly passing test cases are due to the viewport-percentage unit 
calculations
now staying in `double` precision the entire time. Previously, some of the math 
was
done on `float` values.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/viewport-units-extreme-scale-expected.txt:
* Source/WebCore/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations:
* Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations:
* Source/WebCore/css/CSSToLengthConversionData.cpp:
* Source/WebCore/css/CSSToLengthConversionData.h:
* Source/WebCore/css/calc/CSSCalcTree+Simplification.cpp:
* Source/WebCore/css/calc/CSSCalcValue.cpp:
* Source/WebCore/css/parser/SizesAttributeParser.cpp:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
* Source/WebCore/style/StyleResolveForFont.cpp:
* Source/WebCore/style/calc/StyleCalculationTree+Conversion.cpp:
* Source/WebCore/style/values/primitives/StyleLengthResolution.cpp:
* Source/WebCore/style/values/primitives/StyleLengthResolution.h:
* 
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Conversions.cpp:
* Source/WebCore/svg/SVGLengthContext.cpp:

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



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

Reply via email to