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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2735283002: Combine ComputedStyle default ctor with initial style ctor. (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index dd686597bdff2afb4b06c8140f040842bc7f7919..204d91b299d49464653df023e0f7dcc435d04ef8 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -95,7 +95,7 @@ struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> {
ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle);
PassRefPtr<ComputedStyle> ComputedStyle::create() {
- return adoptRef(new ComputedStyle());
+ return adoptRef(new ComputedStyle(initialStyle()));
}
PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() {
@@ -120,24 +120,6 @@ PassRefPtr<ComputedStyle> ComputedStyle::clone(const ComputedStyle& other) {
return adoptRef(new ComputedStyle(other));
}
-ALWAYS_INLINE ComputedStyle::ComputedStyle()
- : ComputedStyleBase(),
- RefCounted<ComputedStyle>(),
- m_box(initialStyle().m_box),
- m_visual(initialStyle().m_visual),
- m_background(initialStyle().m_background),
- m_surround(initialStyle().m_surround),
- m_rareNonInheritedData(initialStyle().m_rareNonInheritedData),
- m_rareInheritedData(initialStyle().m_rareInheritedData),
- m_styleInheritedData(initialStyle().m_styleInheritedData),
- m_svgStyle(initialStyle().m_svgStyle) {
- initializeBitDefaults(); // Would it be faster to copy this from the default
- // style?
- static_assert((sizeof(InheritedData) <= 8), "InheritedData should not grow");
- static_assert((sizeof(NonInheritedData) <= 12),
- "NonInheritedData should not grow");
-}
-
ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag)
: ComputedStyleBase(), RefCounted<ComputedStyle>() {
initializeBitDefaults();
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698