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
1299e89d
Commit
1299e89d
authored
Apr 12, 2011
by
Azatoth
Committed by
jeresig
Apr 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QUnit test for overriding important css declarations, references #4427
parent
31b3c44d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
testsuite.css
test/data/testsuite.css
+4
-0
css.js
test/unit/css.js
+15
-0
No files found.
test/data/testsuite.css
View file @
1299e89d
...
...
@@ -109,3 +109,7 @@ div#show-tests * { display: none; }
#nothiddendiv
{
font-size
:
16px
;
}
#nothiddendivchild
.em
{
font-size
:
2em
;
}
#nothiddendivchild
.prct
{
font-size
:
150%
;
}
div
.isimportant
{
background-color
:
rgb
(
255
,
255
,
255
)
!important
;
}
test/unit/css.js
View file @
1299e89d
...
...
@@ -377,3 +377,18 @@ test("marginRight computed style (bug #3333)", function() {
equals
(
$div
.
css
(
"marginRight"
),
"0px"
,
"marginRight correctly calculated with a width and display block"
);
});
test
(
"$().css override !important css declarations (bug #4427)"
,
function
(){
expect
(
4
);
var
div
=
jQuery
(
"<div/>"
,
{
"class"
:
"isimportant"
// background-color: #fff !important
});
div
.
css
(
"backgroundColor"
,
"rgb(0, 255, 0)"
);
equals
(
div
.
css
(
"backgroundColor"
),
"rgb(0, 255, 0)"
,
"Background color is overrided to rgb(0, 255, 0)"
);
equals
(
div
.
css
(
"background-color"
),
"rgb(0, 255, 0)"
,
"Background color is overrided to rgb(0, 255, 0)"
);
div
.
css
(
"background-color"
,
"rgb(0, 255, 0)"
);
equals
(
div
.
css
(
"backgroundColor"
),
"rgb(0, 255, 0)"
,
"Background color is overrided to rgb(0, 255, 0)"
);
equals
(
div
.
css
(
"background-color"
),
"rgb(0, 255, 0)"
,
"Background color is overrided to rgb(0, 255, 0)"
);
});
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