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
147953
Percentage padding of absolutely positioned element being calculated based on parent's content width instead of containing block.
https://bugs.webkit.org/show_bug.cgi?id=147953
Summary
Percentage padding of absolutely positioned element being calculated based on...
Keith Grant
Reported
2015-08-12 14:09:47 PDT
Create a relatively-positioned container that has left/right padding. Inside that, create an absolutely-positioned element with left: 0 and right: 0, so its width equals the width of the container. Give the absolutely-positioned element a percentage based left and/or right padding, and that padding will be calculated based on the width of the container's content, rather than the width of the containing block. I've recreated the bug here:
http://codepen.io/keithjgrant/pen/LVvbYZ
The spec states the percentage is calculated with respect to the width of the containing block (
http://www.w3.org/TR/css3-box/#the-padding
). The containing block should be determined by the padding edge of the ancestor (
http://www.w3.org/TR/css3-box/#the-padding
).
Attachments
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-06-10 17:36:05 PDT
All browser match each other in the "codepen" test case. Tested using Safari 15.5 on macOS 12.4, Chrome Canary 104 and Firefox Nightly 103. Thanks! I think this got fixed along the lines and it can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!
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