mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make "align descendants" rule use parent's text-align.
Flows never care about their own text-align, only the text-align of their parent; change the text-align flags to account for that. Make the "align descendants" rule use the flags instead of the current node's style. Fixes #7301.
This commit is contained in:
parent
69ca066802
commit
a31461bad9
2 changed files with 4 additions and 21 deletions
|
@ -655,14 +655,6 @@ static HAS_FLOATED_DESCENDANTS_BITMASK: FlowFlags = FlowFlags { bits: 0b0000_001
|
|||
static TEXT_ALIGN_SHIFT: usize = 11;
|
||||
|
||||
impl FlowFlags {
|
||||
/// Propagates text alignment flags from an appropriate parent flow per CSS 2.1.
|
||||
///
|
||||
/// FIXME(#2265, pcwalton): It would be cleaner and faster to make this a derived CSS property
|
||||
/// `-servo-text-align-in-effect`.
|
||||
pub fn propagate_text_alignment_from_parent(&mut self, parent_flags: FlowFlags) {
|
||||
self.set_text_align_override(parent_flags);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn text_align(self) -> text_align::T {
|
||||
text_align::T::from_u32((self & TEXT_ALIGN).bits() >> TEXT_ALIGN_SHIFT).unwrap()
|
||||
|
@ -674,11 +666,6 @@ impl FlowFlags {
|
|||
FlowFlags::from_bits(value.to_u32() << TEXT_ALIGN_SHIFT).unwrap();
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_text_align_override(&mut self, parent: FlowFlags) {
|
||||
self.insert(parent & TEXT_ALIGN);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn union_floated_descendants_flags(&mut self, other: FlowFlags) {
|
||||
self.insert(other & HAS_FLOATED_DESCENDANTS_BITMASK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue