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

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

Issue 2106073005: Add fast-path for propagated variable changes (WIP) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@+pointer_events_fastpath_5
Patch Set: Rebase Created 4 years, 1 month 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 (m_textTransform == other.m_textTransform) && 221 (m_textTransform == other.m_textTransform) &&
222 (m_textUnderline == other.m_textUnderline) && 222 (m_textUnderline == other.m_textUnderline) &&
223 (m_cursorStyle == other.m_cursorStyle) && 223 (m_cursorStyle == other.m_cursorStyle) &&
224 (m_direction == other.m_direction) && 224 (m_direction == other.m_direction) &&
225 (m_whiteSpace == other.m_whiteSpace) && 225 (m_whiteSpace == other.m_whiteSpace) &&
226 (m_borderCollapse == other.m_borderCollapse) && 226 (m_borderCollapse == other.m_borderCollapse) &&
227 (m_boxDirection == other.m_boxDirection) && 227 (m_boxDirection == other.m_boxDirection) &&
228 (m_rtlOrdering == other.m_rtlOrdering) && 228 (m_rtlOrdering == other.m_rtlOrdering) &&
229 (m_printColorAdjust == other.m_printColorAdjust) && 229 (m_printColorAdjust == other.m_printColorAdjust) &&
230 (m_insideLink == other.m_insideLink) && 230 (m_insideLink == other.m_insideLink) &&
231 (m_writingMode == other.m_writingMode); 231 (m_writingMode == other.m_writingMode) &&
232 (m_variableReference == other.m_variableReference);
232 } 233 }
233 234
234 unsigned m_captionSide : 2; // ECaptionSide 235 unsigned m_captionSide : 2; // ECaptionSide
235 unsigned m_listStyleType : 7; // EListStyleType 236 unsigned m_listStyleType : 7; // EListStyleType
236 unsigned m_listStylePosition : 1; // EListStylePosition 237 unsigned m_listStylePosition : 1; // EListStylePosition
237 unsigned m_textAlign : 4; // ETextAlign 238 unsigned m_textAlign : 4; // ETextAlign
238 unsigned m_textTransform : 2; // ETextTransform 239 unsigned m_textTransform : 2; // ETextTransform
239 unsigned m_textUnderline : 1; 240 unsigned m_textUnderline : 1;
240 unsigned m_cursorStyle : 6; // ECursor 241 unsigned m_cursorStyle : 6; // ECursor
241 unsigned m_direction : 1; // TextDirection 242 unsigned m_direction : 1; // TextDirection
242 unsigned m_whiteSpace : 3; // EWhiteSpace 243 unsigned m_whiteSpace : 3; // EWhiteSpace
243 unsigned m_borderCollapse : 1; // EBorderCollapse 244 unsigned m_borderCollapse : 1; // EBorderCollapse
244 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction property, 245 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction property,
245 // flexible box layout module) 246 // flexible box layout module)
246 // 32 bits 247 // 32 bits
247 248
248 // non CSS2 inherited 249 // non CSS2 inherited
249 unsigned m_rtlOrdering : 1; // Order 250 unsigned m_rtlOrdering : 1; // Order
250 unsigned m_printColorAdjust : PrintColorAdjustBits; 251 unsigned m_printColorAdjust : PrintColorAdjustBits;
251 unsigned m_pointerEvents : 4; // EPointerEvents 252 unsigned m_pointerEvents : 4; // EPointerEvents
252 unsigned m_insideLink : 2; // EInsideLink 253 unsigned m_insideLink : 2; // EInsideLink
253 254
254 // CSS Text Layout Module Level 3: Vertical writing support 255 // CSS Text Layout Module Level 3: Vertical writing support
255 unsigned m_writingMode : 2; // WritingMode 256 unsigned m_writingMode : 2; // WritingMode
256 // 42 bits 257
258 unsigned m_variableReference : 1; // Whether an inherited property
259 // references a variable.
260 // 43 bits
257 } m_inheritedData; 261 } m_inheritedData;
258 262
259 // don't inherit 263 // don't inherit
260 struct NonInheritedData { 264 struct NonInheritedData {
261 // Compare computed styles, differences in inherited bits or other flags 265 // Compare computed styles, differences in inherited bits or other flags
262 // should not cause an inequality. 266 // should not cause an inequality.
263 bool operator==(const NonInheritedData& other) const { 267 bool operator==(const NonInheritedData& other) const {
264 return m_effectiveDisplay == other.m_effectiveDisplay && 268 return m_effectiveDisplay == other.m_effectiveDisplay &&
265 m_originalDisplay == other.m_originalDisplay && 269 m_originalDisplay == other.m_originalDisplay &&
266 m_overflowAnchor == other.m_overflowAnchor && 270 m_overflowAnchor == other.m_overflowAnchor &&
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 m_inheritedData.m_cursorStyle = initialCursor(); 376 m_inheritedData.m_cursorStyle = initialCursor();
373 m_inheritedData.m_direction = initialDirection(); 377 m_inheritedData.m_direction = initialDirection();
374 m_inheritedData.m_whiteSpace = initialWhiteSpace(); 378 m_inheritedData.m_whiteSpace = initialWhiteSpace();
375 m_inheritedData.m_borderCollapse = initialBorderCollapse(); 379 m_inheritedData.m_borderCollapse = initialBorderCollapse();
376 m_inheritedData.m_rtlOrdering = initialRTLOrdering(); 380 m_inheritedData.m_rtlOrdering = initialRTLOrdering();
377 m_inheritedData.m_boxDirection = initialBoxDirection(); 381 m_inheritedData.m_boxDirection = initialBoxDirection();
378 m_inheritedData.m_printColorAdjust = initialPrintColorAdjust(); 382 m_inheritedData.m_printColorAdjust = initialPrintColorAdjust();
379 m_inheritedData.m_pointerEvents = initialPointerEvents(); 383 m_inheritedData.m_pointerEvents = initialPointerEvents();
380 m_inheritedData.m_insideLink = NotInsideLink; 384 m_inheritedData.m_insideLink = NotInsideLink;
381 m_inheritedData.m_writingMode = initialWritingMode(); 385 m_inheritedData.m_writingMode = initialWritingMode();
386 m_inheritedData.m_variableReference = false;
382 387
383 m_nonInheritedData.m_effectiveDisplay = 388 m_nonInheritedData.m_effectiveDisplay =
384 m_nonInheritedData.m_originalDisplay = 389 m_nonInheritedData.m_originalDisplay =
385 static_cast<unsigned>(initialDisplay()); 390 static_cast<unsigned>(initialDisplay());
386 m_nonInheritedData.m_overflowAnchor = initialOverflowAnchor(); 391 m_nonInheritedData.m_overflowAnchor = initialOverflowAnchor();
387 m_nonInheritedData.m_overflowX = initialOverflowX(); 392 m_nonInheritedData.m_overflowX = initialOverflowX();
388 m_nonInheritedData.m_overflowY = initialOverflowY(); 393 m_nonInheritedData.m_overflowY = initialOverflowY();
389 m_nonInheritedData.m_verticalAlign = initialVerticalAlign(); 394 m_nonInheritedData.m_verticalAlign = initialVerticalAlign();
390 m_nonInheritedData.m_clear = initialClear(); 395 m_nonInheritedData.m_clear = initialClear();
391 m_nonInheritedData.m_position = initialPosition(); 396 m_nonInheritedData.m_position = initialPosition();
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2643 } 2648 }
2644 2649
2645 // Comparison operators 2650 // Comparison operators
2646 bool operator==(const ComputedStyle& other) const; 2651 bool operator==(const ComputedStyle& other) const;
2647 bool operator!=(const ComputedStyle& other) const { 2652 bool operator!=(const ComputedStyle& other) const {
2648 return !(*this == other); 2653 return !(*this == other);
2649 } 2654 }
2650 2655
2651 bool inheritedEqual(const ComputedStyle&) const; 2656 bool inheritedEqual(const ComputedStyle&) const;
2652 bool nonInheritedEqual(const ComputedStyle&) const; 2657 bool nonInheritedEqual(const ComputedStyle&) const;
2658
2659 // Compares independent inherited properties, not including variables.
2653 inline bool independentInheritedEqual(const ComputedStyle&) const; 2660 inline bool independentInheritedEqual(const ComputedStyle&) const;
2654 inline bool nonIndependentInheritedEqual(const ComputedStyle&) const; 2661 inline bool nonIndependentInheritedEqual(const ComputedStyle&) const;
2662
2663 // Compares variables.
2664 inline bool variablesEqual(const ComputedStyle&) const;
2665
2655 bool loadingCustomFontsEqual(const ComputedStyle&) const; 2666 bool loadingCustomFontsEqual(const ComputedStyle&) const;
2656 bool inheritedDataShared(const ComputedStyle&) const; 2667 bool inheritedDataShared(const ComputedStyle&) const;
2657 2668
2658 bool hasChildDependentFlags() const { 2669 bool hasChildDependentFlags() const {
2659 return emptyState() || hasExplicitlyInheritedProperties(); 2670 return emptyState() || hasExplicitlyInheritedProperties();
2660 } 2671 }
2661 void copyChildDependentFlagsFrom(const ComputedStyle&); 2672 void copyChildDependentFlagsFrom(const ComputedStyle&);
2662 2673
2663 // Counters. 2674 // Counters.
2664 const CounterDirectiveMap* counterDirectives() const; 2675 const CounterDirectiveMap* counterDirectives() const;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 2709
2699 // Handles both inherited and non-inherited variables 2710 // Handles both inherited and non-inherited variables
2700 CSSVariableData* getVariable(const AtomicString&) const; 2711 CSSVariableData* getVariable(const AtomicString&) const;
2701 2712
2702 void setHasVariableReferenceFromNonInheritedProperty() { 2713 void setHasVariableReferenceFromNonInheritedProperty() {
2703 m_nonInheritedData.m_variableReference = true; 2714 m_nonInheritedData.m_variableReference = true;
2704 } 2715 }
2705 bool hasVariableReferenceFromNonInheritedProperty() const { 2716 bool hasVariableReferenceFromNonInheritedProperty() const {
2706 return m_nonInheritedData.m_variableReference; 2717 return m_nonInheritedData.m_variableReference;
2707 } 2718 }
2719 void setHasVariableReferenceFromInheritedProperty() {
2720 m_inheritedData.m_variableReference = true;
2721 }
2722 bool hasVariableReferenceFromInheritedProperty() const {
2723 return m_inheritedData.m_variableReference;
2724 }
2708 2725
2709 // Animations. 2726 // Animations.
2710 CSSAnimationData& accessAnimations(); 2727 CSSAnimationData& accessAnimations();
2711 const CSSAnimationData* animations() const { 2728 const CSSAnimationData* animations() const {
2712 return m_rareNonInheritedData->m_animations.get(); 2729 return m_rareNonInheritedData->m_animations.get();
2713 } 2730 }
2714 2731
2715 // Transitions. 2732 // Transitions.
2716 const CSSTransitionData* transitions() const { 2733 const CSSTransitionData* transitions() const {
2717 return m_rareNonInheritedData->m_transitions.get(); 2734 return m_rareNonInheritedData->m_transitions.get();
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
4103 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 4120 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
4104 } 4121 }
4105 4122
4106 inline bool ComputedStyle::hasPseudoElementStyle() const { 4123 inline bool ComputedStyle::hasPseudoElementStyle() const {
4107 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 4124 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
4108 } 4125 }
4109 4126
4110 } // namespace blink 4127 } // namespace blink
4111 4128
4112 #endif // ComputedStyle_h 4129 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698