Index: Source/core/css/resolver/StyleResolverState.h |
diff --git a/Source/core/css/resolver/StyleResolverState.h b/Source/core/css/resolver/StyleResolverState.h |
index 4e01e8c4fa48bc016e62a86868ad8b56e1a2db45..a23f9da7bd9f7b7d7bc7d54b5d91a7d452de4c01 100644 |
--- a/Source/core/css/resolver/StyleResolverState.h |
+++ b/Source/core/css/resolver/StyleResolverState.h |
@@ -94,7 +94,14 @@ public: |
void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; } |
CSSValue* lineHeightValue() { return m_lineHeightValue; } |
- void cacheUserAgentBorderAndBackground() { m_cachedUAStyle = CachedUAStyle(style()); } |
+ void cacheUserAgentBorderAndBackground() |
ojan
2014/03/17 18:59:13
Nit: this is now kind of big for the header file.
|
+ { |
+ // RenderTheme only needs the cached style if it has an appearance, |
+ // and constructing it is expensive so we avoid it if possible. |
+ if (!style()->hasAppearance()) |
+ return; |
+ m_cachedUAStyle = CachedUAStyle(style()); |
+ } |
const CachedUAStyle& cachedUAStyle() const { return m_cachedUAStyle; } |
ElementStyleResources& elementStyleResources() { return m_elementStyleResources; } |