mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Ensure logical longhands appear before their physical counter-part.
Bug: 1410028 Reviewed-by: xidorn MozReview-Commit-ID: KPIbt1e2Eq
This commit is contained in:
parent
a296e386af
commit
b8021335d7
1 changed files with 31 additions and 5 deletions
|
@ -173,11 +173,37 @@ pub mod shorthands {
|
||||||
|
|
||||||
// We don't defined the 'all' shorthand using the regular helpers:shorthand
|
// We don't defined the 'all' shorthand using the regular helpers:shorthand
|
||||||
// mechanism, since it causes some very large types to be generated.
|
// mechanism, since it causes some very large types to be generated.
|
||||||
<% data.declare_shorthand("all",
|
//
|
||||||
[p.name for p in data.longhands
|
// Also, make sure logical properties appear before its physical
|
||||||
if p.name not in ['direction', 'unicode-bidi']
|
// counter-parts, in order to prevent bugs like:
|
||||||
and not p.internal],
|
//
|
||||||
spec="https://drafts.csswg.org/css-cascade-3/#all-shorthand") %>
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1410028
|
||||||
|
//
|
||||||
|
// FIXME(emilio): Adopt the resolution from:
|
||||||
|
//
|
||||||
|
// https://github.com/w3c/csswg-drafts/issues/1898
|
||||||
|
//
|
||||||
|
// when there is one, whatever that is.
|
||||||
|
<%
|
||||||
|
logical_longhands = []
|
||||||
|
other_longhands = []
|
||||||
|
|
||||||
|
for p in data.longhands:
|
||||||
|
if p.name in ['direction', 'unicode-bidi']:
|
||||||
|
continue;
|
||||||
|
if p.internal:
|
||||||
|
continue;
|
||||||
|
if p.logical:
|
||||||
|
logical_longhands.append(p.name)
|
||||||
|
else:
|
||||||
|
other_longhands.append(p.name)
|
||||||
|
|
||||||
|
data.declare_shorthand(
|
||||||
|
"all",
|
||||||
|
logical_longhands + other_longhands,
|
||||||
|
spec="https://drafts.csswg.org/css-cascade-3/#all-shorthand"
|
||||||
|
)
|
||||||
|
%>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A module with all the code related to animated properties.
|
/// A module with all the code related to animated properties.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue