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

Issue 601118 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

getComputedStyle does not handle over-constrained properties correctly

Project Member Reported by kh...@codeaurora.org, Apr 6 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

Example URL:
http://jsfiddle.net/xu5b7rLq/6/

Steps to reproduce the problem:
1. Open URL
2. Observe values of bottom and right

What is the expected behavior?
Bottom and right should be negative

What went wrong?
getComputedStyle is returning computed values for over-constrained top/left/bottom/right, when it should return used values.  The resolution of over-constrained properties is described by 
https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#relative-positioning
 and 
https://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#abs-non-replaced-width

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 Windows / Firefox 45.0.1, IE 11.0.9600.18230

Chrome version: 46.0.2490.86  Channel: n/a
OS Version: 
Flash Version: Shockwave Flash 21.0 r0

Related to https://bugs.chromium.org/p/chromium/issues/detail?id=589347, and discovered during the review process.
 

Comment 1 by kojii@chromium.org, Apr 7 2016

Components: -Blink Blink>CSS
Labels: -OS-Linux OS-All
Status: Available (was: Unconfirmed)
I'd like to work on this.
Project Member

Comment 4 by bugdroid1@chromium.org, May 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c8291dea8bfa84ab9a3220fb9f57eb059e913a05

commit c8291dea8bfa84ab9a3220fb9f57eb059e913a05
Author: deokjin81.kim <deokjin81.kim@samsung.com>
Date: Thu May 19 15:52:06 2016

getComputedStyle should handle over-constrained properties.

If neither 'left' nor 'right' is 'auto', the position is over-constrained,
and one of them has to be ignored. If 'direction' property of the
containing block is 'ltr', the value of 'left' wins and 'right'
becomes -'left'. If 'direction' of the containing block is 'rtl',
'right' wins and 'left' is ignored. Detail is described by
https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#relative-positioning

BUG= 601118 

Review-Url: https://codereview.chromium.org/1988813002
Cr-Commit-Position: refs/heads/master@{#394780}

[modify] https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05/third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom-expected.txt
[modify] https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05/third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom.html
[add] https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-expected.txt
[add] https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained.html
[add] https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto-expected.txt
[add] https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto.html
[modify] https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Status: Fixed (was: Available)
Fixed by r394780.

Comment 6 by bzbar...@mit.edu, May 27 2016

Did we just go from a situation where all browsers were interoperable (albeit not matching the spec draft, which is not finalized and might well have bugs) to Blink changing its behavior to match the spec draft?  I didn't see an intent to ship for this web-facing behavior change...
Project Member

Comment 7 by bugdroid1@chromium.org, May 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9835ebf3b20d95106a5541e44b297963e0136802

commit 9835ebf3b20d95106a5541e44b297963e0136802
Author: deokjin81.kim <deokjin81.kim@samsung.com>
Date: Fri May 27 15:22:20 2016

Revert of getComputedStyle should handle over-constrained properties. (patchset #7 id:100001 of https://codereview.chromium.org/1988813002/ )

Reason for revert:
Other vendors didn't implement this yet. And work with the others to either get all to fix or to change the spec.

BUG=614198

Original issue's description:
> getComputedStyle should handle over-constrained properties.
>
> If neither 'left' nor 'right' is 'auto', the position is over-constrained,
> and one of them has to be ignored. If 'direction' property of the
> containing block is 'ltr', the value of 'left' wins and 'right'
> becomes -'left'. If 'direction' of the containing block is 'rtl',
> 'right' wins and 'left' is ignored. Detail is described by
> https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#relative-positioning
>
> BUG= 601118 
>
> Committed: https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05
> Cr-Commit-Position: refs/heads/master@{#394780}

TBR=mstensho@opera.com,alancutter@chromium.org,rune@opera.com,eae@chromium.org,timloh@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 601118 

Review-Url: https://codereview.chromium.org/2016913003
Cr-Commit-Position: refs/heads/master@{#396470}

[modify] https://crrev.com/9835ebf3b20d95106a5541e44b297963e0136802/third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom-expected.txt
[modify] https://crrev.com/9835ebf3b20d95106a5541e44b297963e0136802/third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom.html
[delete] https://crrev.com/399b6116d8244fe758d5252c17b10a3ed66acf6c/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-expected.txt
[delete] https://crrev.com/399b6116d8244fe758d5252c17b10a3ed66acf6c/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained.html
[delete] https://crrev.com/399b6116d8244fe758d5252c17b10a3ed66acf6c/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto-expected.txt
[delete] https://crrev.com/399b6116d8244fe758d5252c17b10a3ed66acf6c/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto.html
[modify] https://crrev.com/9835ebf3b20d95106a5541e44b297963e0136802/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Project Member

Comment 8 by bugdroid1@chromium.org, May 28 2016

Labels: merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/608b46dc19395374c484a85ea3411460a67964c7

commit 608b46dc19395374c484a85ea3411460a67964c7
Author: Rune Lillesveen <rune@opera.com>
Date: Sat May 28 18:51:25 2016

Revert of getComputedStyle should handle over-constrained properties. (patchset #7 id:100001 of https://codereview.chromium.org/1988813002/ )

Reason for revert:
Other vendors didn't implement this yet. And work with the others to either get all to fix or to change the spec.

BUG=614198

Original issue's description:
> getComputedStyle should handle over-constrained properties.
>
> If neither 'left' nor 'right' is 'auto', the position is over-constrained,
> and one of them has to be ignored. If 'direction' property of the
> containing block is 'ltr', the value of 'left' wins and 'right'
> becomes -'left'. If 'direction' of the containing block is 'rtl',
> 'right' wins and 'left' is ignored. Detail is described by
> https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#relative-positioning
>
> BUG= 601118 
>
> Committed: https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05
> Cr-Commit-Position: refs/heads/master@{#394780}

TBR=mstensho@opera.com,alancutter@chromium.org,rune@opera.com,eae@chromium.org,timloh@chromium.org
BUG= 601118 

Review-Url: https://codereview.chromium.org/2016913003
Cr-Commit-Position: refs/heads/master@{#396470}
(cherry picked from commit 9835ebf3b20d95106a5541e44b297963e0136802)

Review URL: https://codereview.chromium.org/2025523002 .

Cr-Commit-Position: refs/branch-heads/2743@{#116}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/608b46dc19395374c484a85ea3411460a67964c7/third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom-expected.txt
[modify] https://crrev.com/608b46dc19395374c484a85ea3411460a67964c7/third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom.html
[delete] https://crrev.com/aa008be0d11d62626e0c474b3b3d32deccac4a82/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-expected.txt
[delete] https://crrev.com/aa008be0d11d62626e0c474b3b3d32deccac4a82/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained.html
[delete] https://crrev.com/aa008be0d11d62626e0c474b3b3d32deccac4a82/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto-expected.txt
[delete] https://crrev.com/aa008be0d11d62626e0c474b3b3d32deccac4a82/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto.html
[modify] https://crrev.com/608b46dc19395374c484a85ea3411460a67964c7/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Cc: kavvaru@chromium.org
Labels: Needs-Feedback
Tested the issue on windows 7, Linux Ubuntu 14.04 and Mac 10.11.5 using chrome version 52.0.2743.19.Seeing 5px for all left,right,top and bottom values.Please find the attached screen shot for the same.

could any one from  dev team please confirm on the fix.

Thanks,
601118.png
116 KB View Download

Comment 10 by bzbar...@mit.edu, Jun 21 2016

The spec has been changed to reflect the consensus browser behavior.

Sign in to add a comment