Skip to content
Permalink
Browse files
Fix computation of min|max-content contribution of non-replaced blocks
https://bugs.webkit.org/show_bug.cgi?id=152004

Reviewed by Darin Adler.

Source/WebCore:

WebKit currently always returns the min preferred logical
width for the min-content contribution (and the max preferred
logical width for the max-content contribution) for
non-replaced blocks. That is not correct according to specs
https://drafts.csswg.org/css-sizing/#block-intrinsic.

The min-content and max-content contributions actually depend
on the computed inline size of the block:
* for min-content,max-content or definite sizes: min-content
and max-content contributions are the inline size plus border,
margin and padding.
* otherwise: min-content contribution is the min-content size
and max-content contribution is the max-content size (in both
cases plus border, padding and margin).

Tests: fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1.html
       fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2.html
       fast/css-intrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
       fast/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):

LayoutTests:

* fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1-expected.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2-expected.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/resources/intrinsic-size-contribution.css: Added.
(.container):
(.item):
(.border):
(.padding):
(.margin):

Canonical link: https://commits.webkit.org/170447@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
svillar committed Dec 16, 2015
1 parent 8ae5550 commit e05d87cc0f75d3a4f03a764fa55d4aa1536ade9a
Showing with 1,139 additions and 2 deletions.
  1. +42 −0 LayoutTests/ChangeLog
  2. +35 −0 ...css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  3. +34 −0 ...sts/fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
  4. +34 −0 ...css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  5. +34 −0 ...sts/fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks.html
  6. +35 −0 ...nsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  7. +35 −0 ...css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
  8. +35 −0 ...nsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  9. +35 −0 ...css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks.html
  10. +35 −0 ...trinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  11. +35 −0 ...st/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
  12. +34 −0 ...trinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  13. +34 −0 ...st/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
  14. +38 −0 ...ts/fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1-expected.html
  15. +38 −0 LayoutTests/fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1.html
  16. +52 −0 ...ts/fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2-expected.html
  17. +52 −0 LayoutTests/fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2.html
  18. +38 −0 ...dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  19. +38 −0 ...ntrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
  20. +38 −0 ...dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  21. +38 −0 ...ntrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
  22. +34 −0 ...trinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  23. +34 −0 ...st/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
  24. +34 −0 ...trinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  25. +34 −0 ...st/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
  26. +34 −0 ...trinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  27. +34 −0 ...st/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
  28. +34 −0 ...trinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html
  29. +34 −0 ...st/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
  30. +17 −0 LayoutTests/fast/css-intrinsic-dimensions/resources/intrinsic-size-contribution.css
  31. +40 −0 Source/WebCore/ChangeLog
  32. +21 −2 Source/WebCore/rendering/RenderBlock.cpp
@@ -1,3 +1,45 @@
2015-12-08 Sergio Villar Senin <svillar@igalia.com>

Fix computation of min|max-content contribution of non-replaced blocks
https://bugs.webkit.org/show_bug.cgi?id=152004

Reviewed by Darin Adler.

* fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1-expected.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2-expected.html: Added.
* fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks-expected.html: Added.
* fast/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html: Added.
* fast/css-intrinsic-dimensions/resources/intrinsic-size-contribution.css: Added.
(.container):
(.item):
(.border):
(.padding):
(.margin):

2015-12-16 Youenn Fablet <youenn.fablet@crf.canon.fr>

Mac EWS bots frequently fail several wpt tests
@@ -0,0 +1,35 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container" style="width: 90px;">
<div class="item">XXX XXXXX</div>
</div>

<div class="container" style="width: 100px;">
<div class="item border">XXX XXXXX</div>
</div>

<div class="container" style="width: 110px;">
<div class="item padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 130px;">
<div class="item margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 120px;">
<div class="item border padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 140px;">
<div class="item border margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 160px;">
<div class="item border padding margin">XXX XXXXX</div>
</div>

@@ -0,0 +1,34 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container max-content">
<div class="item">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item border">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item padding">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item margin">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item border padding">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item border margin">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item border padding margin">XXX XXXXX</div>
</div>
@@ -0,0 +1,34 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container" style="width: 50px;">
<div class="item">XXX XXXXX</div>
</div>

<div class="container" style="width: 60px;">
<div class="item border">XXX XXXXX</div>
</div>

<div class="container" style="width: 70px;">
<div class="item padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 90px;">
<div class="item margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 80px;">
<div class="item border padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 100px;">
<div class="item border margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 120px;">
<div class="item border padding margin">XXX XXXXX</div>
</div>
@@ -0,0 +1,34 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container min-content">
<div class="item">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item border">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item padding">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item margin">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item border padding">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item border margin">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item border padding margin">XXX XXXXX</div>
</div>
@@ -0,0 +1,35 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container" style="width: 90px;">
<div class="item">XXX XXXXX</div>
</div>

<div class="container" style="width: 100px;">
<div class="item border">XXX XXXXX</div>
</div>

<div class="container" style="width: 110px;">
<div class="item padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 130px;">
<div class="item margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 120px;">
<div class="item border padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 140px;">
<div class="item border margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 160px;">
<div class="item border padding margin">XXX XXXXX</div>
</div>

@@ -0,0 +1,35 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container max-content">
<div class="item fill-available">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item fill-available border">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item fill-available padding">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item fill-available margin">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item fill-available border padding">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item fill-available border margin">XXX XXXXX</div>
</div>

<div class="container max-content">
<div class="item fill-available border padding margin">XXX XXXXX</div>
</div>

@@ -0,0 +1,35 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container" style="width: 50px;">
<div class="item">XXX XXXXX</div>
</div>

<div class="container" style="width: 60px;">
<div class="item border">XXX XXXXX</div>
</div>

<div class="container" style="width: 70px;">
<div class="item padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 90px;">
<div class="item margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 80px;">
<div class="item border padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 100px;">
<div class="item border margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 120px;">
<div class="item border padding margin">XXX XXXXX</div>
</div>

@@ -0,0 +1,35 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container min-content">
<div class="item fill-available">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item fill-available border">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item fill-available padding">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item fill-available margin">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item fill-available border padding">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item fill-available border margin">XXX XXXXX</div>
</div>

<div class="container min-content">
<div class="item fill-available border padding margin">XXX XXXXX</div>
</div>

@@ -0,0 +1,35 @@
<!DOCTYPE html>

<style>
@import "resources/width-keyword-classes.css";
@import "resources/intrinsic-size-contribution.css";
</style>

<div class="container" style="width: 90px;">
<div class="item">XXX XXXXX</div>
</div>

<div class="container" style="width: 100px;">
<div class="item border">XXX XXXXX</div>
</div>

<div class="container" style="width: 110px;">
<div class="item padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 130px;">
<div class="item margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 120px;">
<div class="item border padding">XXX XXXXX</div>
</div>

<div class="container" style="width: 140px;">
<div class="item border margin">XXX XXXXX</div>
</div>

<div class="container" style="width: 160px;">
<div class="item border padding margin">XXX XXXXX</div>
</div>

0 comments on commit e05d87c

Please sign in to comment.