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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 381473002: Use reference for FillLayer if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/rendering/style/RenderStyle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index 624ec2af859cc90866a489c67ae2651e63a91db1..1da5456a9b73bbdaf80f3d5d4a7a4469ffa26ce3 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -1012,14 +1012,14 @@ RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
return roundedRect;
}
-static bool allLayersAreFixed(const FillLayer* layer)
+static bool allLayersAreFixed(const FillLayer& layer)
{
- bool allFixed = true;
-
- for (const FillLayer* currLayer = layer; currLayer; currLayer = currLayer->next())
- allFixed &= (currLayer->image() && currLayer->attachment() == FixedBackgroundAttachment);
+ for (const FillLayer* currLayer = &layer; currLayer; currLayer = currLayer->next()) {
+ if (!currLayer->image() || currLayer->attachment() != FixedBackgroundAttachment)
+ return false;
+ }
- return layer && allFixed;
+ return true;
}
bool RenderStyle::hasEntirelyFixedBackground() const
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698