Chromium Code Reviews| Index: Source/core/style/ComputedStyle.h |
| diff --git a/Source/core/style/ComputedStyle.h b/Source/core/style/ComputedStyle.h |
| index 71c132621d8369d5138c3a993d331669364778ad..d8944dae1358e284bef2fe0e0e2829fb45dc969d 100644 |
| --- a/Source/core/style/ComputedStyle.h |
| +++ b/Source/core/style/ComputedStyle.h |
| @@ -1204,6 +1204,22 @@ public: |
| PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(inherited_flags.m_printColorAdjust); } |
| void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printColorAdjust = value; } |
| + // A stacking context is painted atomically and defines a stacking order, whereas |
| + // a containing stacking context defines in which order the stacking contexts |
| + // below are painted. In Blink, a stacking context is defined by non-auto |
| + // z-index'. This invariant is enforced by the logic in StyleAdjuster |
| + // See CSS 2.1, Appendix E for more details. |
| + bool isStackingContext() const { return !hasAutoZIndex(); } |
| + |
| + // Some elements are "treated as if they create a new stacking context" for the purpose |
| + // of painting and hit testing. However they don't determine the stacking of the stacking |
| + // context underneath them. That means that they are painted atomically. |
| + bool isTreatedAsStackingContextForPainting() const |
| + { |
| + // FIXME: Floating objects are also considered stacking contexts. |
|
leviw_travelin_and_unemployed
2015/06/09 18:29:00
Nit: add "for painting"
Julien - ping for review
2015/06/09 19:39:55
Nuked the nit!
|
| + return isStackingContext() || position() != StaticPosition; |
| + } |
| + |
| bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } |
| void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0); } |
| int zIndex() const { return m_box->zIndex(); } |