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
5d522f5c
Commit
5d522f5c
authored
Jan 13, 2015
by
Leonardo Braga
Committed by
Oleg Gaidarenko
Jan 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manipulation: add support to tag-hyphenated elements
Ref #1987 Ref 85ffc6d973865a031ded170934e0acfc2e97cb11
parent
f19595ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
manipulation.js
src/manipulation.js
+2
-2
manipulation.js
test/unit/manipulation.js
+17
-0
No files found.
src/manipulation.js
View file @
5d522f5c
...
@@ -34,8 +34,8 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
...
@@ -34,8 +34,8 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
rinlinejQuery
=
/ jQuery
\d
+="
(?:
null|
\d
+
)
"/g
,
rinlinejQuery
=
/ jQuery
\d
+="
(?:
null|
\d
+
)
"/g
,
rnoshimcache
=
new
RegExp
(
"<(?:"
+
nodeNames
+
")[
\\
s/>]"
,
"i"
),
rnoshimcache
=
new
RegExp
(
"<(?:"
+
nodeNames
+
")[
\\
s/>]"
,
"i"
),
rleadingWhitespace
=
/^
\s
+/
,
rleadingWhitespace
=
/^
\s
+/
,
rxhtmlTag
=
/<
(?!
area|br|col|embed|hr|img|input|link|meta|param
)(([\w
:
]
+
)[^
>
]
*
)\/
>/gi
,
rxhtmlTag
=
/<
(?!
area|br|col|embed|hr|img|input|link|meta|param
)(([\w
:
-
]
+
)[^
>
]
*
)\/
>/gi
,
rtagName
=
/<
([\w
:
]
+
)
/
,
rtagName
=
/<
([\w
:
-
]
+
)
/
,
rhtml
=
/<|&#
?\w
+;/
,
rhtml
=
/<|&#
?\w
+;/
,
rnoInnerhtml
=
/<
(?:
script|style|link
)
/i
,
rnoInnerhtml
=
/<
(?:
script|style|link
)
/i
,
// checked="checked" or checked
// checked="checked" or checked
...
...
test/unit/manipulation.js
View file @
5d522f5c
...
@@ -527,6 +527,23 @@ test( "html(String) with HTML5 (Bug #6485)", function() {
...
@@ -527,6 +527,23 @@ test( "html(String) with HTML5 (Bug #6485)", function() {
equal
(
jQuery
(
"#qunit-fixture"
).
children
().
children
().
children
().
length
,
1
,
"Make sure nested HTML5 elements can hold children."
);
equal
(
jQuery
(
"#qunit-fixture"
).
children
().
children
().
children
().
length
,
1
,
"Make sure nested HTML5 elements can hold children."
);
});
});
test
(
"html(String) tag-hyphenated elements (Bug #1987)"
,
function
()
{
expect
(
27
);
jQuery
.
each
(
"thead tbody tfoot colgroup caption tr th td"
.
split
(
" "
),
function
(
i
,
name
)
{
var
j
=
jQuery
(
"<"
+
name
+
"-d></"
+
name
+
"-d><"
+
name
+
"-d></"
+
name
+
"-d>"
);
ok
(
j
[
0
],
"Create a tag-hyphenated element"
);
ok
(
jQuery
.
nodeName
(
j
[
0
],
name
.
toUpperCase
()
+
"-D"
),
"Hyphenated node name"
);
ok
(
jQuery
.
nodeName
(
j
[
1
],
name
.
toUpperCase
()
+
"-D"
),
"Hyphenated node name"
);
});
var
j
=
jQuery
(
"<tr-multiple-hyphens><td-with-hyphen>text</td-with-hyphen></tr-multiple-hyphens>"
);
ok
(
jQuery
.
nodeName
(
j
[
0
],
"TR-MULTIPLE-HYPHENS"
),
"Tags with multiple hypens"
);
ok
(
jQuery
.
nodeName
(
j
.
children
()[
0
],
"TD-WITH-HYPHEN"
),
"Tags with multiple hypens"
);
equal
(
j
.
children
().
text
(),
"text"
,
"Tags with multple hypens behave normally"
);
});
test
(
"IE8 serialization bug"
,
function
()
{
test
(
"IE8 serialization bug"
,
function
()
{
expect
(
2
);
expect
(
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