dom-debug.js revision e3fa31b41d9fb77561d888486cfbb728d490c5df
/**
* The DOM utility provides a cross-browser abtraction layer
* normalizing DOM tasks, and adds extra helper functionality
* for other common tasks.
* @module dom
* @submodule dom-base
*
*/
/**
* Provides DOM helper methods.
* @class DOM
*
*/
var NODE_TYPE = 'nodeType',
OWNER_DOCUMENT = 'ownerDocument',
DOCUMENT_ELEMENT = 'documentElement',
DEFAULT_VIEW = 'defaultView',
PARENT_WINDOW = 'parentWindow',
TAG_NAME = 'tagName',
PARENT_NODE = 'parentNode',
FIRST_CHILD = 'firstChild',
LAST_CHILD = 'lastChild',
PREVIOUS_SIBLING = 'previousSibling',
NEXT_SIBLING = 'nextSibling',
CONTAINS = 'contains',
COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition',
INNER_TEXT = 'innerText',
TEXT_CONTENT = 'textContent',
LENGTH = 'length',
var re_tag = /<([a-z]+)/i;
var templateCache = {};
Y.DOM = {
/**
* Returns the HTMLElement with the given ID (Wrapper for document.getElementById).
* @method byId
* @param {String} id the id attribute
* @param {Object} doc optional The document to search. Defaults to current document
* @return {HTMLElement | null} The HTMLElement with the id, or null if none found.
*/
},
/**
* Returns the text content of the HTMLElement.
* @method getText
* @param {HTMLElement} element The html element.
* @return {String} The text content of the element (includes text of any descending elements).
*/
}
return text || '';
},
/**
* Finds the firstChild of the given HTMLElement.
* @method firstChild
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current HTMLElement being tested as its only argument.
* If no function is given, the first found is returned.
* @return {HTMLElement | null} The first matching child html element.
*/
},
},
/**
* Finds the lastChild of the given HTMLElement.
* @method lastChild
* @param {HTMLElement} element The html element.
* @param {String} tag The tag to search for.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current HTMLElement being tested as its only argument.
* If no function is given, the first found is returned.
* @return {HTMLElement | null} The first matching child html element.
*/
},
},
/**
* Finds all HTMLElement childNodes matching the given tag.
* @method childrenByTag
* @param {HTMLElement} element The html element.
* @param {String} tag The tag to search for.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current HTMLElement being tested as its only argument.
* If no function is given, all children with the given tag are collected.
* @return {Array} The collection of child elements.
*/
childrenByTag: function() {
var elements = [];
if (element) {
}
}
return elements;
};
} else {
var elements = [],
if (element) {
if (tag) { // wrap fn and add tag test TODO: allow tag in filterElementsBy?
};
}
}
return elements;
};
}
}(),
/**
* Finds all HTMLElement childNodes.
* @method children
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current HTMLElement being tested as its only argument.
* If no function is given, all children are collected.
* @return {Array} The collection of child elements.
*/
},
/**
* Finds the previous sibling of the element.
* @method previous
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current DOM node being tested as its only argument.
* If no function is given, the first sibling is returned.
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
* @return {HTMLElement | null} The matching DOM node or null if none found.
*/
},
/**
* Finds the next sibling of the element.
* @method next
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current DOM node being tested as its only argument.
* If no function is given, the first sibling is returned.
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
* @return {HTMLElement | null} The matching DOM node or null if none found.
*/
},
/**
* Finds the ancestor of the element.
* @method ancestor
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current DOM node being tested as its only argument.
* If no function is given, the parentNode is returned.
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
* @return {HTMLElement | null} The matching DOM node or null if none found.
*/
// TODO: optional stopAt node?
},
/**
* Searches the element by the given axis for the first matching element.
* @method elementByAxis
* @param {HTMLElement} element The html element.
* @param {String} axis The axis to search (parentNode, nextSibling, previousSibling).
* @param {Function} fn optional An optional boolean test to apply.
* @param {Boolean} all optional Whether all node types should be returned, or just element nodes.
* The optional function is passed the current HTMLElement being tested as its only argument.
* If no function is given, the first element is returned.
* @return {HTMLElement | null} The matching element or null if none found.
*/
return element;
}
}
return null;
},
/**
* Finds all elements with the given tag.
* @method byTag
* @param {String} tag The tag being search for.
* @param {HTMLElement} root optional An optional root element to start from.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current HTMLElement being tested as its only argument.
* If no function is given, all elements with the given tag are returned.
* @return {Array} The collection of matching elements.
*/
retNodes = [];
}
}
return retNodes;
},
/**
* Finds the first element with the given tag.
* @method firstByTag
* @param {String} tag The tag being search for.
* @param {HTMLElement} root optional An optional root element to start from.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current HTMLElement being tested as its only argument.
* If no function is given, the first match is returned.
* @return {HTMLElement} The matching element.
*/
ret = null;
break;
}
}
return ret;
},
/**
* Filters a collection of HTMLElements by the given attributes.
* @method filterElementsBy
* @param {Array} elements The collection of HTMLElements to filter.
* @param {Function} fn A boolean test to apply.
* The function is passed the current HTMLElement being tested as its only argument.
* If no function is given, all HTMLElements are kept.
* @return {Array} The filtered collection of HTMLElements.
*/
if (firstOnly) {
break;
} else {
}
}
}
return ret;
},
/**
* Determines whether or not one HTMLElement is or contains another HTMLElement.
* @method contains
* @param {HTMLElement} element The containing html element.
* @param {HTMLElement} needle The html element that may be contained.
* @return {Boolean} Whether or not the element is or contains the needle.
*/
var ret = false;
ret = false;
if (Y.UA.opera || needle[NODE_TYPE] === 1) { // IE & SAF contains fail if needle not an ELEMENT_NODE
} else {
}
ret = true;
}
}
return ret;
},
/**
* Determines whether or not the HTMLElement is part of the document.
* @method inDoc
* @param {HTMLElement} element The containing html element.
* @param {HTMLElement} doc optional The document to check.
* @return {Boolean} Whether or not the element is attached to the document.
*/
},
// TODO: dont return collection
if (m && custom[m[1]]) {
} else {
}
}
//return ret.firstChild;
},
return frag;
},
/**
* Brute force version of contains.
* Used for browsers without contains support for non-HTMLElement Nodes (textNodes, etc).
* @method _bruteContains
* @private
* @param {HTMLElement} element The containing html element.
* @param {HTMLElement} needle The html element that may be contained.
* @return {Boolean} Whether or not the element is or contains the needle.
*/
while (needle) {
return true;
}
}
return false;
},
// TODO: move to Lang?
/**
* Memoizes dynamic regular expressions to boost runtime performance.
* @method _getRegExp
* @private
* @param {String} str The string to convert to a regular expression.
* @param {String} flags optional An optinal string of flags.
* @return {RegExp} An instance of RegExp
*/
}
},
/**
* returns the appropriate document.
* @method _getDoc
* @private
* @param {HTMLElement} element optional Target element.
* @return {Object} The document for the given element or the default document.
*/
// TODO: use nodeName instead of magic number
},
/**
* returns the appropriate window.
* @method _getWin
* @private
* @param {HTMLElement} element optional Target element.
* @return {Object} The window for the given element or the default window.
*/
},
// TODO: document this
var ret = null,
if (element) {
if (rev) {
} else {
axis = NEXT_SIBLING;
}
} else { // need to scan nextSibling axis of firstChild to find matching element
}
}
return ret;
},
},
creators: {},
}
};
(function() {
var TABLE_OPEN = '<table>',
TABLE_CLOSE = '</table>';
return frag;
},
return frag.firstChild;
},
return frag.firstChild;
},
return frag;
},
legend: 'fieldset'
});
}
// TODO: allow multiples ("<link><link>")
}
return frag;
};
}
});
}
})();
/**
* The DOM utility provides a cross-browser abtraction layer
* normalizing DOM tasks, and adds extra helper functionality
* for other common tasks.
* @module dom
* @submodule dom-base
* @for DOM
*/
var CLASS_NAME = 'className';
/**
* Determines whether a DOM element has the given className.
* @method hasClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to search for
* @return {Boolean} Whether or not the element has the given class.
*/
},
/**
* Adds a class name to a given DOM element.
* @method addClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to add to the class attribute
*/
}
},
/**
* Removes a class name from a given element.
* @method removeClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to remove from the class attribute
*/
}
}
},
/**
* Replace a class with another class for a given element.
* If no oldClassName is present, the newClassName is simply added.
* @method replaceClass
* @param {HTMLElement} element The DOM element.
* @param {String} oldClassName the class name to be replaced
* @param {String} newClassName the class name that will be replacing the old class name
*/
//Y.log('replaceClass replacing ' + oldC + ' with ' + newC, 'info', 'Node');
},
/**
* If the className exists on the node it is removed, if it doesn't exist it is added.
* @method toggleClass
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to be toggled
*/
} else {
}
}
});
/**
* 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',
VISIBLE = 'visible',
WIDTH = 'width',
HEIGHT = 'height',
BORDER_TOP_WIDTH = 'borderTopWidth',
BORDER_RIGHT_WIDTH = 'borderRightWidth',
BORDER_BOTTOM_WIDTH = 'borderBottomWidth',
BORDER_LEFT_WIDTH = 'borderLeftWidth',
GET_COMPUTED_STYLE = 'getComputedStyle',
CUSTOM_STYLES: {},
/**
* 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 (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;
};
}
/**
* Adds position and region management functionality to DOM.
* @module dom
* @submodule dom-screen
* @for DOM
*/
var OFFSET_TOP = 'offsetTop',
DOCUMENT_ELEMENT = 'documentElement',
COMPAT_MODE = 'compatMode',
OFFSET_LEFT = 'offsetLeft',
OFFSET_PARENT = 'offsetParent',
POSITION = 'position',
FIXED = 'fixed',
RELATIVE = 'relative',
LEFT = 'left',
TOP = 'top',
SCROLL_LEFT = 'scrollLeft',
SCROLL_TOP = 'scrollTop',
_BACK_COMPAT = 'BackCompat',
MEDIUM = 'medium',
HEIGHT = 'height',
WIDTH = 'width',
BORDER_LEFT_WIDTH = 'borderLeftWidth',
BORDER_TOP_WIDTH = 'borderTopWidth',
GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect',
GET_COMPUTED_STYLE = 'getComputedStyle',
// TODO: does caption matter?
/**
* Returns the inner height of the viewport (exludes scrollbar).
* @method winHeight
*/
return h;
},
/**
* Returns the inner width of the viewport (exludes scrollbar).
* @method winWidth
*/
return w;
},
/**
* Document height
* @method docHeight
*/
},
/**
* Document width
* @method docWidth
*/
},
/**
* Amount page has been scroll vertically
* @method docScrollX
*/
docScrollX: function(node) {
},
/**
* Amount page has been scroll horizontally
* @method docScrollY
*/
docScrollY: function(node) {
},
/**
* Gets the current position of an element based on page coordinates.
* Element must be part of the DOM tree to have page coordinates
* (display:none or elements not appended return false).
* @method getXY
* @param element The target element
* @return {Array} The XY position of the element
TODO: test inDocument/display
*/
getXY: function() {
return function(node) {
if (!node) {
return false;
}
//Round the numbers so we get sane data back
if (mode !== _BACK_COMPAT) {
off1 = 0;
off2 = 0;
}
}
if ((mode == _BACK_COMPAT)) {
}
}
}
}
if ((scrollTop || scrollLeft)) {
}
// gecko may return sub-pixel (non-int) values
return xy;
};
} else {
return function(node) { // manually calculate by crawling up offsetParents
//Calculate the Top and Left border sizes (assumes pixels)
parentNode = node,
// TODO: refactor with !! or just falsey
if (bCheck) {
}
}
// account for any scrolled ancestors
parentNode = node;
var scrollTop, scrollLeft;
//Firefox does something funky with borders when overflow is not visible.
}
if (scrollTop || scrollLeft) {
}
}
} else {
//Fix FIXED position -- add scrollbars
}
}
//Round the numbers so we get sane data back
return xy;
};
}
}(),// NOTE: Executing for loadtime branching
/**
* Gets the current X position of an element based on page coordinates.
* Element must be part of the DOM tree to have page coordinates
* (display:none or elements not appended return false).
* @method getX
* @param element The target element
* @return {Int} The X position of the element
*/
},
/**
* Gets the current Y position of an element based on page coordinates.
* Element must be part of the DOM tree to have page coordinates
* (display:none or elements not appended return false).
* @method getY
* @param element The target element
* @return {Int} The Y position of the element
*/
},
/**
* Set the position of an html element in page coordinates.
* The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @method setXY
* @param element The target element
* @param {Array} xy Contains X & Y values for new position (coordinates are page-based)
* @param {Boolean} noRetry By default we try and set the position a second time if the first fails
*/
delta = [ // assuming pixels; if not we will have to retry
];
}
if (currentXY === false) { // has to be part of doc to have xy
return false;
}
}
}
if (xy[0] !== null) {
}
if (xy[1] !== null) {
}
if (!noRetry) {
// if retry is true, try one more time if we miss
}
}
},
/**
* Set the X position of an html element in page coordinates, regardless of how the element is positioned.
* The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @method setX
* @param element The target element
* @param {Int} x The X values for new position (coordinates are page-based)
*/
},
/**
* Set the Y position of an html element in page coordinates, regardless of how the element is positioned.
* The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @method setY
* @param element The target element
* @param {Int} y The Y values for new position (coordinates are page-based)
*/
},
t = 0;
l = 0;
}
}
xy2[0] += l;
xy2[1] += t;
return xy2;
},
_getWinSize: function(node) {
h = win.innerHeight,
w = win.innerWidth,
}
h = root.clientHeight;
w = root.clientWidth;
}
},
_getDocSize: function(node) {
}
}
});
/**
* Adds position and region management functionality to DOM.
* @module dom
* @submodule dom-screen
* @for DOM
*/
var OFFSET_WIDTH = 'offsetWidth',
OFFSET_HEIGHT = 'offsetHeight',
TOP = 'top',
RIGHT = 'right',
BOTTOM = 'bottom',
LEFT = 'left',
TAG_NAME = 'tagName';
ret = {};
return ret;
};
/**
* Returns an Object literal containing the following about this element: (top, right, bottom, left)
* @method region
* @param {HTMLElement} element The DOM element.
@return {Object} Object literal containing the following about this element: (top, right, bottom, left)
*/
ret = false;
if (x) {
ret = {
'0': x[0],
'1': x[1],
top: x[1],
left: x[0],
};
}
return ret;
},
/**
* Find the intersect information for the passes nodes.
* @method intersect
* @param {HTMLElement} element The first element
* @param {HTMLElement | Object} element2 The element or region to check the interect with
* @param {Object} altRegion An object literal containing the region for the first element if we already have the data (for performance i.e. DragDrop)
@return {Object} Object literal containing the following intersection data: (top, right, bottom, left, area, yoff, xoff, inRegion)
*/
var n = node2;
if (n[TAG_NAME]) {
} else {
return false;
}
return {
};
},
/**
* Check if any part of this node is in the passed region
* @method inRegion
* @param {Object} node2 The node to get the region from or an Object literal of the region
* $param {Boolean} all Should all of the node be inside the region
* @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance i.e. DragDrop)
* @return {Boolean} True if in region, false if not.
*/
var region = {},
var n = node2;
if (n[TAG_NAME]) {
} else {
return false;
}
if (all) {
return (
} else {
return true;
} else {
return false;
}
}
},
/**
* Check if any part of this element is in the viewport
* @method inViewportRegion
* @param {HTMLElement} element The DOM element.
* @param {Boolean} all Should all of the node be inside the region
* @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance i.e. DragDrop)
* @return {Boolean} True if in region, false if not.
*/
},
/**
* Returns an Object literal containing the following about the visible region of viewport: (top, right, bottom, left)
* @method viewportRegion
@return {Object} Object literal containing the following about the visible region of the viewport: (top, right, bottom, left)
*/
viewportRegion: function(node) {
var r = {};
return r;
}
});
/**
* Add style management functionality to DOM.
* @module dom
* @submodule dom-style
* @for DOM
*/
var CLIENT_TOP = 'clientTop',
CLIENT_LEFT = 'clientLeft',
PARENT_NODE = 'parentNode',
RIGHT = 'right',
HAS_LAYOUT = 'hasLayout',
PX = 'px',
FILTER = 'filter',
FILTERS = 'filters',
OPACITY = 'opacity',
AUTO = 'auto',
CURRENT_STYLE = 'currentStyle';
// 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;
},
}
}
}
};
}
// IE getComputedStyle
// TODO: unit-less lineHeight (e.g. 1.22)
var ComputedStyle = {
CUSTOM_STYLES: {},
var value = '',
} else {
}
return value;
},
value = '';
value = 0;
}
// the difference is padding + border (works in Standards & Quirks modes)
}
}
} else { // convert units to px
if (!el[STYLE][pixel] && !el[STYLE][prop]) { // need to map style.width to currentStyle (no currentStyle.pixelWidth)
}
}
},
// clientHeight/Width = paddingBox (e.g. offsetWidth - borderWidth)
var value = null;
}
switch(property) {
case BORDER_TOP_WIDTH:
break;
case BORDER_BOTTOM_WIDTH:
break;
case BORDER_LEFT_WIDTH:
break;
case BORDER_RIGHT_WIDTH:
break;
}
},
// use pixelRight to convert to px
var val = null,
},
var val;
} else {
}
return val;
},
var current;
}
},
return true;
}
});
}
},
}
};
//fontSize: getPixelFont,
var IEComputed = {};
}
Y.namespace('DOM.IE');
/**
* Provides helper methods for collecting and filtering DOM elements.
* @module dom
* @submodule selector
*/
/**
* Provides helper methods for collecting and filtering DOM elements.
* @class Selector
* @static
*/
var TAG = 'tag',
PARENT_NODE = 'parentNode',
PREVIOUS_SIBLING = 'previousSibling',
LENGTH = 'length',
NODE_TYPE = 'nodeType',
TAG_NAME = 'tagName',
ATTRIBUTES = 'attributes',
PSEUDOS = 'pseudos',
COMBINATOR = 'combinator';
var patterns = {
pseudos: /^:([\-\w]+)(?:\(['"]?(.+)['"]?\))*/i,
combinator: /^\s*([>+~]|\s)\s*/
};
var Selector = {
/**
* Default document for use queries
* @property document
* @type object
* @default window.document
*/
document: Y.config.doc,
/**
* Mapping of attributes to aliases, normally to work around HTMLAttributes
* that conflict with JS reserved words.
* @property attrAliases
* @type object
*/
attrAliases: {},
/**
* Mapping of shorthand tokens to corresponding attribute selector
* @property shorthand
* @type object
*/
shorthand: {
},
/**
* List of operators and corresponding boolean functions.
*/
operators: {
var s = ' ';
},
'|=': function(attr, val) { return Y.DOM._getRegExp('^' + val + '[-]?').test(attr); }, // Match start with value followed by optional hyphen
'$=': function(attr, val) { return attr.lastIndexOf(val) === attr[LENGTH] - val[LENGTH]; }, // Match ends with value
},
/**
* List of pseudo-classes and corresponding boolean functions.
* These functions are called with the current node, and any value that was parsed with the pseudo regex.
* @property pseudos
* @type object
*/
pseudos: {
'root': function(node) {
},
},
},
},
},
'first-child': function(node) {
},
'last-child': function(node) {
},
},
},
'only-child': function(node) {
},
'only-of-type': function(node) {
},
'empty': function(node) {
},
},
},
'checked': function(node) {
}
},
/**
* Test if the supplied node matches the supplied selector.
* @method test
*
* @param {HTMLElement | String} node An id or node reference to the HTMLElement being tested.
* @param {string} selector The CSS Selector to test the node against.
* @return{boolean} Whether or not the node matches the selector.
* @static
*/
if (!node) {
return false;
}
return true;
}
}
return false;
}
},
/**
* Filters a set of nodes based on a given CSS selector.
* @method filter
*
* @param {string} selector The selector used to test each node.
* @return{array} An array of nodes from the supplied array that match the given selector.
* @static
*/
return result;
},
/**
* Retrieves a set of nodes based on a given CSS selector.
* @method query
*
* @param {string} selector The CSS Selector to test the node against.
* @param {HTMLElement | String} root optional An id or HTMLElement to start the query from. Defaults to Selector.document.
* @param {Boolean} firstOnly optional Whether or not to return only the first match.
* @return {Array} An array of nodes that match the given selector.
* @static
*/
//Y.log('query: ' + selector + ' returning ' + result, 'info', 'Selector');
return result;
},
if (!selector) {
return result;
}
var found;
}
return result;
}
nodes = [],
node,
id,
if (idToken) {
}
// use id shortcut when possible
if (id) {
} else {
}
}
} else {
return result;
}
}
}
}
return result;
},
return false;
}
if (deDupe) {
return false;
}
}
return true;
}, firstOnly);
return result;
},
i, len;
return false;
}
var attribute;
return false;
}
return false;
}
}
}
return false;
}
}
}
true;
},
_foundCache: [],
_regexCache: {},
_clearFoundCache: function() {
try { // IE no like delete
} catch(e) {
}
}
Selector._foundCache = [];
Y.log('getBySelector: done clearing Selector._foundCache');
},
combinators: {
return true;
}
}
return false;
},
},
}
return true;
}
return false;
},
while (sib) {
return true;
}
}
return false;
}
},
/*
an+b = get every _a_th node starting at the _b_th
0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element
1n+b = get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n")
an+0 = get every _a_th element, "0" may be omitted
*/
var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_)
n = RegExp.$2, // "n"
if (tag) {
} else {
}
if (oddeven) {
a = 2; // always every other
op = '+';
n = 'n';
} else if ( isNaN(a) ) {
a = (n) ? 1 : 0; // start from the first or no repeat
}
if (a === 0) { // just the first
if (reverse) {
}
return true;
} else {
return false;
}
} else if (a < 0) {
a = Math.abs(a);
}
if (!reverse) {
return true;
}
}
} else {
return true;
}
}
}
return false;
},
return attr[i][2];
}
}
},
_getIdTokenIndex: function(tokens) {
return i;
}
}
return -1;
},
/**
Break selector into token units per simple selector.
Combinator is attached to left-hand selector.
*/
var token = {}, // one token per simple selector (left selector holds combinator)
tokens = [], // array of tokens
found = false, // whether or not any matches were found this pass
match; // the regex match
/*
Search for selector patterns, store, and strip them from the selector string
until no patterns match (invalid selector) or we run out of chars.
Multiple attributes and pseudos are allowed, in any order.
for example:
'form:first-child[type=button]:not(button)[lang|=en]'
*/
do {
found = false; // reset after full pass
}
found = true;
//token[re] = token[re] || [];
// capture ID for fast path to element
}
} else { // single selector (tag, combinator)
}
token = { // prep next token
};
}
}
}
}
} while (found);
return tokens;
},
_fixAttributes: function(attr) {
}
}
}
return attr;
},
_replaceShorthand: function(selector) {
var attrs = selector.match(patterns[ATTRIBUTES]); // pull attributes to avoid false pos on "." and "#"
if (attrs) {
}
}
}
if (attrs) {
}
}
return selector;
}
};
}
/**
* Add style management functionality to DOM.
* @module dom
* @submodule dom-style
* @for DOM
*/
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 = [
r[TO_STRING](16),
g[TO_STRING](16),
b[TO_STRING](16)
].join('');
}
}
}
return val.toLowerCase();
}
};
}, '@VERSION@' );