mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Ignore non-margin properties in @page rule
Extend Servo's @page parsing to match Gecko's CSS 2.2 behavior, where only margin properties are allowed in an @page rule. Other properties are ignored. MozReview-Commit-ID: IPYUlnkLYSb
This commit is contained in:
parent
f0e849cbd8
commit
981571f4f8
10 changed files with 47 additions and 20 deletions
|
@ -97,7 +97,8 @@ class Longhand(object):
|
|||
need_clone=False, need_index=False, gecko_ffi_name=None, depend_on_viewport_size=False,
|
||||
allowed_in_keyframe_block=True, complex_color=False, cast_type='u8',
|
||||
has_uncacheable_values=False, logical=False, alias=None, extra_prefixes=None, boxed=False,
|
||||
creates_stacking_context=False, fixpos_cb=False, abspos_cb=False):
|
||||
creates_stacking_context=False, fixpos_cb=False, abspos_cb=False,
|
||||
allowed_in_page_rule=False):
|
||||
self.name = name
|
||||
if not spec:
|
||||
raise TypeError("Spec should be specified for %s" % name)
|
||||
|
@ -124,6 +125,7 @@ class Longhand(object):
|
|||
self.creates_stacking_context = arg_to_bool(creates_stacking_context)
|
||||
self.fixpos_cb = arg_to_bool(fixpos_cb)
|
||||
self.abspos_cb = arg_to_bool(abspos_cb)
|
||||
self.allowed_in_page_rule = arg_to_bool(allowed_in_page_rule)
|
||||
|
||||
# https://drafts.csswg.org/css-animations/#keyframes
|
||||
# > The <declaration-list> inside of <keyframe-block> accepts any CSS property
|
||||
|
@ -154,7 +156,8 @@ class Longhand(object):
|
|||
|
||||
class Shorthand(object):
|
||||
def __init__(self, name, sub_properties, spec=None, experimental=False, internal=False,
|
||||
allowed_in_keyframe_block=True, alias=None, extra_prefixes=None):
|
||||
allowed_in_keyframe_block=True, alias=None, extra_prefixes=None,
|
||||
allowed_in_page_rule=False):
|
||||
self.name = name
|
||||
if not spec:
|
||||
raise TypeError("Spec should be specified for %s" % name)
|
||||
|
@ -167,6 +170,7 @@ class Shorthand(object):
|
|||
self.internal = internal
|
||||
self.alias = alias.split() if alias else []
|
||||
self.extra_prefixes = extra_prefixes.split() if extra_prefixes else []
|
||||
self.allowed_in_page_rule = arg_to_bool(allowed_in_page_rule)
|
||||
|
||||
# https://drafts.csswg.org/css-animations/#keyframes
|
||||
# > The <declaration-list> inside of <keyframe-block> accepts any CSS property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue