mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Core: Moved regex declarations for potential speed increase.
This commit is contained in:
parent
8cde7476d3
commit
16c61e43f4
@ -39,9 +39,8 @@ $.keyCode = {
|
|||||||
UP: 38
|
UP: 38
|
||||||
};
|
};
|
||||||
|
|
||||||
//Temporary mappings
|
var _remove = $.fn.remove,
|
||||||
var _remove = $.fn.remove;
|
isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
|
||||||
var isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
|
|
||||||
|
|
||||||
|
|
||||||
//Helper functions and ui object
|
//Helper functions and ui object
|
||||||
@ -110,24 +109,25 @@ $.ui = {
|
|||||||
|
|
||||||
// WAI-ARIA normalization
|
// WAI-ARIA normalization
|
||||||
// tweak $.attr for FF2 implementation
|
// tweak $.attr for FF2 implementation
|
||||||
if (isFF2){
|
if (isFF2) {
|
||||||
|
var attr = $.attr,
|
||||||
var attr = $.attr;
|
ariaState = /^aria-/,
|
||||||
$.attr = function(elem, name, value) {
|
ariaRole = /^wairole:/;
|
||||||
var set = value !== undefined,
|
|
||||||
state = /^aria-/;
|
|
||||||
|
|
||||||
return (name == 'role'
|
$.attr = function(elem, name, value) {
|
||||||
? (set
|
var set = value !== undefined;
|
||||||
? attr.call(this, elem, name, "wairole:" + value)
|
|
||||||
: (attr.apply(this, arguments) || "").replace(/^wairole:/, ""))
|
return (name == 'role'
|
||||||
: (state.test(name)
|
|
||||||
? (set
|
? (set
|
||||||
? elem.setAttributeNS("http://www.w3.org/2005/07/aaa", name.replace(state, "aaa:"), value)
|
? attr.call(this, elem, name, "wairole:" + value)
|
||||||
: attr.call(this, elem, name.replace(state, "aaa:")))
|
: (attr.apply(this, arguments) || "").replace(ariaRole, ""))
|
||||||
: attr.apply(this,arguments)));
|
: (ariaState.test(name)
|
||||||
};
|
? (set
|
||||||
|
? elem.setAttributeNS("http://www.w3.org/2005/07/aaa",
|
||||||
|
name.replace(ariaState, "aaa:"), value)
|
||||||
|
: attr.call(this, elem, name.replace(ariaState, "aaa:")))
|
||||||
|
: attr.apply(this, arguments)));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//jQuery plugins
|
//jQuery plugins
|
||||||
@ -170,7 +170,7 @@ $.extend($.expr[':'], {
|
|||||||
tabbable: function(a, i, m) {
|
tabbable: function(a, i, m) {
|
||||||
|
|
||||||
var nodeName = a.nodeName.toLowerCase();
|
var nodeName = a.nodeName.toLowerCase();
|
||||||
var isVisible = function(element) {
|
function isVisible(element) {
|
||||||
function checkStyles(element) {
|
function checkStyles(element) {
|
||||||
var style = element.style;
|
var style = element.style;
|
||||||
return (style.display != 'none' && style.visibility != 'hidden');
|
return (style.display != 'none' && style.visibility != 'hidden');
|
||||||
@ -183,7 +183,7 @@ $.extend($.expr[':'], {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
return visible;
|
return visible;
|
||||||
};
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// in tab order
|
// in tab order
|
||||||
|
Loading…
Reference in New Issue
Block a user