Changeset 147245 in webkit
- Timestamp:
- Mar 29, 2013 1:12:16 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147243 r147245 1 2013-03-19 Ojan Vafai <ojan@chromium.org> 2 3 min-width/max-width of min-content/max-content don't work correctly if width is specified 4 https://bugs.webkit.org/show_bug.cgi?id=106143 5 6 Reviewed by Tony Chang. 7 8 * css3/flexbox/box-sizing.html: 9 The old result was incorrectly using the preferred width as the min-content width of the flex items. 10 The new result is correctly resolving the min-content width to 0 and allowing the flex items to shrink. 11 12 * fast/css-intrinsic-dimensions/intrinsic-sized-blocks-expected.txt: Added. 13 * fast/css-intrinsic-dimensions/intrinsic-sized-blocks.html: Added. 14 * platform/chromium-win/fast/table/overflowHidden-expected.txt: 15 The new result correctly adds the scrollbar width to the table cell intrinsic width. 16 The pixel result doesn't need ot be updated because the elements that changed are below 17 the fold, so they don't show up in the png. 18 19 * platform/chromium/TestExpectations: 20 * platform/efl/TestExpectations: 21 * platform/gtk/TestExpectations: 22 * platform/mac/TestExpectations: 23 * platform/qt/TestExpectations: 24 Add tests that will need rebaselines. 25 26 * scrollbars/custom-scrollbar-table-cell-expected.png: 27 The new result correctly adds the scrollbar width to the table cell intrinsic width. 28 29 1 30 2013-03-29 Timothy Hatcher <timothy@apple.com> 2 31 -
trunk/LayoutTests/css3/flexbox/box-sizing.html
r130979 r147245 49 49 <h3>flex-flow: default, orange box has width: auto, flex-box has box-sizing: border-box</h3> 50 50 <div class="flexbox border-box"> 51 <div></div><div></div><div></div> 51 <div data-expected-width=30></div> 52 <div data-expected-width=30></div> 53 <div data-expected-width=30></div> 52 54 </div> 53 55 -
trunk/LayoutTests/platform/chromium-win/fast/table/overflowHidden-expected.txt
r117821 r147245 119 119 RenderBR {BR} at (0,0) size 0x19 120 120 RenderBR {BR} at (0,20) size 0x19 121 RenderTable {TABLE} at (0,2210) size 4 18x112 [border: (2px outset #808080)]122 RenderTableSection {TBODY} at (2,2) size 4 14x108123 RenderTableRow {TR} at (0,2) size 4 14x104124 RenderTableCell {TD} at (3 08,2) size 104x104 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]121 RenderTable {TABLE} at (0,2210) size 433x112 [border: (2px outset #808080)] 122 RenderTableSection {TBODY} at (2,2) size 429x108 123 RenderTableRow {TR} at (0,2) size 429x104 124 RenderTableCell {TD} at (323,2) size 104x104 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1] 125 125 RenderBlock {DIV} at (2,2) size 100x100 [bgcolor=#800080] 126 126 RenderBlock (anonymous) at (0,2322) size 769x40 … … 184 184 RenderText {#text} at (0,0) size 141x19 185 185 text run at (0,0) width 141: "Test with overflow:auto" 186 layer at (12,2222) size 3 04x104 clip at (13,2223) size 287x87 scrollWidth 601187 RenderTableCell {TD} at (2,44) size 3 04x19 [bgcolor=#808080] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]186 layer at (12,2222) size 319x104 clip at (13,2223) size 302x87 scrollWidth 601 187 RenderTableCell {TD} at (2,44) size 319x19 [bgcolor=#808080] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1] 188 188 RenderBlock {DIV} at (2,-18) size 300x20 [bgcolor=#00FF00] 189 189 RenderBlock {DIV} at (0,0) size 600x20 [bgcolor=#008000] -
trunk/LayoutTests/platform/chromium/TestExpectations
r147195 r147245 3766 3766 Bug(leviw) fast/text/shaping/shaping-selection-rect.html [ Failure ] 3767 3767 3768 Bug(ojan) [ Mac Win ] fast/table/overflowHidden.html [ ImageOnlyFailure Failure ] 3769 Bug(ojan) [ Mac Win ] scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ] 3770 3768 3771 # Flaky tests 3769 3772 webkit.org/b/112598 [ Win Mac Linux ] http/tests/security/mixedContent/insecure-audio-video-in-main-frame.html [ Failure Pass ] -
trunk/LayoutTests/platform/efl/TestExpectations
r147116 r147245 1794 1794 webkit.org/b/111058 plugins/plugin-clip-subframe.html [ Failure ] 1795 1795 1796 Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ] 1797 Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ] 1796 1798 1797 1799 # Newly added tests in r144190 are failing. -
trunk/LayoutTests/platform/gtk/TestExpectations
r147201 r147245 1369 1369 webkit.org/b/111606 fast/repaint/border-fit-lines.html [ Failure ] 1370 1370 1371 Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ] 1372 Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ] 1373 1371 1374 webkit.org/b/112109 fast/box-shadow/box-shadow-with-zero-radius.html [ ImageOnlyFailure ] 1372 1375 -
trunk/LayoutTests/platform/mac/TestExpectations
r147243 r147245 1451 1451 webkit.org/b/111606 fast/repaint/border-fit-lines.html [ Failure Pass ] 1452 1452 1453 Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ] 1454 Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ] 1453 1455 1454 1456 # Flakey -
trunk/LayoutTests/platform/qt/TestExpectations
r147203 r147245 2703 2703 webkit.org/b/111016 http/tests/loading/promote-img-preload-priority.html [ Failure ] 2704 2704 2705 Bug(ojan) fast/table/overflowHidden.html [ ImageOnlyFailure Failure ] 2706 Bug(ojan) scrollbars/custom-scrollbar-table-cell.html [ ImageOnlyFailure Failure ] 2705 2707 2706 2708 # Border-fit should happen at layout time rather than paint time -
trunk/LayoutTests/scrollbars/custom-scrollbar-table-cell.html
r126591 r147245 42 42 <!-- 43 43 Bug 93903: Crash in RenderTableCell::borderTop() due to custom scrollbars after r124168 44 This test has PASSED if there are 2 grey custom scrollbars with a black thumb on each div below. 45 Note that currently the right scrollbar is missing due to https://bugs.webkit.org/show_bug.cgi?id=94054 44 This test has PASSED if there are 2 grey custom scrollbars and each block is 216x216px. 46 45 --> 47 46 <div class="scroll-cell"><div class="overflowing"></div></div> -
trunk/Source/WebCore/ChangeLog
r147244 r147245 1 2013-03-19 Ojan Vafai <ojan@chromium.org> 2 3 min-width/max-width of min-content/max-content don't work correctly if width is specified 4 https://bugs.webkit.org/show_bug.cgi?id=106143 5 6 Reviewed by Tony Chang. 7 8 Test: fast/css-intrinsic-dimensions/intrinsic-sized-blocks.html 9 10 * rendering/RenderBlock.cpp: 11 (WebCore::RenderBlock::computeIntrinsicLogicalWidths): 12 Expose this so that we don't use the preferred widths when calculating intrinsic width 13 values since the preferred width will be the regular width value if it is set. 14 Also, simplified the logic around table cells and scrollbar widths. The old code was 15 wrong and unnecessarily complicated. 16 17 (WebCore::RenderBlock::computePreferredLogicalWidths): 18 Use the new computeIntrinsicLogicalWidths method. 19 20 (WebCore::RenderBlock::computeInlinePreferredLogicalWidths): 21 (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): 22 Pass in the min/max values as out params so they can be called from computeIntrinsicLogicalWidths. 23 Also, make computeBlockPreferredLogicalWidths const. 24 25 * rendering/RenderBlock.h: 26 1 27 2013-03-29 Joshua Bell <jsbell@chromium.org> 2 28 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r146726 r147245 5751 5751 } 5752 5752 5753 void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 5754 { 5755 if (childrenInline()) { 5756 // FIXME: Remove this const_cast. 5757 const_cast<RenderBlock*>(this)->computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); 5758 } else 5759 computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); 5760 5761 maxLogicalWidth = max(minLogicalWidth, maxLogicalWidth); 5762 5763 if (!style()->autoWrap() && childrenInline()) { 5764 minLogicalWidth = maxLogicalWidth; 5765 // A horizontal marquee with inline children has no minimum width. 5766 if (layer() && layer()->marquee() && layer()->marquee()->isHorizontal()) 5767 minLogicalWidth = 0; 5768 } 5769 5770 if (isTableCell()) { 5771 Length tableCellWidth = toRenderTableCell(this)->styleOrColLogicalWidth(); 5772 if (tableCellWidth.isFixed() && tableCellWidth.value() > 0) 5773 maxLogicalWidth = max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth.value())); 5774 } 5775 5776 int scrollbarWidth = instrinsicScrollbarLogicalWidth(); 5777 maxLogicalWidth += scrollbarWidth; 5778 minLogicalWidth += scrollbarWidth; 5779 } 5780 5753 5781 void RenderBlock::computePreferredLogicalWidths() 5754 5782 { … … 5756 5784 5757 5785 updateFirstLetter(); 5786 5787 m_minPreferredLogicalWidth = 0; 5788 m_maxPreferredLogicalWidth = 0; 5758 5789 5759 5790 RenderStyle* styleToUse = style(); … … 5761 5792 && !(isDeprecatedFlexItem() && !styleToUse->logicalWidth().intValue())) 5762 5793 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalWidth().value()); 5763 else { 5764 m_minPreferredLogicalWidth = 0; 5765 m_maxPreferredLogicalWidth = 0; 5766 5767 if (childrenInline()) 5768 computeInlinePreferredLogicalWidths(); 5769 else 5770 computeBlockPreferredLogicalWidths(); 5771 5772 m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 5773 5774 if (!styleToUse->autoWrap() && childrenInline()) { 5775 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth; 5776 5777 // A horizontal marquee with inline children has no minimum width. 5778 if (layer() && layer()->marquee() && layer()->marquee()->isHorizontal()) 5779 m_minPreferredLogicalWidth = 0; 5780 } 5781 5782 int scrollbarWidth = instrinsicScrollbarLogicalWidth(); 5783 m_maxPreferredLogicalWidth += scrollbarWidth; 5784 5785 if (isTableCell()) { 5786 Length w = toRenderTableCell(this)->styleOrColLogicalWidth(); 5787 if (w.isFixed() && w.value() > 0) { 5788 m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(w.value())); 5789 scrollbarWidth = 0; 5790 } 5791 } 5792 5793 m_minPreferredLogicalWidth += scrollbarWidth; 5794 } 5794 else 5795 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 5795 5796 5796 5797 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) { … … 5940 5941 5941 5942 5942 void RenderBlock::computeInlinePreferredLogicalWidths( )5943 void RenderBlock::computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) 5943 5944 { 5944 5945 float inlineMax = 0; … … 6062 6063 bool canBreakReplacedElement = !child->isImage() || allowImagesToBreak; 6063 6064 if ((canBreakReplacedElement && (autoWrap || oldAutoWrap) && (!isPrevChildInlineFlow || shouldBreakLineAfterText)) || clearPreviousFloat) { 6064 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6065 updatePreferredWidth(minLogicalWidth, inlineMin); 6065 6066 inlineMin = 0; 6066 6067 } … … 6068 6069 // If we're supposed to clear the previous float, then terminate maxwidth as well. 6069 6070 if (clearPreviousFloat) { 6070 updatePreferredWidth(m _maxPreferredLogicalWidth, inlineMax);6071 updatePreferredWidth(maxLogicalWidth, inlineMax); 6071 6072 inlineMax = 0; 6072 6073 } … … 6090 6091 if (!autoWrap || !canBreakReplacedElement || (isPrevChildInlineFlow && !shouldBreakLineAfterText)) { 6091 6092 if (child->isFloating()) 6092 updatePreferredWidth(m _minPreferredLogicalWidth, childMin);6093 updatePreferredWidth(minLogicalWidth, childMin); 6093 6094 else 6094 6095 inlineMin += childMin; 6095 6096 } else { 6096 6097 // Now check our line. 6097 updatePreferredWidth(m _minPreferredLogicalWidth, childMin);6098 updatePreferredWidth(minLogicalWidth, childMin); 6098 6099 6099 6100 // Now start a new line. … … 6102 6103 6103 6104 if (autoWrap && canBreakReplacedElement && isPrevChildInlineFlow) { 6104 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6105 updatePreferredWidth(minLogicalWidth, inlineMin); 6105 6106 inlineMin = 0; 6106 6107 } … … 6117 6118 6118 6119 if (t->isWordBreak()) { 6119 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6120 updatePreferredWidth(minLogicalWidth, inlineMin); 6120 6121 inlineMin = 0; 6121 6122 continue; … … 6141 6142 if (!hasBreak && childMax == 0) { 6142 6143 if (autoWrap && (beginWS || endWS)) { 6143 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6144 updatePreferredWidth(minLogicalWidth, inlineMin); 6144 6145 inlineMin = 0; 6145 6146 } … … 6184 6185 if (beginWS) 6185 6186 // Go ahead and end the current line. 6186 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6187 updatePreferredWidth(minLogicalWidth, inlineMin); 6187 6188 else { 6188 6189 inlineMin += beginMin; 6189 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6190 updatePreferredWidth(minLogicalWidth, inlineMin); 6190 6191 childMin -= ti; 6191 6192 } … … 6196 6197 // We end in whitespace, which means we can go ahead 6197 6198 // and end our current line. 6198 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6199 updatePreferredWidth(minLogicalWidth, inlineMin); 6199 6200 inlineMin = 0; 6200 6201 shouldBreakLineAfterText = false; 6201 6202 } else { 6202 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6203 updatePreferredWidth(minLogicalWidth, inlineMin); 6203 6204 inlineMin = endMin; 6204 6205 shouldBreakLineAfterText = true; … … 6208 6209 if (hasBreak) { 6209 6210 inlineMax += beginMax; 6210 updatePreferredWidth(m _maxPreferredLogicalWidth, inlineMax);6211 updatePreferredWidth(m _maxPreferredLogicalWidth, childMax);6211 updatePreferredWidth(maxLogicalWidth, inlineMax); 6212 updatePreferredWidth(maxLogicalWidth, childMax); 6212 6213 inlineMax = endMax; 6213 6214 addedTextIndent = true; … … 6220 6221 stripFrontSpaces = true; 6221 6222 } else { 6222 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6223 updatePreferredWidth(m _maxPreferredLogicalWidth, inlineMax);6223 updatePreferredWidth(minLogicalWidth, inlineMin); 6224 updatePreferredWidth(maxLogicalWidth, inlineMax); 6224 6225 inlineMin = inlineMax = 0; 6225 6226 stripFrontSpaces = true; … … 6239 6240 stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild); 6240 6241 6241 updatePreferredWidth(m _minPreferredLogicalWidth, inlineMin);6242 updatePreferredWidth(m _maxPreferredLogicalWidth, inlineMax);6243 } 6244 6245 void RenderBlock::computeBlockPreferredLogicalWidths( )6242 updatePreferredWidth(minLogicalWidth, inlineMin); 6243 updatePreferredWidth(maxLogicalWidth, inlineMax); 6244 } 6245 6246 void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 6246 6247 { 6247 6248 RenderStyle* styleToUse = style(); … … 6262 6263 LayoutUnit floatTotalWidth = floatLeftWidth + floatRightWidth; 6263 6264 if (childStyle->clear() & CLEFT) { 6264 m _maxPreferredLogicalWidth = max(floatTotalWidth, m_maxPreferredLogicalWidth);6265 maxLogicalWidth = max(floatTotalWidth, maxLogicalWidth); 6265 6266 floatLeftWidth = 0; 6266 6267 } 6267 6268 if (childStyle->clear() & CRIGHT) { 6268 m _maxPreferredLogicalWidth = max(floatTotalWidth, m_maxPreferredLogicalWidth);6269 maxLogicalWidth = max(floatTotalWidth, maxLogicalWidth); 6269 6270 floatRightWidth = 0; 6270 6271 } … … 6297 6298 6298 6299 LayoutUnit w = childMinPreferredLogicalWidth + margin; 6299 m _minPreferredLogicalWidth = max(w, m_minPreferredLogicalWidth);6300 minLogicalWidth = max(w, minLogicalWidth); 6300 6301 6301 6302 // IE ignores tables for calculation of nowrap. Makes some sense. 6302 6303 if (nowrap && !child->isTable()) 6303 m _maxPreferredLogicalWidth = max(w, m_maxPreferredLogicalWidth);6304 maxLogicalWidth = max(w, maxLogicalWidth); 6304 6305 6305 6306 w = childMaxPreferredLogicalWidth + margin; … … 6319 6320 } 6320 6321 else 6321 m _maxPreferredLogicalWidth = max(floatLeftWidth + floatRightWidth, m_maxPreferredLogicalWidth);6322 maxLogicalWidth = max(floatLeftWidth + floatRightWidth, maxLogicalWidth); 6322 6323 floatLeftWidth = floatRightWidth = 0; 6323 6324 } … … 6329 6330 floatRightWidth += w; 6330 6331 } else 6331 m _maxPreferredLogicalWidth = max(w, m_maxPreferredLogicalWidth);6332 maxLogicalWidth = max(w, maxLogicalWidth); 6332 6333 6333 6334 child = child->nextSibling(); … … 6335 6336 6336 6337 // Always make sure these values are non-negative. 6337 m _minPreferredLogicalWidth = max<LayoutUnit>(0, m_minPreferredLogicalWidth);6338 m _maxPreferredLogicalWidth = max<LayoutUnit>(0, m_maxPreferredLogicalWidth);6339 6340 m _maxPreferredLogicalWidth = max(floatLeftWidth + floatRightWidth, m_maxPreferredLogicalWidth);6338 minLogicalWidth = max<LayoutUnit>(0, minLogicalWidth); 6339 maxLogicalWidth = max<LayoutUnit>(0, maxLogicalWidth); 6340 6341 maxLogicalWidth = max(floatLeftWidth + floatRightWidth, maxLogicalWidth); 6341 6342 } 6342 6343 -
trunk/Source/WebCore/rendering/RenderBlock.h
r147019 r147245 523 523 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE; 524 524 525 virtual void computePreferredLogicalWidths(); 525 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE; 526 virtual void computePreferredLogicalWidths() OVERRIDE; 526 527 527 528 virtual int firstLineBoxBaseline() const; … … 900 901 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset); 901 902 902 void computeInlinePreferredLogicalWidths(); 903 void computeBlockPreferredLogicalWidths(); 903 // FIXME: Make this method const so we can remove the const_cast in computeIntrinsicLogicalWidths. 904 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth); 905 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const; 904 906 905 907 // Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
Note: See TracChangeset
for help on using the changeset viewer.