Changeset 271003 in webkit
- Timestamp:
- Dec 19, 2020 2:10:14 PM (19 months ago)
- Location:
- trunk
- Files:
-
- 21 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/AutoTableLayout.cpp (modified) (1 diff)
-
Source/WebCore/rendering/FixedTableLayout.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlockFlow.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (9 diffs)
-
Source/WebCore/rendering/RenderBox.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderFileUploadControl.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderFragmentContainer.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderGrid.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderListBox.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderMenuList.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderReplaced.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderSlider.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderTable.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderTextControl.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271001 r271003 1 2020-12-19 Zalan Bujtas <zalan@apple.com> 2 3 width: max-content with box-sizing: border-box should leave space for padding (Twitter date hover overflow) 4 https://bugs.webkit.org/show_bug.cgi?id=219687 5 <rdar://problem/72137685> 6 7 Reviewed by Antti Koivisto. 8 9 * platform/mac-wk2/TestExpectations: 10 * platform/mac/TestExpectations: 11 1 12 2020-12-18 Rini Patel <rini_patel@apple.com> 2 13 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r270973 r271003 1317 1317 webkit.org/b/219322 fast/layoutformattingcontext/table-simple-border-collapse.html [ ImageOnlyFailure ] 1318 1318 webkit.org/b/219322 fast/layoutformattingcontext/table-simple-border-collapse2.html [ ImageOnlyFailure ] 1319 webkit.org/b/219687 fast/layoutformattingcontext/max-content-and-box-sizing-simple.html [ Skip ]1320 1319 1321 1320 webkit.org/b/220018 webanimations/accelerated-transform-related-animation-property-order.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/mac/TestExpectations
r270960 r271003 2258 2258 webkit.org/b/219907 imported/w3c/web-platform-tests/server-timing/service_worker_idl.html [ Pass Failure ] 2259 2259 2260 webkit.org/b/219687 fast/layoutformattingcontext/max-content-and-box-sizing-simple.html [ ImageOnlyFailure ]2261 2262 2260 webkit.org/b/219965 [ BigSur ] imported/w3c/web-platform-tests/fetch/content-type/script.window.html [ Pass Failure ] -
trunk/Source/WebCore/ChangeLog
r271002 r271003 1 2020-12-19 Zalan Bujtas <zalan@apple.com> 2 3 width: max-content with box-sizing: border-box should leave space for padding (Twitter date hover overflow) 4 https://bugs.webkit.org/show_bug.cgi?id=219687 5 <rdar://problem/72137685> 6 7 Reviewed by Antti Koivisto. 8 9 Non-quantitative values such as auto and min-content are not influenced by the box-sizing property. 10 See http:://www.w3.org/TR/css-sizing-3/#box-sizing 11 (adjustContentBoxLogicalWidthFor* now needs the property type too) 12 13 * rendering/RenderBlock.cpp: 14 (WebCore::RenderBlock::computePreferredLogicalWidths): 15 * rendering/RenderBlockFlow.cpp: 16 (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const): 17 * rendering/RenderBox.cpp: 18 (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const): 19 (WebCore::RenderBox::computeReplacedLogicalWidthUsing const): 20 (WebCore::RenderBox::computePositionedLogicalWidthUsing const): 21 * rendering/RenderBox.h: 22 (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const): 23 * rendering/RenderDeprecatedFlexibleBox.cpp: 24 (WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths): 25 * rendering/RenderFileUploadControl.cpp: 26 (WebCore::RenderFileUploadControl::computePreferredLogicalWidths): 27 * rendering/RenderFragmentContainer.cpp: 28 (WebCore::RenderFragmentContainer::computePreferredLogicalWidths): 29 * rendering/RenderGrid.cpp: 30 (WebCore::RenderGrid::computeAutoRepeatTracksCount const): 31 * rendering/RenderListBox.cpp: 32 (WebCore::RenderListBox::computePreferredLogicalWidths): 33 * rendering/RenderMenuList.cpp: 34 (RenderMenuList::computePreferredLogicalWidths): 35 * rendering/RenderReplaced.cpp: 36 (WebCore::RenderReplaced::computePreferredLogicalWidths): 37 * rendering/RenderSlider.cpp: 38 (WebCore::RenderSlider::computePreferredLogicalWidths): 39 * rendering/RenderTable.cpp: 40 (WebCore::RenderTable::computePreferredLogicalWidths): 41 * rendering/RenderTextControl.cpp: 42 (WebCore::RenderTextControl::computePreferredLogicalWidths): 43 1 44 2020-12-19 Zalan Bujtas <zalan@apple.com> 2 45 -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r265499 r271003 96 96 // ignore width=0 97 97 if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercentOrCalculated()) { 98 float logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth .value());98 float logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth); 99 99 if (columnLayout.logicalWidth.isFixed()) { 100 100 // Nav/IE weirdness -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r245543 r271003 143 143 // RenderBox::computeLogicalWidthInFragmentUsing to compute the width. 144 144 if (logicalWidth.isFixed() && logicalWidth.isPositive()) { 145 fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth .value());145 fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth); 146 146 logicalWidth.setValue(Fixed, fixedBorderBoxLogicalWidth); 147 147 } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r270220 r271003 2281 2281 if (!isTableCell() && styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() >= 0 2282 2282 && !(isDeprecatedFlexItem() && !styleToUse.logicalWidth().intValue())) 2283 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth() .value());2283 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth()); 2284 2284 else 2285 2285 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 2286 2286 2287 2287 if (styleToUse.logicalMaxWidth().isFixed()) { 2288 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth() .value()));2289 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth() .value()));2288 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth())); 2289 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth())); 2290 2290 } 2291 2291 2292 2292 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) { 2293 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));2294 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));2293 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 2294 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 2295 2295 } 2296 2296 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r270220 r271003 357 357 Length tableCellWidth = downcast<RenderTableCell>(*this).styleOrColLogicalWidth(); 358 358 if (tableCellWidth.isFixed() && tableCellWidth.value() > 0) 359 maxLogicalWidth = std::max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth .value()));359 maxLogicalWidth = std::max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth)); 360 360 } 361 361 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r270551 r271003 1232 1232 } 1233 1233 1234 LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const 1235 { 1234 LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const 1235 { 1236 auto width = LayoutUnit { logicalWidth.value() }; 1236 1237 LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth(); 1237 if (style().boxSizing() == BoxSizing::ContentBox )1238 if (style().boxSizing() == BoxSizing::ContentBox || logicalWidth.isIntrinsicOrAuto()) 1238 1239 return width + bordersPlusPadding; 1239 1240 return std::max(width, bordersPlusPadding); 1241 } 1242 1243 LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const 1244 { 1245 if (originalType == Calculated) 1246 return adjustBorderBoxLogicalWidthForBoxSizing({ computedLogicalWidth, Fixed, false }); 1247 return adjustBorderBoxLogicalWidthForBoxSizing({ computedLogicalWidth, originalType, false }); 1240 1248 } 1241 1249 … … 1248 1256 } 1249 1257 1250 LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const 1251 { 1252 if (style().boxSizing() == BoxSizing::BorderBox) 1253 width -= borderAndPaddingLogicalWidth(); 1254 return std::max<LayoutUnit>(0, width); 1258 LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const 1259 { 1260 auto width = LayoutUnit { logicalWidth.value() }; 1261 if (style().boxSizing() == BoxSizing::ContentBox || logicalWidth.isIntrinsicOrAuto()) 1262 return std::max(0_lu, width); 1263 return std::max(0_lu, width - borderAndPaddingLogicalWidth()); 1264 } 1265 1266 LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const 1267 { 1268 if (originalType == Calculated) 1269 return adjustContentBoxLogicalWidthForBoxSizing({ computedLogicalWidth, Fixed, false }); 1270 return adjustContentBoxLogicalWidthForBoxSizing({ computedLogicalWidth, originalType, false }); 1255 1271 } 1256 1272 … … 2574 2590 ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto()); 2575 2591 if (widthType == MinSize && logicalWidth.isAuto()) 2576 return adjustBorderBoxLogicalWidthForBoxSizing(0 );2592 return adjustBorderBoxLogicalWidthForBoxSizing(0, logicalWidth.type()); 2577 2593 2578 2594 if (!logicalWidth.isIntrinsicOrAuto()) { 2579 2595 // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead. 2580 return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth) );2596 return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth), logicalWidth.type()); 2581 2597 } 2582 2598 … … 3114 3130 ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto()); 3115 3131 if (widthType == MinSize && logicalWidth.isAuto()) 3116 return adjustContentBoxLogicalWidthForBoxSizing(0 );3132 return adjustContentBoxLogicalWidthForBoxSizing(0, logicalWidth.type()); 3117 3133 3118 3134 switch (logicalWidth.type()) { 3119 3135 case Fixed: 3120 return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth .value());3136 return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth); 3121 3137 case MinContent: 3122 3138 case MaxContent: { … … 3139 3155 return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth(); 3140 3156 if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercentOrCalculated()))) 3141 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw) );3157 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw), logicalWidth.type()); 3142 3158 return 0_lu; 3143 3159 } … … 3697 3713 { 3698 3714 ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto()); 3715 auto originalLogicalWidthType = logicalWidth.type(); 3699 3716 if (widthType == MinSize && logicalWidth.isAuto()) 3700 3717 logicalWidth = Length(0, Fixed); … … 3733 3750 3734 3751 logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); 3735 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth) );3752 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth), originalLogicalWidthType); 3736 3753 3737 3754 const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue + computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth) + bordersPlusPadding); … … 3843 3860 } else if (logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) { 3844 3861 // RULE 4: (solve for left) 3845 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth) );3862 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth), originalLogicalWidthType); 3846 3863 logicalLeftValue = availableSpace - (computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth)); 3847 3864 } else if (!logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { … … 3852 3869 // RULE 6: (no need solve for right) 3853 3870 logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); 3854 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth) );3871 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth), originalLogicalWidthType); 3855 3872 } 3856 3873 } -
trunk/Source/WebCore/rendering/RenderBox.h
r270551 r271003 336 336 LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const override; 337 337 338 LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const; 339 LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const; 340 341 template<typename T> LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(T width) const { return adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit(width)); } 342 template<typename T> LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(T width) const { return adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit(width)); } 338 LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const; 339 LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const; 340 341 LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const; 342 LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const; 343 344 template<typename T> LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(T computedLogicalWidth, LengthType originalType) const { return adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit(computedLogicalWidth), originalType); } 345 template<typename T> LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(T computedLogicalWidth, LengthType originalType) const { return adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit(computedLogicalWidth), originalType); } 343 346 344 347 // Overridden by fieldsets to subtract out the intrinsic border. -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r269537 r271003 224 224 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0; 225 225 if (style().width().isFixed() && style().width().value() > 0) 226 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width() .value());226 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width()); 227 227 else 228 228 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 229 229 230 230 if (style().minWidth().isFixed() && style().minWidth().value() > 0) { 231 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));232 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));231 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 232 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 233 233 } 234 234 235 235 if (style().maxWidth().isFixed()) { 236 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));237 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));236 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 237 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 238 238 } 239 239 -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r265338 r271003 225 225 226 226 if (style().width().isFixed() && style().width().value() > 0) 227 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width() .value());227 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width()); 228 228 else 229 229 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 230 230 231 231 if (style().minWidth().isFixed() && style().minWidth().value() > 0) { 232 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));233 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));232 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 233 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 234 234 } 235 235 236 236 if (style().maxWidth().isFixed()) { 237 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));238 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));237 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 238 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 239 239 } 240 240 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r270617 r271003 781 781 } else { 782 782 ASSERT(crossSizeLength.isPercentOrCalculated()); 783 crossSize = mainAxisIsChildInlineAxis(child) ? child.computePercentageLogicalHeight(crossSizeLength) : adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(crossSizeLength, contentWidth()) );783 crossSize = mainAxisIsChildInlineAxis(child) ? child.computePercentageLogicalHeight(crossSizeLength) : adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(crossSizeLength, contentWidth()), crossSizeLength.type()); 784 784 if (!crossSize) 785 785 return 0_lu; -
trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp
r253290 r271003 375 375 const RenderStyle& styleToUse = style(); 376 376 if (styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() > 0) 377 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth() .value());377 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth()); 378 378 else 379 379 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 380 380 381 381 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) { 382 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));383 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));382 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 383 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 384 384 } 385 385 386 386 if (styleToUse.logicalMaxWidth().isFixed()) { 387 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth() .value()));388 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth() .value()));387 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth())); 388 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth())); 389 389 } 390 390 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r268919 r271003 467 467 containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); 468 468 LayoutUnit maxSizeValue = valueForLength(maxSize, containingBlockAvailableSize.valueOr(LayoutUnit())); 469 availableMaxSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(maxSizeValue ) : adjustContentBoxLogicalHeightForBoxSizing(maxSizeValue);469 availableMaxSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(maxSizeValue, maxSize.type()) : adjustContentBoxLogicalHeightForBoxSizing(maxSizeValue); 470 470 } 471 471 … … 479 479 containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); 480 480 LayoutUnit minSizeValue = valueForLength(minSize, containingBlockAvailableSize.valueOr(LayoutUnit())); 481 availableMinSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(minSizeValue ) : adjustContentBoxLogicalHeightForBoxSizing(minSizeValue);481 availableMinSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(minSizeValue, minSize.type()) : adjustContentBoxLogicalHeightForBoxSizing(minSizeValue); 482 482 if (!maxSize.isSpecified()) 483 483 needsToFulfillMinimumSize = true; -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r270557 r271003 227 227 228 228 if (style().width().isFixed() && style().width().value() > 0) 229 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width() .value());229 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width()); 230 230 else 231 231 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 232 232 233 233 if (style().minWidth().isFixed() && style().minWidth().value() > 0) { 234 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));235 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));234 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 235 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 236 236 } 237 237 238 238 if (style().maxWidth().isFixed()) { 239 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));240 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));239 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 240 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 241 241 } 242 242 -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r270713 r271003 327 327 328 328 if (style().width().isFixed() && style().width().value() > 0) 329 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width() .value());329 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width()); 330 330 else 331 331 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 332 332 333 333 if (style().minWidth().isFixed() && style().minWidth().value() > 0) { 334 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));335 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));334 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 335 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 336 336 } 337 337 338 338 if (style().maxWidth().isFixed()) { 339 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));340 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));339 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 340 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 341 341 } 342 342 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r270618 r271003 664 664 665 665 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) { 666 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));667 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));666 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 667 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 668 668 } 669 669 670 670 if (styleToUse.logicalMaxWidth().isFixed()) { 671 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth() .value()));672 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth() .value()));671 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth())); 672 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth())); 673 673 } 674 674 -
trunk/Source/WebCore/rendering/RenderSlider.cpp
r270625 r271003 81 81 82 82 if (style().width().isFixed() && style().width().value() > 0) 83 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width() .value());83 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width()); 84 84 else 85 85 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 86 86 87 87 if (style().minWidth().isFixed() && style().minWidth().value() > 0) { 88 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));89 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth() .value()));88 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 89 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth())); 90 90 } 91 91 92 92 if (style().maxWidth().isFixed()) { 93 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));94 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth() .value()));93 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 94 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth())); 95 95 } 96 96 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r268919 r271003 825 825 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for min-width. 826 826 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) { 827 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));828 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth() .value()));827 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 828 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth())); 829 829 } 830 830 831 831 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for maxWidth. 832 832 if (styleToUse.logicalMaxWidth().isFixed()) { 833 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth() .value()));833 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth())); 834 834 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, m_minPreferredLogicalWidth); 835 835 } -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r269188 r271003 173 173 174 174 if (style().logicalWidth().isFixed() && style().logicalWidth().value() >= 0) 175 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().logicalWidth() .value());175 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().logicalWidth()); 176 176 else 177 177 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 178 178 179 179 if (style().logicalMinWidth().isFixed() && style().logicalMinWidth().value() > 0) { 180 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth() .value()));181 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth() .value()));180 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth())); 181 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth())); 182 182 } 183 183 184 184 if (style().logicalMaxWidth().isFixed()) { 185 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth() .value()));186 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth() .value()));185 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth())); 186 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth())); 187 187 } 188 188
Note: See TracChangeset
for help on using the changeset viewer.