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

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

Issue 2047283002: Avoid touching z-index in StyleAdjuster by using an isStackingContext flag instead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Animation expectation Created 4 years, 6 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 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 void clearCursorList(); 1268 void clearCursorList();
1269 1269
1270 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = i nsideLink; } 1270 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = i nsideLink; }
1271 void setIsLink(bool b) { noninherited_flags.isLink = b; } 1271 void setIsLink(bool b) { noninherited_flags.isLink = b; }
1272 1272
1273 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor Adjust>(inherited_flags.m_printColorAdjust); } 1273 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor Adjust>(inherited_flags.m_printColorAdjust); }
1274 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printCo lorAdjust = value; } 1274 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printCo lorAdjust = value; }
1275 1275
1276 // A stacking context is painted atomically and defines a stacking order, wh ereas 1276 // A stacking context is painted atomically and defines a stacking order, wh ereas
1277 // a containing stacking context defines in which order the stacking context s 1277 // a containing stacking context defines in which order the stacking context s
1278 // below are painted. In Blink, a stacking context is defined by non-auto 1278 // below are painted.
1279 // z-index'. This invariant is enforced by the logic in StyleAdjuster
1280 // See CSS 2.1, Appendix E (https://www.w3.org/TR/CSS21/zindex.html) for mor e details. 1279 // See CSS 2.1, Appendix E (https://www.w3.org/TR/CSS21/zindex.html) for mor e details.
1281 bool isStackingContext() const { return !hasAutoZIndex(); } 1280 bool isStackingContext() const { return rareNonInheritedData->m_isStackingCo ntext; }
1281
1282 void updateIsStackingContext(bool isDocumentElement, bool isInTopLayer);
1283 void setIsStackingContext(bool b) { SET_VAR(rareNonInheritedData, m_isStacki ngContext, b); }
1282 1284
1283 // Stacking contexts and positioned elements[1] are stacked (sorted in negZO rderList 1285 // Stacking contexts and positioned elements[1] are stacked (sorted in negZO rderList
1284 // and posZOrderList) in their enclosing stacking contexts. 1286 // and posZOrderList) in their enclosing stacking contexts.
1285 // 1287 //
1286 // [1] According to CSS2.1, Appendix E.2.8 (https://www.w3.org/TR/CSS21/zind ex.html), 1288 // [1] According to CSS2.1, Appendix E.2.8 (https://www.w3.org/TR/CSS21/zind ex.html),
1287 // positioned elements with 'z-index: auto' are "treated as if it created a new 1289 // positioned elements with 'z-index: auto' are "treated as if it created a new
1288 // stacking context" and z-ordered together with other elements with 'z-inde x: 0'. 1290 // stacking context" and z-ordered together with other elements with 'z-inde x: 0'.
1289 // The difference of them from normal stacking contexts is that they don't d etermine 1291 // The difference of them from normal stacking contexts is that they don't d etermine
1290 // the stacking of the elements underneath them. 1292 // the stacking of the elements underneath them.
1291 // (Note: There are also other elements treated as stacking context during p ainting, 1293 // (Note: There are also other elements treated as stacking context during p ainting,
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 } 2027 }
2026 2028
2027 inline bool ComputedStyle::hasPseudoElementStyle() const 2029 inline bool ComputedStyle::hasPseudoElementStyle() const
2028 { 2030 {
2029 return noninherited_flags.pseudoBits & ElementPseudoIdMask; 2031 return noninherited_flags.pseudoBits & ElementPseudoIdMask;
2030 } 2032 }
2031 2033
2032 } // namespace blink 2034 } // namespace blink
2033 2035
2034 #endif // ComputedStyle_h 2036 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698