Changeset 128130 in webkit
- Timestamp:
- Sep 10, 2012 4:55:38 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128129 r128130 1 2012-09-10 Ojan Vafai <ojan@chromium.org> 2 3 Rename box-sizing applying methods to be more clear about just applying box-sizing. 4 https://bugs.webkit.org/show_bug.cgi?id=96319 5 6 Reviewed by Tony Chang. 7 8 This is strictly a rename. No logic or web-exposed changes. 9 10 * rendering/AutoTableLayout.cpp: 11 (WebCore::AutoTableLayout::recalcColumn): 12 * rendering/FixedTableLayout.cpp: 13 (WebCore::FixedTableLayout::calcWidthArray): 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::computePreferredLogicalWidths): 16 * rendering/RenderBox.cpp: 17 (WebCore::RenderBox::adjustBorderBoxLogicalWidthForBoxSizing): 18 (WebCore::RenderBox::adjustBorderBoxLogicalHeightForBoxSizing): 19 (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing): 20 (WebCore::RenderBox::adjustContentBoxLogicalHeightForBoxSizing): 21 (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight): 22 (WebCore::RenderBox::computeLogicalWidthInRegionUsing): 23 (WebCore::RenderBox::computeLogicalHeightUsing): 24 (WebCore::RenderBox::computeLogicalClientHeight): 25 (WebCore::RenderBox::computePercentageLogicalHeight): 26 (WebCore::RenderBox::computeReplacedLogicalWidthUsing): 27 (WebCore::RenderBox::computeReplacedLogicalHeightUsing): 28 (WebCore::RenderBox::availableLogicalHeightUsing): 29 (WebCore::RenderBox::computePositionedLogicalWidthUsing): 30 (WebCore::RenderBox::computePositionedLogicalHeightUsing): 31 * rendering/RenderBox.h: 32 (RenderBox): 33 * rendering/RenderDeprecatedFlexibleBox.cpp: 34 (WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths): 35 * rendering/RenderFileUploadControl.cpp: 36 (WebCore::RenderFileUploadControl::computePreferredLogicalWidths): 37 * rendering/RenderFlexibleBox.cpp: 38 (WebCore::RenderFlexibleBox::computePreferredLogicalWidths): 39 (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild): 40 * rendering/RenderListBox.cpp: 41 (WebCore::RenderListBox::computePreferredLogicalWidths): 42 * rendering/RenderMenuList.cpp: 43 (WebCore::RenderMenuList::computePreferredLogicalWidths): 44 * rendering/RenderSlider.cpp: 45 (WebCore::RenderSlider::computePreferredLogicalWidths): 46 * rendering/RenderTextControl.cpp: 47 (WebCore::RenderTextControl::computePreferredLogicalWidths): 48 1 49 2012-09-10 Jer Noble <jer.noble@apple.com> 2 50 -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r125917 r128130 94 94 // ignore width=0 95 95 if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercent()) { 96 LayoutUnit logicalWidth = cell-> computeBorderBoxLogicalWidth(cellLogicalWidth.value());96 LayoutUnit logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth.value()); 97 97 if (columnLayout.logicalWidth.isFixed()) { 98 98 // Nav/IE weirdness -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r121279 r128130 146 146 int fixedBorderBoxLogicalWidth = 0; 147 147 if (logicalWidth.isFixed() && logicalWidth.isPositive()) { 148 fixedBorderBoxLogicalWidth = cell-> computeBorderBoxLogicalWidth(logicalWidth.value());148 fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth.value()); 149 149 logicalWidth.setValue(fixedBorderBoxLogicalWidth); 150 150 } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r128110 r128130 5553 5553 if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() >= 0 5554 5554 && style()->marqueeBehavior() != MALTERNATE && !(isDeprecatedFlexItem() && !styleToUse->logicalWidth().intValue())) 5555 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(styleToUse->logicalWidth().value());5555 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalWidth().value()); 5556 5556 else { 5557 5557 m_minPreferredLogicalWidth = 0; … … 5585 5585 Length w = toRenderTableCell(this)->styleOrColLogicalWidth(); 5586 5586 if (w.isFixed() && w.value() > 0) { 5587 m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(w.value()));5587 m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(w.value())); 5588 5588 scrollbarWidth = 0; 5589 5589 } … … 5594 5594 5595 5595 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) { 5596 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMinWidth().value()));5597 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMinWidth().value()));5596 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 5597 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 5598 5598 } 5599 5599 5600 5600 if (styleToUse->logicalMaxWidth().isFixed()) { 5601 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMaxWidth().value()));5602 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMaxWidth().value()));5601 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 5602 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 5603 5603 } 5604 5604 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r128110 r128130 708 708 } 709 709 710 LayoutUnit RenderBox:: computeBorderBoxLogicalWidth(LayoutUnit width) const710 LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const 711 711 { 712 712 LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth(); … … 716 716 } 717 717 718 LayoutUnit RenderBox:: computeBorderBoxLogicalHeight(LayoutUnit height) const718 LayoutUnit RenderBox::adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const 719 719 { 720 720 LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight(); … … 724 724 } 725 725 726 LayoutUnit RenderBox:: computeContentBoxLogicalWidth(LayoutUnit width) const726 LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const 727 727 { 728 728 if (style()->boxSizing() == BORDER_BOX) … … 731 731 } 732 732 733 LayoutUnit RenderBox:: computeContentBoxLogicalHeight(LayoutUnit height) const733 LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit height) const 734 734 { 735 735 if (style()->boxSizing() == BORDER_BOX) … … 1245 1245 1246 1246 // Use the content box logical height as specified by the style. 1247 return cb-> computeContentBoxLogicalHeight(logicalHeightLength.value());1247 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.value()); 1248 1248 } 1249 1249 … … 1733 1733 1734 1734 if (widthType == MinSize && logicalWidth.isAuto()) 1735 return computeBorderBoxLogicalWidth(0);1735 return adjustBorderBoxLogicalWidthForBoxSizing(0); 1736 1736 1737 1737 if (!logicalWidth.isIntrinsicOrAuto()) { 1738 1738 // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead. 1739 return computeBorderBoxLogicalWidth(valueForLength(logicalWidth, availableLogicalWidth, view()));1739 return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth, view())); 1740 1740 } 1741 1741 … … 2092 2092 LayoutUnit logicalHeight = computeContentLogicalHeightUsing(heightType, height); 2093 2093 if (logicalHeight != -1) 2094 logicalHeight = computeBorderBoxLogicalHeight(logicalHeight);2094 logicalHeight = adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight); 2095 2095 return logicalHeight; 2096 2096 } … … 2101 2101 if (heightIncludingScrollbar == -1) 2102 2102 return -1; 2103 return std::max<LayoutUnit>(0, computeContentBoxLogicalHeight(heightIncludingScrollbar) - scrollbarLogicalHeight());2103 return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight()); 2104 2104 } 2105 2105 … … 2169 2169 } else if (cbstyle->logicalHeight().isFixed()) { 2170 2170 // Otherwise we only use our percentage height if our containing block had a specified height. 2171 LayoutUnit contentBoxHeightWithScrollbar = cb-> computeContentBoxLogicalHeight(cbstyle->logicalHeight().value());2171 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle->logicalHeight().value()); 2172 2172 result = max<LayoutUnit>(0, contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight()); 2173 2173 } else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) { … … 2175 2175 LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle->logicalHeight()); 2176 2176 if (heightWithScrollbar != -1) { 2177 LayoutUnit contentBoxHeightWithScrollbar = cb-> computeContentBoxLogicalHeight(heightWithScrollbar);2177 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar); 2178 2178 result = max<LayoutUnit>(0, contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight()); 2179 2179 } … … 2215 2215 { 2216 2216 if (sizeType == MinSize && logicalWidth.isAuto()) 2217 return computeContentBoxLogicalWidth(0);2217 return adjustContentBoxLogicalWidthForBoxSizing(0); 2218 2218 2219 2219 switch (logicalWidth.type()) { 2220 2220 case Fixed: 2221 return computeContentBoxLogicalWidth(logicalWidth.value());2221 return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth.value()); 2222 2222 case ViewportPercentageWidth: 2223 2223 case ViewportPercentageHeight: 2224 2224 case ViewportPercentageMin: 2225 return computeContentBoxLogicalWidth(valueForLength(logicalWidth, 0, view()));2225 return adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, 0, view())); 2226 2226 case Percent: 2227 2227 case Calculated: { … … 2234 2234 // https://bugs.webkit.org/show_bug.cgi?id=91071 2235 2235 if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercent()))) 2236 return computeContentBoxLogicalWidth(minimumValueForLength(logicalWidth, cw));2236 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw)); 2237 2237 } 2238 2238 // fall through … … 2257 2257 { 2258 2258 if (sizeType == MinSize && logicalHeight.isAuto()) 2259 return computeContentBoxLogicalHeight(0);2259 return adjustContentBoxLogicalHeightForBoxSizing(0); 2260 2260 2261 2261 switch (logicalHeight.type()) { 2262 2262 case Fixed: 2263 return computeContentBoxLogicalHeight(logicalHeight.value());2263 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value()); 2264 2264 case Percent: 2265 2265 case Calculated: … … 2278 2278 LayoutUnit oldHeight = block->height(); 2279 2279 block->computeLogicalHeight(); 2280 LayoutUnit newHeight = block-> computeContentBoxLogicalHeight(block->contentHeight());2280 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(block->contentHeight()); 2281 2281 block->setHeight(oldHeight); 2282 return computeContentBoxLogicalHeight(valueForLength(logicalHeight, newHeight));2282 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, newHeight)); 2283 2283 } 2284 2284 … … 2307 2307 } 2308 2308 } 2309 return computeContentBoxLogicalHeight(valueForLength(logicalHeight, availableHeight));2309 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, availableHeight)); 2310 2310 } 2311 2311 case ViewportPercentageWidth: 2312 2312 case ViewportPercentageHeight: 2313 2313 case ViewportPercentageMin: 2314 return computeContentBoxLogicalHeight(valueForLength(logicalHeight, 0, view()));2314 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, 0, view())); 2315 2315 default: 2316 2316 return intrinsicLogicalHeight(); … … 2336 2336 if (h.isPercent() && isOutOfFlowPositioned()) { 2337 2337 LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(containingBlock()); 2338 return computeContentBoxLogicalHeight(valueForLength(h, availableHeight));2338 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, availableHeight)); 2339 2339 } 2340 2340 2341 2341 LayoutUnit heightIncludingScrollbar = computeContentLogicalHeightUsing(MainOrPreferredSize, h); 2342 2342 if (heightIncludingScrollbar != -1) 2343 return std::max<LayoutUnit>(0, computeContentBoxLogicalHeight(heightIncludingScrollbar) - scrollbarLogicalHeight());2343 return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight()); 2344 2344 2345 2345 // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical writing-mode. … … 2349 2349 LayoutUnit oldHeight = block->logicalHeight(); 2350 2350 block->computeLogicalHeight(); 2351 LayoutUnit newHeight = block-> computeContentBoxLogicalHeight(block->contentLogicalHeight());2351 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(block->contentLogicalHeight()); 2352 2352 block->setLogicalHeight(oldHeight); 2353 return computeContentBoxLogicalHeight(newHeight);2353 return adjustContentBoxLogicalHeightForBoxSizing(newHeight); 2354 2354 } 2355 2355 … … 2718 2718 2719 2719 logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); 2720 computedValues.m_extent = computeContentBoxLogicalWidth(valueForLength(logicalWidth, containerLogicalWidth, renderView));2720 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth, renderView)); 2721 2721 2722 2722 const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue + computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth, renderView) + bordersPlusPadding); … … 2828 2828 } else if (logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) { 2829 2829 // RULE 4: (solve for left) 2830 computedValues.m_extent = computeContentBoxLogicalWidth(valueForLength(logicalWidth, containerLogicalWidth, renderView));2830 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth, renderView)); 2831 2831 logicalLeftValue = availableSpace - (computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth, renderView)); 2832 2832 } else if (!logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { … … 2837 2837 // RULE 6: (no need solve for right) 2838 2838 logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); 2839 computedValues.m_extent = computeContentBoxLogicalWidth(valueForLength(logicalWidth, containerLogicalWidth, renderView));2839 computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth, renderView)); 2840 2840 } 2841 2841 } … … 3044 3044 // case because the value is not used for any further calculations. 3045 3045 3046 logicalHeightValue = computeContentBoxLogicalHeight(valueForLength(logicalHeightLength, containerLogicalHeight, renderView));3046 logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight, renderView)); 3047 3047 logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); 3048 3048 … … 3111 3111 } else if (logicalTopIsAuto && !logicalHeightIsAuto && !logicalBottomIsAuto) { 3112 3112 // RULE 4: (solve of top) 3113 logicalHeightValue = computeContentBoxLogicalHeight(valueForLength(logicalHeightLength, containerLogicalHeight, renderView));3113 logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight, renderView)); 3114 3114 logicalTopValue = availableSpace - (logicalHeightValue + valueForLength(logicalBottom, containerLogicalHeight, renderView)); 3115 3115 } else if (!logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) { … … 3119 3119 } else if (!logicalTopIsAuto && !logicalHeightIsAuto && logicalBottomIsAuto) { 3120 3120 // RULE 6: (no need solve of bottom) 3121 logicalHeightValue = computeContentBoxLogicalHeight(valueForLength(logicalHeightLength, containerLogicalHeight, renderView));3121 logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight, renderView)); 3122 3122 logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); 3123 3123 } -
trunk/Source/WebCore/rendering/RenderBox.h
r128110 r128130 300 300 virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&, bool* offsetDependsOnPoint = 0) const; 301 301 302 LayoutUnit computeBorderBoxLogicalWidth(LayoutUnit width) const;303 LayoutUnit computeBorderBoxLogicalHeight(LayoutUnit height) const;304 LayoutUnit computeContentBoxLogicalWidth(LayoutUnit width) const;305 LayoutUnit computeContentBoxLogicalHeight(LayoutUnit height) const;302 LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const; 303 LayoutUnit adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const; 304 LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const; 305 LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit height) const; 306 306 307 307 virtual void borderFitAdjust(LayoutRect&) const { } // Shrink the box in which the border paints if border-fit is set. -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r128110 r128130 193 193 194 194 if (style()->width().isFixed() && style()->width().value() > 0) 195 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());195 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value()); 196 196 else { 197 197 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0; … … 213 213 214 214 if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) { 215 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));216 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));215 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 216 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 217 217 } 218 218 219 219 if (style()->maxWidth().isFixed()) { 220 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));221 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));220 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 221 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 222 222 } 223 223 -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r126359 r128130 185 185 const Font& font = style->font(); 186 186 if (style->width().isFixed() && style->width().value() > 0) 187 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style->width().value());187 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style->width().value()); 188 188 else { 189 189 // Figure out how big the filename space needs to be for a given number of characters … … 202 202 203 203 if (style->minWidth().isFixed() && style->minWidth().value() > 0) { 204 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style->minWidth().value()));205 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style->minWidth().value()));204 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style->minWidth().value())); 205 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style->minWidth().value())); 206 206 } else if (style->width().isPercent() || (style->width().isAuto() && style->height().isPercent())) 207 207 m_minPreferredLogicalWidth = 0; … … 210 210 211 211 if (style->maxWidth().isFixed()) { 212 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style->maxWidth().value()));213 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style->maxWidth().value()));212 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style->maxWidth().value())); 213 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style->maxWidth().value())); 214 214 } 215 215 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r128110 r128130 168 168 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for width. 169 169 if (styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0) 170 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(styleToUse->logicalWidth().value());170 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalWidth().value()); 171 171 else { 172 172 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0; … … 218 218 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for min-width. 219 219 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) { 220 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMinWidth().value()));221 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMinWidth().value()));220 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 221 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 222 222 } 223 223 224 224 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for maxWidth. 225 225 if (styleToUse->logicalMaxWidth().isFixed()) { 226 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMaxWidth().value()));227 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMaxWidth().value()));226 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 227 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 228 228 } 229 229 … … 407 407 if (isColumnFlow()) 408 408 return child->computeLogicalClientHeight(sizeType, size); 409 return child-> computeContentBoxLogicalWidth(valueForLength(size, maximumValue, view()));409 return child->adjustContentBoxLogicalWidthForBoxSizing(valueForLength(size, maximumValue, view())); 410 410 } 411 411 -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r126859 r128130 199 199 200 200 if (style()->width().isFixed() && style()->width().value() > 0) 201 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());201 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value()); 202 202 else { 203 203 m_maxPreferredLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal; … … 207 207 208 208 if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) { 209 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));210 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));209 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 210 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 211 211 } else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent())) 212 212 m_minPreferredLogicalWidth = 0; … … 215 215 216 216 if (style()->maxWidth().isFixed()) { 217 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));218 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));217 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 218 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 219 219 } 220 220 -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r126967 r128130 279 279 280 280 if (style()->width().isFixed() && style()->width().value() > 0) 281 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());281 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value()); 282 282 else 283 283 m_maxPreferredLogicalWidth = max(m_optionsWidth, theme()->minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight(); 284 284 285 285 if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) { 286 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));287 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));286 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 287 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 288 288 } else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent())) 289 289 m_minPreferredLogicalWidth = 0; … … 292 292 293 293 if (style()->maxWidth().isFixed()) { 294 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));295 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));294 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 295 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 296 296 } 297 297 -
trunk/Source/WebCore/rendering/RenderSlider.cpp
r124556 r128130 77 77 78 78 if (style()->width().isFixed() && style()->width().value() > 0) 79 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());79 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value()); 80 80 else 81 81 m_maxPreferredLogicalWidth = defaultTrackLength * style()->effectiveZoom(); 82 82 83 83 if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) { 84 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));85 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));84 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 85 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 86 86 } else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent())) 87 87 m_minPreferredLogicalWidth = 0; … … 90 90 91 91 if (style()->maxWidth().isFixed()) { 92 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));93 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));92 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 93 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 94 94 } 95 95 -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r127737 r128130 263 263 264 264 if (style()->width().isFixed() && style()->width().value() >= 0) 265 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());265 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value()); 266 266 else { 267 267 // Use average character width. Matches IE. … … 273 273 274 274 if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) { 275 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));276 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));275 m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 276 m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value())); 277 277 } else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent())) 278 278 m_minPreferredLogicalWidth = 0; … … 281 281 282 282 if (style()->maxWidth().isFixed()) { 283 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));284 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));283 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 284 m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value())); 285 285 } 286 286
Note: See TracChangeset
for help on using the changeset viewer.