mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Do not inherit node and fragment flags in anonymous boxes (#31586)
This doesn't really have observable behavior right now, as much as I tried to trigger some kind of bug. On the other hand, it's just wrong and is very obvious when you dump the Fragment tree. If you create a `display: table-cell` that is a child of the `<body>` all parts of the anonymous table are flagged as if they are the `<body>` element.
This commit is contained in:
parent
55f908653f
commit
1f23ec2b27
7 changed files with 73 additions and 38 deletions
|
@ -47,8 +47,8 @@ impl BaseFragment {
|
|||
/// Information necessary to construct a new BaseFragment.
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub(crate) struct BaseFragmentInfo {
|
||||
/// The tag to use for the new BaseFragment.
|
||||
pub tag: Tag,
|
||||
/// The tag to use for the new BaseFragment, if it is not an anonymous Fragment.
|
||||
pub tag: Option<Tag>,
|
||||
|
||||
/// The flags to use for the new BaseFragment.
|
||||
pub flags: FragmentFlags,
|
||||
|
@ -57,7 +57,14 @@ pub(crate) struct BaseFragmentInfo {
|
|||
impl BaseFragmentInfo {
|
||||
pub(crate) fn new_for_node(node: OpaqueNode) -> Self {
|
||||
Self {
|
||||
tag: Tag::new(node),
|
||||
tag: Some(Tag::new(node)),
|
||||
flags: FragmentFlags::empty(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn anonymous() -> Self {
|
||||
Self {
|
||||
tag: None,
|
||||
flags: FragmentFlags::empty(),
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +73,7 @@ impl BaseFragmentInfo {
|
|||
impl From<BaseFragmentInfo> for BaseFragment {
|
||||
fn from(info: BaseFragmentInfo) -> Self {
|
||||
Self {
|
||||
tag: Some(info.tag),
|
||||
tag: info.tag,
|
||||
debug_id: DebugId::new(),
|
||||
flags: info.flags,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue