Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
92dfb533
Commit
92dfb533
authored
Apr 10, 2011
by
jeresig
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'attrhooks.1.6v2' of
https://github.com/timmywil/jquery
parents
f89edbc6
215c507f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
20 deletions
+3
-20
attributes.js
src/attributes.js
+0
-14
support.js
src/support.js
+3
-2
attributes.js
test/unit/attributes.js
+0
-4
No files found.
src/attributes.js
View file @
92dfb533
...
@@ -23,20 +23,6 @@ jQuery.fn.extend({
...
@@ -23,20 +23,6 @@ jQuery.fn.extend({
return
jQuery
.
access
(
this
,
name
,
value
,
true
,
jQuery
.
prop
);
return
jQuery
.
access
(
this
,
name
,
value
,
true
,
jQuery
.
prop
);
},
},
removeProp
:
function
(
name
)
{
return
this
.
each
(
function
()
{
// try/catch handles cases where IE balks (such as removing a property on window)
try
{
this
[
name
]
=
undefined
;
delete
this
[
name
];
}
catch
(
e
)
{}
});
},
prop
:
function
(
name
,
value
)
{
return
jQuery
.
access
(
this
,
name
,
value
,
true
,
jQuery
.
prop
);
},
removeProp
:
function
(
name
)
{
removeProp
:
function
(
name
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
// try/catch handles cases where IE balks (such as removing a property on window)
// try/catch handles cases where IE balks (such as removing a property on window)
...
...
src/support.js
View file @
92dfb533
...
@@ -19,7 +19,8 @@ jQuery.support = (function() {
...
@@ -19,7 +19,8 @@ jQuery.support = (function() {
isSupported
;
isSupported
;
// Preliminary tests
// Preliminary tests
div
.
innerHTML
=
" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"
;
div
.
setAttribute
(
"className"
,
"t"
);
div
.
innerHTML
=
" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"
;
all
=
div
.
getElementsByTagName
(
"*"
);
all
=
div
.
getElementsByTagName
(
"*"
);
a
=
div
.
getElementsByTagName
(
"a"
)[
0
];
a
=
div
.
getElementsByTagName
(
"a"
)[
0
];
...
@@ -48,7 +49,7 @@ jQuery.support = (function() {
...
@@ -48,7 +49,7 @@ jQuery.support = (function() {
// Get the style information from getAttribute
// Get the style information from getAttribute
// (IE uses .cssText instead)
// (IE uses .cssText instead)
style
:
/
red
/
.
test
(
a
.
getAttribute
(
"style"
)
),
style
:
/
top
/
.
test
(
a
.
getAttribute
(
"style"
)
),
// Make sure that URLs aren't manipulated
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
// (IE normalizes it by default)
...
...
test/unit/attributes.js
View file @
92dfb533
...
@@ -127,10 +127,6 @@ test("attr(String)", function() {
...
@@ -127,10 +127,6 @@ test("attr(String)", function() {
body
.
removeAttribute
(
'foo'
);
// Cleanup
body
.
removeAttribute
(
'foo'
);
// Cleanup
var
select
=
document
.
createElement
(
"select"
),
optgroup
=
document
.
createElement
(
"optgroup"
),
option
=
document
.
createElement
(
"option"
);
optgroup
.
appendChild
(
option
);
select
.
appendChild
(
optgroup
);
var
$img
=
jQuery
(
'<img style="display:none" width="215" height="53" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif"/>'
).
appendTo
(
'body'
);
var
$img
=
jQuery
(
'<img style="display:none" width="215" height="53" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif"/>'
).
appendTo
(
'body'
);
equals
(
$img
.
attr
(
'width'
),
"215"
,
"Retrieve width attribute an an element with display:none."
);
equals
(
$img
.
attr
(
'width'
),
"215"
,
"Retrieve width attribute an an element with display:none."
);
equals
(
$img
.
attr
(
'height'
),
"53"
,
"Retrieve height attribute an an element with display:none."
);
equals
(
$img
.
attr
(
'height'
),
"53"
,
"Retrieve height attribute an an element with display:none."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment