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

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

Issue 2351993002: Added support for non-inherited flags in ComputedStyleBase (Closed)
Patch Set: Rebase Created 4 years, 2 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 r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 bool operator==(const NonInheritedData& other) const 244 bool operator==(const NonInheritedData& other) const
245 { 245 {
246 return m_effectiveDisplay == other.m_effectiveDisplay 246 return m_effectiveDisplay == other.m_effectiveDisplay
247 && m_originalDisplay == other.m_originalDisplay 247 && m_originalDisplay == other.m_originalDisplay
248 && m_overflowAnchor == other.m_overflowAnchor 248 && m_overflowAnchor == other.m_overflowAnchor
249 && m_overflowX == other.m_overflowX 249 && m_overflowX == other.m_overflowX
250 && m_overflowY == other.m_overflowY 250 && m_overflowY == other.m_overflowY
251 && m_verticalAlign == other.m_verticalAlign 251 && m_verticalAlign == other.m_verticalAlign
252 && m_clear == other.m_clear 252 && m_clear == other.m_clear
253 && m_position == other.m_position 253 && m_position == other.m_position
254 && m_floating == other.m_floating
255 && m_tableLayout == other.m_tableLayout 254 && m_tableLayout == other.m_tableLayout
256 && m_unicodeBidi == other.m_unicodeBidi 255 && m_unicodeBidi == other.m_unicodeBidi
257 // hasViewportUnits 256 // hasViewportUnits
258 && m_breakBefore == other.m_breakBefore 257 && m_breakBefore == other.m_breakBefore
259 && m_breakAfter == other.m_breakAfter 258 && m_breakAfter == other.m_breakAfter
260 && m_breakInside == other.m_breakInside; 259 && m_breakInside == other.m_breakInside;
261 // styleType 260 // styleType
262 // pseudoBits 261 // pseudoBits
263 // explicitInheritance 262 // explicitInheritance
264 // unique 263 // unique
265 // emptyState 264 // emptyState
266 // affectedByFocus 265 // affectedByFocus
267 // affectedByHover 266 // affectedByHover
268 // affectedByActive 267 // affectedByActive
269 // affectedByDrag 268 // affectedByDrag
270 // isLink 269 // isLink
271 // isInherited flags 270 // isInherited flags
272 } 271 }
273 272
274 bool operator!=(const NonInheritedData& other) const { return !(*this == other); } 273 bool operator!=(const NonInheritedData& other) const { return !(*this == other); }
275 274
276 unsigned m_effectiveDisplay : 5; // EDisplay 275 unsigned m_effectiveDisplay : 5; // EDisplay
277 unsigned m_originalDisplay : 5; // EDisplay 276 unsigned m_originalDisplay : 5; // EDisplay
278 unsigned m_overflowAnchor : 2; // EOverflowAnchor 277 unsigned m_overflowAnchor : 2; // EOverflowAnchor
279 unsigned m_overflowX : 3; // EOverflow 278 unsigned m_overflowX : 3; // EOverflow
280 unsigned m_overflowY : 3; // EOverflow 279 unsigned m_overflowY : 3; // EOverflow
281 unsigned m_verticalAlign : 4; // EVerticalAlign 280 unsigned m_verticalAlign : 4; // EVerticalAlign
282 unsigned m_clear : 2; // EClear 281 unsigned m_clear : 2; // EClear
283 unsigned m_position : 3; // EPosition 282 unsigned m_position : 3; // EPosition
284 unsigned m_floating : 2; // EFloat
285 unsigned m_tableLayout : 1; // ETableLayout 283 unsigned m_tableLayout : 1; // ETableLayout
286 unsigned m_unicodeBidi : 3; // EUnicodeBidi 284 unsigned m_unicodeBidi : 3; // EUnicodeBidi
287 285
288 // This is set if we used viewport units when resolving a length. 286 // This is set if we used viewport units when resolving a length.
289 // It is mutable so we can pass around const ComputedStyles to resolve l engths. 287 // It is mutable so we can pass around const ComputedStyles to resolve l engths.
290 mutable unsigned m_hasViewportUnits : 1; 288 mutable unsigned m_hasViewportUnits : 1;
291 289
292 // 32 bits 290 // 32 bits
293 291
294 unsigned m_breakBefore : 4; // EBreak 292 unsigned m_breakBefore : 4; // EBreak
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 m_inheritedData.m_insideLink = NotInsideLink; 359 m_inheritedData.m_insideLink = NotInsideLink;
362 m_inheritedData.m_writingMode = initialWritingMode(); 360 m_inheritedData.m_writingMode = initialWritingMode();
363 361
364 m_nonInheritedData.m_effectiveDisplay = m_nonInheritedData.m_originalDis play = initialDisplay(); 362 m_nonInheritedData.m_effectiveDisplay = m_nonInheritedData.m_originalDis play = initialDisplay();
365 m_nonInheritedData.m_overflowAnchor = initialOverflowAnchor(); 363 m_nonInheritedData.m_overflowAnchor = initialOverflowAnchor();
366 m_nonInheritedData.m_overflowX = initialOverflowX(); 364 m_nonInheritedData.m_overflowX = initialOverflowX();
367 m_nonInheritedData.m_overflowY = initialOverflowY(); 365 m_nonInheritedData.m_overflowY = initialOverflowY();
368 m_nonInheritedData.m_verticalAlign = initialVerticalAlign(); 366 m_nonInheritedData.m_verticalAlign = initialVerticalAlign();
369 m_nonInheritedData.m_clear = initialClear(); 367 m_nonInheritedData.m_clear = initialClear();
370 m_nonInheritedData.m_position = initialPosition(); 368 m_nonInheritedData.m_position = initialPosition();
371 m_nonInheritedData.m_floating = static_cast<unsigned>(initialFloating()) ;
372 m_nonInheritedData.m_tableLayout = initialTableLayout(); 369 m_nonInheritedData.m_tableLayout = initialTableLayout();
373 m_nonInheritedData.m_unicodeBidi = initialUnicodeBidi(); 370 m_nonInheritedData.m_unicodeBidi = initialUnicodeBidi();
374 m_nonInheritedData.m_breakBefore = initialBreakBefore(); 371 m_nonInheritedData.m_breakBefore = initialBreakBefore();
375 m_nonInheritedData.m_breakAfter = initialBreakAfter(); 372 m_nonInheritedData.m_breakAfter = initialBreakAfter();
376 m_nonInheritedData.m_breakInside = initialBreakInside(); 373 m_nonInheritedData.m_breakInside = initialBreakInside();
377 m_nonInheritedData.m_styleType = PseudoIdNone; 374 m_nonInheritedData.m_styleType = PseudoIdNone;
378 m_nonInheritedData.m_pseudoBits = 0; 375 m_nonInheritedData.m_pseudoBits = 0;
379 m_nonInheritedData.m_explicitInheritance = false; 376 m_nonInheritedData.m_explicitInheritance = false;
380 m_nonInheritedData.m_variableReference = false; 377 m_nonInheritedData.m_variableReference = false;
381 m_nonInheritedData.m_unique = false; 378 m_nonInheritedData.m_unique = false;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 819
823 // -webkit-box-reflect 820 // -webkit-box-reflect
824 static StyleReflection* initialBoxReflect() { return 0; } 821 static StyleReflection* initialBoxReflect() { return 0; }
825 StyleReflection* boxReflect() const { return m_rareNonInheritedData->m_boxRe flect.get(); } 822 StyleReflection* boxReflect() const { return m_rareNonInheritedData->m_boxRe flect.get(); }
826 void setBoxReflect(PassRefPtr<StyleReflection> reflect) 823 void setBoxReflect(PassRefPtr<StyleReflection> reflect)
827 { 824 {
828 if (m_rareNonInheritedData->m_boxReflect != reflect) 825 if (m_rareNonInheritedData->m_boxReflect != reflect)
829 m_rareNonInheritedData.access()->m_boxReflect = reflect; 826 m_rareNonInheritedData.access()->m_boxReflect = reflect;
830 } 827 }
831 828
832 // float
833 static EFloat initialFloating() { return EFloat::None; }
834 EFloat floating() const { return static_cast<EFloat>(m_nonInheritedData.m_fl oating); }
835 void setFloating(EFloat v) { m_nonInheritedData.m_floating = static_cast<uns igned>(v); }
836
837 // Grid properties. 829 // Grid properties.
838 static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<G ridTrackSize>(); /* none */ } 830 static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<G ridTrackSize>(); /* none */ }
839 static size_t initialGridAutoRepeatInsertionPoint() { return 0; } 831 static size_t initialGridAutoRepeatInsertionPoint() { return 0; }
840 static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; } 832 static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; }
841 static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLin esMap(); } 833 static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLin esMap(); }
842 static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesM ap(); } 834 static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesM ap(); }
843 static OrderedNamedGridLines initialOrderedNamedGridColumnLines() { return O rderedNamedGridLines(); } 835 static OrderedNamedGridLines initialOrderedNamedGridColumnLines() { return O rderedNamedGridLines(); }
844 static OrderedNamedGridLines initialOrderedNamedGridRowLines() { return Orde redNamedGridLines(); } 836 static OrderedNamedGridLines initialOrderedNamedGridRowLines() { return Orde redNamedGridLines(); }
845 static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap(); } 837 static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap(); }
846 static size_t initialNamedGridAreaCount() { return 0; } 838 static size_t initialNamedGridAreaCount() { return 0; }
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 } 2622 }
2631 2623
2632 inline bool ComputedStyle::hasPseudoElementStyle() const 2624 inline bool ComputedStyle::hasPseudoElementStyle() const
2633 { 2625 {
2634 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 2626 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
2635 } 2627 }
2636 2628
2637 } // namespace blink 2629 } // namespace blink
2638 2630
2639 #endif // ComputedStyle_h 2631 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698