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

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

Issue 2838513002: DO NOT LAND. Revert of https://codereview.chromium.org/2797963002 (Closed)
Patch Set: Created 3 years, 8 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 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_hasRemUnits(false), m_hasViewportUnits(false) {}
209
210 // These are set if we used viewport or rem units when resolving a length.
211 unsigned m_hasRemUnits : 1;
212 unsigned m_hasViewportUnits : 1;
213 } m_nonInheritedData;
214
215 // !END SYNC!
216
203 private: 217 private:
204 // TODO(sashab): Move these private members to the bottom of ComputedStyle. 218 // TODO(sashab): Move these private members to the bottom of ComputedStyle.
205 ALWAYS_INLINE ComputedStyle(); 219 ALWAYS_INLINE ComputedStyle();
206 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); 220 ALWAYS_INLINE ComputedStyle(const ComputedStyle&);
207 221
208 static PassRefPtr<ComputedStyle> CreateInitialStyle(); 222 static PassRefPtr<ComputedStyle> CreateInitialStyle();
209 // TODO(shend): Remove this. Initial style should not be mutable. 223 // TODO(shend): Remove this. Initial style should not be mutable.
210 static inline ComputedStyle& MutableInitialStyle() { 224 static inline ComputedStyle& MutableInitialStyle() {
211 LEAK_SANITIZER_DISABLED_SCOPE; 225 LEAK_SANITIZER_DISABLED_SCOPE;
212 DEFINE_STATIC_REF(ComputedStyle, initial_style, 226 DEFINE_STATIC_REF(ComputedStyle, initial_style,
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 } 2312 }
2299 CSSTransitionData& AccessTransitions(); 2313 CSSTransitionData& AccessTransitions();
2300 2314
2301 // Callback selectors. 2315 // Callback selectors.
2302 const Vector<String>& CallbackSelectors() const { 2316 const Vector<String>& CallbackSelectors() const {
2303 return rare_non_inherited_data_->callback_selectors_; 2317 return rare_non_inherited_data_->callback_selectors_;
2304 } 2318 }
2305 void AddCallbackSelector(const String& selector); 2319 void AddCallbackSelector(const String& selector);
2306 2320
2307 // Non-property flags. 2321 // Non-property flags.
2322 bool HasViewportUnits() const {
2323 return m_nonInheritedData.m_hasViewportUnits;
2324 }
2325 // TODO(shend): This function should take no arguments.
2326 void SetHasViewportUnits(bool hasViewportUnits) {
2327 m_nonInheritedData.m_hasViewportUnits = hasViewportUnits;
2328 }
2329
2330 bool HasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; }
2331 void SetHasRemUnits() {
2332 m_nonInheritedData.m_hasRemUnits = static_cast<unsigned>(true);
2333 }
2334
2308 bool EmptyState() const { return EmptyStateInternal(); } 2335 bool EmptyState() const { return EmptyStateInternal(); }
2309 void SetEmptyState(bool b) { 2336 void SetEmptyState(bool b) {
2310 SetUnique(); 2337 SetUnique();
2311 SetEmptyStateInternal(b); 2338 SetEmptyStateInternal(b);
2312 } 2339 }
2313 2340
2314 bool HasInlineTransform() const { 2341 bool HasInlineTransform() const {
2315 return rare_non_inherited_data_->has_inline_transform_; 2342 return rare_non_inherited_data_->has_inline_transform_;
2316 } 2343 }
2317 void SetHasInlineTransform(bool b) { 2344 void SetHasInlineTransform(bool b) {
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
3741 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3768 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3742 } 3769 }
3743 3770
3744 inline bool ComputedStyle::HasPseudoElementStyle() const { 3771 inline bool ComputedStyle::HasPseudoElementStyle() const {
3745 return PseudoBitsInternal() & kElementPseudoIdMask; 3772 return PseudoBitsInternal() & kElementPseudoIdMask;
3746 } 3773 }
3747 3774
3748 } // namespace blink 3775 } // namespace blink
3749 3776
3750 #endif // ComputedStyle_h 3777 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698