[webkit-changes] [WebKit/WebKit] 3070b3: Add PropertyWrapperFontWeight to bound the values ...

Chirag Shah noreply at github.com
Fri Oct 28 17:27:34 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3070b3d704a3a9364da1442c873419a7b6757343
      https://github.com/WebKit/WebKit/commit/3070b3d704a3a9364da1442c873419a7b6757343
  Author: Chirag M Shah <chirag_m_shah at apple.com>
  Date:   2022-10-28 (Fri, 28 Oct 2022)

  Changed paths:
    A LayoutTests/fonts/font-weight-invalid-crash-expected.txt
    A LayoutTests/fonts/font-weight-invalid-crash.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt
    M LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt
    M LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt
    M LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt
    M Source/WebCore/animation/CSSPropertyAnimation.cpp

  Log Message:
  -----------
  Add PropertyWrapperFontWeight to bound the values for weight
https://bugs.webkit.org/show_bug.cgi?id=247140
rdar://problem/100986499

Reviewed by Myles C. Maxfield.

Currently, fontWeight wasn't bounded based on the CSS specs, which led
to scenarios where FontSelectionRequest had a 0 fontWeight, and which
resulted in an empty FontSelectionRequest, which is an invalid key
based for the HashMap segmentedFontFaceCache. This resulted in map
corruption, which led to a crash. The change fixes the issue by
correctly defining PropertyWrapperFontWeight, which doesn't allow the
blend() to set invalid weight values.

Test: fonts/font-weight-invalid-crash.html

* LayoutTests/fonts/font-weight-invalid-crash-expected.txt: Added.
* LayoutTests/fonts/font-weight-invalid-crash.html: Added.
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt:
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-fonts/animations/system-fonts-expected.txt:

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




More information about the webkit-changes mailing list