Skip to content

Commit

Permalink
style: Generate ComputedStyleMap entry list from property data.
Browse files Browse the repository at this point in the history
This changes the order of properties returned from gCS. The old order
doesn't make much sense, and other browsers don't agree on an identical
order either, so it should be trivial to change it. Also the spec isn't
super clear / useful in this case.

Several -moz-prefixed properties are excluded from the list due to their
being internal. I suspect they are never accessible anyway, so probably
nothing gets changed by this.

Bug: 1471114
Reviewed-by: xidorn
MozReview-Commit-ID: 9LfangjpJ3P
  • Loading branch information
upsuper authored and emilio committed Jun 30, 2018
1 parent 9d1ae18 commit ce0496e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/style/properties/properties.mako.rs
Expand Up @@ -836,6 +836,8 @@ bitflags! {
* they can be checked in the C++ side via ServoCSSPropList.h. */
/// This property can be animated on the compositor.
const CAN_ANIMATE_ON_COMPOSITOR = 0;
/// This shorthand property is accessible from getComputedStyle.
const SHORTHAND_IN_GETCS = 0;
}
}

Expand Down
1 change: 1 addition & 0 deletions components/style/properties/shorthands/background.mako.rs
Expand Up @@ -196,6 +196,7 @@
</%helpers:shorthand>

<%helpers:shorthand name="background-position"
flags="SHORTHAND_IN_GETCS"
sub_properties="background-position-x background-position-y"
spec="https://drafts.csswg.org/css-backgrounds-4/#the-background-position">
use properties::longhands::{background_position_x, background_position_y};
Expand Down
1 change: 1 addition & 0 deletions components/style/properties/shorthands/box.mako.rs
Expand Up @@ -6,6 +6,7 @@

<%helpers:shorthand
name="overflow"
flags="SHORTHAND_IN_GETCS"
sub_properties="overflow-x overflow-y"
spec="https://drafts.csswg.org/css-overflow/#propdef-overflow"
>
Expand Down
1 change: 1 addition & 0 deletions components/style/properties/shorthands/font.mako.rs
Expand Up @@ -285,6 +285,7 @@
</%helpers:shorthand>

<%helpers:shorthand name="font-variant"
flags="SHORTHAND_IN_GETCS"
sub_properties="font-variant-caps
${'font-variant-alternates' if product == 'gecko' else ''}
${'font-variant-east-asian' if product == 'gecko' else ''}
Expand Down
2 changes: 2 additions & 0 deletions components/style/properties/shorthands/svg.mako.rs
Expand Up @@ -5,6 +5,7 @@
<%namespace name="helpers" file="/helpers.mako.rs" />

<%helpers:shorthand name="mask" products="gecko" extra_prefixes="webkit"
flags="SHORTHAND_IN_GETCS"
sub_properties="mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position-x
mask-position-y mask-size mask-image"
spec="https://drafts.fxtf.org/css-masking/#propdef-mask">
Expand Down Expand Up @@ -182,6 +183,7 @@
</%helpers:shorthand>

<%helpers:shorthand name="mask-position" products="gecko" extra_prefixes="webkit"
flags="SHORTHAND_IN_GETCS"
sub_properties="mask-position-x mask-position-y"
spec="https://drafts.csswg.org/css-masks-4/#the-mask-position">
use properties::longhands::{mask_position_x,mask_position_y};
Expand Down
1 change: 1 addition & 0 deletions components/style/properties/shorthands/text.mako.rs
Expand Up @@ -5,6 +5,7 @@
<%namespace name="helpers" file="/helpers.mako.rs" />

<%helpers:shorthand name="text-decoration"
flags="SHORTHAND_IN_GETCS"
sub_properties="text-decoration-line
${' text-decoration-style text-decoration-color' if product == 'gecko' else ''}"
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration">
Expand Down

0 comments on commit ce0496e

Please sign in to comment.