(no commit message)
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 19 Dec 2006 18:52:45 +0000 (18:52 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 19 Dec 2006 18:52:45 +0000 (18:52 +0000)
src/jquery/coreTest.js
src/jquery/jquery.js

index 25fd4dd..7dd7a16 100644 (file)
@@ -379,7 +379,7 @@ test("expressions - child and adjacent", function() {
 });\r
 \r
 test("expressions - attributes", function() {\r
-       expect(16);\r
+       expect(19);\r
        t( "Attribute Exists", "a[@title]", ["google"] );\r
        t( "Attribute Exists", "*[@title]", ["google"] );\r
        t( "Attribute Exists", "[@title]", ["google"] );\r
@@ -395,6 +395,10 @@ test("expressions - attributes", function() {
        t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] );\r
        t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] );\r
        \r
+       t("Select options via [@selected]", "#select1 option[@selected]", ["option1a"] );\r
+       t("Select options via [@selected]", "#select2 option[@selected]", ["option2d"] );\r
+       t("Select options via [@selected]", "#select3 option[@selected]", ["option3b", "option3c"] );\r
+       \r
        t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] );\r
        \r
        t( ":not() Existing attribute", "select:not([@multiple])", ["select1", "select2"]);\r
index d3ed8c6..8cffb8e 100644 (file)
@@ -1418,7 +1418,7 @@ jQuery.extend({
                        enabled: "!a.disabled",\r
                        disabled: "a.disabled",\r
                        checked: "a.checked",\r
-                       selected: "a.selected || jQuery.attr(a, 'selected')",\r
+                       selected: "a.selected",\r
 \r
                        // Form elements\r
                        text: "a.type=='text'",\r
@@ -1570,7 +1570,8 @@ jQuery.extend({
                        value: "value",\r
                        disabled: "disabled",\r
                        checked: "checked",\r
-                       readonly: "readOnly"\r
+                       readonly: "readOnly",\r
+                       selected: "selected"\r
                };\r
                \r
                // IE actually uses filters for opacity ... elem is actually elem.style\r