Changeset 121285 in webkit


Ignore:
Timestamp:
Jun 26, 2012 1:23:26 PM (12 years ago)
Author:
tomz@codeaurora.org
Message:

ietestcenter/css3/valuesandunits/units-000.htm asserts
https://bugs.webkit.org/show_bug.cgi?id=86176

Patch by Dave Tharp <dtharp@codeaurora.org> on 2012-06-26
Reviewed by Beth Dakin.

Source/WebCore:

Modified computeLengthDouble() to handle vh, vw, and vmin units. Per the spec
(http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) viewport -percentage
lengths are "relative to the size of the initial containing block", which I read to be
the size of the parent element. Since parentStyle was not available in computeLengthDouble,
most of the changes for this patch involved "pushing down" the parentStyle pointer through
the network of computeLength methods and dependencies.

Tests: css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border.html

css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border.html
css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border.html

  • css/CSSCalculationValue.cpp:

(WebCore::CSSCalcValue::computeLengthPx):
(WebCore::CSSCalcPrimitiveValue::toCalcValue):
(WebCore::CSSCalcPrimitiveValue::computeLengthPx):
(WebCore::CSSCalcBinaryOperation::toCalcValue):
(WebCore::CSSCalcBinaryOperation::computeLengthPx):

  • css/CSSCalculationValue.h:

(CSSCalcExpressionNode):
(WebCore::CSSCalcValue::toCalcValue):
(CSSCalcValue):

  • css/CSSGradientValue.cpp:

(WebCore::CSSGradientValue::addStops):
(WebCore::positionFromValue):
(WebCore::CSSGradientValue::computeEndPoint):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::resolveRadius):
(WebCore::CSSRadialGradientValue::createGradient):

  • css/CSSGradientValue.h:

(CSSGradientValue):
(CSSRadialGradientValue):

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::computeLength):
(WebCore::CSSPrimitiveValue::computeLengthDouble):

  • css/CSSPrimitiveValue.h:

(CSSPrimitiveValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::convertToLength):

  • css/CSSToStyleMap.cpp:

(WebCore::CSSToStyleMap::parentStyle):
(WebCore):
(WebCore::CSSToStyleMap::mapFillSize):
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
(WebCore::CSSToStyleMap::mapNinePieceImageQuad):

  • css/CSSToStyleMap.h:

(CSSToStyleMap):

  • css/MediaQueryEvaluator.cpp:

(WebCore::computeLength):
(WebCore::device_heightMediaFeatureEval):
(WebCore::device_widthMediaFeatureEval):
(WebCore::heightMediaFeatureEval):
(WebCore::widthMediaFeatureEval):

  • css/SVGCSSStyleSelector.cpp:

(WebCore::StyleResolver::applySVGProperty):

  • css/StyleBuilder.cpp:

(WebCore::ApplyPropertyAuto::applyValue):
(WebCore::ApplyPropertyClip::convertToLength):
(WebCore::ApplyPropertyLength::applyValue):
(WebCore::ApplyPropertyBorderRadius::applyValue):
(WebCore::ApplyPropertyComputeLength::applyValue):
(WebCore::ApplyPropertyFontSize::applyValue):
(WebCore::ApplyPropertyLineHeight::applyValue):
(WebCore::ApplyPropertyPageSize::mmLength):
(WebCore::ApplyPropertyPageSize::inchLength):
(WebCore::ApplyPropertyPageSize::applyValue):
(WebCore::ApplyPropertyVerticalAlign::applyValue):

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::collectMatchingRulesForList):

  • css/StyleResolver.h:

(WebCore::StyleResolver::parentNode):
(StyleResolver):

  • css/WebKitCSSMatrix.cpp:

(WebCore::WebKitCSSMatrix::setMatrixValue):

LayoutTests:

Adding explicit tests for viewport border length tests. Inspired by IE Test center
units-000 test which highlighted that vw, vh, and vmin were not being handled in computeLengthDouble().
Also, adjusting test_expectations and Skipped for units-000, which no longer Asserts with this
patch implemented.

  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border-expected.html: Added.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border.html: Added.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border-expected.html: Added.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border.html: Added.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border-expected.htm: Added.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border.html: Added.
  • ietestcenter/css3/valuesandunits/units-000.htm:
  • platform/chromium/TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/qt/TestExpectations:
