equals( element.attr( "role" ), "tablist", "main role" );
equals( headers.attr( "role" ), "tab", "tab roles" );
equals( headers.next().attr( "role" ), "tabpanel", "tabpanel roles" );
- equals( headers.eq( 1 ).prop( "aria-expanded" ), true, "active tab has aria-expanded" );
- equals( headers.eq( 0 ).prop( "aria-expanded" ), false, "inactive tab has aria-expanded" );
- equals( headers.eq( 1 ).prop( "aria-selected" ), true, "active tab has aria-selected" );
- equals( headers.eq( 0 ).prop( "aria-selected" ), false, "inactive tab has aria-selected" );
+ equals( headers.eq( 1 ).attr( "aria-expanded" ), "true", "active tab has aria-expanded" );
+ equals( headers.eq( 0 ).attr( "aria-expanded" ), "false", "inactive tab has aria-expanded" );
+ equals( headers.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
+ equals( headers.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
element.accordion( "option", "active", 0 );
- equals( headers.eq( 0 ).prop( "aria-expanded" ), true, "newly active tab has aria-expanded" );
- equals( headers.eq( 1 ).prop( "aria-expanded" ), false, "newly inactive tab has aria-expanded" );
- equals( headers.eq( 0 ).prop( "aria-selected" ), true, "active tab has aria-selected" );
- equals( headers.eq( 1 ).prop( "aria-selected" ), false, "inactive tab has aria-selected" );
+ equals( headers.eq( 0 ).attr( "aria-expanded" ), "true", "newly active tab has aria-expanded" );
+ equals( headers.eq( 1 ).attr( "aria-expanded" ), "false", "newly inactive tab has aria-expanded" );
+ equals( headers.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
+ equals( headers.eq( 1 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
});
}( jQuery ) );
el.progressbar("value", 77);
equals(el.attr("aria-valuenow"), 77, "aria-valuenow");
el.progressbar("disable");
- equals(el.prop("aria-disabled"), true, "aria-disabled on");
+ equals(el.attr("aria-disabled"), "true", "aria-disabled on");
el.progressbar("enable");
// FAIL: for some reason IE6 and 7 return a boolean false instead of the string
- equals(el.prop("aria-disabled"), false, "aria-disabled off");
+ equals(el.attr("aria-disabled"), "false", "aria-disabled off");
});
})(jQuery);
self.headers
.not( self.active )
- .prop({
- "aria-expanded": false,
- "aria-selected": false
+ .attr({
+ "aria-expanded": "false",
+ "aria-selected": "false",
+ tabIndex: -1
})
- .attr( "tabIndex", -1 )
.next()
.hide();
if ( !self.active.length ) {
self.headers.eq( 0 ).attr( "tabIndex", 0 );
} else {
- self.active
- .prop({
- "aria-expanded": true,
- "aria-selected": true
- })
- .attr( "tabIndex", 0 );
+ self.active.attr({
+ "aria-expanded": "true",
+ "aria-selected": "true",
+ tabIndex: 0
+ });
}
// only need links in tab order for Safari
.unbind( ".accordion" )
.removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
.removeAttr( "role" )
- .removeProp( "aria-expanded" )
- .removeProp( "aria-selected" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-selected" )
.removeAttr( "tabIndex" )
.find( "a" )
.removeAttr( "tabIndex" )
// TODO assert that the blur and focus triggers are really necessary, remove otherwise
toHide.prev()
- .prop({
- "aria-expanded": false,
- "aria-selected": false
+ .attr({
+ "aria-expanded": "false",
+ "aria-selected": "false",
+ tabIndex: -1
})
- .attr( "tabIndex", -1 )
.blur();
toShow.prev()
- .prop({
- "aria-expanded": true,
- "aria-selected": true
+ .attr({
+ "aria-expanded": "true",
+ "aria-selected": "true",
+ tabIndex: 0
})
- .attr( "tabIndex", 0 )
.focus();
},
// TODO verify these actually work as intended
.attr({
role: "textbox",
- "aria-autocomplete": "list"
+ "aria-autocomplete": "list",
+ "aria-haspopup": "true"
})
- .prop( "aria-haspopup", true )
.bind( "keydown.autocomplete", function( event ) {
if ( self.options.disabled || self.element.prop( "readonly" ) ) {
suppressKeyPress = true;
.removeAttr( "autocomplete" )
.removeAttr( "role" )
.removeAttr( "aria-autocomplete" )
- .removeProp( "aria-haspopup" );
+ .removeAttr( "aria-haspopup" );
this.menu.element.remove();
},
return false;
}
$( this ).toggleClass( "ui-state-active" );
- self.buttonElement.prop( "aria-pressed", self.element[0].checked );
+ self.buttonElement.attr( "aria-pressed", self.element[0].checked );
});
} else if ( this.type === "radio" ) {
this.buttonElement.bind( "click.button", function() {
return false;
}
$( this ).addClass( "ui-state-active" );
- self.buttonElement.prop( "aria-pressed", true );
+ self.buttonElement.attr( "aria-pressed", "true" );
var radio = self.element[ 0 ];
radioGroup( radio )
return $( this ).button( "widget" )[ 0 ];
})
.removeClass( "ui-state-active" )
- .prop( "aria-pressed", false );
+ .attr( "aria-pressed", "false" );
});
} else {
this.buttonElement
this.buttonElement
.removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
.removeAttr( "role" )
- .removeProp( "aria-pressed" )
+ .removeAttr( "aria-pressed" )
.html( this.buttonElement.find(".ui-button-text").html() );
if ( !this.hasTitle ) {
if ( $( this ).is( ":checked" ) ) {
$( this ).button( "widget" )
.addClass( "ui-state-active" )
- .prop( "aria-pressed", true );
+ .attr( "aria-pressed", "true" );
} else {
$( this ).button( "widget" )
.removeClass( "ui-state-active" )
- .prop( "aria-pressed", false );
+ .attr( "aria-pressed", "false" );
}
});
} else if ( this.type === "checkbox" ) {
if ( this.element.is( ":checked" ) ) {
this.buttonElement
.addClass( "ui-state-active" )
- .prop( "aria-pressed", true );
+ .attr( "aria-pressed", "true" );
} else {
this.buttonElement
.removeClass( "ui-state-active" )
- .prop( "aria-pressed", false );
+ .attr( "aria-pressed", "false" );
}
}
},
.removeAttr( "role" )
.removeAttr("tabIndex")
.removeAttr( "aria-labelledby" )
- .removeProp( "aria-expanded" )
- .removeProp( "aria-hidden" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-hidden" )
.show();
//destroy menu items
.removeClass( "ui-corner-all ui-state-hover" )
.removeAttr( "tabIndex" )
.removeAttr( "role" )
- .removeProp( "aria-haspopup" )
+ .removeAttr( "aria-haspopup" )
.removeAttr( "id" )
.children(".ui-icon").remove();
},
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
.attr("role", "menu")
.hide()
- .prop({
- "aria-hidden": true,
- "aria-expanded": false
+ .attr({
+ "aria-hidden": "true",
+ "aria-expanded": "false"
});
// don't refresh list items that are already adapted
submenus.each(function() {
var menu = $(this);
var item = menu.prev("a")
- item.prop("aria-haspopup", true)
+ item.attr("aria-haspopup", "true")
.prepend('<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>');
menu.attr("aria-labelledby", item.attr("id"));
});
_open: function(submenu) {
clearTimeout(this.timer);
- this.element.find(".ui-menu").not(submenu.parents()).hide().prop("aria-hidden", true);
+ this.element.find(".ui-menu").not(submenu.parents()).hide().attr("aria-hidden", "true");
var position = $.extend({}, {
of: this.active
}, $.type(this.options.position) == "function"
? this.options.position(this.active)
: this.options.position
);
- submenu.show().removeProp("aria-hidden").prop("aria-expanded", true).position(position);
+ submenu.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(position);
},
closeAll: function() {
this.element
- .find("ul").hide().prop("aria-hidden", true).prop("aria-expanded", false).end()
+ .find("ul").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end()
.find("a.ui-state-active").removeClass("ui-state-active");
this.blur();
this.activeMenu = this.element;
_close: function() {
this.active.parent()
- .find("ul").hide().prop("aria-hidden", true).prop("aria-expanded", false).end()
+ .find("ul").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end()
.find("a.ui-state-active").removeClass("ui-state-active");
},
left: function(event) {
var newItem = this.active && this.active.parents("li:not(.ui-menubar-item)").first();
if (newItem && newItem.length) {
- this.active.parent().prop("aria-hidden", true).prop("aria-expanded", false).hide();
+ this.active.parent().attr("aria-hidden", "true").attr("aria-expanded", "false").hide();
this.focus(event, newItem);
return true;
}
}
})
.hide()
- .prop({
- "aria-hidden": true,
- "aria-expanded": false
+ .attr({
+ "aria-hidden": "true",
+ "aria-expanded": "false"
})
.bind( "keydown.menubar", function( event ) {
var menu = $( this );
})
.addClass( "ui-button ui-widget ui-button-text-only ui-menubar-link" )
.attr( "role", "menuitem" )
- .prop( "aria-haspopup", true )
+ .attr( "aria-haspopup", "true" )
.wrapInner( "<span class='ui-button-text'></span>" );
// TODO review if these options are a good choice, maybe they can be merged
.unbind( ".menubar" )
.removeClass( "ui-button ui-widget ui-button-text-only ui-menubar-link ui-state-default" )
.removeAttr( "role" )
- .removeProp( "aria-haspopup" )
+ .removeAttr( "aria-haspopup" )
// TODO unwrap?
.children( "span.ui-button-text" ).each(function( i, e ) {
var item = $( this );
this.element.find( ":ui-menu" )
.menu( "destroy" )
.show()
- .removeProp( "aria-hidden" )
- .removeProp( "aria-expanded" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-expanded" )
.removeAttr( "tabindex" )
.unbind( ".menubar" );
},
this.active
.menu( "closeAll" )
.hide()
- .prop({
- "aria-hidden": true,
- "aria-expanded": false
+ .attr({
+ "aria-hidden": "true",
+ "aria-expanded": "false"
});
this.active
.prev()
this.active
.menu( "closeAll" )
.hide()
- .prop({
- "aria-hidden": true,
- "aria-expanded": false
+ .attr({
+ "aria-hidden": "true",
+ "aria-expanded": "false"
});
this.active
.prev()
at: "left bottom",
of: button
})
- .removeProp( "aria-hidden" )
- .prop( "aria-expanded", true )
+ .removeAttr( "aria-hidden" )
+ .attr( "aria-expanded", "true" )
.menu("focus", event, menu.children( "li" ).first() )
// TODO need a comment here why both events are triggered
.focus()
}
this.options.trigger
- .prop( "aria-haspopup", true )
+ .attr( "aria-haspopup", "true" )
.attr( "aria-owns", this.element.attr( "id" ) );
this.element
this.element
.show()
.removeClass( "ui-popup" )
- .removeProp( "aria-hidden" )
- .removeProp( "aria-expanded" );
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-expanded" );
this.options.trigger
- .removeProp( "aria-haspopup" )
+ .removeAttr( "aria-haspopup" )
.removeAttr( "aria-owns" );
if ( this.generatedId ) {
this.element
.show()
- .prop( "aria-hidden", false )
- .prop( "aria-expanded", true )
+ .attr( "aria-hidden", "false" )
+ .attr( "aria-expanded", "true" )
.position( position )
// TODO find a focussable child, otherwise put focus on element, add tabIndex=0 if not focussable
.focus();
close: function( event ) {
this.element
.hide()
- .prop( "aria-hidden", true )
- .prop( "aria-expanded", false );
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" );
this.options.trigger.attr("tabindex", 0);
.removeData( this.widgetName );
this.widget()
.unbind( "." + this.widgetName )
- .removeProp( "aria-disabled" )
+ .removeAttr( "aria-disabled" )
.removeClass(
this.widgetBaseClass + "-disabled " +
"ui-state-disabled" );
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetBaseClass + "-disabled ui-state-disabled", !!value )
- .prop( "aria-disabled", value );
+ .attr( "aria-disabled", value );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}