| Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
|
| index 70c3094cd1c6be3e3743d3aa485618808489d7c7..db333c1135c439eec292d09dff3002b7d9bac00f 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
|
| @@ -690,93 +690,6 @@ LayoutUnit LayoutBoxModelObject::computedCSSPadding(const Length& padding) const
|
| return minimumValueForLength(padding, w);
|
| }
|
|
|
| -static inline LayoutUnit resolveWidthForRatio(LayoutUnit height, const FloatSize& intrinsicRatio)
|
| -{
|
| - return LayoutUnit(height * intrinsicRatio.width() / intrinsicRatio.height());
|
| -}
|
| -
|
| -static inline LayoutUnit resolveHeightForRatio(LayoutUnit width, const FloatSize& intrinsicRatio)
|
| -{
|
| - return LayoutUnit(width * intrinsicRatio.height() / intrinsicRatio.width());
|
| -}
|
| -
|
| -static inline LayoutSize resolveAgainstIntrinsicWidthOrHeightAndRatio(const LayoutSize& size, const FloatSize& intrinsicRatio, LayoutUnit useWidth, LayoutUnit useHeight)
|
| -{
|
| - if (intrinsicRatio.isEmpty()) {
|
| - if (useWidth)
|
| - return LayoutSize(useWidth, size.height());
|
| - return LayoutSize(size.width(), useHeight);
|
| - }
|
| -
|
| - if (useWidth)
|
| - return LayoutSize(useWidth, resolveHeightForRatio(useWidth, intrinsicRatio));
|
| - return LayoutSize(resolveWidthForRatio(useHeight, intrinsicRatio), useHeight);
|
| -}
|
| -
|
| -static inline LayoutSize resolveAgainstIntrinsicRatio(const LayoutSize& size, const FloatSize& intrinsicRatio)
|
| -{
|
| - // Two possible solutions: (size.width(), solutionHeight) or (solutionWidth, size.height())
|
| - // "... must be assumed to be the largest dimensions..." = easiest answer: the rect with the largest surface area.
|
| -
|
| - LayoutUnit solutionWidth = resolveWidthForRatio(size.height(), intrinsicRatio);
|
| - LayoutUnit solutionHeight = resolveHeightForRatio(size.width(), intrinsicRatio);
|
| - if (solutionWidth <= size.width()) {
|
| - if (solutionHeight <= size.height()) {
|
| - // If both solutions fit, choose the one covering the larger area.
|
| - LayoutUnit areaOne = solutionWidth * size.height();
|
| - LayoutUnit areaTwo = size.width() * solutionHeight;
|
| - if (areaOne < areaTwo)
|
| - return LayoutSize(size.width(), solutionHeight);
|
| - return LayoutSize(solutionWidth, size.height());
|
| - }
|
| -
|
| - // Only the first solution fits.
|
| - return LayoutSize(solutionWidth, size.height());
|
| - }
|
| -
|
| - // Only the second solution fits, assert that.
|
| - ASSERT(solutionHeight <= size.height());
|
| - return LayoutSize(size.width(), solutionHeight);
|
| -}
|
| -
|
| -LayoutSize LayoutBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize& positioningAreaSize, ScaleByEffectiveZoomOrNot shouldScaleOrNot) const
|
| -{
|
| - // A generated image without a fixed size, will always return the container size as intrinsic size.
|
| - if (image->isGeneratedImage() && image->usesImageContainerSize())
|
| - return positioningAreaSize;
|
| -
|
| - FloatSize intrinsicSize;
|
| - FloatSize intrinsicRatio;
|
| - image->computeIntrinsicDimensions(this, intrinsicSize, intrinsicRatio);
|
| -
|
| - LayoutSize resolvedSize(intrinsicSize);
|
| - LayoutSize minimumSize(resolvedSize.width() > LayoutUnit() ? LayoutUnit(1) : LayoutUnit(),
|
| - resolvedSize.height() > LayoutUnit() ? LayoutUnit(1) : LayoutUnit());
|
| - if (shouldScaleOrNot == ScaleByEffectiveZoom)
|
| - resolvedSize.scale(style()->effectiveZoom());
|
| - resolvedSize.clampToMinimumSize(minimumSize);
|
| -
|
| - if (!resolvedSize.isEmpty())
|
| - return resolvedSize;
|
| -
|
| - // If the image has one of either an intrinsic width or an intrinsic height:
|
| - // * and an intrinsic aspect ratio, then the missing dimension is calculated from the given dimension and the ratio.
|
| - // * and no intrinsic aspect ratio, then the missing dimension is assumed to be the size of the rectangle that
|
| - // establishes the coordinate system for the 'background-position' property.
|
| - if (resolvedSize.width() > LayoutUnit() || resolvedSize.height() > LayoutUnit())
|
| - return resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedSize.width(), resolvedSize.height());
|
| -
|
| - // If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the
|
| - // largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that
|
| - // establishes the coordinate system for the 'background-position' property.
|
| - if (!intrinsicRatio.isEmpty())
|
| - return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio);
|
| -
|
| - // If the image has no intrinsic ratio either, then the dimensions must be assumed to be the rectangle that
|
| - // establishes the coordinate system for the 'background-position' property.
|
| - return positioningAreaSize;
|
| -}
|
| -
|
| bool LayoutBoxModelObject::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance bleedAvoidance, const InlineFlowBox* inlineFlowBox) const
|
| {
|
| if (bleedAvoidance != BackgroundBleedNone)
|
|
|