mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Move all the fixup code into a StyleAdjuster struct.
This will allow reusing it from text styles, which we need for some corner cases, like text-align: -moz-center and similar stuff.
This commit is contained in:
parent
cd8af86244
commit
ccf15c0a26
5 changed files with 356 additions and 208 deletions
|
@ -179,6 +179,12 @@ impl ComputedValues {
|
|||
!self.get_box().gecko.mBinding.mPtr.mRawPtr.is_null()
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
pub fn in_top_layer(&self) -> bool {
|
||||
matches!(self.get_box().clone__moz_top_layer(),
|
||||
longhands::_moz_top_layer::SpecifiedValue::top)
|
||||
}
|
||||
|
||||
// FIXME(bholley): Implement this properly.
|
||||
#[inline]
|
||||
pub fn is_multicol(&self) -> bool { false }
|
||||
|
@ -1814,7 +1820,9 @@ fn static_assert() {
|
|||
/// Set the display value from the style adjustment code. This is pretty
|
||||
/// much like set_display, but without touching the mOriginalDisplay field,
|
||||
/// which we want to keep.
|
||||
pub fn set_adjusted_display(&mut self, v: longhands::display::computed_value::T) {
|
||||
pub fn set_adjusted_display(&mut self,
|
||||
v: longhands::display::computed_value::T,
|
||||
_is_item_or_root: bool) {
|
||||
use properties::longhands::display::computed_value::T as Keyword;
|
||||
let result = match v {
|
||||
% for value in display_keyword.values_for('gecko'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue