Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved value (getComputedStyle) of "top" isn't computed correctly #8220

Open
eefriedman opened this issue Oct 27, 2015 · 3 comments
Open

Resolved value (getComputedStyle) of "top" isn't computed correctly #8220

eefriedman opened this issue Oct 27, 2015 · 3 comments

Comments

@eefriedman
Copy link
Contributor

@eefriedman eefriedman commented Oct 27, 2015

<div style="position: absolute; padding: 30px;">
<div style="opacity: 0.5; background-color: green; padding: 10px">
<div id=cool style="position: absolute; top: 0;"></div>
</div>
</div>
<script>
alert(getComputedStyle(document.getElementById("cool")).top);
</script>

The obvious value for top is 0px; Servo comes up with -30px because it's computing the position relative to the stacking context, not the absolute containing block.

@dzbarsky
Copy link
Member

@dzbarsky dzbarsky commented Oct 27, 2015

getComputedStyle is pretty complex and isn't specced in much detail =/

@jdm jdm added the A-layout/query label Oct 27, 2015
@nox
Copy link
Member

@nox nox commented Sep 30, 2017

This is still true.

@dralley
Copy link
Contributor

@dralley dralley commented Mar 25, 2020

Not sure what the correct answer is supposed to be, but I get -38px currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.