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
ed66609a
Commit
ed66609a
authored
Apr 18, 2013
by
Timmy Willison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove usage of the deprecated getAttributeNode() unless a support test warrants it. Fixes #12072.
parent
35784a82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
attributes.js
src/attributes.js
+15
-14
manipulation.js
src/manipulation.js
+1
-2
No files found.
src/attributes.js
View file @
ed66609a
...
...
@@ -229,10 +229,11 @@ jQuery.extend({
valHooks
:
{
option
:
{
get
:
function
(
elem
)
{
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var
val
=
elem
.
attributes
.
value
;
return
!
val
||
val
.
specified
?
elem
.
value
:
elem
.
text
;
// Use proper attribute retrieval(#6932, #12072)
var
val
=
jQuery
.
find
.
attr
(
elem
,
"value"
);
return
val
!=
null
?
val
:
elem
.
text
;
}
},
select
:
{
...
...
@@ -430,10 +431,11 @@ jQuery.extend({
get
:
function
(
elem
)
{
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
var
attributeNode
=
elem
.
getAttributeNode
(
"tabindex"
);
// Use proper attribute retrieval(#12072)
var
tabindex
=
jQuery
.
find
.
attr
(
elem
,
"tabindex"
);
return
attributeNode
&&
attributeNode
.
specified
?
parseInt
(
attributeNode
.
value
,
10
)
:
return
tabindex
?
parseInt
(
tabindex
,
10
)
:
rfocusable
.
test
(
elem
.
nodeName
)
||
rclickable
.
test
(
elem
.
nodeName
)
&&
elem
.
href
?
0
:
-
1
;
...
...
@@ -489,13 +491,12 @@ jQuery.each( jQuery.expr.match.boolean.source.match( /\w+/g ), function( i, name
// fix oldIE attroperties
if
(
!
getSetInput
||
!
getSetAttribute
)
{
jQuery
.
expr
.
attrHandle
.
value
=
function
(
elem
,
name
,
isXML
)
{
var
ret
=
elem
.
getAttributeNode
(
name
);
return
isXML
?
undefined
:
jQuery
.
nodeName
(
elem
,
"input"
)
?
// Ignore the value *property* by using defaultValue
elem
.
defaultValue
:
ret
&&
ret
.
specified
?
ret
.
value
:
undefined
;
var
ret
;
return
isXML
?
undefined
:
// Ignore the value *property* on inputs by using defaultValue
jQuery
.
nodeName
(
elem
,
"input"
)
?
elem
.
defaultValue
:
// Retrieve the attribute
(
ret
=
elem
.
getAttributeNode
(
name
))
&&
ret
.
specified
?
ret
.
value
:
undefined
;
};
jQuery
.
attrHooks
.
value
=
{
set
:
function
(
elem
,
value
,
name
)
{
...
...
src/manipulation.js
View file @
ed66609a
...
...
@@ -319,8 +319,7 @@ function manipulationTarget( elem, content ) {
// Replace/restore the type attribute of script elements for safe DOM manipulation
function
disableScript
(
elem
)
{
var
attr
=
elem
.
getAttributeNode
(
"type"
);
elem
.
type
=
(
attr
&&
attr
.
specified
)
+
"/"
+
elem
.
type
;
elem
.
type
=
!!
jQuery
.
find
.
attr
(
elem
,
"type"
)
+
"/"
+
elem
.
type
;
return
elem
;
}
function
restoreScript
(
elem
)
{
...
...
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