mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Simplify ::-moz-fieldset-content special-casing.
The style adjuster knows about the pseudo, so there's no reason to thread that info down. There are more simplifications that can be done in followups, cleaning a bit the cascade flags too, those will come later.
This commit is contained in:
parent
446536b9c3
commit
563da3a19c
3 changed files with 7 additions and 16 deletions
|
@ -343,12 +343,12 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
fn adjust_for_fieldset_content(
|
||||
&mut self,
|
||||
layout_parent_style: &ComputedValues,
|
||||
flags: CascadeFlags,
|
||||
) {
|
||||
use properties::CascadeFlags;
|
||||
if !flags.contains(CascadeFlags::IS_FIELDSET_CONTENT) {
|
||||
return;
|
||||
match self.style.pseudo {
|
||||
Some(ref p) if p.is_fieldset_content() => {},
|
||||
_ => return,
|
||||
}
|
||||
|
||||
debug_assert_eq!(self.style.get_box().clone_display(), Display::Block);
|
||||
// TODO We actually want style from parent rather than layout
|
||||
// parent, so that this fixup doesn't happen incorrectly when
|
||||
|
@ -570,7 +570,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
self.adjust_for_prohibited_display_contents(flags);
|
||||
self.adjust_for_fieldset_content(layout_parent_style, flags);
|
||||
self.adjust_for_fieldset_content(layout_parent_style);
|
||||
}
|
||||
self.adjust_for_top_layer();
|
||||
self.blockify_if_necessary(layout_parent_style, flags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue