mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
stylo: Support -x-span for <col span>
This commit is contained in:
parent
b85e1f5f0c
commit
f27cd541b3
3 changed files with 57 additions and 4 deletions
|
@ -2230,6 +2230,15 @@ fn static_assert() {
|
|||
|
||||
</%self:impl_trait>
|
||||
|
||||
<%self:impl_trait style_struct_name="Table" skip_longhands="-x-span">
|
||||
#[allow(non_snake_case)]
|
||||
pub fn set__x_span(&mut self, v: longhands::_x_span::computed_value::T) {
|
||||
self.gecko.mSpan = v.0
|
||||
}
|
||||
|
||||
${impl_simple_copy('_x_span', 'mSpan')}
|
||||
</%self:impl_trait>
|
||||
|
||||
<%self:impl_trait style_struct_name="Effects"
|
||||
skip_longhands="box-shadow filter">
|
||||
pub fn set_box_shadow(&mut self, v: longhands::box_shadow::computed_value::T) {
|
||||
|
|
|
@ -9,3 +9,39 @@
|
|||
${helpers.single_keyword("table-layout", "auto fixed",
|
||||
gecko_ffi_name="mLayoutStrategy", animatable=False,
|
||||
spec="https://drafts.csswg.org/css-tables/#propdef-table-layout")}
|
||||
|
||||
<%helpers:longhand name="-x-span" products="gecko"
|
||||
spec="Internal-only (for `<col span>` pres attr)"
|
||||
animatable="False"
|
||||
internal="True">
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
pub type SpecifiedValue = computed_value::T;
|
||||
pub mod computed_value {
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(PartialEq, Clone, Copy, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub i32);
|
||||
|
||||
impl ToCss for T {
|
||||
fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
computed_value::T(1)
|
||||
}
|
||||
|
||||
// never parse it, only set via presentation attribute
|
||||
fn parse(_: &ParserContext, _: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
Err(())
|
||||
}
|
||||
</%helpers:longhand>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue