mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Share supported CSS properties between style and CSSStyleDeclaration
Avoids duplicated code when implementing the CSS properties accessors in CSSStyleDeclaration WebIDL. Servo internal CSS properties are not accessible. CSS property "float" is unnacessible because we currently lack support for BinaryName IDL annotation (#4435). Fixes #4429, #4430.
This commit is contained in:
parent
d747a33df9
commit
dc008977f9
4 changed files with 46 additions and 97 deletions
|
@ -342,93 +342,5 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> {
|
|||
rval
|
||||
}
|
||||
|
||||
css_properties!(
|
||||
[Color, SetColor, "color"],
|
||||
[Background, SetBackground, "background"],
|
||||
[BackgroundColor, SetBackgroundColor, "background-color"],
|
||||
[BackgroundPosition, SetBackgroundPosition, "background-position"],
|
||||
[BackgroundImage, SetBackgroundImage, "background-image"],
|
||||
[BackgroundRepeat, SetBackgroundRepeat, "background-repeat"],
|
||||
[BackgroundAttachment, SetBackgroundAttachment, "background-attachment"],
|
||||
[Border, SetBorder, "border"],
|
||||
[BorderColor, SetBorderColor, "border-color"],
|
||||
[BorderRadius, SetBorderRadius, "border-radius"],
|
||||
[BorderStyle, SetBorderStyle, "border-style"],
|
||||
[BorderWidth, SetBorderWidth, "border-width"],
|
||||
[BorderBottom, SetBorderBottom, "border-bottom"],
|
||||
[BorderBottomColor, SetBorderBottomColor, "border-bottom-color"],
|
||||
[BorderBottomStyle, SetBorderBottomStyle, "border-bottom-style"],
|
||||
[BorderBottomWidth, SetBorderBottomWidth, "border-bottom-width"],
|
||||
[BorderLeft, SetBorderLeft, "border-left"],
|
||||
[BorderLeftColor, SetBorderLeftColor, "border-left-color"],
|
||||
[BorderLeftStyle, SetBorderLeftStyle, "border-left-style"],
|
||||
[BorderLeftWidth, SetBorderLeftWidth, "border-left-width"],
|
||||
[BorderRight, SetBorderRight, "border-right"],
|
||||
[BorderRightColor, SetBorderRightColor, "border-right-color"],
|
||||
[BorderRightStyle, SetBorderRightStyle, "border-right-style"],
|
||||
[BorderRightWidth, SetBorderRightWidth, "border-right-width"],
|
||||
[BorderTop, SetBorderTop, "border-top"],
|
||||
[BorderTopColor, SetBorderTopColor, "border-top-color"],
|
||||
[BorderTopStyle, SetBorderTopStyle, "border-top-style"],
|
||||
[BorderTopWidth, SetBorderTopWidth, "border-top-width"],
|
||||
[Content, SetContent, "content"],
|
||||
[Display, SetDisplay, "display"],
|
||||
[Opacity, SetOpacity, "opacity"],
|
||||
[Width, SetWidth, "width"],
|
||||
[MinWidth, SetMinWidth, "min-width"],
|
||||
[MaxWidth, SetMaxWidth, "max-width"],
|
||||
[Height, SetHeight, "height"],
|
||||
[MinHeight, SetMinHeight, "min-height"],
|
||||
[MaxHeight, SetMaxHeight, "max-height"],
|
||||
[Clear, SetClear, "clear"],
|
||||
[Direction, SetDirection, "direction"],
|
||||
[LineHeight, SetLineHeight, "line-height"],
|
||||
[VerticalAlign, SetVerticalAlign, "vertical-align"],
|
||||
[ListStyle, SetListStyle, "list-style"],
|
||||
[ListStylePosition, SetListStylePosition, "list-style-position"],
|
||||
[ListStyleType, SetListStyleType, "list-style-type"],
|
||||
[ListStyleImage, SetListStyleImage, "list-style-image"],
|
||||
[Visibility, SetVisibility, "visibility"],
|
||||
[Cursor, SetCursor, "cursor"],
|
||||
[BoxShadow, SetBoxShadow, "box-shadow"],
|
||||
[BoxSizing, SetBoxSizing, "box-sizing"],
|
||||
[Overflow, SetOverflow, "overflow"],
|
||||
[OverflowWrap, SetOverflowWrap, "overflow-wrap"],
|
||||
[TableLayout, SetTableLayout, "table-layout"],
|
||||
[EmptyCells, SetEmptyCells, "empty-cells"],
|
||||
[CaptionSide, SetCaptionSide, "caption-side"],
|
||||
[WhiteSpace, SetWhiteSpace, "white-space"],
|
||||
[WritingMode, SetWritingMode, "writing-mode"],
|
||||
[LetterSpacing, SetLetterSpacing, "letter-spacing"],
|
||||
[WordSpacing, SetWordSpacing, "word-spacing"],
|
||||
[WordWrap, SetWordWrap, "word-wrap"],
|
||||
[TextAlign, SetTextAlign, "text-align"],
|
||||
[TextDecoration, SetTextDecoration, "text-decoration"],
|
||||
[TextIndent, SetTextIndent, "text-indent"],
|
||||
[TextOrientation, SetTextOrientation, "text-orientation"],
|
||||
[TextTransform, SetTextTransform, "text-transform"],
|
||||
[Font, SetFont, "font"],
|
||||
[FontFamily, SetFontFamily, "font-family"],
|
||||
[FontSize, SetFontSize, "font-size"],
|
||||
[FontStyle, SetFontStyle, "font-style"],
|
||||
[FontVariant, SetFontVariant, "font-variant"],
|
||||
[FontWeight, SetFontWeight, "font-weight"],
|
||||
[Margin, SetMargin, "margin"],
|
||||
[MarginBottom, SetMarginBottom, "margin-bottom"],
|
||||
[MarginLeft, SetMarginLeft, "margin-left"],
|
||||
[MarginRight, SetMarginRight, "margin-right"],
|
||||
[MarginTop, SetMarginTop, "margin-top"],
|
||||
[Padding, SetPadding, "padding"],
|
||||
[PaddingBottom, SetPaddingBottom, "padding-bottom"],
|
||||
[PaddingLeft, SetPaddingLeft, "padding-left"],
|
||||
[PaddingRight, SetPaddingRight, "padding-right"],
|
||||
[PaddingTop, SetPaddingTop, "padding-top"],
|
||||
[Outline, SetOutline, "outline"],
|
||||
[Position, SetPosition, "position"],
|
||||
[Bottom, SetBottom, "bottom"],
|
||||
[Left, SetLeft, "left"],
|
||||
[Right, SetRight, "right"],
|
||||
[Top, SetTop, "top"],
|
||||
[ZIndex, SetZIndex, "z-index"]
|
||||
)
|
||||
css_properties_accessors!(css_properties)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue