From 1698ac831759676ab3736b267744176337c1611c Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Fri, 12 Aug 2011 14:42:58 -0700 Subject: [PATCH] Add back support for old-style border radius properties. --- r2/r2/lib/cssfilter.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/r2/r2/lib/cssfilter.py b/r2/r2/lib/cssfilter.py index 12dcc28c3..5b205ad1a 100644 --- a/r2/r2/lib/cssfilter.py +++ b/r2/r2/lib/cssfilter.py @@ -64,6 +64,8 @@ custom_macros = { 'bg-gradient': r'none|{color}|[a-z-]*-gradient\(.*\)', 'bg-gradients': r'{bg-gradient}(?:,\s*{bg-gradient})*', + + 'border-radius': r'(({length}|{percentage}){w}){1,2}', 'single-text-shadow': r'({color}\s+)?{length}\s+{length}(\s+{length})?|{length}\s+{length}(\s+{length})?(\s+{color})?', @@ -85,11 +87,17 @@ custom_values = { 'background-position': r'(({percentage}|{length}){0,3})?\s*(top|center|left)?\s*(left|center|right)?', # http://www.w3.org/TR/css3-background/#border-top-right-radius - 'border-radius': r'(({length}|{percentage}){w}){1,2}', - 'border-top-right-radius': r'(({length}|{percentage}){w}){1,2}', - 'border-bottom-right-radius': r'(({length}|{percentage}){w}){1,2}', - 'border-bottom-left-radius': r'(({length}|{percentage}){w}){1,2}', - 'border-top-left-radius': r'(({length}|{percentage}){w}){1,2}', + 'border-radius': r'{border-radius}', + 'border-top-right-radius': r'{border-radius}', + 'border-bottom-right-radius': r'{border-radius}', + 'border-bottom-left-radius': r'{border-radius}', + 'border-top-left-radius': r'{border-radius}', + + # old mozilla style (for compatibility with existing stylesheets) + 'border-radius-topright': r'{border-radius}', + 'border-radius-bottomright': r'{border-radius}', + 'border-radius-bottomleft': r'{border-radius}', + 'border-radius-topleft': r'{border-radius}', # http://www.w3.org/TR/css3-text/#text-shadow 'text-shadow': r'none|({single-text-shadow}{w},{w})*{single-text-shadow}',