Chromium Code Reviews| Index: Source/core/css/CSSComputedStyleDeclaration.cpp |
| diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp |
| index 9604eb68cd29534f3c740247bb6ffb2cb33331a2..003f5f5b3fe356634f74f818906104bb15cec345 100644 |
| --- a/Source/core/css/CSSComputedStyleDeclaration.cpp |
| +++ b/Source/core/css/CSSComputedStyleDeclaration.cpp |
| @@ -443,7 +443,7 @@ static void logUnimplementedPropertyID(CSSPropertyID propertyID) |
| WTF_LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", getPropertyName(propertyID)); |
| } |
| -static bool isLayoutDependent(CSSPropertyID propertyID, const ComputedStyle* style, LayoutObject* renderer) |
| +static bool isLayoutDependent(CSSPropertyID propertyID, const ComputedStyle* style, LayoutObject* layoutObject) |
| { |
| // Some properties only depend on layout in certain conditions which |
| // are specified in the main switch statement below. So we can avoid |
| @@ -472,25 +472,25 @@ static bool isLayoutDependent(CSSPropertyID propertyID, const ComputedStyle* sty |
| case CSSPropertyRy: |
| return true; |
| case CSSPropertyMargin: |
| - return renderer && renderer->isBox() && (!style || !style->marginBottom().isFixed() || !style->marginTop().isFixed() || !style->marginLeft().isFixed() || !style->marginRight().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->marginBottom().isFixed() || !style->marginTop().isFixed() || !style->marginLeft().isFixed() || !style->marginRight().isFixed()); |
|
leviw_travelin_and_unemployed
2015/04/27 18:27:09
Nit: this may actually be wrap-worthy :p
dsinclair
2015/04/27 19:10:45
Done.
|
| case CSSPropertyMarginLeft: |
| - return renderer && renderer->isBox() && (!style || !style->marginLeft().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->marginLeft().isFixed()); |
| case CSSPropertyMarginRight: |
| - return renderer && renderer->isBox() && (!style || !style->marginRight().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->marginRight().isFixed()); |
| case CSSPropertyMarginTop: |
| - return renderer && renderer->isBox() && (!style || !style->marginTop().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->marginTop().isFixed()); |
| case CSSPropertyMarginBottom: |
| - return renderer && renderer->isBox() && (!style || !style->marginBottom().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->marginBottom().isFixed()); |
| case CSSPropertyPadding: |
| - return renderer && renderer->isBox() && (!style || !style->paddingBottom().isFixed() || !style->paddingTop().isFixed() || !style->paddingLeft().isFixed() || !style->paddingRight().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->paddingBottom().isFixed() || !style->paddingTop().isFixed() || !style->paddingLeft().isFixed() || !style->paddingRight().isFixed()); |
|
leviw_travelin_and_unemployed
2015/04/27 18:27:09
Ditto.
dsinclair
2015/04/27 19:10:45
Done.
|
| case CSSPropertyPaddingBottom: |
| - return renderer && renderer->isBox() && (!style || !style->paddingBottom().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->paddingBottom().isFixed()); |
| case CSSPropertyPaddingLeft: |
| - return renderer && renderer->isBox() && (!style || !style->paddingLeft().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->paddingLeft().isFixed()); |
| case CSSPropertyPaddingRight: |
| - return renderer && renderer->isBox() && (!style || !style->paddingRight().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->paddingRight().isFixed()); |
| case CSSPropertyPaddingTop: |
| - return renderer && renderer->isBox() && (!style || !style->paddingTop().isFixed()); |
| + return layoutObject && layoutObject->isBox() && (!style || !style->paddingTop().isFixed()); |
| default: |
| return false; |
| } |
| @@ -519,7 +519,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu |
| Node* styledNode = this->styledNode(); |
| if (!styledNode) |
| return nullptr; |
| - LayoutObject* renderer = styledNode->layoutObject(); |
| + LayoutObject* layoutObject = styledNode->layoutObject(); |
| const ComputedStyle* style; |
| Document& document = styledNode->document(); |
| @@ -532,11 +532,11 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu |
| // The style recalc could have caused the styled node to be discarded or replaced |
| // if it was a PseudoElement so we need to update it. |
| styledNode = this->styledNode(); |
| - renderer = styledNode->layoutObject(); |
| + layoutObject = styledNode->layoutObject(); |
| style = computeComputedStyle(); |
| - bool forceFullLayout = isLayoutDependent(propertyID, style, renderer) |
| + bool forceFullLayout = isLayoutDependent(propertyID, style, layoutObject) |
| || styledNode->isInShadowTree() |
| || (document.ownerElement() && document.ensureStyleResolver().hasViewportDependentMediaQueries()); |
| @@ -544,13 +544,13 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu |
| document.updateLayoutIgnorePendingStylesheets(); |
| styledNode = this->styledNode(); |
| style = computeComputedStyle(); |
| - renderer = styledNode->layoutObject(); |
| + layoutObject = styledNode->layoutObject(); |
| } |
| if (!style) |
| return nullptr; |
| - RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(propertyID, *style, renderer, styledNode, m_allowVisitedStyle); |
| + RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(propertyID, *style, layoutObject, styledNode, m_allowVisitedStyle); |
| if (value) |
| return value; |