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

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: Update comments Created 4 years, 5 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 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 void clearCursorList(); 1286 void clearCursorList();
1287 1287
1288 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = i nsideLink; } 1288 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = i nsideLink; }
1289 void setIsLink(bool b) { noninherited_flags.isLink = b; } 1289 void setIsLink(bool b) { noninherited_flags.isLink = b; }
1290 1290
1291 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor Adjust>(inherited_flags.m_printColorAdjust); } 1291 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor Adjust>(inherited_flags.m_printColorAdjust); }
1292 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printCo lorAdjust = value; } 1292 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printCo lorAdjust = value; }
1293 1293
1294 // A stacking context is painted atomically and defines a stacking order, wh ereas 1294 // A stacking context is painted atomically and defines a stacking order, wh ereas
1295 // a containing stacking context defines in which order the stacking context s 1295 // a containing stacking context defines in which order the stacking context s
1296 // below are painted. In Blink, a stacking context is defined by non-auto 1296 // below are painted.
1297 // z-index'. This invariant is enforced by the logic in StyleAdjuster
1298 // See CSS 2.1, Appendix E (https://www.w3.org/TR/CSS21/zindex.html) for mor e details. 1297 // See CSS 2.1, Appendix E (https://www.w3.org/TR/CSS21/zindex.html) for mor e details.
1299 bool isStackingContext() const { return !hasAutoZIndex(); } 1298 bool isStackingContext() const { return rareNonInheritedData->m_isStackingCo ntext; }
1299
1300 void updateIsStackingContext(bool isDocumentElement, bool isInTopLayer);
1301 void setIsStackingContext(bool b) { SET_VAR(rareNonInheritedData, m_isStacki ngContext, b); }
1300 1302
1301 // Stacking contexts and positioned elements[1] are stacked (sorted in negZO rderList 1303 // Stacking contexts and positioned elements[1] are stacked (sorted in negZO rderList
1302 // and posZOrderList) in their enclosing stacking contexts. 1304 // and posZOrderList) in their enclosing stacking contexts.
1303 // 1305 //
1304 // [1] According to CSS2.1, Appendix E.2.8 (https://www.w3.org/TR/CSS21/zind ex.html), 1306 // [1] According to CSS2.1, Appendix E.2.8 (https://www.w3.org/TR/CSS21/zind ex.html),
1305 // positioned elements with 'z-index: auto' are "treated as if it created a new 1307 // positioned elements with 'z-index: auto' are "treated as if it created a new
1306 // stacking context" and z-ordered together with other elements with 'z-inde x: 0'. 1308 // stacking context" and z-ordered together with other elements with 'z-inde x: 0'.
1307 // The difference of them from normal stacking contexts is that they don't d etermine 1309 // The difference of them from normal stacking contexts is that they don't d etermine
1308 // the stacking of the elements underneath them. 1310 // the stacking of the elements underneath them.
1309 // (Note: There are also other elements treated as stacking context during p ainting, 1311 // (Note: There are also other elements treated as stacking context during p ainting,
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 } 2049 }
2048 2050
2049 inline bool ComputedStyle::hasPseudoElementStyle() const 2051 inline bool ComputedStyle::hasPseudoElementStyle() const
2050 { 2052 {
2051 return noninherited_flags.pseudoBits & ElementPseudoIdMask; 2053 return noninherited_flags.pseudoBits & ElementPseudoIdMask;
2052 } 2054 }
2053 2055
2054 } // namespace blink 2056 } // namespace blink
2055 2057
2056 #endif // ComputedStyle_h 2058 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/README.md ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698