Commit 6efd34e3 authored by ojan@chromium.org's avatar ojan@chromium.org

min-width/max-width of min-content/max-content don't work correctly if width is specified

https://bugs.webkit.org/show_bug.cgi?id=106143

Reviewed by Tony Chang.

Source/WebCore:

Test: fast/css-intrinsic-dimensions/intrinsic-sized-blocks.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidths):
Expose this so that we don't use the preferred widths when calculating intrinsic width
values since the preferred width will be the regular width value if it is set.
Also, simplified the logic around table cells and scrollbar widths. The old code was
wrong and unnecessarily complicated.

(WebCore::RenderBlock::computePreferredLogicalWidths):
Use the new computeIntrinsicLogicalWidths method.

(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
Pass in the min/max values as out params so they can be called from computeIntrinsicLogicalWidths.
Also, make computeBlockPreferredLogicalWidths const.

* rendering/RenderBlock.h:

LayoutTests:

* css3/flexbox/box-sizing.html:
The old result was incorrectly using the preferred width as the min-content width of the flex items.
The new result is correctly resolving the min-content width to 0 and allowing the flex items to shrink.

* fast/css-intrinsic-dimensions/intrinsic-sized-blocks-expected.txt: Added.
* fast/css-intrinsic-dimensions/intrinsic-sized-blocks.html: Added.
* platform/chromium-win/fast/table/overflowHidden-expected.txt:
The new result correctly adds the scrollbar width to the table cell intrinsic width.
The pixel result doesn't need ot be updated because the elements that changed are below
the fold, so they don't show up in the png.

* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
Add tests that will need rebaselines.

* scrollbars/custom-scrollbar-table-cell-expected.png:
The new result correctly adds the scrollbar width to the table cell intrinsic width.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 06d04857
2013-03-19 Ojan Vafai <ojan@chromium.org>
min-width/max-width of min-content/max-content don't work correctly if width is specified
https://bugs.webkit.org/show_bug.cgi?id=106143
Reviewed by Tony Chang.
* css3/flexbox/box-sizing.html:
The old result was incorrectly using the preferred width as the min-content width of the flex items.
The new result is correctly resolving the min-content width to 0 and allowing the flex items to shrink.
* fast/css-intrinsic-dimensions/intrinsic-sized-blocks-expected.txt: Added.
* fast/css-intrinsic-dimensions/intrinsic-sized-blocks.html: Added.
* platform/chromium-win/fast/table/overflowHidden-expected.txt:
The new result correctly adds the scrollbar width to the table cell intrinsic width.
The pixel result doesn't need ot be updated because the elements that changed are below
the fold, so they don't show up in the png.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
Add tests that will need rebaselines.
* scrollbars/custom-scrollbar-table-cell-expected.png:
The new result correctly adds the scrollbar width to the table cell intrinsic width.
2013-03-29 Timothy Hatcher <timothy@apple.com>
Marking animation-delay-changed.html and reinserting-svg-into-document.html as flaky.
......@@ -48,7 +48,9 @@ All blue boxes are 100x100px with box-sizing: border-box and 2px border (4px bor
<h3>flex-flow: default, orange box has width: auto, flex-box has box-sizing: border-box</h3>
<div class="flexbox border-box">
<div></div><div></div><div></div>
<div data-expected-width=30></div>
<div data-expected-width=30></div>
<div data-expected-width=30></div>
</div>
<h3>flex-flow: column, red box has height: 300px</h3>
......
Tests that intrinsic width values on blocks work.
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
<!DOCTYPE html>
<style>
.container {
border: 5px solid blue;
width: 250px;
height: 250px;
}
.child {
border: 5px solid pink;
}
.content {
display: inline-block;
width: 100px;
height: 100px;
background-color: salmon;
}
</style>
Tests that intrinsic width values on blocks work.
<!-- width tests -->
<div class="container">
<div class="child" style="width: -webkit-max-content;" data-expected-width="210">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="width: -webkit-min-content;" data-expected-width="110">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="width: -webkit-fit-content;" data-expected-width="210">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container" style="width: 50px">
<div class="child" style="width: -webkit-fit-content;" data-expected-width="110">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="width: -webkit-fill-available;" data-expected-width="250">
<div class="content"></div><div class="content"></div>
</div>
</div>
<!-- min-width tests -->
<div class="container">
<div class="child" style="min-width: -webkit-max-content; width: 10px;" data-expected-width="210">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="min-width: -webkit-min-content; width: 10px;" data-expected-width="110">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="min-width: -webkit-fit-content; width: 10px;" data-expected-width="210">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container" style="width: 50px">
<div class="child" style="min-width: -webkit-fit-content; width: 10px;" data-expected-width="110">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="min-width: -webkit-fill-available; width: 10px;" data-expected-width="250">
<div class="content"></div><div class="content"></div>
</div>
</div>
<!-- max-width tests -->
<div class="container">
<div class="child" style="max-width: -webkit-max-content; width: 1000px;" data-expected-width="210">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="max-width: -webkit-min-content; width: 1000px;" data-expected-width="110">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="max-width: -webkit-fit-content; width: 1000px;" data-expected-width="210">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container" style="width: 50px">
<div class="child" style="max-width: -webkit-fit-content; width: 1000px;" data-expected-width="110">
<div class="content"></div><div class="content"></div>
</div>
</div>
<div class="container">
<div class="child" style="max-width: -webkit-fill-available; width: 1000px;" data-expected-width="250">
<div class="content"></div><div class="content"></div>
</div>
</div>
<script src="../../resources/check-layout.js"></script>
<script>
checkLayout(".container");
</script>
......@@ -118,10 +118,10 @@ layer at (0,0) size 785x2484
RenderBlock (anonymous) at (0,2170) size 769x40
RenderBR {BR} at (0,0) size 0x19
RenderBR {BR} at (0,20) size 0x19
RenderTable {TABLE} at (0,2210) size 418x112 [border: (2px outset #808080)]
RenderTableSection {TBODY} at (2,2) size 414x108
RenderTableRow {TR} at (0,2) size 414x104
RenderTableCell {TD} at (308,2) size 104x104 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
RenderTable {TABLE} at (0,2210) size 433x112 [border: (2px outset #808080)]
RenderTableSection {TBODY} at (2,2) size 429x108
RenderTableRow {TR} at (0,2) size 429x104
RenderTableCell {TD} at (323,2) size 104x104 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
RenderBlock {DIV} at (2,2) size 100x100 [bgcolor=#800080]
RenderBlock (anonymous) at (0,2322) size 769x40
RenderBR {BR} at (0,0) size 0x19
......@@ -183,8 +183,8 @@ layer at (12,2070) size 304x83 clip at (13,2071) size 302x66 scrollWidth 601
RenderBlock {DIV} at (0,0) size 600x20 [bgcolor=#008000]
RenderText {#text} at (0,0) size 141x19
text run at (0,0) width 141: "Test with overflow:auto"
layer at (12,2222) size 304x104 clip at (13,2223) size 287x87 scrollWidth 601
RenderTableCell {TD} at (2,44) size 304x19 [bgcolor=#808080] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
layer at (12,2222) size 319x104 clip at (13,2223) size 302x87 scrollWidth 601
RenderTableCell {TD} at (2,44) size 319x19 [bgcolor=#808080] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
RenderBlock {DIV} at (2,-18) size 300x20 [bgcolor=#00FF00]
RenderBlock {DIV} at (0,0) size 600x20 [bgcolor=#008000]
RenderText {#text} at (0,0) size 147x19
......
......@@ -3765,6 +3765,9 @@ webkit.org/b/112369 [ Debug ] inspector/debugger/pause-in-inline-script.html [ P
# Needs rebaseline on all platforms
Bug(leviw) fast/text/shaping/shaping-selection-rect.html [ Failure ]
Bug(ojan) [ Mac Win ] fast/table/overflowHidden.html [ ImageOnlyFailure Failure ]
Bug(ojan) [ Mac Win ] scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ]
# Flaky tests
webkit.org/b/112598 [ Win Mac Linux ] http/tests/security/mixedContent/insecure-audio-video-in-main-frame.html [ Failure Pass ]
webkit.org/b/112601 http/tests/security/cross-frame-access-port-explicit-domain.html [ Failure Pass ]
......
......@@ -1793,6 +1793,8 @@ webkit.org/b/111016 http/tests/loading/promote-img-preload-priority.html [ Failu
webkit.org/b/111058 plugins/plugin-clip-subframe.html [ Failure ]
Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ]
Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ]
# Newly added tests in r144190 are failing.
webkit.org/b/111172 compositing/overlap-blending/children-opacity-huge.html [ ImageOnlyFailure ]
......
......@@ -1368,6 +1368,9 @@ webkit.org/b/111606 fast/borders/border-fit.html [ Failure ]
webkit.org/b/111606 fast/borders/border-fit-2.html [ Failure ]
webkit.org/b/111606 fast/repaint/border-fit-lines.html [ Failure ]
Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ]
Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ]
webkit.org/b/112109 fast/box-shadow/box-shadow-with-zero-radius.html [ ImageOnlyFailure ]
webkit.org/b/112110 media/track/track-cue-container-rendering-position.html [ Failure ]
......
......@@ -1450,6 +1450,8 @@ webkit.org/b/111606 fast/borders/border-fit-2.html [ Failure Pass ]
webkit.org/b/111606 fast/borders/border-fit.html [ Failure Pass ]
webkit.org/b/111606 fast/repaint/border-fit-lines.html [ Failure Pass ]
Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ]
Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ]
# Flakey
webkit.org/b/112533 media/auto-play-in-sandbox-with-allow-scripts.html [ Pass Failure ]
......
......@@ -2702,6 +2702,8 @@ webkit.org/b/110654 css3/flexbox/button.html [ Failure ]
# Need support for ResourceHandle::didChangePriority and DRT support
webkit.org/b/111016 http/tests/loading/promote-img-preload-priority.html [ Failure ]
Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ]
Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ]
# Border-fit should happen at layout time rather than paint time
webkit.org/b/111606 fast/borders/border-fit-2.html [ Skip ]
......
......@@ -41,8 +41,7 @@ if (window.testRunner)
<body>
<!--
Bug 93903: Crash in RenderTableCell::borderTop() due to custom scrollbars after r124168
This test has PASSED if there are 2 grey custom scrollbars with a black thumb on each div below.
Note that currently the right scrollbar is missing due to https://bugs.webkit.org/show_bug.cgi?id=94054
This test has PASSED if there are 2 grey custom scrollbars and each block is 216x216px.
-->
<div class="scroll-cell"><div class="overflowing"></div></div>
<div class="scroll-row"><div class="scroll-cell"><div class="overflowing"></div></div></div>
......
2013-03-19 Ojan Vafai <ojan@chromium.org>
min-width/max-width of min-content/max-content don't work correctly if width is specified
https://bugs.webkit.org/show_bug.cgi?id=106143
Reviewed by Tony Chang.
Test: fast/css-intrinsic-dimensions/intrinsic-sized-blocks.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidths):
Expose this so that we don't use the preferred widths when calculating intrinsic width
values since the preferred width will be the regular width value if it is set.
Also, simplified the logic around table cells and scrollbar widths. The old code was
wrong and unnecessarily complicated.
(WebCore::RenderBlock::computePreferredLogicalWidths):
Use the new computeIntrinsicLogicalWidths method.
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
Pass in the min/max values as out params so they can be called from computeIntrinsicLogicalWidths.
Also, make computeBlockPreferredLogicalWidths const.
* rendering/RenderBlock.h:
2013-03-29 Joshua Bell <jsbell@chromium.org>
IndexedDB: Use WTF::TemporaryChange rather than manually resetting a flag
This diff is collapsed.
......@@ -522,7 +522,8 @@ protected:
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
virtual void computePreferredLogicalWidths();
virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;
virtual void computePreferredLogicalWidths() OVERRIDE;
virtual int firstLineBoxBaseline() const;
virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
......@@ -899,8 +900,9 @@ private:
virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset);
void computeInlinePreferredLogicalWidths();
void computeBlockPreferredLogicalWidths();
// FIXME: Make this method const so we can remove the const_cast in computeIntrinsicLogicalWidths.
void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth);
void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const;
// Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
// children.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment