Bug 147953

Summary: Percentage padding of absolutely positioned element being calculated based on parent's content width instead of containing block.
Product: WebKit Reporter: Keith Grant <keithjgrant>
Component: CSSAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: ahmad.saleem792, ap, rniwa, simon.fraser, zalan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Keith Grant 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).
Comment 1 Ahmad Saleem 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!