From fe5534b3479e5971b370636f7da34c0a1b4a7e42 Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Fri, 21 Aug 2015 00:14:57 -0400 Subject: [PATCH] Core: Style updates Ref #14246 Ref gh-1588 --- tests/unit/core/core.js | 34 +++++++++++++++++----------------- tests/unit/core/selector.js | 32 ++++++++++++++++---------------- ui/data.js | 3 ++- ui/focusable.js | 5 +++-- ui/jquery-1-7.js | 2 +- 5 files changed, 39 insertions(+), 37 deletions(-) diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index d1b65403e..c21a4e050 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -17,7 +17,7 @@ test( "innerWidth - getter", function() { equal( el.innerWidth(), 122, "getter passthru" ); el.hide(); equal( el.innerWidth(), 122, "getter passthru when hidden" ); -}); +} ); test( "innerWidth - setter", function() { expect( 2 ); @@ -28,7 +28,7 @@ test( "innerWidth - setter", function() { el.hide(); el.innerWidth( 100 ); equal( el.width(), 78, "width set properly when hidden" ); -}); +} ); test( "innerHeight - getter", function() { expect( 2 ); @@ -37,7 +37,7 @@ test( "innerHeight - getter", function() { equal( el.innerHeight(), 70, "getter passthru" ); el.hide(); equal( el.innerHeight(), 70, "getter passthru when hidden" ); -}); +} ); test( "innerHeight - setter", function() { expect( 2 ); @@ -48,7 +48,7 @@ test( "innerHeight - setter", function() { el.hide(); el.innerHeight( 50 ); equal( el.height(), 30, "height set properly when hidden" ); -}); +} ); test( "outerWidth - getter", function() { expect( 2 ); @@ -57,7 +57,7 @@ test( "outerWidth - getter", function() { equal( el.outerWidth(), 140, "getter passthru" ); el.hide(); equal( el.outerWidth(), 140, "getter passthru when hidden" ); -}); +} ); test( "outerWidth - setter", function() { expect( 2 ); @@ -68,16 +68,16 @@ test( "outerWidth - setter", function() { el.hide(); el.outerWidth( 120 ); equal( el.width(), 80, "width set properly when hidden" ); -}); +} ); test( "outerWidth(true) - getter", function() { expect( 2 ); var el = $( "#dimensions" ); - equal( el.outerWidth(true), 154, "getter passthru w/ margin" ); + equal( el.outerWidth( true ), 154, "getter passthru w/ margin" ); el.hide(); - equal( el.outerWidth(true), 154, "getter passthru w/ margin when hidden" ); -}); + equal( el.outerWidth( true ), 154, "getter passthru w/ margin when hidden" ); +} ); test( "outerWidth(true) - setter", function() { expect( 2 ); @@ -88,7 +88,7 @@ test( "outerWidth(true) - setter", function() { el.hide(); el.outerWidth( 120, true ); equal( el.width(), 66, "width set properly when hidden" ); -}); +} ); test( "outerHeight - getter", function() { expect( 2 ); @@ -97,7 +97,7 @@ test( "outerHeight - getter", function() { equal( el.outerHeight(), 86, "getter passthru" ); el.hide(); equal( el.outerHeight(), 86, "getter passthru when hidden" ); -}); +} ); test( "outerHeight - setter", function() { expect( 2 ); @@ -108,16 +108,16 @@ test( "outerHeight - setter", function() { el.hide(); el.outerHeight( 70 ); equal( el.height(), 34, "height set properly when hidden" ); -}); +} ); test( "outerHeight(true) - getter", function() { expect( 2 ); var el = $( "#dimensions" ); - equal( el.outerHeight(true), 98, "getter passthru w/ margin" ); + equal( el.outerHeight( true ), 98, "getter passthru w/ margin" ); el.hide(); - equal( el.outerHeight(true), 98, "getter passthru w/ margin when hidden" ); -}); + equal( el.outerHeight( true ), 98, "getter passthru w/ margin when hidden" ); +} ); test( "outerHeight(true) - setter", function() { expect( 2 ); @@ -128,7 +128,7 @@ test( "outerHeight(true) - setter", function() { el.hide(); el.outerHeight( 80, true ); equal( el.height(), 32, "height set properly when hidden" ); -}); +} ); test( "uniqueId / removeUniqueId", function() { expect( 3 ); @@ -138,7 +138,7 @@ test( "uniqueId / removeUniqueId", function() { ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" ); el.removeUniqueId(); equal( el.attr( "id" ), null, "unique id has been removed from element" ); -}); +} ); test( "Labels", function() { expect( 2 ); diff --git a/tests/unit/core/selector.js b/tests/unit/core/selector.js index e553e769d..c0a0f4888 100644 --- a/tests/unit/core/selector.js +++ b/tests/unit/core/selector.js @@ -14,7 +14,7 @@ function isFocusable( selector, msg ) { } function isNotFocusable( selector, msg ) { - QUnit.push( $( selector ).length && !$( selector ).is(":focusable"), null, null, + QUnit.push( $( selector ).length && !$( selector ).is( ":focusable" ), null, null, msg + " - selector " + selector + " is not focusable" ); } @@ -85,7 +85,7 @@ test( "data", function() { element = $( "
" ).data( "test", function() {} ); shouldHaveData( "data set to function" ); -}); +} ); test( "focusable - visible, enabled elements", function() { expect( 18 ); @@ -108,7 +108,7 @@ test( "focusable - visible, enabled elements", function() { isNotFocusable( "#visibleAncestor-div", "div" ); isFocusable( "#visibleAncestor-spanWithTabindex", "span with tabindex" ); isFocusable( "#visibleAncestor-divWithNegativeTabindex", "div with tabindex" ); -}); +} ); test( "focusable - disabled elements", function() { expect( 9 ); @@ -122,7 +122,7 @@ test( "focusable - disabled elements", function() { isNotFocusable( "#disabledElement-button", "button" ); isNotFocusable( "#disabledElement-select", "select" ); isNotFocusable( "#disabledElement-textarea", "textarea" ); -}); +} ); test( "focusable - hidden styles", function() { expect( 8 ); @@ -138,7 +138,7 @@ test( "focusable - hidden styles", function() { isNotFocusable( "#displayNone-span", "span with tabindex, display: none" ); isNotFocusable( "#visibilityHidden-span", "span with tabindex, visibility: hidden" ); -}); +} ); test( "focusable - natively focusable with various tabindex", function() { expect( 4 ); @@ -147,7 +147,7 @@ test( "focusable - natively focusable with various tabindex", function() { isFocusable( "#inputTabindex10", "input, tabindex 10" ); isFocusable( "#inputTabindex-1", "input, tabindex -1" ); isFocusable( "#inputTabindex-50", "input, tabindex -50" ); -}); +} ); test( "focusable - not natively focusable with various tabindex", function() { expect( 4 ); @@ -156,7 +156,7 @@ test( "focusable - not natively focusable with various tabindex", function() { isFocusable( "#spanTabindex10", "span, tabindex 10" ); isFocusable( "#spanTabindex-1", "span, tabindex -1" ); isFocusable( "#spanTabindex-50", "span, tabindex -50" ); -}); +} ); test( "focusable - area elements", function() { expect( 3 ); @@ -164,13 +164,13 @@ test( "focusable - area elements", function() { isFocusable( "#areaCoordsHref", "coords and href" ); isFocusable( "#areaNoCoordsHref", "href but no coords" ); isNotFocusable( "#areaNoImg", "not associated with an image" ); -}); +} ); test( "focusable - dimensionless parent with overflow", function() { expect( 1 ); isFocusable( "#dimensionlessParent", "input" ); -}); +} ); test( "tabbable - visible, enabled elements", function() { expect( 18 ); @@ -193,7 +193,7 @@ test( "tabbable - visible, enabled elements", function() { isNotTabbable( "#visibleAncestor-div", "div" ); isTabbable( "#visibleAncestor-spanWithTabindex", "span with tabindex" ); isNotTabbable( "#visibleAncestor-divWithNegativeTabindex", "div with tabindex" ); -}); +} ); test( "tabbable - disabled elements", function() { expect( 9 ); @@ -207,7 +207,7 @@ test( "tabbable - disabled elements", function() { isNotTabbable( "#disabledElement-button", "button" ); isNotTabbable( "#disabledElement-select", "select" ); isNotTabbable( "#disabledElement-textarea", "textarea" ); -}); +} ); test( "tabbable - hidden styles", function() { expect( 8 ); @@ -223,7 +223,7 @@ test( "tabbable - hidden styles", function() { isNotTabbable( "#displayNone-span", "span with tabindex, display: none" ); isNotTabbable( "#visibilityHidden-span", "span with tabindex, visibility: hidden" ); -}); +} ); test( "tabbable - natively tabbable with various tabindex", function() { expect( 4 ); @@ -232,7 +232,7 @@ test( "tabbable - natively tabbable with various tabindex", function() { isTabbable( "#inputTabindex10", "input, tabindex 10" ); isNotTabbable( "#inputTabindex-1", "input, tabindex -1" ); isNotTabbable( "#inputTabindex-50", "input, tabindex -50" ); -}); +} ); test( "tabbable - not natively tabbable with various tabindex", function() { expect( 4 ); @@ -241,7 +241,7 @@ test( "tabbable - not natively tabbable with various tabindex", function() { isTabbable( "#spanTabindex10", "span, tabindex 10" ); isNotTabbable( "#spanTabindex-1", "span, tabindex -1" ); isNotTabbable( "#spanTabindex-50", "span, tabindex -50" ); -}); +} ); test( "tabbable - area elements", function() { expect( 3 ); @@ -249,13 +249,13 @@ test( "tabbable - area elements", function() { isTabbable( "#areaCoordsHref", "coords and href" ); isTabbable( "#areaNoCoordsHref", "href but no coords" ); isNotTabbable( "#areaNoImg", "not associated with an image" ); -}); +} ); test( "tabbable - dimensionless parent with overflow", function() { expect( 1 ); isTabbable( "#dimensionlessParent", "input" ); -}); +} ); test( "escapeSelector", function() { expect( 1 ); diff --git a/ui/data.js b/ui/data.js index e989902da..f76098d8c 100644 --- a/ui/data.js +++ b/ui/data.js @@ -30,7 +30,8 @@ return $.extend( $.expr[ ":" ], { return !!$.data( elem, dataName ); }; } ) : - // support: jQuery <1.8 + + // Support: jQuery <1.8 function( elem, i, match ) { return !!$.data( elem, match[ 3 ] ); } diff --git a/ui/focusable.js b/ui/focusable.js index b6e86e062..a50598cd4 100644 --- a/ui/focusable.js +++ b/ui/focusable.js @@ -24,7 +24,7 @@ } } ( function( $ ) { -// selectors +// Selectors $.ui.focusable = function( element, hasTabindex ) { var map, mapName, img, nodeName = element.nodeName.toLowerCase(); @@ -42,7 +42,8 @@ $.ui.focusable = function( element, hasTabindex ) { "a" === nodeName ? element.href || hasTabindex : hasTabindex ) && - // the element and all of its ancestors must be visible + + // The element and all of its ancestors must be visible visible( element ); }; diff --git a/ui/jquery-1-7.js b/ui/jquery-1-7.js index 29e008e8a..8d25f8807 100644 --- a/ui/jquery-1-7.js +++ b/ui/jquery-1-7.js @@ -24,7 +24,7 @@ } }( function( $ ) { -// support: jQuery 1.7 only +// Support: jQuery 1.7 only // Not a great way to check versions, but since we only support 1.7+ and only // need to detect <1.8, this is a simple check that should suffice. Checking // for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0 -- 2.39.5