mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Remove unused stubbing support for Gecko properties.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
041de7ba65
commit
162acd6cab
1 changed files with 3 additions and 59 deletions
|
@ -1146,13 +1146,6 @@ impl Clone for ${style_struct.gecko_struct_name} {
|
||||||
longhands = [x for x in style_struct.longhands
|
longhands = [x for x in style_struct.longhands
|
||||||
if not (skip_longhands == "*" or x.name in skip_longhands.split())]
|
if not (skip_longhands == "*" or x.name in skip_longhands.split())]
|
||||||
|
|
||||||
#
|
|
||||||
# Make a list of types we can't auto-generate.
|
|
||||||
#
|
|
||||||
force_stub = [];
|
|
||||||
# These have unusual representations in gecko.
|
|
||||||
force_stub += ["list-style-type"]
|
|
||||||
|
|
||||||
# Types used with predefined_type()-defined properties that we can auto-generate.
|
# Types used with predefined_type()-defined properties that we can auto-generate.
|
||||||
predefined_types = {
|
predefined_types = {
|
||||||
"length::LengthOrAuto": impl_style_coord,
|
"length::LengthOrAuto": impl_style_coord,
|
||||||
|
@ -1200,30 +1193,10 @@ impl Clone for ${style_struct.gecko_struct_name} {
|
||||||
|
|
||||||
method(**args)
|
method(**args)
|
||||||
|
|
||||||
picked_longhands, stub_longhands = [], []
|
picked_longhands = []
|
||||||
for x in longhands:
|
for x in longhands:
|
||||||
if (x.keyword or x.predefined_type in predefined_types or x.logical) and x.name not in force_stub:
|
if x.keyword or x.predefined_type in predefined_types or x.logical:
|
||||||
picked_longhands.append(x)
|
picked_longhands.append(x)
|
||||||
else:
|
|
||||||
stub_longhands.append(x)
|
|
||||||
|
|
||||||
# If one of the longhands is not handled
|
|
||||||
# by either:
|
|
||||||
# - being a keyword
|
|
||||||
# - being a predefined longhand
|
|
||||||
# - being a longhand with manual glue code (i.e. in skip_longhands)
|
|
||||||
# - being generated as a stub
|
|
||||||
#
|
|
||||||
# then we raise an error here.
|
|
||||||
#
|
|
||||||
# If you hit this error, please add `product="servo"` to the longhand.
|
|
||||||
# In case the longhand is used in a shorthand, add it to the force_stub
|
|
||||||
# list above.
|
|
||||||
|
|
||||||
for stub in stub_longhands:
|
|
||||||
if stub.name not in force_stub:
|
|
||||||
raise Exception("Don't know what to do with longhand %s in style struct %s"
|
|
||||||
% (stub.name,style_struct. gecko_struct_name))
|
|
||||||
%>
|
%>
|
||||||
impl ${style_struct.gecko_struct_name} {
|
impl ${style_struct.gecko_struct_name} {
|
||||||
/*
|
/*
|
||||||
|
@ -1238,35 +1211,6 @@ impl ${style_struct.gecko_struct_name} {
|
||||||
for longhand in picked_longhands:
|
for longhand in picked_longhands:
|
||||||
longhand_method(longhand)
|
longhand_method(longhand)
|
||||||
%>
|
%>
|
||||||
|
|
||||||
/*
|
|
||||||
* Stubs.
|
|
||||||
*/
|
|
||||||
% for longhand in stub_longhands:
|
|
||||||
#[allow(non_snake_case)]
|
|
||||||
pub fn set_${longhand.ident}(&mut self, _: longhands::${longhand.ident}::computed_value::T) {
|
|
||||||
warn!("stylo: Unimplemented property setter: ${longhand.name}");
|
|
||||||
}
|
|
||||||
#[allow(non_snake_case)]
|
|
||||||
pub fn copy_${longhand.ident}_from(&mut self, _: &Self) {
|
|
||||||
warn!("stylo: Unimplemented property setter: ${longhand.name}");
|
|
||||||
}
|
|
||||||
#[allow(non_snake_case)]
|
|
||||||
pub fn reset_${longhand.ident}(&mut self, other: &Self) {
|
|
||||||
self.copy_${longhand.ident}_from(other)
|
|
||||||
}
|
|
||||||
#[allow(non_snake_case)]
|
|
||||||
pub fn clone_${longhand.ident}(&self) -> longhands::${longhand.ident}::computed_value::T {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
% if longhand.need_index:
|
|
||||||
pub fn ${longhand.ident}_count(&self) -> usize { 0 }
|
|
||||||
pub fn ${longhand.ident}_at(&self, _index: usize)
|
|
||||||
-> longhands::${longhand.ident}::computed_value::SingleComputedValue {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
% endif
|
|
||||||
% endfor
|
|
||||||
}
|
}
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
|
@ -5690,7 +5634,7 @@ clip-path
|
||||||
${impl_simple_copy("_moz_box_ordinal_group", "mBoxOrdinal")}
|
${impl_simple_copy("_moz_box_ordinal_group", "mBoxOrdinal")}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
pub fn clone__moz_box_ordinal_group(&self) -> i32{
|
pub fn clone__moz_box_ordinal_group(&self) -> i32 {
|
||||||
self.gecko.mBoxOrdinal as i32
|
self.gecko.mBoxOrdinal as i32
|
||||||
}
|
}
|
||||||
</%self:impl_trait>
|
</%self:impl_trait>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue