New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 604968 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

transform is ignored when offsetParent calculation

Project Member Reported by samli@chromium.org, Apr 20 2016

Issue description

Test case: http://jsbin.com/dihuhugati/1/edit?html,css,js,output

Expected: #parent is the offsetParent
Actual: body is the offsetParent
Firefox: #parent is the offsetParent

Note the actual positioning of the element is correct. Clearly the child (green) is offset from the parent (red) not the body.

Unaware if this is a regression issue, reproduced in 50 and 52.
 

Comment 1 by samli@chromium.org, Apr 20 2016

https://www.w3.org/TR/css-transforms-1/#transform-rendering

Near the end of the section:

"For elements whose layout is governed by the CSS box model, any value other than none for the transform results in the creation of both a stacking context and a containing block. The object acts as a containing block for fixed positioned descendants."

Comment 3 by samli@chromium.org, Apr 21 2016

Sorry, fixed test case: http://jsbin.com/qibediduho/edit?html,css,js,output

Comment 4 by nainar@chromium.org, Apr 21 2016

Status: WontFix (was: Unconfirmed)
So this looks like we are compliant with the spec here and that instead the other browser(FF) isnt.

Step 2 of the algorithm says to "Return the nearest ancestor element of the element for which at least one of the following is true and terminate this algorithm if such an ancestor is found:

The computed value of the position property is not static.
It is the HTML body element.
The computed value of the position property of the element is static and the ancestor is one of the following HTML elements: td, th, or table."

The modified jsbin here: http://jsbin.com/cikejureno/edit?html,css,js,output shows that the parent of the child div here has position static. Which is why it goes up to the body element and terminates there. Seems like this issue should be on FF in this case.

Marking as WontFix - Sam please let me know if I am wrong here. I will also raise an issue on Firefox for this if you agree with my assessment.

Comment 5 by samli@chromium.org, Apr 25 2016

I think you're right in saying this is consistent with the current spec. However, I think this is inconsistent.

eg. our values for offsetLeft return values which are not relative to what we return for offsetParent, which is bizarre.

Comment 6 by nainar@chromium.org, Apr 26 2016

Labels: -OS-Linux
Going to raise a separate issue for the stuff going on with offset(Top/Left/Width and Height)

Sign in to add a comment