Ignore:
Timestamp:
Jun 26, 2012, 2:35:55 PM (13 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r121285.
http://trac.webkit.org/changeset/121285
https://bugs.webkit.org/show_bug.cgi?id=90014

"We misinterpreted 'size of the initial containing block'"
(Requested by tomz on #webkit).

Patch by Sheriff Bot <[email protected]> on 2012-06-26

Source/WebCore:

  • 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::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:

(StyleResolver):

  • css/WebKitCSSMatrix.cpp:

(WebCore::WebKitCSSMatrix::setMatrixValue):

LayoutTests:

  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border-expected.html: Removed.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border.html: Removed.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border-expected.html: Removed.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border.html: Removed.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border-expected.htm: Removed.
  • css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border.html: Removed.
  • ietestcenter/css3/valuesandunits/units-000.htm:
  • platform/chromium/TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/qt/TestExpectations:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSGradientValue.cpp

    r121285 r121289  
    106106};
    107107
    108 void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, RenderStyle* rootStyle, RenderStyle* parentStyle, float maxLengthForRepeat)
     108void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, RenderStyle* rootStyle, 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, parentStyle, style->effectiveZoom());
     163                    length = stop.m_position->computeLength<float>(style, rootStyle, style->effectiveZoom());
    164164                else
    165                     length = stop.m_position->cssCalcValue()->toCalcValue(style, rootStyle, parentStyle, style->effectiveZoom())->evaluate(gradientLength);
     165                    length = stop.m_position->cssCalcValue()->toCalcValue(style, rootStyle, 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, RenderStyle* parentStyle, const IntSize& size, bool isHorizontal)
     366static float positionFromValue(CSSPrimitiveValue* value, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size, bool isHorizontal)
    367367{
    368368    float zoomFactor = style->effectiveZoom();
     
    376376
    377377    if (value->isCalculatedPercentageWithLength())
    378         return value->cssCalcValue()->toCalcValue(style, rootStyle, parentStyle, style->effectiveZoom())->evaluate(edgeDistance);
     378        return value->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(edgeDistance);
    379379
    380380    switch (value->getIdent()) {
     
    393393    }
    394394
    395     return value->computeLength<float>(style, rootStyle, parentStyle, zoomFactor);
    396 }
    397 
    398 FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* first, CSSPrimitiveValue* second, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, const IntSize& size)
     395    return value->computeLength<float>(style, rootStyle, zoomFactor);
     396}
     397
     398FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* first, CSSPrimitiveValue* second, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size)
    399399{
    400400    FloatPoint result;
    401401
    402402    if (first)
    403         result.setX(positionFromValue(first, style, rootStyle, parentStyle, size, true));
     403        result.setX(positionFromValue(first, style, rootStyle, size, true));
    404404
    405405    if (second)
    406         result.setY(positionFromValue(second, style, rootStyle, parentStyle, size, false));
     406        result.setY(positionFromValue(second, style, rootStyle, 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;
    547545
    548546    FloatPoint firstPoint;
     
    552550        endPointsFromAngle(angle, size, firstPoint, secondPoint);
    553551    } else {
    554         firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, parentStyle, size);
     552        firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
    555553
    556554        if (m_secondX || m_secondY)
    557             secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, parentStyle, size);
     555            secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, size);
    558556        else {
    559557            if (m_firstX)
     
    567565
    568566    // Now add the stops.
    569     addStops(gradient.get(), renderer, rootStyle, parentStyle, 1);
     567    addStops(gradient.get(), renderer, rootStyle, 1);
    570568
    571569    return gradient.release();
     
    641639}
    642640
    643 float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, float* widthOrHeight)
     641float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, float* widthOrHeight)
    644642{
    645643    float zoomFactor = style->effectiveZoom();
     
    651649        result = *widthOrHeight * radius->getFloatValue() / 100;
    652650    else
    653         result = radius->computeLength<float>(style, rootStyle, parentStyle, zoomFactor);
     651        result = radius->computeLength<float>(style, rootStyle, zoomFactor);
    654652
    655653    return result;
     
    738736
    739737    RenderStyle* rootStyle = renderer->document()->documentElement()->renderStyle();
    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);
     738
     739    FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
    744740    if (!m_firstX)
    745741        firstPoint.setX(size.width() / 2);
     
    747743        firstPoint.setY(size.height() / 2);
    748744
    749     FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, parentStyle, size);
     745    FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, size);
    750746    if (!m_secondX)
    751747        secondPoint.setX(size.width() / 2);
     
    755751    float firstRadius = 0;
    756752    if (m_firstRadius)
    757         firstRadius = resolveRadius(m_firstRadius.get(), renderer->style(), rootStyle, parentStyle);
     753        firstRadius = resolveRadius(m_firstRadius.get(), renderer->style(), rootStyle);
    758754
    759755    float secondRadius = 0;
    760756    float aspectRatio = 1; // width / height.
    761757    if (m_secondRadius)
    762         secondRadius = resolveRadius(m_secondRadius.get(), renderer->style(), rootStyle, parentStyle);
     758        secondRadius = resolveRadius(m_secondRadius.get(), renderer->style(), rootStyle);
    763759    else if (m_endHorizontalSize || m_endVerticalSize) {
    764760        float width = size.width();
    765761        float height = size.height();
    766         secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle, parentStyle, &width);
    767         aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle, parentStyle, &height);
     762        secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle, &width);
     763        aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle, &height);
    768764    } else {
    769765        enum GradientShape { Circle, Ellipse };
     
    866862
    867863    // Now add the stops.
    868     addStops(gradient.get(), renderer, rootStyle, parentStyle, maxExtent);
     864    addStops(gradient.get(), renderer, rootStyle, maxExtent);
    869865
    870866    return gradient.release();
Note: See TracChangeset for help on using the changeset viewer.