Location:
trunk
Files:
6 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121280 r121285  
     12012-06-26  Dave Tharp  <dtharp@codeaurora.org>
     2
     3        ietestcenter/css3/valuesandunits/units-000.htm asserts
     4        https://bugs.webkit.org/show_bug.cgi?id=86176
     5
     6        Reviewed by Beth Dakin.
     7
     8        Adding explicit tests for viewport border length tests. Inspired by IE Test center
     9        units-000 test which highlighted that vw, vh, and vmin were not being handled in computeLengthDouble().
     10        Also, adjusting test_expectations and Skipped for units-000, which no longer Asserts with this
     11        patch implemented.
     12
     13        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border-expected.html: Added.
     14        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border.html: Added.
     15        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border-expected.html: Added.
     16        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border.html: Added.
     17        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border-expected.htm: Added.
     18        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border.html: Added.
     19        * ietestcenter/css3/valuesandunits/units-000.htm:
     20        * platform/chromium/TestExpectations:
     21        * platform/efl/TestExpectations:
     22        * platform/gtk/TestExpectations:
     23        * platform/mac/TestExpectations:
     24        * platform/qt/TestExpectations:
     25
    1262012-06-26  Filip Pizlo  <fpizlo@apple.com>
    227
  • trunk/LayoutTests/ietestcenter/css3/valuesandunits/units-000.htm

    r116658 r121285  
    120120            #div12
    121121            {
    122                 border-right: solid green 100vm;
     122                border-right: solid green 100vmin;
    123123                height: 16px;
    124124                width: 0;
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r121283 r121285  
    34623462BUGWK85212 : ietestcenter/css3/flexbox/flexbox-layout-002.htm = IMAGE
    34633463// IETC CSS units
    3464 BUGWK85308 DEBUG : ietestcenter/css3/valuesandunits/units-000.htm = CRASH
    3465 BUGWK85308 RELEASE : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
     3464BUGWK85308 : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
    34663465BUGWK85310 : ietestcenter/css3/valuesandunits/units-010.htm = IMAGE
    34673466// IETC namespace failures
  • trunk/LayoutTests/platform/efl/TestExpectations

    r121257 r121285  
    578578
    579579// Tests imported in r116658
    580 BUGWK85308 : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE CRASH
     580BUGWK85308 : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
    581581BUGWK85310 : ietestcenter/css3/valuesandunits/units-010.htm = IMAGE
    582582
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r121252 r121285  
    356356BUGWK86443 : plugins/npruntime/delete-plugin-within-getProperty.html = CRASH
    357357BUGWK86443 : plugins/npruntime/delete-plugin-within-invoke.html = CRASH
    358 
    359 BUGWK86176 DEBUG : ietestcenter/css3/valuesandunits/units-000.htm = CRASH
    360358
    361359BUGWK89188 RELEASE : storage/websql/quota-tracking.html = CRASH PASS
     
    11721170BUGWK86061 : http/tests/security/referrer-policy-redirect-link.html = TEXT
    11731171
    1174 BUGWK85308 RELEASE : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
     1172// IETC Units test failures
     1173BUGWK85308 : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
    11751174BUGWK85310 : ietestcenter/css3/valuesandunits/units-010.htm = IMAGE
    11761175
  • trunk/LayoutTests/platform/mac/TestExpectations

    r121182 r121285  
    244244BUGWK85689 SKIP : fast/animation/request-animation-frame-disabled.html = TEXT
    245245
    246 // Hits assert https://bugs.webkit.org/show_bug.cgi?id=86208
    247 BUGWK85308 SKIP : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
     246// IETC units test failures
     247BUGWK85308 : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
    248248BUGWK85310 : ietestcenter/css3/valuesandunits/units-010.htm = IMAGE
    249249
  • trunk/LayoutTests/platform/qt/TestExpectations

    r121182 r121285  
    6060BUGWK85689 SKIP : fast/animation/request-animation-frame-disabled.html = TEXT
    6161
    62 // ietestcenter/css3/valuesandunits/units-000.htm asserts
    63 // https://bugs.webkit.org/show_bug.cgi?id=86176
    64 BUGWK85308 SKIP : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
     62// IETC units test failures
     63BUGWK85308 : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
    6564BUGWK85310 : ietestcenter/css3/valuesandunits/units-010.htm = IMAGE
    6665
  • trunk/Source/WebCore/ChangeLog

    r121284 r121285  
     12012-06-26  Dave Tharp  <dtharp@codeaurora.org>
     2
     3        ietestcenter/css3/valuesandunits/units-000.htm asserts
     4        https://bugs.webkit.org/show_bug.cgi?id=86176
     5
     6        Reviewed by Beth Dakin.
     7
     8        Modified computeLengthDouble() to handle vh, vw, and vmin units. Per the spec
     9        (http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) viewport -percentage
     10        lengths are "relative to the size of the initial containing block", which I read to be
     11        the size of the parent element. Since parentStyle was not available in computeLengthDouble,
     12        most of the changes for this patch involved "pushing down" the parentStyle pointer through
     13        the network of computeLength methods and dependencies.
     14
     15        Tests: css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border.html
     16               css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border.html
     17               css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border.html
     18
     19        * css/CSSCalculationValue.cpp:
     20        (WebCore::CSSCalcValue::computeLengthPx):
     21        (WebCore::CSSCalcPrimitiveValue::toCalcValue):
     22        (WebCore::CSSCalcPrimitiveValue::computeLengthPx):
     23        (WebCore::CSSCalcBinaryOperation::toCalcValue):
     24        (WebCore::CSSCalcBinaryOperation::computeLengthPx):
     25        * css/CSSCalculationValue.h:
     26        (CSSCalcExpressionNode):
     27        (WebCore::CSSCalcValue::toCalcValue):
     28        (CSSCalcValue):
     29        * css/CSSGradientValue.cpp:
     30        (WebCore::CSSGradientValue::addStops):
     31        (WebCore::positionFromValue):
     32        (WebCore::CSSGradientValue::computeEndPoint):
     33        (WebCore::CSSLinearGradientValue::createGradient):
     34        (WebCore::CSSRadialGradientValue::resolveRadius):
     35        (WebCore::CSSRadialGradientValue::createGradient):
     36        * css/CSSGradientValue.h:
     37        (CSSGradientValue):
     38        (CSSRadialGradientValue):
     39        * css/CSSPrimitiveValue.cpp:
     40        (WebCore::CSSPrimitiveValue::computeLength):
     41        (WebCore::CSSPrimitiveValue::computeLengthDouble):
     42        * css/CSSPrimitiveValue.h:
     43        (CSSPrimitiveValue):
     44        * css/CSSPrimitiveValueMappings.h:
     45        (WebCore::CSSPrimitiveValue::convertToLength):
     46        * css/CSSToStyleMap.cpp:
     47        (WebCore::CSSToStyleMap::parentStyle):
     48        (WebCore):
     49        (WebCore::CSSToStyleMap::mapFillSize):
     50        (WebCore::CSSToStyleMap::mapFillXPosition):
     51        (WebCore::CSSToStyleMap::mapFillYPosition):
     52        (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
     53        * css/CSSToStyleMap.h:
     54        (CSSToStyleMap):
     55        * css/MediaQueryEvaluator.cpp:
     56        (WebCore::computeLength):
     57        (WebCore::device_heightMediaFeatureEval):
     58        (WebCore::device_widthMediaFeatureEval):
     59        (WebCore::heightMediaFeatureEval):
     60        (WebCore::widthMediaFeatureEval):
     61        * css/SVGCSSStyleSelector.cpp:
     62        (WebCore::StyleResolver::applySVGProperty):
     63        * css/StyleBuilder.cpp:
     64        (WebCore::ApplyPropertyAuto::applyValue):
     65        (WebCore::ApplyPropertyClip::convertToLength):
     66        (WebCore::ApplyPropertyLength::applyValue):
     67        (WebCore::ApplyPropertyBorderRadius::applyValue):
     68        (WebCore::ApplyPropertyComputeLength::applyValue):
     69        (WebCore::ApplyPropertyFontSize::applyValue):
     70        (WebCore::ApplyPropertyLineHeight::applyValue):
     71        (WebCore::ApplyPropertyPageSize::mmLength):
     72        (WebCore::ApplyPropertyPageSize::inchLength):
     73        (WebCore::ApplyPropertyPageSize::applyValue):
     74        (WebCore::ApplyPropertyVerticalAlign::applyValue):
     75        * css/StyleResolver.cpp:
     76        (WebCore::StyleResolver::collectMatchingRulesForList):
     77        * css/StyleResolver.h:
     78        (WebCore::StyleResolver::parentNode):
     79        (StyleResolver):
     80        * css/WebKitCSSMatrix.cpp:
     81        (WebCore::WebKitCSSMatrix::setMatrixValue):
     82
    1832012-06-25  James Robinson  <jamesr@chromium.org>
    284
  • trunk/Source/WebCore/css/CSSCalculationValue.cpp

    r118900 r121285  
    9898}
    9999
    100 double CSSCalcValue::computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
    101 {
    102     return clampToPermittedRange(m_expression->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize));
     100double CSSCalcValue::computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier, bool computingFontSize) const
     101{
     102    return clampToPermittedRange(m_expression->computeLengthPx(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize));
    103103}
    104104   
     
    125125    }
    126126
    127     virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, double zoom) const
     127    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double zoom) const
    128128    {
    129129        switch (m_category) {
     
    131131            return adoptPtr(new CalcExpressionNumber(m_value->getFloatValue()));
    132132        case CalcLength:
    133             return adoptPtr(new CalcExpressionNumber(m_value->computeLength<float>(style, rootStyle, zoom)));
     133            return adoptPtr(new CalcExpressionNumber(m_value->computeLength<float>(style, rootStyle, parentStyle, zoom)));
    134134        case CalcPercent:
    135135        case CalcPercentLength:
    136             return adoptPtr(new CalcExpressionLength(StyleResolver::convertToFloatLength(m_value.get(), style, rootStyle, zoom)));
     136            return adoptPtr(new CalcExpressionLength(StyleResolver::convertToFloatLength(m_value.get(), style, rootStyle, parentStyle, zoom)));
    137137        // Only types that could be part of a Length expression can be converted
    138138        // to a CalcExpressionNode. CalcPercentNumber makes no sense as a Length.
     
    160160    }
    161161   
    162     virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
     162    virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier, bool computingFontSize) const
    163163    {
    164164        switch (m_category) {
    165165        case CalcLength:
    166             return m_value->computeLength<double>(currentStyle, rootStyle, multiplier, computingFontSize);
     166            return m_value->computeLength<double>(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize);
    167167        case CalcPercent:
    168168        case CalcNumber:
     
    238238    }
    239239
    240     virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, double zoom) const
    241     {
    242         OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(style, rootStyle, zoom));
     240    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double zoom) const
     241    {
     242        OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(style, rootStyle, parentStyle, zoom));
    243243        if (!left)
    244244            return nullptr;
    245         OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(style, rootStyle, zoom));
     245        OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(style, rootStyle, parentStyle, zoom));
    246246        if (!right)
    247247            return nullptr;
     
    254254    }
    255255   
    256     virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
    257     {
    258         const double leftValue = m_leftSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);
    259         const double rightValue = m_rightSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);
     256    virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier, bool computingFontSize) const
     257    {
     258        const double leftValue = m_leftSide->computeLengthPx(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize);
     259        const double rightValue = m_rightSide->computeLengthPx(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize);
    260260        return evaluate(leftValue, rightValue);
    261261    }
  • trunk/Source/WebCore/css/CSSCalculationValue.h

    r118900 r121285  
    6161    virtual ~CSSCalcExpressionNode() = 0;
    6262    virtual bool isZero() const = 0;
    63     virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle*, RenderStyle* rootStyle, double zoom = 1.0) const = 0;   
     63    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle*, RenderStyle* rootStyle, RenderStyle* parentStyle, double zoom = 1.0) const = 0;
    6464    virtual double doubleValue() const = 0;
    65     virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const = 0;
     65    virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier = 1.0, bool computingFontSize = false) const = 0;
    6666    virtual String customCssText() const = 0;
    6767   
     
    8585    static PassRefPtr<CSSCalcValue> create(CalculationValue*);
    8686
    87     PassRefPtr<CalculationValue> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, double zoom = 1.0) const
     87    PassRefPtr<CalculationValue> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double zoom = 1.0) const
    8888    {
    89         return CalculationValue::create(m_expression->toCalcValue(style, rootStyle, zoom), m_nonNegative ? CalculationRangeNonNegative : CalculationRangeAll);
     89        return CalculationValue::create(m_expression->toCalcValue(style, rootStyle, parentStyle, zoom), m_nonNegative ? CalculationRangeNonNegative : CalculationRangeAll);
    9090    }
    9191    CalculationCategory category() const { return m_expression->category(); }
     
    9393    double doubleValue() const;
    9494    bool isNegative() const { return m_expression->doubleValue() < 0; }
    95     double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const;
     95    double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier = 1.0, bool computingFontSize = false) const;
    9696       
    9797    String customCssText() const;
  • trunk/Source/WebCore/css/CSSGradientValue.cpp

    r115215 r121285  
    106106};
    107107
    108 void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, RenderStyle* rootStyle, float maxLengthForRepeat)
     108void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, RenderStyle* rootStyle, RenderStyle* parentStyle, float maxLengthForRepeat)
    109109{
    110110    RenderStyle* style = renderer->style();
     
    161161                float length;
    162162                if (stop.m_position->isLength())
    163                     length = stop.m_position->computeLength<float>(style, rootStyle, style->effectiveZoom());
     163                    length = stop.m_position->computeLength<float>(style, rootStyle, parentStyle, style->effectiveZoom());
    164164                else
    165                     length = stop.m_position->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(gradientLength);
     165                    length = stop.m_position->cssCalcValue()->toCalcValue(style, rootStyle, parentStyle, style->effectiveZoom())->evaluate(gradientLength);
    166166                stops[i].offset = (gradientLength > 0) ? length / gradientLength : 0;
    167167            } else {
     
    364364}
    365365
    366 static float positionFromValue(CSSPrimitiveValue* value, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size, bool isHorizontal)
     366static float positionFromValue(CSSPrimitiveValue* value, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, const IntSize& size, bool isHorizontal)
    367367{
    368368    float zoomFactor = style->effectiveZoom();
     
    376376
    377377    if (value->isCalculatedPercentageWithLength())
    378         return value->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(edgeDistance);
     378        return value->cssCalcValue()->toCalcValue(style, rootStyle, parentStyle, style->effectiveZoom())->evaluate(edgeDistance);
    379379
    380380    switch (value->getIdent()) {
     
    393393    }
    394394
    395     return value->computeLength<float>(style, rootStyle, zoomFactor);
    396 }
    397 
    398 FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* first, CSSPrimitiveValue* second, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size)
     395    return value->computeLength<float>(style, rootStyle, parentStyle, zoomFactor);
     396}
     397
     398FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* first, CSSPrimitiveValue* second, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, const IntSize& size)
    399399{
    400400    FloatPoint result;
    401401
    402402    if (first)
    403         result.setX(positionFromValue(first, style, rootStyle, size, true));
     403        result.setX(positionFromValue(first, style, rootStyle, parentStyle, size, true));
    404404
    405405    if (second)
    406         result.setY(positionFromValue(second, style, rootStyle, size, false));
     406        result.setY(positionFromValue(second, style, rootStyle, parentStyle, size, false));
    407407
    408408    return result;
     
    543543
    544544    RenderStyle* rootStyle = renderer->document()->documentElement()->renderStyle();
     545    RenderObject* parent = renderer->parent();
     546    RenderStyle* parentStyle = parent ? parent->style() : 0;
    545547
    546548    FloatPoint firstPoint;
     
    550552        endPointsFromAngle(angle, size, firstPoint, secondPoint);
    551553    } else {
    552         firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
     554        firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, parentStyle, size);
    553555
    554556        if (m_secondX || m_secondY)
    555             secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, size);
     557            secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, parentStyle, size);
    556558        else {
    557559            if (m_firstX)
     
    565567
    566568    // Now add the stops.
    567     addStops(gradient.get(), renderer, rootStyle, 1);
     569    addStops(gradient.get(), renderer, rootStyle, parentStyle, 1);
    568570
    569571    return gradient.release();
     
    639641}
    640642
    641 float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, float* widthOrHeight)
     643float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float* widthOrHeight)
    642644{
    643645    float zoomFactor = style->effectiveZoom();
     
    649651        result = *widthOrHeight * radius->getFloatValue() / 100;
    650652    else
    651         result = radius->computeLength<float>(style, rootStyle, zoomFactor);
     653        result = radius->computeLength<float>(style, rootStyle, parentStyle, zoomFactor);
    652654
    653655    return result;
     
    736738
    737739    RenderStyle* rootStyle = renderer->document()->documentElement()->renderStyle();
    738 
    739     FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
     740    RenderObject* parent = renderer->parent();
     741    RenderStyle* parentStyle = parent ? parent->style() : 0;
     742
     743    FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, parentStyle, size);
    740744    if (!m_firstX)
    741745        firstPoint.setX(size.width() / 2);
     
    743747        firstPoint.setY(size.height() / 2);
    744748
    745     FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, size);
     749    FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, parentStyle, size);
    746750    if (!m_secondX)
    747751        secondPoint.setX(size.width() / 2);
     
    751755    float firstRadius = 0;
    752756    if (m_firstRadius)
    753         firstRadius = resolveRadius(m_firstRadius.get(), renderer->style(), rootStyle);
     757        firstRadius = resolveRadius(m_firstRadius.get(), renderer->style(), rootStyle, parentStyle);
    754758
    755759    float secondRadius = 0;
    756760    float aspectRatio = 1; // width / height.
    757761    if (m_secondRadius)
    758         secondRadius = resolveRadius(m_secondRadius.get(), renderer->style(), rootStyle);
     762        secondRadius = resolveRadius(m_secondRadius.get(), renderer->style(), rootStyle, parentStyle);
    759763    else if (m_endHorizontalSize || m_endVerticalSize) {
    760764        float width = size.width();
    761765        float height = size.height();
    762         secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle, &width);
    763         aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle, &height);
     766        secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle, parentStyle, &width);
     767        aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle, parentStyle, &height);
    764768    } else {
    765769        enum GradientShape { Circle, Ellipse };
     
    862866
    863867    // Now add the stops.
    864     addStops(gradient.get(), renderer, rootStyle, maxExtent);
     868    addStops(gradient.get(), renderer, rootStyle, parentStyle, maxExtent);
    865869
    866870    return gradient.release();
  • trunk/Source/WebCore/css/CSSGradientValue.h

    r100535 r121285  
    8282    }
    8383
    84     void addStops(Gradient*, RenderObject*, RenderStyle* rootStyle, float maxLengthForRepeat = 0);
     84    void addStops(Gradient*, RenderObject*, RenderStyle* rootStyle, RenderStyle* parentStyle, float maxLengthForRepeat = 0);
    8585
    8686    // Resolve points/radii to front end values.
    87     FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, const IntSize&);
     87    FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, RenderStyle* parentStyle, const IntSize&);
    8888
    8989    bool isCacheable() const;
     
    155155
    156156    // Resolve points/radii to front end values.
    157     float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, float* widthOrHeight = 0);
     157    float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, RenderStyle* parentStyle, float* widthOrHeight = 0);
    158158
    159159    // These may be null for non-deprecated gradients.
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r120849 r121285  
    456456}
    457457
    458 template<> int CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
    459 {
    460     return roundForImpreciseConversion<int>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
    461 }
    462 
    463 template<> unsigned CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
    464 {
    465     return roundForImpreciseConversion<unsigned>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
    466 }
    467 
    468 template<> Length CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
     458template<> int CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
     459{
     460    return roundForImpreciseConversion<int>(computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize));
     461}
     462
     463template<> unsigned CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
     464{
     465    return roundForImpreciseConversion<unsigned>(computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize));
     466}
     467
     468template<> Length CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
    469469{
    470470#if ENABLE(SUBPIXEL_LAYOUT)
    471     return Length(static_cast<float>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize)), Fixed);
     471    return Length(static_cast<float>(computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize)), Fixed);
    472472#else
    473     return Length(roundForImpreciseConversion<float>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize)), Fixed);
    474 #endif
    475 }
    476 
    477 template<> short CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
    478 {
    479     return roundForImpreciseConversion<short>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
    480 }
    481 
    482 template<> unsigned short CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
    483 {
    484     return roundForImpreciseConversion<unsigned short>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
    485 }
    486 
    487 template<> float CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
    488 {
    489     return static_cast<float>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
    490 }
    491 
    492 template<> double CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
    493 {
    494     return computeLengthDouble(style, rootStyle, multiplier, computingFontSize);
    495 }
    496 
    497 double CSSPrimitiveValue::computeLengthDouble(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
     473    return Length(roundForImpreciseConversion<float>(computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize)), Fixed);
     474#endif
     475}
     476
     477template<> short CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
     478{
     479    return roundForImpreciseConversion<short>(computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize));
     480}
     481
     482template<> unsigned short CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
     483{
     484    return roundForImpreciseConversion<unsigned short>(computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize));
     485}
     486
     487template<> float CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
     488{
     489    return static_cast<float>(computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize));
     490}
     491
     492template<> double CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
     493{
     494    return computeLengthDouble(style, rootStyle, parentStyle, multiplier, computingFontSize);
     495}
     496
     497double CSSPrimitiveValue::computeLengthDouble(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize)
    498498{
    499499    double factor;
     
    538538            ASSERT_NOT_REACHED();
    539539            return -1.0;
     540        case CSS_VW:
     541            factor = parentStyle ? 0.01 * parentStyle->width().getFloatValue() : 0;
     542            break;
     543        case CSS_VH:
     544            factor = parentStyle ? 0.01 * parentStyle->height().getFloatValue() : 0;
     545            break;
     546        case CSS_VMIN:
     547            factor = 0;
     548            if (parentStyle)
     549                factor = .01 * (float) min(parentStyle->width().getFloatValue(), parentStyle->height().getFloatValue());
     550            break;
    540551        default:
    541552            ASSERT_NOT_REACHED();
     
    546557    if (m_primitiveUnitType == CSS_CALC)
    547558        // The multiplier is passed in as 1.0 here to ensure it is only applied once
    548         computedValue = m_value.calc->computeLengthPx(style, rootStyle, 1.0, computingFontSize);
     559        computedValue = m_value.calc->computeLengthPx(style, rootStyle, parentStyle, 1.0, computingFontSize);
    549560    else
    550561        computedValue = getDoubleValue();
  • trunk/Source/WebCore/css/CSSPrimitiveValue.h

    r120308 r121285  
    239239     * and some tool to calibrate.
    240240     */
    241     template<typename T> T computeLength(RenderStyle* currStyle, RenderStyle* rootStyle, float multiplier = 1.0f, bool computingFontSize = false);
     241    template<typename T> T computeLength(RenderStyle* currStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier = 1.0f, bool computingFontSize = false);
    242242
    243243    // Converts to a Length, mapping various unit types appropriately.
    244     template<int> Length convertToLength(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false);
     244    template<int> Length convertToLength(RenderStyle* currStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier = 1.0, bool computingFontSize = false);
    245245
    246246    // use with care!!!
     
    343343    bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const;
    344344
    345     double computeLengthDouble(RenderStyle* currentStyle, RenderStyle* rootStyle, float multiplier, bool computingFontSize);
     345    double computeLengthDouble(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, float multiplier, bool computingFontSize);
    346346
    347347    union {
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r120735 r121285  
    38003800};
    38013801
    3802 template<int supported> Length CSSPrimitiveValue::convertToLength(RenderStyle* style, RenderStyle* rootStyle, double multiplier, bool computingFontSize)
     3802template<int supported> Length CSSPrimitiveValue::convertToLength(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier, bool computingFontSize)
    38033803{
    38043804    if ((supported & (FixedIntegerConversion | FixedFloatConversion)) && isFontRelativeLength() && (!style || !rootStyle))
    38053805        return Length(Undefined);
    38063806    if ((supported & FixedIntegerConversion) && isLength())
    3807         return computeLength<Length>(style, rootStyle, multiplier, computingFontSize);
     3807        return computeLength<Length>(style, rootStyle, parentStyle, multiplier, computingFontSize);
    38083808    if ((supported & FixedFloatConversion) && isLength())
    3809         return Length(computeLength<double>(style, rootStyle, multiplier), Fixed);
     3809        return Length(computeLength<double>(style, rootStyle, parentStyle, multiplier), Fixed);
    38103810    if ((supported & PercentConversion) && isPercentage())
    38113811        return Length(getDoubleValue(), Percent);
     
    38153815        return Length(Auto);
    38163816    if ((supported & CalculatedConversion) && isCalculated())
    3817         return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier));
     3817        return Length(cssCalcValue()->toCalcValue(style, rootStyle, parentStyle, multiplier));
    38183818    if ((supported & ViewportPercentageConversion) && isViewportPercentageLength())
    38193819        return viewportPercentageLength();
  • trunk/Source/WebCore/css/CSSToStyleMap.cpp

    r121164 r121285  
    5252}
    5353
     54RenderStyle* CSSToStyleMap::parentStyle() const
     55{
     56    return m_resolver->parentStyle();
     57}
     58
    5459bool CSSToStyleMap::useSVGZoomRules() const
    5560{
     
    199204        CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(pair->first());
    200205        CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(pair->second());
    201         firstLength = first->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
    202         secondLength = second->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
     206        firstLength = first->convertToLength<AnyConversion>(style(), rootElementStyle(), parentStyle(), zoomFactor);
     207        secondLength = second->convertToLength<AnyConversion>(style(), rootElementStyle(), parentStyle(),  zoomFactor);
    203208    } else {
    204         firstLength = primitiveValue->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
     209        firstLength = primitiveValue->convertToLength<AnyConversion>(style(), rootElementStyle(), parentStyle(), zoomFactor);
    205210        secondLength = Length();
    206211    }
     
    229234    Length length;
    230235    if (primitiveValue->isLength())
    231         length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);
     236        length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoomFactor);
    232237    else if (primitiveValue->isPercentage())
    233238        length = Length(primitiveValue->getDoubleValue(), Percent);
    234239    else if (primitiveValue->isCalculatedPercentageWithLength())
    235         length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));
     240        length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), parentStyle(), zoomFactor));
    236241    else if (primitiveValue->isViewportPercentageLength())
    237242        length = primitiveValue->viewportPercentageLength();
     
    256261    Length length;
    257262    if (primitiveValue->isLength())
    258         length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);
     263        length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoomFactor);
    259264    else if (primitiveValue->isPercentage())
    260265        length = Length(primitiveValue->getDoubleValue(), Percent);
    261266    else if (primitiveValue->isCalculatedPercentageWithLength())
    262         length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));
     267        length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), parentStyle(), zoomFactor));
    263268    else if (primitiveValue->isViewportPercentageLength())
    264269        length = primitiveValue->viewportPercentageLength();
     
    583588        box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    584589    else if (slices->top()->getIdent() != CSSValueAuto)
    585         box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom);
     590        box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom);
    586591
    587592    if (slices->right()->isNumber())
     
    590595        box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    591596    else if (slices->right()->getIdent() != CSSValueAuto)
    592         box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom);
     597        box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom);
    593598
    594599    if (slices->bottom()->isNumber())
     
    597602        box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    598603    else if (slices->bottom()->getIdent() != CSSValueAuto)
    599         box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom);
     604        box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom);
    600605
    601606    if (slices->left()->isNumber())
     
    604609        box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
    605610    else if (slices->left()->getIdent() != CSSValueAuto)
    606         box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom);
     611        box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom);
    607612
    608613    return box;
  • trunk/Source/WebCore/css/CSSToStyleMap.h

    r121164 r121285  
    7474    RenderStyle* style() const;
    7575    RenderStyle* rootElementStyle() const;
     76    RenderStyle* parentStyle() const;
    7677    bool useSVGZoomRules() const;
    7778
  • trunk/Source/WebCore/css/MediaQueryEvaluator.cpp

    r119045 r121285  
    308308}
    309309
    310 static bool computeLength(CSSValue* value, bool strict, RenderStyle* style, RenderStyle* rootStyle, int& result)
     310static bool computeLength(CSSValue* value, bool strict, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, int& result)
    311311{
    312312    if (!value->isPrimitiveValue())
     
    321321
    322322    if (primitiveValue->isLength()) {
    323         result = primitiveValue->computeLength<int>(style, rootStyle);
     323        result = primitiveValue->computeLength<int>(style, rootStyle, parentStyle);
    324324        return true;
    325325    }
     
    333333        FloatRect sg = screenRect(frame->page()->mainFrame()->view());
    334334        RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
     335        ContainerNode* parentNode = frame->document()->documentElement()->parentNodeForRenderingAndStyle();
     336        RenderStyle* parentStyle = parentNode ? parentNode->renderStyle() : 0;
    335337        int length;
    336338        long height = sg.height();
    337339        InspectorInstrumentation::applyScreenHeightOverride(frame, &height);
    338         return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(static_cast<int>(height), length, op);
     340        return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, parentStyle, length) && compareValue(static_cast<int>(height), length, op);
    339341    }
    340342    // ({,min-,max-}device-height)
     
    348350        FloatRect sg = screenRect(frame->page()->mainFrame()->view());
    349351        RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
     352        ContainerNode* parentNode = frame->document()->documentElement()->parentNodeForRenderingAndStyle();
     353        RenderStyle* parentStyle = parentNode ? parentNode->renderStyle() : 0;
    350354        int length;
    351355        long width = sg.width();
    352356        InspectorInstrumentation::applyScreenWidthOverride(frame, &width);
    353         return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(static_cast<int>(width), length, op);
     357        return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, parentStyle, length) && compareValue(static_cast<int>(width), length, op);
    354358    }
    355359    // ({,min-,max-}device-width)
     
    364368    if (value) {
    365369        RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
     370        ContainerNode* parentNode = frame->document()->documentElement()->parentNodeForRenderingAndStyle();
     371        RenderStyle* parentStyle = parentNode ? parentNode->renderStyle() : 0;
    366372        int length;
    367         return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(view->layoutHeight(), length, op);
     373        return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, parentStyle, length) && compareValue(view->layoutHeight(), length, op);
    368374    }
    369375
     
    377383    if (value) {
    378384        RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
     385        ContainerNode* parentNode = frame->document()->documentElement()->parentNodeForRenderingAndStyle();
     386        RenderStyle* parentStyle = parentNode ? parentNode->renderStyle() : 0;
    379387        int length;
    380         return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(view->layoutWidth(), length, op);
     388        return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, parentStyle, length) && compareValue(view->layoutWidth(), length, op);
    381389    }
    382390
  • trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp

    r115432 r121285  
    560560                return;
    561561            ShadowValue* item = static_cast<ShadowValue*>(firstValue);
    562             IntPoint location(item->x->computeLength<int>(style(), m_rootElementStyle),
    563                               item->y->computeLength<int>(style(), m_rootElementStyle));
    564             int blur = item->blur ? item->blur->computeLength<int>(style(), m_rootElementStyle) : 0;
     562            IntPoint location(item->x->computeLength<int>(style(), m_rootElementStyle, m_parentStyle),
     563                              item->y->computeLength<int>(style(), m_rootElementStyle, m_parentStyle));
     564            int blur = item->blur ? item->blur->computeLength<int>(style(), m_rootElementStyle, m_parentStyle) : 0;
    565565            Color color;
    566566            if (item->color)
  • trunk/Source/WebCore/css/StyleBuilder.cpp

    r121164 r121285  
    3535#include "Document.h"
    3636#include "Element.h"
     37#include "NodeRenderStyle.h"
    3738#include "Pair.h"
    3839#include "Rect.h"
     
    213214            setValue(styleResolver->style(), *primitiveValue);
    214215        else if (valueType == ComputeLength)
    215             setValue(styleResolver->style(), primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
     216            setValue(styleResolver->style(), primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom()));
    216217    }
    217218
     
    223224    static Length convertToLength(StyleResolver* styleResolver, CSSPrimitiveValue* value)
    224225    {
    225         return value->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
     226        return value->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
    226227    }
    227228public:
     
    380381            setValue(styleResolver->style(), Length());
    381382        else if (primitiveValue->isLength()) {
    382             Length length = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
     383            Length length = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
    383384            length.setQuirk(primitiveValue->isQuirkValue());
    384385            setValue(styleResolver->style(), length);
     
    386387            setValue(styleResolver->style(), Length(primitiveValue->getDoubleValue(), Percent));
    387388        else if (primitiveValue->isCalculatedPercentageWithLength())
    388             setValue(styleResolver->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
     389            setValue(styleResolver->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom())));
    389390        else if (primitiveValue->isViewportPercentageLength())
    390391            setValue(styleResolver->style(), primitiveValue->viewportPercentageLength());
     
    446447            return;
    447448        } else
    448             radiusWidth = pair->first()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
     449            radiusWidth = pair->first()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
    449450        if (pair->second()->isPercentage())
    450451            radiusHeight = Length(pair->second()->getDoubleValue(), Percent);
     
    456457            return;
    457458        } else
    458             radiusHeight = pair->second()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
     459            radiusHeight = pair->second()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
    459460        int width = radiusWidth.value();
    460461        int height = radiusHeight.value();
     
    601602        } else if (ident == CSSValueInvalid) {
    602603            float zoom = (svgZoomEnabled && styleResolver->useSVGZoomRules()) ? 1.0f : styleResolver->style()->effectiveZoom();
    603             length = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), zoom);
     604            length = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), zoom);
    604605        } else {
    605606            ASSERT_NOT_REACHED();
     
    739740            fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
    740741                                              || !(primitiveValue->isPercentage() || primitiveValue->isFontRelativeLength()));
     742
     743            RenderStyle* gpStyle = 0;
     744            ContainerNode* parentNode = styleResolver->parentNode();
     745            if (parentNode) {
     746                ContainerNode* gpNode = parentNode->parentNodeForRenderingAndStyle();
     747                gpStyle = gpNode ? gpNode->renderStyle() : 0;
     748            }
     749
    741750            if (primitiveValue->isLength())
    742                 size = primitiveValue->computeLength<float>(styleResolver->parentStyle(), styleResolver->rootElementStyle(), 1.0, true);
     751                size = primitiveValue->computeLength<float>(styleResolver->parentStyle(), styleResolver->rootElementStyle(), gpStyle, 1.0, true);
    743752            else if (primitiveValue->isPercentage())
    744753                size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
    745754            else if (primitiveValue->isCalculatedPercentageWithLength())
    746                 size = primitiveValue->cssCalcValue()->toCalcValue(styleResolver->parentStyle(), styleResolver->rootElementStyle())->evaluate(parentSize);
     755                size = primitiveValue->cssCalcValue()->toCalcValue(styleResolver->parentStyle(), styleResolver->rootElementStyle(), gpStyle)->evaluate(parentSize);
    747756            else if (primitiveValue->isViewportPercentageLength())
    748757                size = valueForLength(primitiveValue->viewportPercentageLength(), 0, styleResolver->document()->renderView());
     
    12011210                    multiplier *= frame->textZoomFactor();
    12021211            }
    1203             lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), multiplier);
     1212            lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), multiplier);
    12041213        } else if (primitiveValue->isPercentage()) {
    12051214            // FIXME: percentage should not be restricted to an integer here.
     
    12231232class ApplyPropertyPageSize {
    12241233private:
    1225     static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLength<Length>(0, 0); }
    1226     static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0); }
     1234    static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLength<Length>(0, 0, 0); }
     1235    static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0, 0); }
    12271236    static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
    12281237    {
     
    13191328                if (!second->isLength())
    13201329                    return;
    1321                 width = first->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
    1322                 height = second->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
     1330                width = first->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle());
     1331                height = second->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle());
    13231332            } else {
    13241333                // <page-size> <orientation>
     
    13381347                // <length>
    13391348                pageSizeType = PAGE_SIZE_RESOLVED;
    1340                 width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
     1349                width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle());
    13411350            } else {
    13421351                switch (primitiveValue->getIdent()) {
     
    15721581            return styleResolver->style()->setVerticalAlign(*primitiveValue);
    15731582
    1574         styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
     1583        styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom()));
    15751584    }
    15761585
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r121229 r121285  
    27582758// this is mostly boring stuff on how to apply a certain rule to the renderstyle...
    27592759
    2760 Length StyleResolver::convertToIntLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier)
    2761 {
    2762     return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined);
    2763 }
    2764 
    2765 Length StyleResolver::convertToFloatLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier)
    2766 {
    2767     return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined);
     2760Length StyleResolver::convertToIntLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier)
     2761{
     2762    return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, parentStyle, multiplier) : Length(Undefined);
     2763}
     2764
     2765Length StyleResolver::convertToFloatLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier)
     2766{
     2767    return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, parentStyle, multiplier) : Length(Undefined);
    27682768}
    27692769
     
    32443244static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, StyleResolver* selector, Length& length)
    32453245{
    3246     Length workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | ViewportPercentageConversion | AutoConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
     3246    Length workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | ViewportPercentageConversion | AutoConversion>(selector->style(), selector->rootElementStyle(), selector->parentStyle(), selector->style()->effectiveZoom());
    32473247    if (workingLength.isUndefined())
    32483248        return false;
     
    37073707                continue;
    37083708            ShadowValue* item = static_cast<ShadowValue*>(currValue);
    3709             int x = item->x->computeLength<int>(style(), m_rootElementStyle, zoomFactor);
    3710             int y = item->y->computeLength<int>(style(), m_rootElementStyle, zoomFactor);
    3711             int blur = item->blur ? item->blur->computeLength<int>(style(), m_rootElementStyle, zoomFactor) : 0;
    3712             int spread = item->spread ? item->spread->computeLength<int>(style(), m_rootElementStyle, zoomFactor) : 0;
     3709            int x = item->x->computeLength<int>(style(), m_rootElementStyle, m_parentStyle, zoomFactor);
     3710            int y = item->y->computeLength<int>(style(), m_rootElementStyle, m_parentStyle, zoomFactor);
     3711            int blur = item->blur ? item->blur->computeLength<int>(style(), m_rootElementStyle, m_parentStyle, zoomFactor) : 0;
     3712            int spread = item->spread ? item->spread->computeLength<int>(style(), m_rootElementStyle, m_parentStyle, zoomFactor) : 0;
    37133713            ShadowStyle shadowStyle = item->style && item->style->getIdent() == CSSValueInset ? Inset : Normal;
    37143714            Color color;
     
    37403740        reflection->setDirection(reflectValue->direction());
    37413741        if (reflectValue->offset())
    3742             reflection->setOffset(reflectValue->offset()->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(style(), m_rootElementStyle, zoomFactor));
     3742            reflection->setOffset(reflectValue->offset()->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(style(), m_rootElementStyle, m_parentStyle, zoomFactor));
    37433743        NinePieceImage mask;
    37443744        mask.setMaskDefaults();
     
    38223822            }
    38233823        } else {
    3824             Length marqueeLength = convertToIntLength(primitiveValue, style(), m_rootElementStyle);
     3824            Length marqueeLength = convertToIntLength(primitiveValue, style(), m_rootElementStyle, m_parentStyle);
    38253825            if (!marqueeLength.isUndefined())
    38263826                m_style->setMarqueeIncrement(marqueeLength);
     
    38683868        DashboardRegion* first = region;
    38693869        while (region) {
    3870             Length top = convertToIntLength(region->top(), style(), m_rootElementStyle);
    3871             Length right = convertToIntLength(region->right(), style(), m_rootElementStyle);
    3872             Length bottom = convertToIntLength(region->bottom(), style(), m_rootElementStyle);
    3873             Length left = convertToIntLength(region->left(), style(), m_rootElementStyle);
     3870            Length top = convertToIntLength(region->top(), style(), m_rootElementStyle, m_parentStyle);
     3871            Length right = convertToIntLength(region->right(), style(), m_rootElementStyle, m_parentStyle);
     3872            Length bottom = convertToIntLength(region->bottom(), style(), m_rootElementStyle, m_parentStyle);
     3873            Length left = convertToIntLength(region->left(), style(), m_rootElementStyle, m_parentStyle);
    38743874
    38753875            if (top.isUndefined())
     
    39063906            else if (primitiveValue->getIdent() == CSSValueThick)
    39073907                result *= 5;
    3908             width = CSSPrimitiveValue::create(result, CSSPrimitiveValue::CSS_EMS)->computeLength<float>(style(), m_rootElementStyle, zoomFactor);
     3908            width = CSSPrimitiveValue::create(result, CSSPrimitiveValue::CSS_EMS)->computeLength<float>(style(), m_rootElementStyle, m_parentStyle, zoomFactor);
    39093909            break;
    39103910        }
    39113911        default:
    3912             width = primitiveValue->computeLength<float>(style(), m_rootElementStyle, zoomFactor);
     3912            width = primitiveValue->computeLength<float>(style(), m_rootElementStyle, m_parentStyle, zoomFactor);
    39133913            break;
    39143914        }
     
    39193919        HANDLE_INHERIT_AND_INITIAL(transform, Transform);
    39203920        TransformOperations operations;
    3921         createTransformOperations(value, style(), m_rootElementStyle, operations);
     3921        createTransformOperations(value, style(), m_rootElementStyle, m_parentStyle, operations);
    39223922        m_style->setTransform(operations);
    39233923        return;
     
    39363936        float perspectiveValue;
    39373937        if (primitiveValue->isLength())
    3938             perspectiveValue = primitiveValue->computeLength<float>(style(), m_rootElementStyle, zoomFactor);
     3938            perspectiveValue = primitiveValue->computeLength<float>(style(), m_rootElementStyle, m_parentStyle, zoomFactor);
    39393939        else if (primitiveValue->isNumber()) {
    39403940            // For backward compatibility, treat valueless numbers as px.
    3941             perspectiveValue = CSSPrimitiveValue::create(primitiveValue->getDoubleValue(), CSSPrimitiveValue::CSS_PX)->computeLength<float>(style(), m_rootElementStyle, zoomFactor);
     3941            perspectiveValue = CSSPrimitiveValue::create(primitiveValue->getDoubleValue(), CSSPrimitiveValue::CSS_PX)->computeLength<float>(style(), m_rootElementStyle, m_parentStyle, zoomFactor);
    39423942        } else
    39433943            return;
     
    48154815}
    48164816
    4817 bool StyleResolver::createTransformOperations(CSSValue* inValue, RenderStyle* style, RenderStyle* rootStyle, TransformOperations& outOperations)
     4817bool StyleResolver::createTransformOperations(CSSValue* inValue, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, TransformOperations& outOperations)
    48184818{
    48194819    if (!inValue || !inValue->isValueList()) {
     
    48994899            Length ty = Length(0, Fixed);
    49004900            if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
    4901                 ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
     4901                ty = convertToFloatLength(firstValue, style, rootStyle, parentStyle, zoomFactor);
    49024902            else {
    4903                 tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
     4903                tx = convertToFloatLength(firstValue, style, rootStyle, parentStyle, zoomFactor);
    49044904                if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
    49054905                    if (transformValue->length() > 1) {
    49064906                        CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
    4907                         ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
     4907                        ty = convertToFloatLength(secondValue, style, rootStyle, parentStyle, zoomFactor);
    49084908                    }
    49094909                }
     
    49224922            Length tz = Length(0, Fixed);
    49234923            if (transformValue->operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
    4924                 tz = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
     4924                tz = convertToFloatLength(firstValue, style, rootStyle, parentStyle, zoomFactor);
    49254925            else if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
    4926                 ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
     4926                ty = convertToFloatLength(firstValue, style, rootStyle, parentStyle, zoomFactor);
    49274927            else {
    4928                 tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
     4928                tx = convertToFloatLength(firstValue, style, rootStyle, parentStyle, zoomFactor);
    49294929                if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
    49304930                    if (transformValue->length() > 2) {
    49314931                        CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));
    4932                         tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor);
     4932                        tz = convertToFloatLength(thirdValue, style, rootStyle, parentStyle, zoomFactor);
    49334933                    }
    49344934                    if (transformValue->length() > 1) {
    49354935                        CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
    4936                         ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
     4936                        ty = convertToFloatLength(secondValue, style, rootStyle, parentStyle, zoomFactor);
    49374937                    }
    49384938                }
     
    50375037            Length p = Length(0, Fixed);
    50385038            if (firstValue->isLength())
    5039                 p = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
     5039                p = convertToFloatLength(firstValue, style, rootStyle, parentStyle, zoomFactor);
    50405040            else {
    50415041                // This is a quirk that should go away when 3d transforms are finalized.
     
    54015401            Length stdDeviation = Length(0, Fixed);
    54025402            if (filterValue->length() >= 1)
    5403                 stdDeviation = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
     5403                stdDeviation = convertToFloatLength(firstValue, style, rootStyle, parentStyle(), zoomFactor);
    54045404            if (stdDeviation.isUndefined())
    54055405                return false;
     
    54175417
    54185418            ShadowValue* item = static_cast<ShadowValue*>(cssValue);
    5419             IntPoint location(item->x->computeLength<int>(style, rootStyle, zoomFactor),
    5420                               item->y->computeLength<int>(style, rootStyle, zoomFactor));
    5421             int blur = item->blur ? item->blur->computeLength<int>(style, rootStyle, zoomFactor) : 0;
     5419            IntPoint location(item->x->computeLength<int>(style, rootStyle, m_parentStyle, zoomFactor),
     5420                              item->y->computeLength<int>(style, rootStyle, m_parentStyle, zoomFactor));
     5421            int blur = item->blur ? item->blur->computeLength<int>(style, rootStyle, m_parentStyle, zoomFactor) : 0;
    54225422            Color color;
    54235423            if (item->color)
  • trunk/Source/WebCore/css/StyleResolver.h

    r121164 r121285  
    157157    void setTextSizeAdjust(bool b) { m_fontDirty |= style()->setTextSizeAdjust(b); }
    158158    bool hasParentNode() const { return m_parentNode; }
    159    
     159    ContainerNode* parentNode() const { return m_parentNode; }
     160
    160161    void appendAuthorStylesheets(unsigned firstNew, const Vector<RefPtr<StyleSheet> >&);
    161162   
     
    245246    bool usesLinkRules() const { return m_features.usesLinkRules; }
    246247
    247     static bool createTransformOperations(CSSValue* inValue, RenderStyle* inStyle, RenderStyle* rootStyle, TransformOperations& outOperations);
     248    static bool createTransformOperations(CSSValue* inValue, RenderStyle* inStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, TransformOperations& outOperations);
    248249   
    249250    void invalidateMatchedPropertiesCache();
     
    410411    bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisitedLinkStyle; }
    411412
    412     static Length convertToIntLength(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, double multiplier = 1);
    413     static Length convertToFloatLength(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, double multiplier = 1);
     413    static Length convertToIntLength(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier = 1);
     414    static Length convertToFloatLength(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier = 1);
    414415
    415416    CSSToStyleMap* styleMap() { return &m_styleMap; }
  • trunk/Source/WebCore/css/WebKitCSSMatrix.cpp

    r115972 r121285  
    6767
    6868        TransformOperations operations;
    69         if (!StyleResolver::createTransformOperations(value.get(), 0, 0, operations)) {
     69        if (!StyleResolver::createTransformOperations(value.get(), 0, 0, 0, operations)) {
    7070            ec = SYNTAX_ERR;
    7171            return;
Note: See TracChangeset for help on using the changeset viewer.