mirror of
https://github.com/servo/servo.git
synced 2025-07-02 04:53:39 +01:00
style: Make contain:paint trigger clipping independent of the overflow property.
Bug: 1465250 Reviewed-by: mattwoodrow MozReview-Commit-ID: 2QbfZD1jnWX
This commit is contained in:
parent
fc3c558cbf
commit
ea5417b29c
1 changed files with 0 additions and 34 deletions
|
@ -315,39 +315,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn adjust_for_contain(&mut self) {
|
||||
use properties::longhands::contain::SpecifiedValue;
|
||||
|
||||
// An element with contain: paint needs to be a formatting context, and
|
||||
// also implies overflow: clip.
|
||||
//
|
||||
// TODO(emilio): This mimics Gecko, but spec links are missing!
|
||||
let contain = self.style.get_box().clone_contain();
|
||||
if !contain.contains(SpecifiedValue::PAINT) {
|
||||
return;
|
||||
}
|
||||
|
||||
if self.style.get_box().clone_display() == Display::Inline {
|
||||
self.style
|
||||
.mutate_box()
|
||||
.set_adjusted_display(Display::InlineBlock, false);
|
||||
}
|
||||
|
||||
// When 'contain: paint', update overflow from 'visible' to 'clip'.
|
||||
if self.style
|
||||
.get_box()
|
||||
.clone_contain()
|
||||
.contains(SpecifiedValue::PAINT)
|
||||
{
|
||||
if self.style.get_box().clone_overflow_x() == Overflow::Visible {
|
||||
let box_style = self.style.mutate_box();
|
||||
box_style.set_overflow_x(Overflow::MozHiddenUnscrollable);
|
||||
box_style.set_overflow_y(Overflow::MozHiddenUnscrollable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// When mathvariant is not "none", font-weight and font-style are
|
||||
/// both forced to "normal".
|
||||
#[cfg(feature = "gecko")]
|
||||
|
@ -752,7 +719,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
self.adjust_for_table_text_align();
|
||||
self.adjust_for_contain();
|
||||
self.adjust_for_mathvariant();
|
||||
self.adjust_for_justify_items();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue