Skip to content

Commit

Permalink
Merge branch 'master' of git@yuisource.corp.yahoo.com:yui3
Browse files Browse the repository at this point in the history
  • Loading branch information
YUI Builder committed Dec 2, 2009
2 parents 99220a1 + af8c815 commit ed0576a
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 37 deletions.
14 changes: 7 additions & 7 deletions build/node/node-base-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var DOT = '.',
return Y.Selector.test(n, fn);
} :
function(n) {
return fn(Node.get(n));
return fn(Y.one(n));
};
}

Expand Down Expand Up @@ -141,7 +141,7 @@ Node.scrubVal = function(val, node) {
if (node && val) { // only truthy values are risky
if (typeof val === 'object' || typeof val === 'function') { // safari nodeList === function
if (NODE_TYPE in val || Y.DOM.isWindow(val)) {// node || window
val = Node.get(val);
val = Y.one(val);
} else if ((val.item && !val._nodes) || // dom collection or Node instance
(val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes
val = Y.all(val);
Expand Down Expand Up @@ -250,7 +250,7 @@ Node.get = function() {
* @return {Node} A Node instance bound to a DOM node or fragment
*/
Node.create = function() {
return Node.get(Y.DOM.create.apply(Y.DOM, arguments));
return Y.one(Y.DOM.create.apply(Y.DOM, arguments));
};

Node.ATTRS = {
Expand Down Expand Up @@ -393,7 +393,7 @@ Y.mix(Node.prototype, {
/**
* Returns an attribute value on the Node instance
* @method get
* @param {String} attr The attribute to be set
* @param {String} attr The attribute
* @return {any} The current value of the attribute
*/
get: function(attr) {
Expand Down Expand Up @@ -546,7 +546,7 @@ Y.mix(Node.prototype, {
* @return {Node} The matching Node instance or null if not found
*/
ancestor: function(fn) {
return Node.get(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
return Y.one(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
},

/**
Expand All @@ -558,7 +558,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
previous: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
},

/**
Expand All @@ -570,7 +570,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
next: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
},

/**
Expand Down
2 changes: 1 addition & 1 deletion build/node/node-base-min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions build/node/node-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var DOT = '.',
return Y.Selector.test(n, fn);
} :
function(n) {
return fn(Node.get(n));
return fn(Y.one(n));
};
}

Expand Down Expand Up @@ -141,7 +141,7 @@ Node.scrubVal = function(val, node) {
if (node && val) { // only truthy values are risky
if (typeof val === 'object' || typeof val === 'function') { // safari nodeList === function
if (NODE_TYPE in val || Y.DOM.isWindow(val)) {// node || window
val = Node.get(val);
val = Y.one(val);
} else if ((val.item && !val._nodes) || // dom collection or Node instance
(val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes
val = Y.all(val);
Expand Down Expand Up @@ -248,7 +248,7 @@ Node.get = function() {
* @return {Node} A Node instance bound to a DOM node or fragment
*/
Node.create = function() {
return Node.get(Y.DOM.create.apply(Y.DOM, arguments));
return Y.one(Y.DOM.create.apply(Y.DOM, arguments));
};

Node.ATTRS = {
Expand Down Expand Up @@ -391,7 +391,7 @@ Y.mix(Node.prototype, {
/**
* Returns an attribute value on the Node instance
* @method get
* @param {String} attr The attribute to be set
* @param {String} attr The attribute
* @return {any} The current value of the attribute
*/
get: function(attr) {
Expand Down Expand Up @@ -544,7 +544,7 @@ Y.mix(Node.prototype, {
* @return {Node} The matching Node instance or null if not found
*/
ancestor: function(fn) {
return Node.get(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
return Y.one(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
},

/**
Expand All @@ -556,7 +556,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
previous: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
},

/**
Expand All @@ -568,7 +568,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
next: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
},

/**
Expand Down
14 changes: 7 additions & 7 deletions build/node/node-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var DOT = '.',
return Y.Selector.test(n, fn);
} :
function(n) {
return fn(Node.get(n));
return fn(Y.one(n));
};
}

Expand Down Expand Up @@ -141,7 +141,7 @@ Node.scrubVal = function(val, node) {
if (node && val) { // only truthy values are risky
if (typeof val === 'object' || typeof val === 'function') { // safari nodeList === function
if (NODE_TYPE in val || Y.DOM.isWindow(val)) {// node || window
val = Node.get(val);
val = Y.one(val);
} else if ((val.item && !val._nodes) || // dom collection or Node instance
(val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes
val = Y.all(val);
Expand Down Expand Up @@ -250,7 +250,7 @@ Node.get = function() {
* @return {Node} A Node instance bound to a DOM node or fragment
*/
Node.create = function() {
return Node.get(Y.DOM.create.apply(Y.DOM, arguments));
return Y.one(Y.DOM.create.apply(Y.DOM, arguments));
};

Node.ATTRS = {
Expand Down Expand Up @@ -393,7 +393,7 @@ Y.mix(Node.prototype, {
/**
* Returns an attribute value on the Node instance
* @method get
* @param {String} attr The attribute to be set
* @param {String} attr The attribute
* @return {any} The current value of the attribute
*/
get: function(attr) {
Expand Down Expand Up @@ -546,7 +546,7 @@ Y.mix(Node.prototype, {
* @return {Node} The matching Node instance or null if not found
*/
ancestor: function(fn) {
return Node.get(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
return Y.one(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
},

/**
Expand All @@ -558,7 +558,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
previous: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
},

/**
Expand All @@ -570,7 +570,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
next: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
},

/**
Expand Down
2 changes: 1 addition & 1 deletion build/node/node-min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions build/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var DOT = '.',
return Y.Selector.test(n, fn);
} :
function(n) {
return fn(Node.get(n));
return fn(Y.one(n));
};
}

Expand Down Expand Up @@ -141,7 +141,7 @@ Node.scrubVal = function(val, node) {
if (node && val) { // only truthy values are risky
if (typeof val === 'object' || typeof val === 'function') { // safari nodeList === function
if (NODE_TYPE in val || Y.DOM.isWindow(val)) {// node || window
val = Node.get(val);
val = Y.one(val);
} else if ((val.item && !val._nodes) || // dom collection or Node instance
(val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes
val = Y.all(val);
Expand Down Expand Up @@ -248,7 +248,7 @@ Node.get = function() {
* @return {Node} A Node instance bound to a DOM node or fragment
*/
Node.create = function() {
return Node.get(Y.DOM.create.apply(Y.DOM, arguments));
return Y.one(Y.DOM.create.apply(Y.DOM, arguments));
};

Node.ATTRS = {
Expand Down Expand Up @@ -391,7 +391,7 @@ Y.mix(Node.prototype, {
/**
* Returns an attribute value on the Node instance
* @method get
* @param {String} attr The attribute to be set
* @param {String} attr The attribute
* @return {any} The current value of the attribute
*/
get: function(attr) {
Expand Down Expand Up @@ -544,7 +544,7 @@ Y.mix(Node.prototype, {
* @return {Node} The matching Node instance or null if not found
*/
ancestor: function(fn) {
return Node.get(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
return Y.one(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
},

/**
Expand All @@ -556,7 +556,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
previous: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
},

/**
Expand All @@ -568,7 +568,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
next: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
},

/**
Expand Down
2 changes: 2 additions & 0 deletions src/dom/tests/selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@

Assert.areEqual(Y.DOM.byId('test-custom-attr'), $("div[foo]", null, true), "div[foo], null, true");
ArrayAssert.itemsAreEqual([Y.DOM.byId('test-custom-attr')], $("[foo]"), "[foo]");

Assert.areEqual(document.body, $('body, div', null, true), "$('body, div', null, true)");
}

});
Expand Down
14 changes: 7 additions & 7 deletions src/node/js/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var DOT = '.',
return Y.Selector.test(n, fn);
} :
function(n) {
return fn(Node.get(n));
return fn(Y.one(n));
};
}

Expand Down Expand Up @@ -139,7 +139,7 @@ Node.scrubVal = function(val, node) {
if (node && val) { // only truthy values are risky
if (typeof val === 'object' || typeof val === 'function') { // safari nodeList === function
if (NODE_TYPE in val || Y.DOM.isWindow(val)) {// node || window
val = Node.get(val);
val = Y.one(val);
} else if ((val.item && !val._nodes) || // dom collection or Node instance
(val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes
val = Y.all(val);
Expand Down Expand Up @@ -248,7 +248,7 @@ Node.get = function() {
* @return {Node} A Node instance bound to a DOM node or fragment
*/
Node.create = function() {
return Node.get(Y.DOM.create.apply(Y.DOM, arguments));
return Y.one(Y.DOM.create.apply(Y.DOM, arguments));
};

Node.ATTRS = {
Expand Down Expand Up @@ -391,7 +391,7 @@ Y.mix(Node.prototype, {
/**
* Returns an attribute value on the Node instance
* @method get
* @param {String} attr The attribute to be set
* @param {String} attr The attribute
* @return {any} The current value of the attribute
*/
get: function(attr) {
Expand Down Expand Up @@ -544,7 +544,7 @@ Y.mix(Node.prototype, {
* @return {Node} The matching Node instance or null if not found
*/
ancestor: function(fn) {
return Node.get(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
return Y.one(Y.DOM.elementByAxis(this._node, 'parentNode', _wrapFn(fn)));
},

/**
Expand All @@ -556,7 +556,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
previous: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
},

/**
Expand All @@ -568,7 +568,7 @@ Y.mix(Node.prototype, {
* @return {Node} Node instance or null if not found
*/
next: function(fn, all) {
return Node.get(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
return Y.one(Y.DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));
},

/**
Expand Down

0 comments on commit ed0576a

Please sign in to comment.