mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Implement 'inline list-item' and 'inline flow-root list-item' values for the 'display' property.
Differential Revision: https://phabricator.services.mozilla.com/D39832
This commit is contained in:
parent
07dad28e49
commit
2d29e6edd4
2 changed files with 84 additions and 90 deletions
|
@ -8,6 +8,8 @@
|
|||
use crate::dom::TElement;
|
||||
use crate::properties::computed_value_flags::ComputedValueFlags;
|
||||
use crate::properties::longhands::display::computed_value::T as Display;
|
||||
#[cfg(feature = "gecko")]
|
||||
use crate::values::specified::box_::DisplayInside;
|
||||
use crate::properties::longhands::float::computed_value::T as Float;
|
||||
use crate::properties::longhands::overflow_x::computed_value::T as Overflow;
|
||||
use crate::properties::longhands::position::computed_value::T as Position;
|
||||
|
@ -175,7 +177,9 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
/// Apply the blockification rules based on the table in CSS 2.2 section 9.7.
|
||||
/// <https://drafts.csswg.org/css2/visuren.html#dis-pos-flo>
|
||||
/// A ::marker pseudo-element with 'list-style-position:outside' needs to
|
||||
/// have its 'display' blockified.
|
||||
/// have its 'display' blockified, unless the ::marker is for an inline
|
||||
/// list-item (for which 'list-style-position:outside' behaves as 'inside').
|
||||
/// https://drafts.csswg.org/css-lists-3/#list-style-position-property
|
||||
fn blockify_if_necessary<E>(&mut self, layout_parent_style: &ComputedValues, element: Option<E>)
|
||||
where
|
||||
E: TElement,
|
||||
|
@ -194,21 +198,19 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
let is_root = self.style.pseudo.is_none() && element.map_or(false, |e| e.is_root());
|
||||
blockify_if!(is_root);
|
||||
if !self.skip_item_display_fixup(element) {
|
||||
blockify_if!(layout_parent_style
|
||||
.get_box()
|
||||
.clone_display()
|
||||
.is_item_container());
|
||||
let parent_display = layout_parent_style.get_box().clone_display();
|
||||
blockify_if!(parent_display.is_item_container());
|
||||
}
|
||||
|
||||
let is_item_or_root = blockify;
|
||||
|
||||
blockify_if!(self.style.floated());
|
||||
blockify_if!(self.style.out_of_flow_positioned());
|
||||
#[cfg(feature = "gecko")]
|
||||
blockify_if!(
|
||||
self.style.pseudo.map_or(false, |p| p.is_marker()) &&
|
||||
self.style.get_parent_list().clone_list_style_position() ==
|
||||
ListStylePosition::Outside
|
||||
);
|
||||
self.style.get_parent_list().clone_list_style_position() == ListStylePosition::Outside &&
|
||||
layout_parent_style.get_box().clone_display().inside() != DisplayInside::Inline);
|
||||
|
||||
if !blockify {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue