diff options
Diffstat (limited to 'Source/WebCore/css/CSSComputedStyleDeclaration.cpp')
-rw-r--r-- | Source/WebCore/css/CSSComputedStyleDeclaration.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp index fe10eb0f6..0708c23ba 100644 --- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -614,7 +614,7 @@ static PassRefPtr<CSSValue> getPositionOffsetValue(RenderStyle* style, CSSProper return 0; } - if (style->position() == AbsolutePosition || style->position() == FixedPosition) { + if (style->hasOutOfFlowPosition()) { if (l.type() == WebCore::Fixed) return zoomAdjustedPixelValue(l.value(), style); else if (l.isViewportPercentage()) @@ -622,7 +622,7 @@ static PassRefPtr<CSSValue> getPositionOffsetValue(RenderStyle* style, CSSProper return cssValuePool().createValue(l); } - if (style->position() == RelativePosition || style->position() == StickyPosition) { + if (style->hasInFlowPosition()) { // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined. // In other words if left is auto and right is not auto, then left's computed value is negative right(). // So we should get the opposite length unit and see if it is auto. @@ -715,21 +715,14 @@ static LayoutRect sizingBox(RenderObject* renderer) return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box->computedCSSContentBoxRect(); } -static IntRect pixelSnappedSizingBox(RenderObject* renderer) -{ - if (!renderer->isBox()) - return IntRect(); - - RenderBox* box = toRenderBox(renderer); - return box->style()->boxSizing() == BORDER_BOX ? box->pixelSnappedBorderBoxRect() : pixelSnappedIntRect(box->computedCSSContentBoxRect()); -} - static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const RenderStyle* style) { - if (!renderer || style->transform().operations().isEmpty()) + if (!renderer || !renderer->hasTransform() || !style->hasTransform()) return cssValuePool().createIdentifierValue(CSSValueNone); - IntRect box = pixelSnappedSizingBox(renderer); + IntRect box; + if (renderer->isBox()) + box = pixelSnappedIntRect(toRenderBox(renderer)->borderBoxRect()); TransformationMatrix transform; style->applyTransform(transform, box.size(), RenderStyle::ExcludeTransformOrigin); @@ -2327,7 +2320,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert case CSSPropertyWebkitTransformOrigin: { RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (renderer) { - LayoutRect box = sizingBox(renderer); + LayoutRect box; + if (renderer->isBox()) + box = toRenderBox(renderer)->borderBoxRect(); + RenderView* renderView = m_node->document()->renderView(); list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginX(), box.width(), renderView), style.get())); list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginY(), box.height(), renderView), style.get())); |