implement vendor prefixes for @keyframes
This commit is contained in:
parent
a28ef7f3ed
commit
8e2a9141be
32
rcssmin.c
32
rcssmin.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011
|
* Copyright 2011 - 2014
|
||||||
* Andr\xe9 Malo or his licensors, as applicable
|
* Andr\xe9 Malo or his licensors, as applicable
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -126,6 +126,26 @@ static const rchar pattern_keyframes[] = {
|
|||||||
U('K'), U('E'), U('Y'), U('F'), U('R'), U('A'), U('M'), U('E'), U('S')
|
U('K'), U('E'), U('Y'), U('F'), U('R'), U('A'), U('M'), U('E'), U('S')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const rchar pattern_vendor_o[] = {
|
||||||
|
U('-'), U('o'), U('-'),
|
||||||
|
U('-'), U('O'), U('-')
|
||||||
|
};
|
||||||
|
|
||||||
|
static const rchar pattern_vendor_moz[] = {
|
||||||
|
U('-'), U('m'), U('o'), U('z'), U('-'),
|
||||||
|
U('-'), U('M'), U('O'), U('Z'), U('-')
|
||||||
|
};
|
||||||
|
|
||||||
|
static const rchar pattern_vendor_webkit[] = {
|
||||||
|
U('-'), U('w'), U('e'), U('b'), U('k'), U('i'), U('t'), U('-'),
|
||||||
|
U('-'), U('W'), U('E'), U('B'), U('K'), U('I'), U('T'), U('-')
|
||||||
|
};
|
||||||
|
|
||||||
|
static const rchar pattern_vendor_ms[] = {
|
||||||
|
U('-'), U('m'), U('s'), U('-'),
|
||||||
|
U('-'), U('M'), U('S'), U('-')
|
||||||
|
};
|
||||||
|
|
||||||
static const rchar pattern_first[] = {
|
static const rchar pattern_first[] = {
|
||||||
U('f'), U('i'), U('r'), U('s'), U('t'), U('-'), U('l'),
|
U('f'), U('i'), U('r'), U('s'), U('t'), U('-'), U('l'),
|
||||||
U('F'), U('I'), U('R'), U('S'), U('T'), U('-'), U('L')
|
U('F'), U('I'), U('R'), U('S'), U('T'), U('-'), U('L')
|
||||||
@ -549,15 +569,21 @@ copy_at_group(const rchar **source_, rchar **target_, rcssmin_ctx_t *ctx)
|
|||||||
target = *target_, \
|
target = *target_, \
|
||||||
IMATCH(what, &source, &target, ctx) \
|
IMATCH(what, &source, &target, ctx) \
|
||||||
)
|
)
|
||||||
|
#define CMATCH(what) IMATCH(what, &source, &target, ctx)
|
||||||
|
|
||||||
if (( !IMATCH(media, &source, &target, ctx)
|
if (( !CMATCH(media)
|
||||||
&& !REMATCH(supports)
|
&& !REMATCH(supports)
|
||||||
|
&& !REMATCH(document)
|
||||||
&& !REMATCH(keyframes)
|
&& !REMATCH(keyframes)
|
||||||
&& !REMATCH(document))
|
&& !(REMATCH(vendor_webkit) && CMATCH(keyframes))
|
||||||
|
&& !(REMATCH(vendor_moz) && CMATCH(keyframes))
|
||||||
|
&& !(REMATCH(vendor_o) && CMATCH(keyframes))
|
||||||
|
&& !(REMATCH(vendor_ms) && CMATCH(keyframes)))
|
||||||
|| !(source < ctx->sentinel && target < ctx->tsentinel)
|
|| !(source < ctx->sentinel && target < ctx->tsentinel)
|
||||||
|| RCSSMIN_IS_NMCHAR(*source))
|
|| RCSSMIN_IS_NMCHAR(*source))
|
||||||
ABORT;
|
ABORT;
|
||||||
|
|
||||||
|
#undef CMATCH
|
||||||
#undef REMATCH
|
#undef REMATCH
|
||||||
|
|
||||||
++ctx->at_group;
|
++ctx->at_group;
|
||||||
|
@ -193,8 +193,11 @@ def _make_cssmin(python_only=False):
|
|||||||
r'|(@(?:'
|
r'|(@(?:'
|
||||||
r'[mM][eE][dD][iI][aA]'
|
r'[mM][eE][dD][iI][aA]'
|
||||||
r'|[sS][uU][pP][pP][oO][rR][tT][sS]'
|
r'|[sS][uU][pP][pP][oO][rR][tT][sS]'
|
||||||
r'|[kK][eE][yY][fF][rR][aA][mM][eE][sS]'
|
|
||||||
r'|[dD][oO][cC][uU][mM][eE][nN][tT]'
|
r'|[dD][oO][cC][uU][mM][eE][nN][tT]'
|
||||||
|
r'|(?:-(?:'
|
||||||
|
r'[wW][eE][bB][kK][iI][tT]|[mM][oO][zZ]|[oO]|[mM][sS]'
|
||||||
|
r')-)?'
|
||||||
|
r'[kK][eE][yY][fF][rR][aA][mM][eE][sS]'
|
||||||
r'))(?!%(nmchar)s)'
|
r'))(?!%(nmchar)s)'
|
||||||
r'|(%(ie7hack)s)(%(space)s*)'
|
r'|(%(ie7hack)s)(%(space)s*)'
|
||||||
r'|(:[fF][iI][rR][sS][tT]-[lL]'
|
r'|(:[fF][iI][rR][sS][tT]-[lL]'
|
||||||
|
Loading…
Reference in New Issue
Block a user