forked from lojjic/PIE
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement rendering of background-clip. Fix order of gradient opacity.
- Loading branch information
Jason Johnston
committed
Dec 27, 2011
1 parent
037ffb3
commit 775ce0a
Showing
7 changed files
with
123 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Handles parsing, caching, and detecting changes to padding CSS | ||
* @constructor | ||
* @param {Element} el the target element | ||
*/ | ||
PIE.PaddingStyleInfo = PIE.StyleInfoBase.newStyleInfo( { | ||
|
||
parseCss: function( css ) { | ||
var tokenizer = new PIE.Tokenizer( css ), | ||
arr = [], | ||
token; | ||
|
||
while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) { | ||
arr.push( PIE.getLength( token.tokenValue ) ); | ||
} | ||
return arr.length > 0 && arr.length < 5 ? { | ||
't': arr[0], | ||
'r': arr[1] || arr[0], | ||
'b': arr[2] || arr[0], | ||
'l': arr[3] || arr[1] || arr[0] | ||
} : null; | ||
}, | ||
|
||
getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { | ||
var el = this.targetElement, | ||
rs = el.runtimeStyle, | ||
rsPadding = rs.padding, | ||
padding; | ||
if( rsPadding ) rs.padding = ''; | ||
padding = el.currentStyle.padding; | ||
if( rsPadding ) rs.padding = rsPadding; | ||
return padding; | ||
} ) | ||
|
||
} ); |