style: Add an inherited style bit to know whether an element is in an opacity: 0 subtree.

I think this should work for the animation throttling stuff.

Opacity works on the element tree, so I think this is sound.

Differential Revision: https://phabricator.services.mozilla.com/D64441
This commit is contained in:
Emilio Cobos Álvarez 2020-02-27 02:26:39 +00:00
parent 3460f71205
commit 1bd551ddc2
2 changed files with 23 additions and 13 deletions

View file

@ -227,15 +227,21 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
fn set_bits(&mut self) {
let display = self.style.get_box().clone_display();
if !display.is_contents() &&
!self
.style
.get_text()
.clone_text_decoration_line()
.is_empty()
{
self.style
.add_flags(ComputedValueFlags::HAS_TEXT_DECORATION_LINES);
if !display.is_contents() {
if !self
.style
.get_text()
.clone_text_decoration_line()
.is_empty()
{
self.style
.add_flags(ComputedValueFlags::HAS_TEXT_DECORATION_LINES);
}
if self.style.get_effects().clone_opacity() == 0. {
self.style
.add_flags(ComputedValueFlags::IS_IN_OPACITY_ZERO_SUBTREE);
}
}
if self.style.is_pseudo_element() {