WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
201637
WebKit incorrectly ignores percentages during calc() serialization
https://bugs.webkit.org/show_bug.cgi?id=201637
Summary
WebKit incorrectly ignores percentages during calc() serialization
Emilio Cobos Álvarez (:emilio)
Reported
2019-09-10 03:42:23 PDT
Chrome also has this bug, see
https://bugs.chromium.org/p/chromium/issues/detail?id=1002430
1. Open data:text/html,<div style="background-position: calc(0% + 0px) calc(0% + 0px)"></div> 2. Run on the terminal: getComputedStyle(document.querySelector("div")).backgroundPosition Expected: calc(0% + 0px) calc(0% + 0px) Actual: 0px 0px Per
https://drafts.csswg.org/css-values-4/#calc-computed-value
:
> Where percentages are not resolved at computed-value time, they are not resolved in math functions, e.g. calc(100% - 100% + 1px) resolves to calc(0% + 1px), not to 1px. If there are special rules for computing percentages in a value (e.g. the height property), they apply whenever a math function contains percentages.
See also
https://github.com/w3c/csswg-drafts/issues/3482
, and
https://bugzilla.mozilla.org/show_bug.cgi?id=1574913
which is where this came up.
Attachments
Add attachment
proposed patch, testcase, etc.
Brent Fulgham
Comment 1
2022-07-01 13:45:28 PDT
Safari, Chrome, and Firefox all agree on the output: "0% 0%" I believe this now works properly. Please REOPEN if I am misunderstanding the issue.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug