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

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: Markdown, isStacked, paintAllPhasesAtomically 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
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
1291 // the purpose of painting and hit testing. This means that they are painted
1292 // atomically (like a stacking context) but they don't determine the
1293 // stacking of the elements underneath them (stacking contexts or elements
1294 // "treated as stacking context"). See PaintLayerStackingNode for
1295 // more about painting order.
1296 bool isTreatedAsStackingContext() const
1297 {
1298 // FIXME: Floating objects are also considered stacking contexts.
1299 return position() != StaticPosition;
1300 }
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
1311 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } 1290 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); } 1291 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(); } 1292 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); } 1293 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_bo x, m_zIndex, v); }
1315 1294
1316 void setHasAutoWidows() { SET_VAR(rareInheritedData, widows, initialWidows() ); } 1295 void setHasAutoWidows() { SET_VAR(rareInheritedData, widows, initialWidows() ); }
1317 void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); } 1296 void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); }
1318 1297
1319 void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true ); SET_VAR(rareInheritedData, orphans, initialOrphans()); } 1298 void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true ); SET_VAR(rareInheritedData, orphans, initialOrphans()); }
1320 void setOrphans(short o) { SET_VAR(rareInheritedData, m_hasAutoOrphans, fals e); SET_VAR(rareInheritedData, orphans, o); } 1299 void setOrphans(short o) { SET_VAR(rareInheritedData, m_hasAutoOrphans, fals e); SET_VAR(rareInheritedData, orphans, o); }
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 } 2030 }
2052 2031
2053 inline bool ComputedStyle::hasPseudoElementStyle() const 2032 inline bool ComputedStyle::hasPseudoElementStyle() const
2054 { 2033 {
2055 return noninherited_flags.pseudoBits & ElementPseudoIdMask; 2034 return noninherited_flags.pseudoBits & ElementPseudoIdMask;
2056 } 2035 }
2057 2036
2058 } // namespace blink 2037 } // namespace blink
2059 2038
2060 #endif // ComputedStyle_h 2039 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698