dom-style-debug.js revision e3bd011d5ae662803e1bb6970a2c841df0036b42
(function(Y) {
/**
* Add style management functionality to DOM.
* @module dom
* @submodule dom-style
* @for DOM
*/
var DOCUMENT_ELEMENT = 'documentElement',
DEFAULT_VIEW = 'defaultView',
OWNER_DOCUMENT = 'ownerDocument',
STYLE = 'style',
FLOAT = 'float',
CSS_FLOAT = 'cssFloat',
STYLE_FLOAT = 'styleFloat',
TRANSPARENT = 'transparent',
GET_COMPUTED_STYLE = 'getComputedStyle',
},
/**
* Sets a style property for a given element.
* @method setStyle
* @param {HTMLElement} An HTMLElement to apply the style to.
* @param {String} att The style property to set.
* @param {String|Number} val The value.
*/
if (style) {
if (val === null) {
}
if (att in CUSTOM_STYLES) {
return; // NOTE: return
}
}
}
},
/**
* Returns the current style value for the given property.
* @method getStyle
* @param {HTMLElement} An HTMLElement to get the style from.
* @param {String} att The style property to get.
*/
val = '';
if (style) {
if (att in CUSTOM_STYLES) {
}
}
}
}
return val;
},
/**
* Sets multiple style properties.
* @method setStyles
* @param {HTMLElement} node An HTMLElement to apply the styles to.
* @param {Object} hash An object literal of property:value pairs.
*/
}, Y.DOM);
},
/**
* Returns the computed style for the given node.
* @method getComputedStyle
* @param {HTMLElement} An HTMLElement to get the style from.
* @param {String} att The style property to get.
* @return {String} The computed value of the style property.
*/
var val = '',
}
return val;
}
});
// normalize reserved word float alternatives ("cssFloat" or "styleFloat")
}
// fix opera computedStyle default color unit (convert to rgb)
}
return val;
};
}
// safari converts transparent to rgba(), others use "transparent"
if (val === 'rgba(0, 0, 0, 0)') {
val = TRANSPARENT;
}
return val;
};
}
})(Y);
(function(Y) {
var TO_STRING = 'toString',
RE = RegExp;
Y.Color = {
KEYWORDS: {
black: '000',
silver: 'c0c0c0',
gray: '808080',
white: 'fff',
maroon: '800000',
red: 'f00',
purple: '800080',
fuchsia: 'f0f',
green: '008000',
lime: '0f0',
olive: '808000',
yellow: 'ff0',
navy: '000080',
blue: '00f',
teal: '008080',
aqua: '0ff'
},
}
val = 'rgb(' + [
}
return val;
},
val = [
];
}
}
}
}
}
return val.toLowerCase();
}
};
})(Y);
(function(Y) {
var CLIENT_TOP = 'clientTop',
CLIENT_LEFT = 'clientLeft',
HAS_LAYOUT = 'hasLayout',
PX = 'px',
FILTER = 'filter',
FILTERS = 'filters',
OPACITY = 'opacity',
AUTO = 'auto',
BORDER_WIDTH = 'borderWidth',
BORDER_TOP_WIDTH = 'borderTopWidth',
BORDER_RIGHT_WIDTH = 'borderRightWidth',
BORDER_BOTTOM_WIDTH = 'borderBottomWidth',
BORDER_LEFT_WIDTH = 'borderLeftWidth',
WIDTH = 'width',
HEIGHT = 'height',
TRANSPARENT = 'transparent',
VISIBLE = 'visible',
GET_COMPUTED_STYLE = 'getComputedStyle',
// TODO: unit-less lineHeight (e.g. 1.22)
_getStyleObj = function(node) {
},
ComputedStyle = {
CUSTOM_STYLES: {},
var value = '',
if (el) {
} else {
}
}
return value;
},
sizeOffsets: {
top: ['Top'],
bottom: ['Bottom']
},
value = '';
// IE pixelWidth incorrect for percent
// manually compute by subtracting padding and border from offset size
// NOTE: clientWidth/Height (size minus border) is 0 when current === AUTO so offsetHeight is used
// reverting to auto from auto causes position stacking issues (old impl)
if (sizeOffsets[0]) {
}
if (sizeOffsets[1]) {
}
} else { // use style.pixelWidth, etc. to convert to pixels
// need to map style.width to currentStyle (no currentStyle.pixelWidth)
}
}
},
borderMap: {
thin: '2px',
medium: '4px',
thick: '6px'
},
} else {
}
}
},
// use pixelRight to convert to px
var val = null,
return val;
},
var val,
val = 0;
} else {
}
},
var current;
}
},
return true;
}
});
}
},
}
},
//fontSize: getPixelFont,
IEComputed = {};
// use alpha filter for IE opacity
var val = 100;
try { // will error if no DXImageTransform
} catch(e) {
try { // make sure its in the document
} catch(err) {
}
}
return val / 100;
},
var current,
}
}
}
}
};
}
try {
} catch(e) { // IE throws error on invalid style set; trap common cases
} else {
}
}
};
} else {
}
}
};
}
// TODO: top, right, bottom, left
}
Y.namespace('DOM.IE');
})(Y);