Browse files

Add <opera> packager block

  • Loading branch information...
1 parent e30d1a0 commit df80aaf1d4d248b19a18a496613c9393abcb330c @arian arian committed Feb 11, 2013
Showing with 8 additions and 6 deletions.
  1. +8 −6 Source/Element/Element.Style.js
View
14 Source/Element/Element.Style.js
@@ -16,11 +16,11 @@ provides: Element.Style
(function(){
-var html = document.html;
+var html = document.html, el;
//<ltIE9>
// Check for oldIE, which does not remove styles when they're set to null
-var el = document.createElement('div');
+el = document.createElement('div');
el.style.color = 'red';
el.style.color = null;
var doesNotRemoveStyles = el.style.color == 'red';
@@ -33,17 +33,19 @@ el = null;
//</ltIE9>
var hasGetComputedStyle = !!window.getComputedStyle,
- brokenGetComputedStyle; // Opera rounds sub-pixel values
+ brokenGetComputedStyle = !hasGetComputedStyle; // Opera rounds sub-pixel values
+//<opera>
if (hasGetComputedStyle){
- var el = document.createElement('div');
+ el = document.createElement('div');
el.style.display = 'none';
- el.style.paddingLeft = '1.5px';
+ var padding = el.style.paddingLeft = '1.5px';
document.html.appendChild(el);
- brokenGetComputedStyle = window.getComputedStyle(el, null).paddingLeft != el.style.paddingLeft;
+ brokenGetComputedStyle = window.getComputedStyle(el, null).paddingLeft != padding;
document.html.removeChild(el);
el = null;
}
+//</opera>
Element.Properties.styles = {set: function(styles){
this.setStyles(styles);

0 comments on commit df80aaf

Please sign in to comment.