Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 1105103003: Update renderer in core/css. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSCanvasValue.cpp ('k') | Source/core/css/CSSCrossfadeValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 9604eb68cd29534f3c740247bb6ffb2cb33331a2..9f274d48e00437736506c032088265b0e9eabe95 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,29 @@ 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());
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());
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 +523,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 +536,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 +548,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;
« no previous file with comments | « Source/core/css/CSSCanvasValue.cpp ('k') | Source/core/css/CSSCrossfadeValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698