Re: [csswg-drafts] [css-align] are there compatibility issues with replacing overconstraint rules from CSS2?

Testing:

# Horizontal, block

```
<!DOCTYPE html>
<div>
 <child>foo</child>
</div>
<style>
div {
width: 300px;
border: solid;
}
child {
display: block;
background: rgba(0,0,0,.2);
width: 100px;
margin: 0 50px;
}
</style>
<script>
var s = getComputedStyle(document.querySelector("child"));
console.log(s.marginLeft);
console.log(s.marginRight);
</script>
```
Result: both Chrome and Firefox return "50px" for both margins, compatible with Align. (They do *not* apply the fixup in an author-observable way.)

# Horizontal, abspos

```
<!DOCTYPE html>
<div>
 <child>foo</child>
</div>
<style>
div {
width: 300px;
height: 100px;
border: solid;
position: relative;
}
child {
position:absolute;
background: rgba(0,0,0,.2);
width: 100px;
margin: 0 50px;
left: 0;
right: 0;
}
</style>
<script>
var s = getComputedStyle(document.querySelector("child"));
console.log(s.marginLeft);
console.log(s.marginRight);
console.log(s.left);
console.log(s.right);
</script>
```
Result: Chrome returns "50px" for both margins and "0px" for both insets, compatible with Align. Firefox returns "100px" for 'right', exposing the used-value fixup in an observable way.

# Vertical, abspos

```
<!DOCTYPE html>
<div>
 <child>foo</child>
</div>
<style>
div {
width: 300px;
height: 100px;
border: solid;
position: relative;
}
child {
position:absolute;
background: rgba(0,0,0,.2);
width: 100px;
height: 50px;
margin: 10px;
top: 0;
bottom: 0;
}
</style>
<script>
var s = getComputedStyle(document.querySelector("child"));
console.log(s.marginTop);
console.log(s.marginBottom);
console.log(s.top);
console.log(s.bottom);
</script>
Result: Chrome returns "10px" for both margins and "0px" for both insets, compatible with Align. Firefox returns "30px" for 'bottom', exposing the used-value fixup in an observable way.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1428#issuecomment-311153997 using your GitHub account

Received on Monday, 26 June 2017 19:11:34 UTC