mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
layout: Allow transforming inline replaced elements (#31833)
This requires passing through information about whether or not the element in question is replaced when checking to see if it's transformable and transitively all functions that make decisions about containing blocks. A new FragmentFlag is added to help track this -- it will be set on both the replaced items BoxFragment container as well as the Fragment for the replaced item itself. Fixes #31806.
This commit is contained in:
parent
15cb9dd5fc
commit
b8c82c1ab0
11 changed files with 114 additions and 35 deletions
|
@ -16,7 +16,7 @@ use crate::dom::NodeExt;
|
|||
use crate::dom_traversal::{Contents, NodeAndStyleInfo};
|
||||
use crate::flexbox::FlexContainer;
|
||||
use crate::flow::BlockFormattingContext;
|
||||
use crate::fragment_tree::{BaseFragmentInfo, Fragment};
|
||||
use crate::fragment_tree::{BaseFragmentInfo, Fragment, FragmentFlags};
|
||||
use crate::positioned::PositioningContext;
|
||||
use crate::replaced::ReplacedContent;
|
||||
use crate::sizing::{self, ContentSizes};
|
||||
|
@ -131,11 +131,15 @@ impl IndependentFormattingContext {
|
|||
contents,
|
||||
})
|
||||
},
|
||||
Err(contents) => Self::Replaced(ReplacedFormattingContext {
|
||||
base_fragment_info: node_and_style_info.into(),
|
||||
style: Arc::clone(&node_and_style_info.style),
|
||||
contents,
|
||||
}),
|
||||
Err(contents) => {
|
||||
let mut base_fragment_info: BaseFragmentInfo = node_and_style_info.into();
|
||||
base_fragment_info.flags.insert(FragmentFlags::IS_REPLACED);
|
||||
Self::Replaced(ReplacedFormattingContext {
|
||||
base_fragment_info,
|
||||
style: Arc::clone(&node_and_style_info.style),
|
||||
contents,
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue