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

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

Issue 2828253004: DO NOT LAND. Revert of https://codereview.chromium.org/2797963002 (Closed)
Patch Set: simplify Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // inherited attributes 194 // inherited attributes
195 DataRef<StyleRareInheritedData> rare_inherited_data_; 195 DataRef<StyleRareInheritedData> rare_inherited_data_;
196 DataRef<StyleInheritedData> style_inherited_data_; 196 DataRef<StyleInheritedData> style_inherited_data_;
197 197
198 // list of associated pseudo styles 198 // list of associated pseudo styles
199 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; 199 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_;
200 200
201 DataRef<SVGComputedStyle> svg_style_; 201 DataRef<SVGComputedStyle> svg_style_;
202 202
203 // !START SYNC!: Keep this in sync with the copy constructor in
204 // ComputedStyle.cpp.
205
206 // don't inherit
207 struct NonInheritedData {
208 NonInheritedData() : m_hasViewportUnits(false) {}
209
210 // These are set if we used viewport or rem units when resolving a length.
211 unsigned m_hasViewportUnits : 1;
212 } m_nonInheritedData;
213
214 // !END SYNC!
215
203 private: 216 private:
204 // TODO(sashab): Move these private members to the bottom of ComputedStyle. 217 // TODO(sashab): Move these private members to the bottom of ComputedStyle.
205 ALWAYS_INLINE ComputedStyle(); 218 ALWAYS_INLINE ComputedStyle();
206 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); 219 ALWAYS_INLINE ComputedStyle(const ComputedStyle&);
207 220
208 static PassRefPtr<ComputedStyle> CreateInitialStyle(); 221 static PassRefPtr<ComputedStyle> CreateInitialStyle();
209 // TODO(shend): Remove this. Initial style should not be mutable. 222 // TODO(shend): Remove this. Initial style should not be mutable.
210 static inline ComputedStyle& MutableInitialStyle() { 223 static inline ComputedStyle& MutableInitialStyle() {
211 LEAK_SANITIZER_DISABLED_SCOPE; 224 LEAK_SANITIZER_DISABLED_SCOPE;
212 DEFINE_STATIC_REF(ComputedStyle, initial_style, 225 DEFINE_STATIC_REF(ComputedStyle, initial_style,
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 } 2313 }
2301 CSSTransitionData& AccessTransitions(); 2314 CSSTransitionData& AccessTransitions();
2302 2315
2303 // Callback selectors. 2316 // Callback selectors.
2304 const Vector<String>& CallbackSelectors() const { 2317 const Vector<String>& CallbackSelectors() const {
2305 return rare_non_inherited_data_->callback_selectors_; 2318 return rare_non_inherited_data_->callback_selectors_;
2306 } 2319 }
2307 void AddCallbackSelector(const String& selector); 2320 void AddCallbackSelector(const String& selector);
2308 2321
2309 // Non-property flags. 2322 // Non-property flags.
2323 bool HasViewportUnits() const {
2324 return m_nonInheritedData.m_hasViewportUnits;
2325 }
2326 // TODO(shend): This function should take no arguments.
2327 void SetHasViewportUnits(bool hasViewportUnits) {
2328 m_nonInheritedData.m_hasViewportUnits = hasViewportUnits;
2329 }
2330
2310 bool EmptyState() const { return EmptyStateInternal(); } 2331 bool EmptyState() const { return EmptyStateInternal(); }
2311 void SetEmptyState(bool b) { 2332 void SetEmptyState(bool b) {
2312 SetUnique(); 2333 SetUnique();
2313 SetEmptyStateInternal(b); 2334 SetEmptyStateInternal(b);
2314 } 2335 }
2315 2336
2316 bool HasInlineTransform() const { 2337 bool HasInlineTransform() const {
2317 return rare_non_inherited_data_->has_inline_transform_; 2338 return rare_non_inherited_data_->has_inline_transform_;
2318 } 2339 }
2319 void SetHasInlineTransform(bool b) { 2340 void SetHasInlineTransform(bool b) {
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3715 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3736 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3716 } 3737 }
3717 3738
3718 inline bool ComputedStyle::HasPseudoElementStyle() const { 3739 inline bool ComputedStyle::HasPseudoElementStyle() const {
3719 return PseudoBitsInternal() & kElementPseudoIdMask; 3740 return PseudoBitsInternal() & kElementPseudoIdMask;
3720 } 3741 }
3721 3742
3722 } // namespace blink 3743 } // namespace blink
3723 3744
3724 #endif // ComputedStyle_h 3745 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698