Auto merge of #19980 - servo:derive-all-the-things, r=emilio

Merge all keyword arms in Clone for PropertyDeclaration 🐉🐲

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19980)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-02-09 16:17:01 -05:00 committed by GitHub
commit 41fb6ed1ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 125 additions and 31 deletions

View file

@ -229,6 +229,58 @@ class Longhand(object):
def enabled_in_content(self):
return self.enabled_in == "content"
def specified_type(self):
if self.predefined_type and not self.is_vector:
ty = "::values::specified::{}".format(self.predefined_type)
else:
ty = "longhands::{}::SpecifiedValue".format(self.ident)
if self.boxed:
ty = "Box<{}>".format(ty)
return ty
def specified_is_copy(self):
if self.is_vector or self.boxed:
return False
if self.predefined_type:
return self.predefined_type in {
"AlignContent",
"AlignItems",
"AlignSelf",
"BackgroundRepeat",
"BorderImageRepeat",
"BorderStyle",
"Contain",
"FontStyleAdjust",
"FontSynthesis",
"FontWeight",
"GridAutoFlow",
"ImageOrientation",
"InitialLetter",
"Integer",
"IntegerOrAuto",
"JustifyContent",
"JustifyItems",
"JustifySelf",
"MozForceBrokenImageIcon",
"MozScriptLevel",
"MozScriptMinSize",
"MozScriptSizeMultiplier",
"NonNegativeNumber",
"Opacity",
"OutlineStyle",
"OverscrollBehavior",
"Percentage",
"PositiveIntegerOrAuto",
"SVGPaintOrder",
"ScrollSnapType",
"TextDecorationLine",
"TouchAction",
"TransformStyle",
"XSpan",
"XTextZoom",
}
return bool(self.keyword)
class Shorthand(object):
def __init__(self, name, sub_properties, spec=None, servo_pref=None, gecko_pref=None,