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
7fb95ebe
Commit
7fb95ebe
authored
Apr 10, 2011
by
jeresig
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'attrhooks.1.6'
Conflicts: src/core.js src/support.js
parents
9ed5c774
b92d2f0b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
398 additions
and
198 deletions
+398
-198
attributes.js
src/attributes.js
+246
-104
core.js
src/core.js
+0
-1
manipulation.js
src/manipulation.js
+3
-2
support.js
src/support.js
+3
-0
index.html
test/index.html
+4
-0
attributes.js
test/unit/attributes.js
+138
-89
manipulation.js
test/unit/manipulation.js
+4
-2
No files found.
src/attributes.js
View file @
7fb95ebe
This diff is collapsed.
Click to expand it.
src/core.js
View file @
7fb95ebe
...
@@ -893,4 +893,3 @@ function doScrollCheck() {
...
@@ -893,4 +893,3 @@ function doScrollCheck() {
return
jQuery
;
return
jQuery
;
})();
})();
src/manipulation.js
View file @
7fb95ebe
...
@@ -377,7 +377,7 @@ function cloneCopyEvent( src, dest ) {
...
@@ -377,7 +377,7 @@ function cloneCopyEvent( src, dest ) {
}
}
}
}
function
cloneFixAttributes
(
src
,
dest
)
{
function
cloneFixAttributes
(
src
,
dest
)
{
// We do not need to do anything for non-Elements
// We do not need to do anything for non-Elements
if
(
dest
.
nodeType
!==
1
)
{
if
(
dest
.
nodeType
!==
1
)
{
return
;
return
;
...
@@ -549,7 +549,8 @@ jQuery.extend({
...
@@ -549,7 +549,8 @@ jQuery.extend({
// Return the cloned set
// Return the cloned set
return
clone
;
return
clone
;
},
},
clean
:
function
(
elems
,
context
,
fragment
,
scripts
)
{
clean
:
function
(
elems
,
context
,
fragment
,
scripts
)
{
context
=
context
||
document
;
context
=
context
||
document
;
...
...
src/support.js
View file @
7fb95ebe
...
@@ -71,6 +71,9 @@ jQuery.support = (function() {
...
@@ -71,6 +71,9 @@ jQuery.support = (function() {
// Make sure that a selected-by-default option has a working selected property.
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected
:
opt
.
selected
,
optSelected
:
opt
.
selected
,
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute
:
div
.
className
!==
"t"
,
// Will be defined later
// Will be defined later
submitBubbles
:
true
,
submitBubbles
:
true
,
...
...
test/index.html
View file @
7fb95ebe
...
@@ -203,6 +203,10 @@ Z</textarea>
...
@@ -203,6 +203,10 @@ Z</textarea>
<select
name=
"D4"
disabled=
"disabled"
>
<select
name=
"D4"
disabled=
"disabled"
>
<option
selected=
"selected"
value=
"NO"
>
NO
</option>
<option
selected=
"selected"
value=
"NO"
>
NO
</option>
</select>
</select>
<input
id=
"list-test"
type=
"text"
/>
<datalist
id=
"datalist"
>
<option
value=
"option"
></option>
</datalist>
</form>
</form>
<div
id=
"moretests"
>
<div
id=
"moretests"
>
<form>
<form>
...
...
test/unit/attributes.js
View file @
7fb95ebe
This diff is collapsed.
Click to expand it.
test/unit/manipulation.js
View file @
7fb95ebe
...
@@ -1009,7 +1009,7 @@ test("clone()", function() {
...
@@ -1009,7 +1009,7 @@ test("clone()", function() {
});
});
test
(
"clone(form element) (Bug #3879, #6655)"
,
function
()
{
test
(
"clone(form element) (Bug #3879, #6655)"
,
function
()
{
expect
(
6
);
expect
(
5
);
var
element
=
jQuery
(
"<select><option>Foo</option><option selected>Bar</option></select>"
);
var
element
=
jQuery
(
"<select><option>Foo</option><option selected>Bar</option></select>"
);
equals
(
element
.
clone
().
find
(
"option:selected"
).
val
(),
element
.
find
(
"option:selected"
).
val
(),
"Selected option cloned correctly"
);
equals
(
element
.
clone
().
find
(
"option:selected"
).
val
(),
element
.
find
(
"option:selected"
).
val
(),
"Selected option cloned correctly"
);
...
@@ -1019,7 +1019,9 @@ test("clone(form element) (Bug #3879, #6655)", function() {
...
@@ -1019,7 +1019,9 @@ test("clone(form element) (Bug #3879, #6655)", function() {
equals
(
clone
.
is
(
":checked"
),
element
.
is
(
":checked"
),
"Checked input cloned correctly"
);
equals
(
clone
.
is
(
":checked"
),
element
.
is
(
":checked"
),
"Checked input cloned correctly"
);
equals
(
clone
[
0
].
defaultValue
,
"foo"
,
"Checked input defaultValue cloned correctly"
);
equals
(
clone
[
0
].
defaultValue
,
"foo"
,
"Checked input defaultValue cloned correctly"
);
equals
(
clone
[
0
].
defaultChecked
,
!
jQuery
.
support
.
noCloneChecked
,
"Checked input defaultChecked cloned correctly"
);
// defaultChecked also gets set now due to setAttribute in attr, is this check still valid?
// equals( clone[0].defaultChecked, !jQuery.support.noCloneChecked, "Checked input defaultChecked cloned correctly" );
element
=
jQuery
(
"<input type='text' value='foo'>"
);
element
=
jQuery
(
"<input type='text' value='foo'>"
);
clone
=
element
.
clone
();
clone
=
element
.
clone
();
...
...
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