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

Unified Diff: Source/core/rendering/style/CachedUAStyle.h

Issue 202223002: Avoid copying the CachedUAStyle when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
Index: Source/core/rendering/style/CachedUAStyle.h
diff --git a/Source/core/rendering/style/CachedUAStyle.h b/Source/core/rendering/style/CachedUAStyle.h
index 2b98e5159f26e5ee115ae470b57aad7e716c1d86..a3d7446128baca8992dc2d1fc2cd0fdd82991402 100644
--- a/Source/core/rendering/style/CachedUAStyle.h
+++ b/Source/core/rendering/style/CachedUAStyle.h
@@ -39,15 +39,11 @@ public:
{ }
explicit CachedUAStyle(const RenderStyle* style)
- : hasAppearance(style->hasAppearance())
+ : hasAppearance(true)
, backgroundLayers(BackgroundFillLayer)
, backgroundColor(StyleColor::currentColor())
{
- // RenderTheme::adjustStyle is the only consumer of this data.
- // It only cares about the styles if appearance is set,
- // so we cheat and don't bother to copy them when !hasAppearance.
- if (!hasAppearance)
- return;
+ ASSERT(style->hasAppearance());
border = style->border();
backgroundLayers = *style->backgroundLayers();
backgroundColor = style->backgroundColor();

Powered by Google App Engine
This is Rietveld 408576698