The calculation for finding the default top/left of an absolutely positioned element using the nearest positioned ancestor is affected by nearest prior sibling instead
Reported by
chase.ma...@gmail.com,
Aug 1 2016
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 Example URL: http://output.jsbin.com/vicopowaha/10 Steps to reproduce the problem: 1. Create a relatively positioned div with margin 2. Create an absolutely positioned div with auto top/left 3. Notice that the absolutely positioned div is affected by it's relatively positioned sibling. What is the expected behavior? Only ancestor nodes (not siblings) are expected to be used to calculate the actual value of top:auto; and left:auto for absolutely positioned elements. What went wrong? Chrome is identifying the sibling node as an ancestor node and including it's margin value in the calculation of the absolutely positioned top:auto and left:auto values. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? No 9.0.3 Chrome version: 51.0.2704.106 Channel: n/a OS Version: OS X 10.11.3 Flash Version: Shockwave Flash 22.0 r0 https://www.w3.org/TR/css-position-3/#abs-pos For box offset top (the value of auto): "For absolutely positioned elements whose containing block is based on a block-level element, this property is an offset from the padding edge of that element."
,
Aug 1 2016
,
Aug 2 2016
Able to repro this issue on Windows 7, MAC (10.11.5) & Ubuntu Trusty (14.04) for Google Chrome Stable Version - 52.0.2743.82 This is a Non-Regression issue existing from M30 - # 30.0.1549.0 [Screen-recording is attached]
,
Aug 2 2016
Looks like this is an layout bug, but could be related to my change for offsetParent. Let me take a look.
,
Aug 2 2016
Oops, my change is quite recent and this one seems non-regression, according to comment #3. Back to layout team.
,
Oct 28 2016
As far as I can tell, the implementation is correct. The absolute positioned box should get the "hypothetical static position", as specified here: https://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#abs-non-replaced-height |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by chase.ma...@gmail.com
, Aug 1 201675.5 KB
75.5 KB View Download