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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2735283002: Combine ComputedStyle default ctor with initial style ctor. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 m_nonInheritedData.m_styleType = PseudoIdNone; 298 m_nonInheritedData.m_styleType = PseudoIdNone;
299 m_nonInheritedData.m_pseudoBits = 0; 299 m_nonInheritedData.m_pseudoBits = 0;
300 m_nonInheritedData.m_explicitInheritance = false; 300 m_nonInheritedData.m_explicitInheritance = false;
301 m_nonInheritedData.m_emptyState = false; 301 m_nonInheritedData.m_emptyState = false;
302 m_nonInheritedData.m_hasViewportUnits = false; 302 m_nonInheritedData.m_hasViewportUnits = false;
303 m_nonInheritedData.m_isLink = false; 303 m_nonInheritedData.m_isLink = false;
304 m_nonInheritedData.m_hasRemUnits = false; 304 m_nonInheritedData.m_hasRemUnits = false;
305 } 305 }
306 306
307 private: 307 private:
308 // TODO(sashab): Move these to the bottom of ComputedStyle.
sashab 2017/03/09 23:48:22 Leave this TODO here - this is referring to the fa
shend 2017/03/14 06:05:21 Done.
309 ALWAYS_INLINE ComputedStyle();
310
311 enum InitialStyleTag { InitialStyle }; 308 enum InitialStyleTag { InitialStyle };
312 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); 309 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag);
313 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); 310 ALWAYS_INLINE ComputedStyle(const ComputedStyle&);
314 311
315 static PassRefPtr<ComputedStyle> createInitialStyle(); 312 static PassRefPtr<ComputedStyle> createInitialStyle();
316 static inline ComputedStyle& mutableInitialStyle() { 313 static inline ComputedStyle& mutableInitialStyle() {
317 LEAK_SANITIZER_DISABLED_SCOPE; 314 LEAK_SANITIZER_DISABLED_SCOPE;
318 DEFINE_STATIC_REF(ComputedStyle, s_initialStyle, 315 DEFINE_STATIC_REF(ComputedStyle, s_initialStyle,
319 (ComputedStyle::createInitialStyle())); 316 (ComputedStyle::createInitialStyle()));
320 return *s_initialStyle; 317 return *s_initialStyle;
(...skipping 3494 matching lines...) Expand 10 before | Expand all | Expand 10 after
3815 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3812 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3816 } 3813 }
3817 3814
3818 inline bool ComputedStyle::hasPseudoElementStyle() const { 3815 inline bool ComputedStyle::hasPseudoElementStyle() const {
3819 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3816 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3820 } 3817 }
3821 3818
3822 } // namespace blink 3819 } // namespace blink
3823 3820
3824 #endif // ComputedStyle_h 3821 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698