OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
7 * Copyright (C) 2015 Google Inc. All rights reserved. | 7 * Copyright (C) 2015 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 case CSSPropertyTop: | 163 case CSSPropertyTop: |
164 offset = style.top(); | 164 offset = style.top(); |
165 break; | 165 break; |
166 case CSSPropertyBottom: | 166 case CSSPropertyBottom: |
167 offset = style.bottom(); | 167 offset = style.bottom(); |
168 break; | 168 break; |
169 default: | 169 default: |
170 return nullptr; | 170 return nullptr; |
171 } | 171 } |
172 | 172 |
173 if (offset.isPercent() && renderer && renderer->isBox()) { | 173 if (offset.isPercent() && renderer && renderer->isBox() && renderer->isPosit
ioned()) { |
174 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope
rtyID == CSSPropertyRight) ? | 174 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope
rtyID == CSSPropertyRight) ? |
175 toLayoutBox(renderer)->containingBlockLogicalWidthForContent() : | 175 toLayoutBox(renderer)->containingBlockLogicalWidthForContent() : |
176 toLayoutBox(renderer)->containingBlockLogicalHeightForContent(Exclud
eMarginBorderPadding); | 176 toLayoutBox(renderer)->containingBlockLogicalHeightForGetComputedSty
le(); |
177 return zoomAdjustedPixelValue(valueForLength(offset, containingBlockSize
), style); | 177 return zoomAdjustedPixelValue(valueForLength(offset, containingBlockSize
), style); |
178 } | 178 } |
179 if (offset.isAuto()) { | 179 if (offset.isAuto()) { |
180 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. | 180 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. |
181 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). | 181 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). |
182 // So we should get the opposite length unit and see if it is auto. | 182 // So we should get the opposite length unit and see if it is auto. |
183 return cssValuePool().createIdentifierValue(CSSValueAuto); | 183 return cssValuePool().createIdentifierValue(CSSValueAuto); |
184 } | 184 } |
185 | 185 |
186 return zoomAdjustedPixelValueForLength(offset, style); | 186 return zoomAdjustedPixelValueForLength(offset, style); |
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2572 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); | 2572 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); |
2573 | 2573 |
2574 case CSSPropertyAll: | 2574 case CSSPropertyAll: |
2575 return nullptr; | 2575 return nullptr; |
2576 } | 2576 } |
2577 ASSERT_NOT_REACHED(); | 2577 ASSERT_NOT_REACHED(); |
2578 return nullptr; | 2578 return nullptr; |
2579 } | 2579 } |
2580 | 2580 |
2581 } | 2581 } |
OLD | NEW |