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

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

Issue 1798263002: Rename isTreatedAsOrStackingContext to isStacked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows compile Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/ScrollbarPainter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = i nsideLink; } 1277 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = i nsideLink; }
1278 void setIsLink(bool b) { noninherited_flags.isLink = b; } 1278 void setIsLink(bool b) { noninherited_flags.isLink = b; }
1279 1279
1280 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor Adjust>(inherited_flags.m_printColorAdjust); } 1280 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor Adjust>(inherited_flags.m_printColorAdjust); }
1281 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printCo lorAdjust = value; } 1281 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printCo lorAdjust = value; }
1282 1282
1283 // A stacking context is painted atomically and defines a stacking order, wh ereas 1283 // A stacking context is painted atomically and defines a stacking order, wh ereas
1284 // a containing stacking context defines in which order the stacking context s 1284 // a containing stacking context defines in which order the stacking context s
1285 // below are painted. In Blink, a stacking context is defined by non-auto 1285 // below are painted. In Blink, a stacking context is defined by non-auto
1286 // z-index'. This invariant is enforced by the logic in StyleAdjuster 1286 // z-index'. This invariant is enforced by the logic in StyleAdjuster
1287 // See CSS 2.1, Appendix E for more details. 1287 // See CSS 2.1, Appendix E (https://www.w3.org/TR/CSS21/zindex.html) for mor e details.
1288 bool isStackingContext() const { return !hasAutoZIndex(); } 1288 bool isStackingContext() const { return !hasAutoZIndex(); }
1289 1289
1290 // Some elements are "treated as if they create a new stacking context" for 1290 // Stacking contexts and positioned elements[1] are stacked (sorted in negZO rderList
1291 // the purpose of painting and hit testing. This means that they are painted 1291 // and posZOrderList) in their enclosing stacking contexts.
1292 // atomically (like a stacking context) but they don't determine the 1292 //
1293 // stacking of the elements underneath them (stacking contexts or elements 1293 // [1] According to CSS2.1, Appendix E.2.8 (https://www.w3.org/TR/CSS21/zind ex.html),
1294 // "treated as stacking context"). See PaintLayerStackingNode for 1294 // positioned elements with 'z-index: auto' are "treated as if it created a new
1295 // more about painting order. 1295 // stacking context" and z-ordered together with other elements with 'z-inde x: 0'.
1296 bool isTreatedAsStackingContext() const 1296 // The difference of them from normal stacking contexts is that they don't d etermine
1297 { 1297 // the stacking of the elements underneath them.
1298 // FIXME: Floating objects are also considered stacking contexts. 1298 // (Note: There are also other elements treated as stacking context during p ainting,
1299 return position() != StaticPosition; 1299 // but not managed in stacks. See ObjectPainter::paintAllPhasesAtomically(). )
1300 } 1300 bool isStacked() const { return isStackingContext() || position() != StaticP osition; }
1301
1302 // Returns true if an element is a stacking context or "treated as a
1303 // stacking context". Most callers care about this as it follows the
1304 // painting order where we collect anything that returns true from this
1305 // function under the enclosing stacking context.
1306 bool isTreatedAsOrStackingContext() const
1307 {
1308 return isStackingContext() || isTreatedAsStackingContext();
1309 }
1310 1301
1311 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } 1302 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
1312 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_b ox, m_zIndex, 0); } 1303 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_b ox, m_zIndex, 0); }
1313 int zIndex() const { return m_box->zIndex(); } 1304 int zIndex() const { return m_box->zIndex(); }
1314 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_bo x, m_zIndex, v); } 1305 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_bo x, m_zIndex, v); }
1315 1306
1316 void setHasAutoWidows() { SET_VAR(rareInheritedData, widows, initialWidows() ); } 1307 void setHasAutoWidows() { SET_VAR(rareInheritedData, widows, initialWidows() ); }
1317 void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); } 1308 void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); }
1318 1309
1319 void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true ); SET_VAR(rareInheritedData, orphans, initialOrphans()); } 1310 void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true ); SET_VAR(rareInheritedData, orphans, initialOrphans()); }
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 } 2042 }
2052 2043
2053 inline bool ComputedStyle::hasPseudoElementStyle() const 2044 inline bool ComputedStyle::hasPseudoElementStyle() const
2054 { 2045 {
2055 return noninherited_flags.pseudoBits & ElementPseudoIdMask; 2046 return noninherited_flags.pseudoBits & ElementPseudoIdMask;
2056 } 2047 }
2057 2048
2058 } // namespace blink 2049 } // namespace blink
2059 2050
2060 #endif // ComputedStyle_h 2051 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ScrollbarPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698