getComputedStyle does not handle over-constrained properties correctly

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

getComputedStyle does not handle over-constrained properties correctly

김덕진
Hello,

I'm working on blink engine as deokjin81.kim at samsung.com.
<https://lists.webkit.org/mailman/listinfo/webkit-dev>
And I have a question about implementation plan for getComputedStyle.
As I know, getComputedStyle does not handle over-constrained properties
correctly.
So I implemented
it(https://bugs.chromium.org/p/chromium/issues/detail?id=601118)
according to
spec(https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#relative-positioning)
on blink engine.

Below paragraphs(from spec) describe detail operation to 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 the '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.

The 'top' and 'bottom' properties move relatively positioned element(s) up
or down without changing their size. 'Top' moves the boxes down, and
'bottom' moves them up. Since boxes are not split or stretched as a result
of 'top' or 'bottom', the used values are always: top = -bottom. If both
are 'auto', their used values are both '0'. If one of them is 'auto', it
becomes the negative of the other. If neither is 'auto', 'bottom' is
ignored (i.e., the used value of 'bottom' will be minus the value of 'top').

I would like to know Gecko have any plan for this.

Thank you in advance,
Deokjin Kim
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getComputedStyle does not handle over-constrained properties correctly

Boris Zbarsky
On 5/27/16 9:12 AM, 김덕진 wrote:
> I would like to know Gecko have any plan for this.

So to be clear we're talking about top/right/bottom/left for
relatively-positioned elements only, in cases when they're
overconstrained?  And in particular, we're talking about ignoring the
value of "bottom" and of either "left" or "right" depending on the
containing block direction?

I'm not aware of us having any plans regarding this, nor indeed of any
bug reports on it...

What is the current behavior of other UAs for this stuff?

-Boris
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getComputedStyle does not handle over-constrained properties correctly

김덕진
2016-05-27 23:47 GMT+09:00 Boris Zbarsky <[hidden email]>:

> On 5/27/16 9:12 AM, 김덕진 wrote:
>
>> I would like to know Gecko have any plan for this.
>>
>
> So to be clear we're talking about top/right/bottom/left for
> relatively-positioned elements only, in cases when they're
> overconstrained?  And in particular, we're talking about ignoring the value
> of "bottom" and of either "left" or "right" depending on the containing
> block direction?
>
Yes, test case(http://jsfiddle.net/xu5b7rLq/6/)'s bottom and right should
be negative according to spec.

I'm not aware of us having any plans regarding this, nor indeed of any bug
> reports on it...
>
I found similar bug on mozilla's bugzilla. But I'm not sure that both are
the exact same issue.
In fact, below issue is related to margin-left/margin-right.
https://bugzilla.mozilla.org/show_bug.cgi?id=381328

What is the current behavior of other UAs for this stuff?
>
When I checked, MS Edge also didn't implement this yet.

Do you think that spec should be changed?

Thank you,
Deokjin Kim
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getComputedStyle does not handle over-constrained properties correctly

Boris Zbarsky
In reply to this post by Boris Zbarsky
On 5/27/16 11:51 AM, Deokjin Kim wrote:
> I found similar bug on mozilla's bugzilla. But I'm not sure that both are
> the exact same issue.
> In fact, below issue is related to margin-left/margin-right.
> https://bugzilla.mozilla.org/show_bug.cgi?id=381328

Yes, I'm aware of this bug report.  It's not the same issue.

> When I checked, MS Edge also didn't implement this yet.
>
> Do you think that spec should be changed?

I think it requires serious thought, given that all UAs agree with each
other but not with the spec.  For one thing, that raises questions about
how web-compatible the spec is.

-Boris

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getComputedStyle does not handle over-constrained properties correctly

김덕진
Hello,

I asked this issue and W3C WG said that it means "used value". (
https://github.com/w3c/csswg-drafts/issues/190)

When I checked spec for getComputedStyle(), some properties('bottom',
'left', 'right', 'top')'s resolved value is the used value if the property
applies to a positioned element. (
https://drafts.csswg.org/cssom/#resolved-values)

Therefore, I think my implementation(
https://bugs.chromium.org/p/chromium/issues/detail?id=601118) is correct.
In this test case(http://jsfiddle.net/xu5b7rLq/6/), bottom and right should
be negative.

What do you think about this issue?

Thank you,
Deokjin Kim


2016-05-28 0:57 GMT+09:00 Boris Zbarsky <[hidden email]>:

> On 5/27/16 11:51 AM, Deokjin Kim wrote:
>
>> I found similar bug on mozilla's bugzilla. But I'm not sure that both are
>> the exact same issue.
>> In fact, below issue is related to margin-left/margin-right.
>> https://bugzilla.mozilla.org/show_bug.cgi?id=381328
>>
>
> Yes, I'm aware of this bug report.  It's not the same issue.
>
> When I checked, MS Edge also didn't implement this yet.
>>
>> Do you think that spec should be changed?
>>
>
> I think it requires serious thought, given that all UAs agree with each
> other but not with the spec.  For one thing, that raises questions about
> how web-compatible the spec is.
>
>
> -Boris
>
> _______________________________________________
> dev-tech-layout mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-layout
>
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getComputedStyle does not handle over-constrained properties correctly

Boris Zbarsky
In reply to this post by Boris Zbarsky
On 6/16/16 3:41 PM, Deokjin Kim wrote:
> I asked this issue and W3C WG said that it means "used value". (
> https://github.com/w3c/csswg-drafts/issues/190)

It's clear what the spec _says_.  What's not clear is whether the spec
is _right_ to say it.

> What do you think about this issue?

I think you asked the wrong question in your issue.  I just pointed out
there what the right question is.

-Boris

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getComputedStyle does not handle over-constrained properties correctly

Boris Zbarsky
On 6/16/16 10:51 AM, Boris Zbarsky wrote:
> On 6/16/16 3:41 PM, Deokjin Kim wrote:
>> I asked this issue and W3C WG said that it means "used value". (
>> https://github.com/w3c/csswg-drafts/issues/190)
>
> It's clear what the spec _says_.  What's not clear is whether the spec
> is _right_ to say it.

And the spec has been changed to reflect actual browser behavior.

-Boris


_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Loading...