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
054daa20
Commit
054daa20
authored
Jan 08, 2013
by
Oleg
Committed by
Dave Methvin
Jan 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ref #8908. Update IE9 css clone fix. Close gh-1119.
parent
94340607
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
css.js
src/css.js
+3
-8
support.js
src/support.js
+4
-0
css.js
test/unit/css.js
+5
-2
No files found.
src/css.js
View file @
054daa20
...
...
@@ -216,18 +216,13 @@ jQuery.extend({
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
// but it would mean to define eight (for every problematic property) identical functions
if
(
value
===
""
&&
name
.
indexOf
(
"background"
)
===
0
)
{
value
=
"
"
;
if
(
!
jQuery
.
support
.
clearCloneStyle
&&
value
===
""
&&
name
.
indexOf
(
"background"
)
===
0
)
{
style
[
name
]
=
"inherit
"
;
}
// If a hook was provided, use that value, otherwise just set the specified value
if
(
!
hooks
||
!
(
"set"
in
hooks
)
||
(
value
=
hooks
.
set
(
elem
,
value
,
extra
))
!==
undefined
)
{
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try
{
style
[
name
]
=
value
;
}
catch
(
e
)
{}
style
[
name
]
=
value
;
}
}
else
{
...
...
src/support.js
View file @
054daa20
...
...
@@ -64,6 +64,10 @@ jQuery.support = (function() {
div
.
setAttribute
(
"onfocusin"
,
"t"
);
support
.
focusinBubbles
=
"onfocusin"
in
window
||
div
.
attributes
.
onfocusin
.
expando
===
false
;
div
.
style
.
backgroundClip
=
"content-box"
;
div
.
cloneNode
().
style
.
backgroundClip
=
""
;
support
.
clearCloneStyle
=
div
.
style
.
backgroundClip
===
"content-box"
;
// Run tests that need a body at doc ready
jQuery
(
function
()
{
var
container
,
marginDiv
,
tds
,
...
...
test/unit/css.js
View file @
054daa20
...
...
@@ -883,7 +883,7 @@ test( "css opacity consistency across browsers (#12685)", function() {
equal
(
Math
.
round
(
el
.
css
(
"opacity"
)
*
100
),
20
,
"remove opacity override"
);
});
asyncTest
(
"Clearing a Cloned Element's Style Shouldn't Clear the Original Element's Style (#8908)"
,
16
,
function
()
{
asyncTest
(
"Clearing a Cloned Element's Style Shouldn't Clear the Original Element's Style (#8908)"
,
24
,
function
()
{
var
baseUrl
=
document
.
location
.
href
.
replace
(
/
([^\/]
*
)
$/
,
""
),
styles
=
[{
name
:
"backgroundAttachment"
,
...
...
@@ -921,7 +921,7 @@ asyncTest( "Clearing a Cloned Element's Style Shouldn't Clear the Original Eleme
expected
:
[
"auto auto"
]
}];
jQuery
.
each
(
styles
,
function
(
index
,
style
)
{
jQuery
.
each
(
styles
,
function
(
index
,
style
)
{
var
$clone
,
$clonedChildren
,
$source
=
jQuery
(
"#firstp"
),
source
=
$source
[
0
],
...
...
@@ -932,6 +932,7 @@ asyncTest( "Clearing a Cloned Element's Style Shouldn't Clear the Original Eleme
if
(
source
.
style
[
style
.
name
]
===
undefined
)
{
ok
(
true
,
style
.
name
+
": style isn't supported and therefore not an issue"
);
ok
(
true
);
return
true
;
}
...
...
@@ -945,6 +946,8 @@ asyncTest( "Clearing a Cloned Element's Style Shouldn't Clear the Original Eleme
$clonedChildren
.
css
(
style
.
name
,
""
);
window
.
setTimeout
(
function
()
{
notEqual
(
$clone
.
css
(
style
.
name
),
style
.
value
[
0
],
"Cloned css was changed"
);
ok
(
jQuery
.
inArray
(
$source
.
css
(
style
.
name
)
!==
-
1
,
style
.
value
),
"Clearing clone.css() doesn't affect source.css(): "
+
style
.
name
+
"; result: "
+
$source
.
css
(
style
.
name
)
+
...
...
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