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
240b141a
Commit
240b141a
authored
Nov 02, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #10299. Add a propHook for oldIE link href.
parent
9c2f0005
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
attributes.js
src/attributes.js
+8
-0
attributes.js
test/unit/attributes.js
+3
-1
No files found.
src/attributes.js
View file @
240b141a
...
@@ -562,6 +562,7 @@ if ( !getSetAttribute ) {
...
@@ -562,6 +562,7 @@ if ( !getSetAttribute ) {
// Some attributes require a special call on IE
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if
(
!
jQuery
.
support
.
hrefNormalized
)
{
if
(
!
jQuery
.
support
.
hrefNormalized
)
{
jQuery
.
each
([
"href"
,
"src"
,
"width"
,
"height"
],
function
(
i
,
name
)
{
jQuery
.
each
([
"href"
,
"src"
,
"width"
,
"height"
],
function
(
i
,
name
)
{
jQuery
.
attrHooks
[
name
]
=
jQuery
.
extend
(
jQuery
.
attrHooks
[
name
],
{
jQuery
.
attrHooks
[
name
]
=
jQuery
.
extend
(
jQuery
.
attrHooks
[
name
],
{
...
@@ -571,6 +572,13 @@ if ( !jQuery.support.hrefNormalized ) {
...
@@ -571,6 +572,13 @@ if ( !jQuery.support.hrefNormalized ) {
}
}
});
});
});
});
// link's href property should get the full normalized URL (#10299)
jQuery
.
propHooks
.
href
=
{
get
:
function
(
elem
,
name
)
{
return
elem
.
getAttribute
(
name
,
4
);
}
};
}
}
if
(
!
jQuery
.
support
.
style
)
{
if
(
!
jQuery
.
support
.
style
)
{
...
...
test/unit/attributes.js
View file @
240b141a
...
@@ -54,7 +54,7 @@ test( "jQuery.propFix integrity test", function() {
...
@@ -54,7 +54,7 @@ test( "jQuery.propFix integrity test", function() {
});
});
test
(
"attr(String)"
,
function
()
{
test
(
"attr(String)"
,
function
()
{
expect
(
4
6
);
expect
(
4
7
);
equal
(
jQuery
(
"#text1"
).
attr
(
"type"
),
"text"
,
"Check for type attribute"
);
equal
(
jQuery
(
"#text1"
).
attr
(
"type"
),
"text"
,
"Check for type attribute"
);
equal
(
jQuery
(
"#radio1"
).
attr
(
"type"
),
"radio"
,
"Check for type attribute"
);
equal
(
jQuery
(
"#radio1"
).
attr
(
"type"
),
"radio"
,
"Check for type attribute"
);
...
@@ -92,6 +92,8 @@ test( "attr(String)", function() {
...
@@ -92,6 +92,8 @@ test( "attr(String)", function() {
"href"
:
"#5"
"href"
:
"#5"
}).
appendTo
(
"#qunit-fixture"
);
}).
appendTo
(
"#qunit-fixture"
);
equal
(
jQuery
(
"#tAnchor5"
).
attr
(
"href"
),
"#5"
,
"Check for non-absolute href (an anchor)"
);
equal
(
jQuery
(
"#tAnchor5"
).
attr
(
"href"
),
"#5"
,
"Check for non-absolute href (an anchor)"
);
jQuery
(
"<a id='tAnchor6' href='#5' />"
).
appendTo
(
"#qunit-fixture"
);
equal
(
jQuery
(
"#tAnchor5"
).
prop
(
"href"
),
jQuery
(
"#tAnchor6"
).
prop
(
"href"
),
"Check for absolute href prop on an anchor"
);
// list attribute is readonly by default in browsers that support it
// list attribute is readonly by default in browsers that support it
jQuery
(
"#list-test"
).
attr
(
"list"
,
"datalist"
);
jQuery
(
"#list-test"
).
attr
(
"list"
,
"datalist"
);
...
...
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