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

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

Issue 2742263002: Add 'storage_only' template to make_computed_style_base.py. (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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // This is set if we used viewport units when resolving a length. 259 // This is set if we used viewport units when resolving a length.
260 // It is mutable so we can pass around const ComputedStyles to resolve 260 // It is mutable so we can pass around const ComputedStyles to resolve
261 // lengths. 261 // lengths.
262 mutable unsigned m_hasViewportUnits : 1; 262 mutable unsigned m_hasViewportUnits : 1;
263 263
264 // 32 bits 264 // 32 bits
265 265
266 unsigned m_styleType : 6; // PseudoId 266 unsigned m_styleType : 6; // PseudoId
267 unsigned m_pseudoBits : 8; 267 unsigned m_pseudoBits : 8;
268 268
269 unsigned m_emptyState : 1;
270
271 // 64 bits 269 // 64 bits
272 270
273 unsigned m_isLink : 1; 271 unsigned m_isLink : 1;
274 272
275 mutable unsigned m_hasRemUnits : 1; 273 mutable unsigned m_hasRemUnits : 1;
276 274
277 // If you add more style bits here, you will also need to update 275 // If you add more style bits here, you will also need to update
278 // ComputedStyle::copyNonInheritedFromCached() 68 bits 276 // ComputedStyle::copyNonInheritedFromCached() 68 bits
279 } m_nonInheritedData; 277 } m_nonInheritedData;
280 278
281 // !END SYNC! 279 // !END SYNC!
282 280
283 // Only call inside the constructor. Generated properties in the base class 281 // Only call inside the constructor. Generated properties in the base class
284 // are not initialized in this method. 282 // are not initialized in this method.
285 void initializeBitDefaults() { 283 void initializeBitDefaults() {
286 m_inheritedData.m_hasSimpleUnderline = false; 284 m_inheritedData.m_hasSimpleUnderline = false;
287 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); 285 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
288 m_inheritedData.m_insideLink = 286 m_inheritedData.m_insideLink =
289 static_cast<unsigned>(EInsideLink::kNotInsideLink); 287 static_cast<unsigned>(EInsideLink::kNotInsideLink);
290 288
291 m_nonInheritedData.m_effectiveDisplay = 289 m_nonInheritedData.m_effectiveDisplay =
292 m_nonInheritedData.m_originalDisplay = 290 m_nonInheritedData.m_originalDisplay =
293 static_cast<unsigned>(initialDisplay()); 291 static_cast<unsigned>(initialDisplay());
294 m_nonInheritedData.m_verticalAlign = 292 m_nonInheritedData.m_verticalAlign =
295 static_cast<unsigned>(initialVerticalAlign()); 293 static_cast<unsigned>(initialVerticalAlign());
296 m_nonInheritedData.m_styleType = PseudoIdNone; 294 m_nonInheritedData.m_styleType = PseudoIdNone;
297 m_nonInheritedData.m_pseudoBits = 0; 295 m_nonInheritedData.m_pseudoBits = 0;
298 m_nonInheritedData.m_emptyState = false;
299 m_nonInheritedData.m_hasViewportUnits = false; 296 m_nonInheritedData.m_hasViewportUnits = false;
300 m_nonInheritedData.m_isLink = false; 297 m_nonInheritedData.m_isLink = false;
301 m_nonInheritedData.m_hasRemUnits = false; 298 m_nonInheritedData.m_hasRemUnits = false;
302 } 299 }
303 300
304 private: 301 private:
305 // TODO(sashab): Move these to the bottom of ComputedStyle. 302 // TODO(sashab): Move these to the bottom of ComputedStyle.
306 ALWAYS_INLINE ComputedStyle(); 303 ALWAYS_INLINE ComputedStyle();
307 304
308 enum InitialStyleTag { InitialStyle }; 305 enum InitialStyleTag { InitialStyle };
(...skipping 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 bool hasViewportUnits() const { 2420 bool hasViewportUnits() const {
2424 return m_nonInheritedData.m_hasViewportUnits; 2421 return m_nonInheritedData.m_hasViewportUnits;
2425 } 2422 }
2426 void setHasViewportUnits(bool hasViewportUnits = true) const { 2423 void setHasViewportUnits(bool hasViewportUnits = true) const {
2427 m_nonInheritedData.m_hasViewportUnits = hasViewportUnits; 2424 m_nonInheritedData.m_hasViewportUnits = hasViewportUnits;
2428 } 2425 }
2429 2426
2430 bool hasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; } 2427 bool hasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; }
2431 void setHasRemUnits() const { m_nonInheritedData.m_hasRemUnits = true; } 2428 void setHasRemUnits() const { m_nonInheritedData.m_hasRemUnits = true; }
2432 2429
2433 bool emptyState() const { return m_nonInheritedData.m_emptyState; } 2430 bool emptyState() const { return m_emptyState; }
2434 void setEmptyState(bool b) { 2431 void setEmptyState(bool b) {
2435 setUnique(); 2432 setUnique();
2436 m_nonInheritedData.m_emptyState = b; 2433 m_emptyState = b;
2437 } 2434 }
2438 2435
2439 bool hasInlineTransform() const { 2436 bool hasInlineTransform() const {
2440 return m_rareNonInheritedData->m_hasInlineTransform; 2437 return m_rareNonInheritedData->m_hasInlineTransform;
2441 } 2438 }
2442 void setHasInlineTransform(bool b) { 2439 void setHasInlineTransform(bool b) {
2443 SET_VAR(m_rareNonInheritedData, m_hasInlineTransform, b); 2440 SET_VAR(m_rareNonInheritedData, m_hasInlineTransform, b);
2444 } 2441 }
2445 2442
2446 bool hasCompositorProxy() const { 2443 bool hasCompositorProxy() const {
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
3802 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); 3799 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId);
3803 } 3800 }
3804 3801
3805 inline bool ComputedStyle::hasPseudoElementStyle() const { 3802 inline bool ComputedStyle::hasPseudoElementStyle() const {
3806 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3803 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3807 } 3804 }
3808 3805
3809 } // namespace blink 3806 } // namespace blink
3810 3807
3811 #endif // ComputedStyle_h 3808 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698