layout: Make position: relative with non-auto z-index create a

stacking context.

Improves imgur.com and Fast Company articles.
This commit is contained in:
Patrick Walton 2015-08-18 15:24:35 -07:00
parent d48f6ffbad
commit fed904fff5
6 changed files with 48 additions and 6 deletions

View file

@ -2023,15 +2023,17 @@ impl Fragment {
overflow_x::T::visible,
overflow_x::T::visible) |
(position::T::fixed,
z_index::T::Auto,
overflow_x::T::visible,
overflow_x::T::visible) |
(position::T::relative,
z_index::T::Auto,
overflow_x::T::visible,
overflow_x::T::visible) => false,
(position::T::absolute, _, _, _) |
(position::T::fixed, _, _, _) => true,
(position::T::relative, _, _, _) |
(position::T::fixed, _, _, _) |
(position::T::relative, _, _, _) => true,
(position::T::static_, _, _, _) => {
// FIXME(pcwalton): `position: relative` establishes a new stacking context if
// `z-index` is not `auto`. But this matches what we did before.
false
}
}