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/StyleBuilder.cpp

    r121285 r121289  
    3535#include "Document.h"
    3636#include "Element.h"
    37 #include "NodeRenderStyle.h"
    3837#include "Pair.h"
    3938#include "Rect.h"
     
    214213            setValue(styleResolver->style(), *primitiveValue);
    215214        else if (valueType == ComputeLength)
    216             setValue(styleResolver->style(), primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom()));
     215            setValue(styleResolver->style(), primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
    217216    }
    218217
     
    224223    static Length convertToLength(StyleResolver* styleResolver, CSSPrimitiveValue* value)
    225224    {
    226         return value->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
     225        return value->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
    227226    }
    228227public:
     
    381380            setValue(styleResolver->style(), Length());
    382381        else if (primitiveValue->isLength()) {
    383             Length length = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
     382            Length length = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
    384383            length.setQuirk(primitiveValue->isQuirkValue());
    385384            setValue(styleResolver->style(), length);
     
    387386            setValue(styleResolver->style(), Length(primitiveValue->getDoubleValue(), Percent));
    388387        else if (primitiveValue->isCalculatedPercentageWithLength())
    389             setValue(styleResolver->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom())));
     388            setValue(styleResolver->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
    390389        else if (primitiveValue->isViewportPercentageLength())
    391390            setValue(styleResolver->style(), primitiveValue->viewportPercentageLength());
     
    447446            return;
    448447        } else
    449             radiusWidth = pair->first()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
     448            radiusWidth = pair->first()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
    450449        if (pair->second()->isPercentage())
    451450            radiusHeight = Length(pair->second()->getDoubleValue(), Percent);
     
    457456            return;
    458457        } else
    459             radiusHeight = pair->second()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom());
     458            radiusHeight = pair->second()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
    460459        int width = radiusWidth.value();
    461460        int height = radiusHeight.value();
     
    602601        } else if (ident == CSSValueInvalid) {
    603602            float zoom = (svgZoomEnabled && styleResolver->useSVGZoomRules()) ? 1.0f : styleResolver->style()->effectiveZoom();
    604             length = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), zoom);
     603            length = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), zoom);
    605604        } else {
    606605            ASSERT_NOT_REACHED();
     
    740739            fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
    741740                                              || !(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 
    750741            if (primitiveValue->isLength())
    751                 size = primitiveValue->computeLength<float>(styleResolver->parentStyle(), styleResolver->rootElementStyle(), gpStyle, 1.0, true);
     742                size = primitiveValue->computeLength<float>(styleResolver->parentStyle(), styleResolver->rootElementStyle(), 1.0, true);
    752743            else if (primitiveValue->isPercentage())
    753744                size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
    754745            else if (primitiveValue->isCalculatedPercentageWithLength())
    755                 size = primitiveValue->cssCalcValue()->toCalcValue(styleResolver->parentStyle(), styleResolver->rootElementStyle(), gpStyle)->evaluate(parentSize);
     746                size = primitiveValue->cssCalcValue()->toCalcValue(styleResolver->parentStyle(), styleResolver->rootElementStyle())->evaluate(parentSize);
    756747            else if (primitiveValue->isViewportPercentageLength())
    757748                size = valueForLength(primitiveValue->viewportPercentageLength(), 0, styleResolver->document()->renderView());
     
    12101201                    multiplier *= frame->textZoomFactor();
    12111202            }
    1212             lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), multiplier);
     1203            lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), multiplier);
    12131204        } else if (primitiveValue->isPercentage()) {
    12141205            // FIXME: percentage should not be restricted to an integer here.
     
    12321223class ApplyPropertyPageSize {
    12331224private:
    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); }
     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); }
    12361227    static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
    12371228    {
     
    13281319                if (!second->isLength())
    13291320                    return;
    1330                 width = first->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle());
    1331                 height = second->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle());
     1321                width = first->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
     1322                height = second->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
    13321323            } else {
    13331324                // <page-size> <orientation>
     
    13471338                // <length>
    13481339                pageSizeType = PAGE_SIZE_RESOLVED;
    1349                 width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle());
     1340                width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
    13501341            } else {
    13511342                switch (primitiveValue->getIdent()) {
     
    15811572            return styleResolver->style()->setVerticalAlign(*primitiveValue);
    15821573
    1583         styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->parentStyle(), styleResolver->style()->effectiveZoom()));
     1574        styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
    15841575    }
    15851576
Note: See TracChangeset for help on using the changeset viewer.