Changeset 112749 in webkit
- Timestamp:
- Mar 30, 2012 5:05:21 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 15 edited
- 14 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112748 r112749 1 2012-03-30 Joe Thomas <joethomas@motorola.com> 2 3 Spec renamed Viewport-relative lengths to Viewport-percentage lengths 4 https://bugs.webkit.org/show_bug.cgi?id=82773 5 6 Reviewed by Antti Koivisto. 7 8 As per the latest version of CSS Values and Units Module Level 3 specification released on 29 March 2012 9 (http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) Viewport-relative lengths is renamed to Viewport-percentage lengths. 10 11 * css3/viewport-percentage-lengths: Added. 12 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt: Added. 13 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: Added. 14 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute-expected.html: Added. 15 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute.html: Added. 16 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-expected.html: Added. 17 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh.html: Added. 18 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute-expected.html: Added. 19 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute.html: Added. 20 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-expected.html: Added. 21 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin.html: Added. 22 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute-expected.html: Added. 23 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute.html: Added. 24 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-expected.html: Added. 25 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw.html: Added. 26 * css3/viewport-relative-lengths: Removed. 27 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle-expected.txt: Removed. 28 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle.html: Removed. 29 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute-expected.html: Removed. 30 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute.html: Removed. 31 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-expected.html: Removed. 32 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh.html: Removed. 33 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute-expected.html: Removed. 34 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute.html: Removed. 35 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-expected.html: Removed. 36 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin.html: Removed. 37 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute-expected.html: Removed. 38 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute.html: Removed. 39 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-expected.html: Removed. 40 * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw.html: Removed. 41 1 42 2012-03-30 Dirk Pranke <dpranke@chromium.org> 2 43 -
trunk/Source/WebCore/ChangeLog
r112745 r112749 1 2012-03-30 Joe Thomas <joethomas@motorola.com> 2 3 Spec renamed Viewport-relative lengths to Viewport-percentage lengths 4 https://bugs.webkit.org/show_bug.cgi?id=82773 5 6 Reviewed by Antti Koivisto. 7 8 As per the latest version of CSS Values and Units Module Level 3 specification released on 29 March 2012 9 (http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) Viewport-relative lengths is renamed to Viewport-percentage lengths. 10 11 * css/CSSComputedStyleDeclaration.cpp: 12 (WebCore::getPositionOffsetValue): 13 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 14 * css/CSSPrimitiveValue.cpp: 15 (WebCore::unitCategory): 16 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 17 (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory): 18 (WebCore::CSSPrimitiveValue::viewportPercentageLength): 19 * css/CSSPrimitiveValue.h: 20 (WebCore::CSSPrimitiveValue::isViewportPercentageLength): 21 (CSSPrimitiveValue): 22 * css/CSSPrimitiveValueMappings.h: 23 (WebCore::CSSPrimitiveValue::convertToLength): 24 * css/CSSStyleApplyProperty.cpp: 25 (WebCore::ApplyPropertyLength::applyValue): 26 (WebCore::ApplyPropertyBorderRadius::applyValue): 27 (WebCore::ApplyPropertyFontSize::applyValue): 28 (WebCore::ApplyPropertyLineHeight::applyValue): 29 (WebCore::ApplyPropertyVerticalAlign::applyValue): 30 * css/CSSStyleSelector.cpp: 31 (WebCore::CSSStyleSelector::collectMatchingRulesForList): 32 * css/LengthFunctions.cpp: 33 (WebCore::minimumValueForLength): 34 (WebCore::valueForLength): 35 (WebCore::floatValueForLength): 36 * platform/Length.h: 37 (WebCore::Length::isViewportPercentage): 38 (WebCore::Length::viewportPercentageLength): 39 * rendering/RenderBlock.cpp: 40 (WebCore::RenderBlock::textIndentOffset): 41 * rendering/RenderBox.cpp: 42 (WebCore::RenderBox::computeContentLogicalHeightUsing): 43 (WebCore::RenderBox::computeReplacedLogicalHeightUsing): 44 * rendering/RenderBoxModelObject.cpp: 45 (WebCore::RenderBoxModelObject::paddingTop): 46 (WebCore::RenderBoxModelObject::paddingBottom): 47 (WebCore::RenderBoxModelObject::paddingLeft): 48 (WebCore::RenderBoxModelObject::paddingRight): 49 (WebCore::RenderBoxModelObject::paddingBefore): 50 (WebCore::RenderBoxModelObject::paddingAfter): 51 (WebCore::RenderBoxModelObject::paddingStart): 52 (WebCore::RenderBoxModelObject::paddingEnd): 53 (WebCore::RenderBoxModelObject::calculateFillTileSize): 54 * rendering/RenderInline.cpp: 55 (WebCore::computeMargin): 56 * rendering/style/RenderStyle.h: 57 1 58 2012-03-30 Alexandru Chiculita <achicu@adobe.com> 2 59 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r112629 r112749 573 573 if (l.type() == WebCore::Fixed) 574 574 return zoomAdjustedPixelValue(l.value(), style, cssValuePool); 575 else if (l.isViewport Relative())575 else if (l.isViewportPercentage()) 576 576 return zoomAdjustedPixelValue(valueForLength(l, 0, renderView), style, cssValuePool); 577 577 return cssValuePool->createValue(l); … … 1778 1778 return zoomAdjustedPixelValueForLength(marginRight, style.get(), cssValuePool); 1779 1779 int value; 1780 if (marginRight.isPercent() || marginRight.isViewport Relative())1780 if (marginRight.isPercent() || marginRight.isViewportPercentage()) 1781 1781 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box 1782 1782 // and the right-edge of the containing box, when display == BLOCK. Let's calculate the absolute -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r112301 r112749 137 137 case CSSPrimitiveValue::CSS_VH: 138 138 case CSSPrimitiveValue::CSS_VMIN: 139 return CSSPrimitiveValue::UViewport RelativeLength;139 return CSSPrimitiveValue::UViewportPercentageLength; 140 140 default: 141 141 return CSSPrimitiveValue::UOther; … … 254 254 m_value.num = length.percent(); 255 255 break; 256 case Viewport RelativeWidth:256 case ViewportPercentageWidth: 257 257 m_primitiveUnitType = CSS_VW; 258 m_value.num = length.viewport RelativeLength();259 break; 260 case Viewport RelativeHeight:258 m_value.num = length.viewportPercentageLength(); 259 break; 260 case ViewportPercentageHeight: 261 261 m_primitiveUnitType = CSS_VH; 262 m_value.num = length.viewport RelativeLength();263 break; 264 case Viewport RelativeMin:262 m_value.num = length.viewportPercentageLength(); 263 break; 264 case ViewportPercentageMin: 265 265 m_primitiveUnitType = CSS_VMIN; 266 m_value.num = length.viewport RelativeLength();266 m_value.num = length.viewportPercentageLength(); 267 267 break; 268 268 case Calculated: … … 594 594 case UFrequency: 595 595 return CSS_HZ; 596 case UViewport RelativeLength:596 case UViewportPercentageLength: 597 597 return CSS_UNKNOWN; // Cannot convert between numbers and relative lengths. 598 598 default: … … 1039 1039 } 1040 1040 1041 Length CSSPrimitiveValue::viewport RelativeLength()1042 { 1043 ASSERT(isViewport RelativeLength());1041 Length CSSPrimitiveValue::viewportPercentageLength() 1042 { 1043 ASSERT(isViewportPercentageLength()); 1044 1044 Length viewportLength; 1045 1045 switch (m_primitiveUnitType) { 1046 1046 case CSS_VW: 1047 viewportLength = Length(getDoubleValue(), Viewport RelativeWidth);1047 viewportLength = Length(getDoubleValue(), ViewportPercentageWidth); 1048 1048 break; 1049 1049 case CSS_VH: 1050 viewportLength = Length(getDoubleValue(), Viewport RelativeHeight);1050 viewportLength = Length(getDoubleValue(), ViewportPercentageHeight); 1051 1051 break; 1052 1052 case CSS_VMIN: 1053 viewportLength = Length(getDoubleValue(), Viewport RelativeMin);1053 viewportLength = Length(getDoubleValue(), ViewportPercentageMin); 1054 1054 break; 1055 1055 default: -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r112301 r112749 81 81 CSS_RECT = 24, 82 82 CSS_RGBCOLOR = 25, 83 // From CSS Values and Units. Viewport Relative Lengths (vw/vh/vmin).83 // From CSS Values and Units. Viewport-percentage Lengths (vw/vh/vmin). 84 84 CSS_VW = 26, 85 85 CSS_VH = 27, … … 123 123 UTime, 124 124 UFrequency, 125 UViewport RelativeLength,125 UViewportPercentageLength, 126 126 UOther 127 127 }; … … 159 159 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CSS_CALC_PERCENTAGE_WITH_NUMBER; } 160 160 bool isCalculatedPercentageWithLength() const { return primitiveType() == CSS_CALC_PERCENTAGE_WITH_LENGTH; } 161 bool isViewport RelativeLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMIN; }161 bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMIN; } 162 162 163 163 static PassRefPtr<CSSPrimitiveValue> createIdentifier(int identifier) { return adoptRef(new CSSPrimitiveValue(identifier)); } … … 275 275 void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*); 276 276 277 Length viewport RelativeLength();277 Length viewportPercentageLength(); 278 278 279 279 private: -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r112587 r112749 3776 3776 FractionConversion = 1 << 4, 3777 3777 CalculatedConversion = 1 << 5, 3778 Viewport RelativeConversion = 1 << 63778 ViewportPercentageConversion = 1 << 6 3779 3779 }; 3780 3780 … … 3795 3795 if ((supported & CalculatedConversion) && isCalculated()) 3796 3796 return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier)); 3797 if ((supported & Viewport RelativeConversion) && isViewportRelativeLength())3798 return viewport RelativeLength();3797 if ((supported & ViewportPercentageConversion) && isViewportPercentageLength()) 3798 return viewportPercentageLength(); 3799 3799 return Length(Undefined); 3800 3800 } -
trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp
r112555 r112749 394 394 else if (primitiveValue->isCalculatedPercentageWithLength()) 395 395 setValue(selector->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()))); 396 else if (primitiveValue->isViewport RelativeLength())397 setValue(selector->style(), primitiveValue->viewport RelativeLength());396 else if (primitiveValue->isViewportPercentageLength()) 397 setValue(selector->style(), primitiveValue->viewportPercentageLength()); 398 398 } 399 399 } … … 447 447 if (pair->first()->isPercentage()) 448 448 radiusWidth = Length(pair->first()->getDoubleValue(), Percent); 449 else if (pair->first()->isViewport RelativeLength())450 radiusWidth = pair->first()->viewport RelativeLength();449 else if (pair->first()->isViewportPercentageLength()) 450 radiusWidth = pair->first()->viewportPercentageLength(); 451 451 else if (pair->first()->isCalculatedPercentageWithLength()) { 452 452 // FIXME calc(): http://webkit.org/b/16662 … … 457 457 if (pair->second()->isPercentage()) 458 458 radiusHeight = Length(pair->second()->getDoubleValue(), Percent); 459 else if (pair->second()->isViewport RelativeLength())460 radiusHeight = pair->second()->viewport RelativeLength();459 else if (pair->second()->isViewportPercentageLength()) 460 radiusHeight = pair->second()->viewportPercentageLength(); 461 461 else if (pair->second()->isCalculatedPercentageWithLength()) { 462 462 // FIXME calc(): http://webkit.org/b/16662 … … 753 753 else if (primitiveValue->isCalculatedPercentageWithLength()) 754 754 size = primitiveValue->cssCalcValue()->toCalcValue(selector->parentStyle(), selector->rootElementStyle())->evaluate(parentSize); 755 else if (primitiveValue->isViewport RelativeLength())756 size = valueForLength(primitiveValue->viewport RelativeLength(), 0, selector->document()->renderView());755 else if (primitiveValue->isViewportPercentageLength()) 756 size = valueForLength(primitiveValue->viewportPercentageLength(), 0, selector->document()->renderView()); 757 757 else 758 758 return; … … 1216 1216 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent). 1217 1217 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent); 1218 } else if (primitiveValue->isViewport RelativeLength()) {1219 lineHeight = primitiveValue->viewport RelativeLength();1218 } else if (primitiveValue->isViewportPercentageLength()) { 1219 lineHeight = primitiveValue->viewportPercentageLength(); 1220 1220 } else 1221 1221 return; … … 1579 1579 return selector->style()->setVerticalAlign(*primitiveValue); 1580 1580 1581 selector->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | Viewport RelativeConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()));1581 selector->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom())); 1582 1582 } 1583 1583 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r112730 r112749 2564 2564 Length CSSStyleSelector::convertToIntLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier) 2565 2565 { 2566 return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | Viewport RelativeConversion>(style, rootStyle, multiplier) : Length(Undefined);2566 return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined); 2567 2567 } 2568 2568 2569 2569 Length CSSStyleSelector::convertToFloatLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier) 2570 2570 { 2571 return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | FractionConversion | Viewport RelativeConversion>(style, rootStyle, multiplier) : Length(Undefined);2571 return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined); 2572 2572 } 2573 2573 … … 2954 2954 static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, CSSStyleSelector* selector, Length& length) 2955 2955 { 2956 Length workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | Viewport RelativeConversion | AutoConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());2956 Length workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | ViewportPercentageConversion | AutoConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()); 2957 2957 if (workingLength.isUndefined()) 2958 2958 return false; … … 4298 4298 else if (primitiveValue->isCalculatedPercentageWithLength()) 4299 4299 l = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), m_rootElementStyle, zoomFactor)); 4300 else if (primitiveValue->isViewport RelativeLength())4301 l = primitiveValue->viewport RelativeLength();4300 else if (primitiveValue->isViewportPercentageLength()) 4301 l = primitiveValue->viewportPercentageLength(); 4302 4302 else 4303 4303 return; … … 4325 4325 else if (primitiveValue->isCalculatedPercentageWithLength()) 4326 4326 l = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), m_rootElementStyle, zoomFactor)); 4327 else if (primitiveValue->isViewport RelativeLength())4328 l = primitiveValue->viewport RelativeLength();4327 else if (primitiveValue->isViewportPercentageLength()) 4328 l = primitiveValue->viewportPercentageLength(); 4329 4329 else 4330 4330 return; -
trunk/Source/WebCore/css/LengthFunctions.cpp
r112472 r112749 42 42 case Calculated: 43 43 return length.nonNanCalculatedValue(maximumValue); 44 case Viewport RelativeWidth:44 case ViewportPercentageWidth: 45 45 if (renderView) 46 return static_cast<int>(renderView->viewportSize().width() * length.viewport RelativeLength() / 100.0f);46 return static_cast<int>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f); 47 47 return 0; 48 case Viewport RelativeHeight:48 case ViewportPercentageHeight: 49 49 if (renderView) 50 return static_cast<int>(renderView->viewportSize().height() * length.viewport RelativeLength() / 100.0f);50 return static_cast<int>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f); 51 51 return 0; 52 case Viewport RelativeMin:52 case ViewportPercentageMin: 53 53 if (renderView) { 54 54 IntSize viewportSize = renderView->viewportSize(); 55 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewport RelativeLength() / 100.0f);55 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f); 56 56 } 57 57 return 0; … … 75 75 case Percent: 76 76 case Calculated: 77 case Viewport RelativeWidth:78 case Viewport RelativeHeight:79 case Viewport RelativeMin:77 case ViewportPercentageWidth: 78 case ViewportPercentageHeight: 79 case ViewportPercentageMin: 80 80 return minimumValueForLength(length, maximumValue, renderView, roundPercentages); 81 81 case Auto: … … 108 108 case Calculated: 109 109 return length.nonNanCalculatedValue(maximumValue); 110 case Viewport RelativeWidth:110 case ViewportPercentageWidth: 111 111 if (renderView) 112 return static_cast<int>(renderView->viewportSize().width() * length.viewport RelativeLength() / 100.0f);112 return static_cast<int>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f); 113 113 return 0; 114 case Viewport RelativeHeight:114 case ViewportPercentageHeight: 115 115 if (renderView) 116 return static_cast<int>(renderView->viewportSize().height() * length.viewport RelativeLength() / 100.0f);116 return static_cast<int>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f); 117 117 return 0; 118 case Viewport RelativeMin:118 case ViewportPercentageMin: 119 119 if (renderView) { 120 120 IntSize viewportSize = renderView->viewportSize(); 121 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewport RelativeLength() / 100.0f);121 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f); 122 122 } 123 123 return 0; … … 144 144 case Calculated: 145 145 return length.nonNanCalculatedValue(maximumValue); 146 case Viewport RelativeWidth:146 case ViewportPercentageWidth: 147 147 if (renderView) 148 return static_cast<int>(renderView->viewportSize().width() * length.viewport RelativeLength() / 100.0f);148 return static_cast<int>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f); 149 149 return 0; 150 case Viewport RelativeHeight:150 case ViewportPercentageHeight: 151 151 if (renderView) 152 return static_cast<int>(renderView->viewportSize().height() * length.viewport RelativeLength() / 100.0f);152 return static_cast<int>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f); 153 153 return 0; 154 case Viewport RelativeMin:154 case ViewportPercentageMin: 155 155 if (renderView) { 156 156 IntSize viewportSize = renderView->viewportSize(); 157 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewport RelativeLength() / 100.0f);157 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f); 158 158 } 159 159 return 0; -
trunk/Source/WebCore/platform/Length.h
r112301 r112749 34 34 namespace WebCore { 35 35 36 enum LengthType { Auto, Relative, Percent, Fixed, Intrinsic, MinIntrinsic, Calculated, Viewport RelativeWidth, ViewportRelativeHeight, ViewportRelativeMin, Undefined };36 enum LengthType { Auto, Relative, Percent, Fixed, Intrinsic, MinIntrinsic, Calculated, ViewportPercentageWidth, ViewportPercentageHeight, ViewportPercentageMin, Undefined }; 37 37 38 38 class CalculationValue; … … 227 227 float nonNanCalculatedValue(int maxValue) const; 228 228 229 bool isViewport Relative() const229 bool isViewportPercentage() const 230 230 { 231 231 LengthType lengthType = type(); 232 return lengthType >= Viewport RelativeWidth && lengthType <= ViewportRelativeMin;233 } 234 float viewport RelativeLength() const235 { 236 ASSERT(isViewport Relative());232 return lengthType >= ViewportPercentageWidth && lengthType <= ViewportPercentageMin; 233 } 234 float viewportPercentageLength() const 235 { 236 ASSERT(isViewportPercentage()); 237 237 return getFloatValue(); 238 238 } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r112566 r112749 3948 3948 if (style()->textIndent().isPercent()) 3949 3949 cw = containingBlock()->availableLogicalWidth(); 3950 else if (style()->textIndent().isViewport Relative())3950 else if (style()->textIndent().isViewportPercentage()) 3951 3951 renderView = view(); 3952 3952 return minimumValueForLength(style()->textIndent(), cw, renderView); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r112745 r112749 2165 2165 else if (height.isPercent()) 2166 2166 logicalHeight = computePercentageLogicalHeight(height); 2167 else if (height.isViewport Relative())2167 else if (height.isViewportPercentage()) 2168 2168 logicalHeight = valueForLength(height, 0, view()); 2169 2169 } … … 2352 2352 return computeContentBoxLogicalHeight(valueForLength(logicalHeight, availableHeight)); 2353 2353 } 2354 case Viewport RelativeWidth:2355 case Viewport RelativeHeight:2356 case Viewport RelativeMin:2354 case ViewportPercentageWidth: 2355 case ViewportPercentageHeight: 2356 case ViewportPercentageMin: 2357 2357 return computeContentBoxLogicalHeight(valueForLength(logicalHeight, 0, view())); 2358 2358 default: -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r112644 r112749 563 563 if (padding.isPercent()) 564 564 w = containingBlock()->availableLogicalWidth(); 565 else if (padding.isViewport Relative())565 else if (padding.isViewportPercentage()) 566 566 renderView = view(); 567 567 return minimumValueForLength(padding, w, renderView); … … 575 575 if (padding.isPercent()) 576 576 w = containingBlock()->availableLogicalWidth(); 577 else if (padding.isViewport Relative())577 else if (padding.isViewportPercentage()) 578 578 renderView = view(); 579 579 return minimumValueForLength(padding, w, renderView); … … 587 587 if (padding.isPercent()) 588 588 w = containingBlock()->availableLogicalWidth(); 589 else if (padding.isViewport Relative())589 else if (padding.isViewportPercentage()) 590 590 renderView = view(); 591 591 return minimumValueForLength(padding, w, renderView); … … 599 599 if (padding.isPercent()) 600 600 w = containingBlock()->availableLogicalWidth(); 601 else if (padding.isViewport Relative())601 else if (padding.isViewportPercentage()) 602 602 renderView = view(); 603 603 return minimumValueForLength(padding, w, renderView); … … 611 611 if (padding.isPercent()) 612 612 w = containingBlock()->availableLogicalWidth(); 613 else if (padding.isViewport Relative())613 else if (padding.isViewportPercentage()) 614 614 renderView = view(); 615 615 return minimumValueForLength(padding, w, renderView); … … 623 623 if (padding.isPercent()) 624 624 w = containingBlock()->availableLogicalWidth(); 625 else if (padding.isViewport Relative())625 else if (padding.isViewportPercentage()) 626 626 renderView = view(); 627 627 return minimumValueForLength(padding, w, renderView); … … 635 635 if (padding.isPercent()) 636 636 w = containingBlock()->availableLogicalWidth(); 637 else if (padding.isViewport Relative())637 else if (padding.isViewportPercentage()) 638 638 renderView = view(); 639 639 return minimumValueForLength(padding, w, renderView); … … 647 647 if (padding.isPercent()) 648 648 w = containingBlock()->availableLogicalWidth(); 649 else if (padding.isViewport Relative())649 else if (padding.isViewportPercentage()) 650 650 renderView = view(); 651 651 return minimumValueForLength(padding, w, renderView); … … 1028 1028 if (layerWidth.isFixed()) 1029 1029 w = layerWidth.value(); 1030 else if (layerWidth.isPercent() || layerHeight.isViewport Relative())1030 else if (layerWidth.isPercent() || layerHeight.isViewportPercentage()) 1031 1031 w = valueForLength(layerWidth, positioningAreaSize.width(), renderView); 1032 1032 1033 1033 if (layerHeight.isFixed()) 1034 1034 h = layerHeight.value(); 1035 else if (layerHeight.isPercent() || layerHeight.isViewport Relative())1035 else if (layerHeight.isPercent() || layerHeight.isViewportPercentage()) 1036 1036 h = valueForLength(layerHeight, positioningAreaSize.height(), renderView); 1037 1037 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r112745 r112749 703 703 if (margin.isPercent()) 704 704 return minimumValueForLength(margin, max<LayoutUnit>(0, renderer->containingBlock()->availableLogicalWidth())); 705 if (margin.isViewport Relative())705 if (margin.isViewportPercentage()) 706 706 return valueForLength(margin, 0, renderer->view()); 707 707 return 0; -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r112475 r112749 634 634 return minimumValueForLength(lh, fontSize()); 635 635 636 if (lh.isViewport Relative())636 if (lh.isViewportPercentage()) 637 637 return valueForLength(lh, 0, renderView); 638 638
Note: See TracChangeset
for help on using the changeset viewer.