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
95cd2009
Commit
95cd2009
authored
Nov 08, 2011
by
Dave Methvin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:jquery/jquery
parents
586fb059
0ce2d5e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
9 deletions
+58
-9
manipulation.js
src/manipulation.js
+1
-1
sizzle
src/sizzle
+1
-1
support.js
src/support.js
+5
-4
manipulation.js
test/unit/manipulation.js
+51
-3
No files found.
src/manipulation.js
View file @
95cd2009
...
...
@@ -483,7 +483,7 @@ jQuery.buildFragment = function( args, nodes, scripts ) {
if
(
args
.
length
===
1
&&
typeof
first
===
"string"
&&
first
.
length
<
512
&&
doc
===
document
&&
first
.
charAt
(
0
)
===
"<"
&&
!
rnocache
.
test
(
first
)
&&
(
jQuery
.
support
.
checkClone
||
!
rchecked
.
test
(
first
))
&&
(
!
jQuery
.
support
.
unknownElems
&&
rnoshimcache
.
test
(
first
))
)
{
(
jQuery
.
support
.
html5Clone
||
!
rnoshimcache
.
test
(
first
))
)
{
cacheable
=
true
;
...
...
sizzle
@
d4e5c22e
Subproject commit
5d3cc64e732631cde3924a3deaaf4a282feef1c5
Subproject commit
d4e5c22e7ee8aa5751fc8d4d4f21d7ed5ff04a49
src/support.js
View file @
95cd2009
...
...
@@ -24,7 +24,7 @@ jQuery.support = (function() {
// Preliminary tests
div
.
setAttribute
(
"className"
,
"t"
);
div
.
innerHTML
=
" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>
<nav></nav>
"
;
div
.
innerHTML
=
" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"
;
all
=
div
.
getElementsByTagName
(
"*"
);
...
...
@@ -69,9 +69,6 @@ jQuery.support = (function() {
// (IE uses styleFloat instead of cssFloat)
cssFloat
:
!!
a
.
style
.
cssFloat
,
// Make sure unknown elements (like HTML5 elems) are handled appropriately
unknownElems
:
!!
div
.
getElementsByTagName
(
"nav"
).
length
,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
...
...
@@ -87,6 +84,10 @@ jQuery.support = (function() {
// Tests for enctype support on a form(#6743)
enctype
:
!!
document
.
createElement
(
"form"
).
enctype
,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone
:
document
.
createElement
(
"nav"
).
cloneNode
(
true
).
outerHTML
!==
"<:nav></:nav>"
,
// Will be defined later
submitBubbles
:
true
,
changeBubbles
:
true
,
...
...
test/unit/manipulation.js
View file @
95cd2009
...
...
@@ -513,7 +513,7 @@ test("HTML5 Elements inherit styles from style rules (Bug #10501)", function ()
notEqual
(
jQuery
(
"section"
).
css
(
"background-color"
),
"transparent"
,
"HTML5 elements inherit styles"
);
});
test
(
"
clone()
(#6485)"
,
function
()
{
test
(
"
html5 clone() cannot use the fragment cache in IE
(#6485)"
,
function
()
{
expect
(
1
);
jQuery
(
"<article><section><aside>HTML5 elements</aside></section></article>"
).
appendTo
(
"#qunit-fixture"
);
...
...
@@ -1034,7 +1034,7 @@ test("clone() (#8070)", function () {
});
test
(
"clone()"
,
function
()
{
expect
(
40
);
expect
(
39
);
equal
(
"This is a normal link: Yahoo"
,
jQuery
(
"#en"
).
text
(),
"Assert text for #en"
);
var
clone
=
jQuery
(
"#yahoo"
).
clone
();
equal
(
"Try them out:Yahoo"
,
jQuery
(
"#first"
).
append
(
clone
).
text
(),
"Check for clone"
);
...
...
@@ -1116,7 +1116,7 @@ test("clone()", function() {
clone
=
div
.
clone
(
true
);
equal
(
clone
.
length
,
1
,
"One element cloned"
);
equal
(
clone
.
html
(),
div
.
html
(),
"Element contents cloned"
);
//
equal( clone.html(), div.html(), "Element contents cloned" );
equal
(
clone
[
0
].
nodeName
.
toUpperCase
(),
"DIV"
,
"DIV element cloned"
);
// and here's a valid one.
...
...
@@ -1642,3 +1642,51 @@ test("Cloned, detached HTML5 elems (#10667,10670)", function() {
$section
.
unbind
(
"click"
);
$clone
.
unbind
(
"click"
);
});
test
(
"jQuery.fragments cache expectations"
,
function
()
{
expect
(
10
);
jQuery
.
fragments
=
{};
function
fragmentCacheSize
()
{
var
n
=
0
,
c
;
for
(
c
in
jQuery
.
fragments
)
{
n
++
;
}
return
n
;
}
jQuery
(
"<li></li>"
);
jQuery
(
"<li>?</li>"
);
jQuery
(
"<li>whip</li>"
);
jQuery
(
"<li>it</li>"
);
jQuery
(
"<li>good</li>"
);
jQuery
(
"<div></div>"
);
jQuery
(
"<div><div><span></span></div></div>"
);
jQuery
(
"<tr><td></td></tr>"
);
jQuery
(
"<tr><td></tr>"
);
jQuery
(
"<li>aaa</li>"
);
jQuery
(
"<ul><li>?</li></ul>"
);
jQuery
(
"<div><p>arf</p>nnn</div>"
);
jQuery
(
"<div><p>dog</p>?</div>"
);
jQuery
(
"<span><span>"
);
equal
(
fragmentCacheSize
(),
12
,
"12 entries exist in jQuery.fragments, 1"
);
jQuery
.
each
(
[
"<tr><td></td></tr>"
,
"<ul><li>?</li></ul>"
,
"<div><p>dog</p>?</div>"
,
"<span><span>"
],
function
(
i
,
frag
)
{
jQuery
(
frag
);
equal
(
jQuery
.
fragments
[
frag
].
nodeType
,
11
,
"Second call with "
+
frag
+
" creates a cached DocumentFragment, has nodeType 11"
);
ok
(
jQuery
.
fragments
[
frag
].
childNodes
.
length
,
"Second call with "
+
frag
+
" creates a cached DocumentFragment, has childNodes with length"
);
});
equal
(
fragmentCacheSize
(),
12
,
"12 entries exist in jQuery.fragments, 2"
);
});
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