Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow calc() values in xywh/rect #43815

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 28, 2023

This patch fixes two checks that are hit when using calc() in xywh/rect
values:

  1. We cannot check for non-negative calc expressions at parse time in
    the general case (see: GetDoubleValue() in css_primitive_value.h),
    so this patch makes the DCHECK only apply to numeric literals.
  2. Similar to CalculationValue::SubtractFromOneHundredPercent, we
    cannot guarantee ranges in CalculationValue::Add. This is used when
    computing the inset value of xywh/rect (see:
    https://drafts.csswg.org/css-shapes/#basic-shape-computed-values),
    where the w and h values are non-negative, but the x and y values
    can be anything.

Bug: 1513647
Change-Id: I8ddf85711d1c3d6a698b6ff174770864e3b776bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5155165
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1241921}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

This patch fixes two checks that are hit when using calc() in xywh/rect
values:
1. We cannot check for non-negative calc expressions at parse time in
   the general case (see: `GetDoubleValue()` in css_primitive_value.h),
   so this patch makes the DCHECK only apply to numeric literals.
2. Similar to CalculationValue::SubtractFromOneHundredPercent, we
   cannot guarantee ranges in CalculationValue::Add. This is used when
   computing the inset value of xywh/rect (see:
   https://drafts.csswg.org/css-shapes/#basic-shape-computed-values),
   where the w and h values are non-negative, but the x and y values
   can be anything.

Bug: 1513647
Change-Id: I8ddf85711d1c3d6a698b6ff174770864e3b776bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5155165
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1241921}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 89eaf4b into master Jan 2, 2024
21 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-5155165 branch January 2, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants