Do not create stacking contexts for text fragments

Without this change, each text fragment in a block that establishes a
stacking context will establish its own stacking context. This is
unnecessary and increases the amount of work done during display list
construction.
This commit is contained in:
Martin Robinson 2016-05-05 13:54:47 -07:00
parent d9323121b6
commit 7e4cf6a4dc
41 changed files with 13 additions and 113 deletions

View file

@ -2207,6 +2207,13 @@ impl Fragment {
/// Returns true if this fragment establishes a new stacking context and false otherwise.
pub fn establishes_stacking_context(&self) -> bool {
// Text fragments shouldn't create stacking contexts.
match self.specific {
SpecificFragmentInfo::ScannedText(_) |
SpecificFragmentInfo::UnscannedText(_) => return false,
_ => {}
}
if self.flags.contains(HAS_LAYER) {
return true
}