| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) |
| 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 LayoutRect LayoutReplaced::replacedContentRect(const LayoutSize* overriddenIntri
nsicSize) const | 220 LayoutRect LayoutReplaced::replacedContentRect(const LayoutSize* overriddenIntri
nsicSize) const |
| 221 { | 221 { |
| 222 LayoutRect contentRect = contentBoxRect(); | 222 LayoutRect contentRect = contentBoxRect(); |
| 223 ObjectFit objectFit = style()->objectFit(); | 223 ObjectFit objectFit = style()->objectFit(); |
| 224 | 224 |
| 225 if (objectFit == ObjectFitFill && style()->objectPosition() == ComputedStyle
::initialObjectPosition()) { | 225 if (objectFit == ObjectFitFill && style()->objectPosition() == ComputedStyle
::initialObjectPosition()) { |
| 226 return contentRect; | 226 return contentRect; |
| 227 } | 227 } |
| 228 | 228 |
| 229 // TODO(davve): intrinsicSize doubles as both intrinsic size and intrinsic r
atio. In the case of |
| 230 // SVG images this isn't correct since they can have intrinsic ratio but no
intrinsic size. In |
| 231 // order to maintain aspect ratio, the intrinsic size for SVG might be faked
from the aspect |
| 232 // ratio, see SVGImage::containerSize(). |
| 229 LayoutSize intrinsicSize = overriddenIntrinsicSize ? *overriddenIntrinsicSiz
e : this->intrinsicSize(); | 233 LayoutSize intrinsicSize = overriddenIntrinsicSize ? *overriddenIntrinsicSiz
e : this->intrinsicSize(); |
| 230 if (!intrinsicSize.width() || !intrinsicSize.height()) | 234 if (!intrinsicSize.width() || !intrinsicSize.height()) |
| 231 return contentRect; | 235 return contentRect; |
| 232 | 236 |
| 233 LayoutRect finalRect = contentRect; | 237 LayoutRect finalRect = contentRect; |
| 234 switch (objectFit) { | 238 switch (objectFit) { |
| 235 case ObjectFitContain: | 239 case ObjectFitContain: |
| 236 case ObjectFitScaleDown: | 240 case ObjectFitScaleDown: |
| 237 case ObjectFitCover: | 241 case ObjectFitCover: |
| 238 finalRect.setSize(finalRect.size().fitToAspectRatio(intrinsicSize, objec
tFit == ObjectFitCover ? AspectRatioFitGrow : AspectRatioFitShrink)); | 242 finalRect.setSize(finalRect.size().fitToAspectRatio(intrinsicSize, objec
tFit == ObjectFitCover ? AspectRatioFitGrow : AspectRatioFitShrink)); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 return LayoutRect(); | 509 return LayoutRect(); |
| 506 | 510 |
| 507 // The selectionRect can project outside of the overflowRect, so take their
union | 511 // The selectionRect can project outside of the overflowRect, so take their
union |
| 508 // for paint invalidation to avoid selection painting glitches. | 512 // for paint invalidation to avoid selection painting glitches. |
| 509 LayoutRect r = isSelected() ? localSelectionRect() : visualOverflowRect(); | 513 LayoutRect r = isSelected() ? localSelectionRect() : visualOverflowRect(); |
| 510 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); | 514 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); |
| 511 return r; | 515 return r; |
| 512 } | 516 } |
| 513 | 517 |
| 514 } | 518 } |
| OLD | NEW |