diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2012-07-22 22:23:32 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-07-22 22:23:32 -0400 |
commit | c14a6b385fa419ce67f115e853fb4a89d8bd8fad (patch) | |
tree | c3214778d8bd142388c73b0c6a899372fd95a950 /src/css.js | |
parent | 74cc5b0984335532ab272b8286566000c4bf3daf (diff) | |
download | jquery-c14a6b385fa419ce67f115e853fb4a89d8bd8fad.tar.gz jquery-c14a6b385fa419ce67f115e853fb4a89d8bd8fad.zip |
Clean up regexen; use common regex for numbers. Close gh-862.
Diffstat (limited to 'src/css.js')
-rw-r--r-- | src/css.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/css.js b/src/css.js index 41b978542..0b20b7c4c 100644 --- a/src/css.js +++ b/src/css.js @@ -1,25 +1,24 @@ var curCSS, iframe, iframeDoc, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity=([^)]*)/, - rnumsplit = /^([\-+]?(?:\d*\.)?\d+)(.*)$/i, - rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i, - rrelNum = /^([\-+])=([\-+.\de]+)/, + rposition = /^(top|right|bottom|left)$/, rmargin = /^margin/, + rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), + rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), + rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ), elemdisplay = {}, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - - // order is important! - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], - rposition = /^(top|right|bottom|left)$/, - - eventsToggle = jQuery.fn.toggle, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400, lineHeight: 1 - }; + }, + + cssExpand = [ "Top", "Right", "Bottom", "Left" ], + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], + + eventsToggle = jQuery.fn.toggle; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { |