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
b5050dc4
Commit
b5050dc4
authored
Mar 04, 2014
by
Michał Gołębiowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support: Simplify the box-sizing test
Don't require body in the support.boxSizing test.
parent
4a6d1631
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
40 deletions
+8
-40
css.js
src/css.js
+2
-2
support.js
src/css/support.js
+6
-14
boxSizing.html
test/data/support/boxSizing.html
+0
-19
support.js
test/unit/support.js
+0
-5
No files found.
src/css.js
View file @
b5050dc4
...
...
@@ -171,7 +171,7 @@ function getWidthOrHeight( elem, name, extra ) {
var
valueIsBorderBox
=
true
,
val
=
name
===
"width"
?
elem
.
offsetWidth
:
elem
.
offsetHeight
,
styles
=
getStyles
(
elem
),
isBorderBox
=
support
.
boxSizing
()
&&
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
;
isBorderBox
=
support
.
boxSizing
&&
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
;
// some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
...
...
@@ -366,7 +366,7 @@ jQuery.each([ "height", "width" ], function( i, name ) {
elem
,
name
,
extra
,
support
.
boxSizing
()
&&
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
,
support
.
boxSizing
&&
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
,
styles
)
:
0
);
...
...
src/css/support.js
View file @
b5050dc4
...
...
@@ -5,7 +5,7 @@ define([
(
function
()
{
// Minified: var b,c,d,e,f,g, h,i
var
div
,
style
,
a
,
pixelPositionVal
,
boxSizing
Val
,
boxSizing
ReliableVal
,
var
div
,
style
,
a
,
pixelPositionVal
,
boxSizingReliableVal
,
reliableHiddenOffsetsVal
,
reliableMarginRightVal
;
// Setup
...
...
@@ -33,6 +33,11 @@ define([
div
.
cloneNode
(
true
).
style
.
backgroundClip
=
""
;
support
.
clearCloneStyle
=
div
.
style
.
backgroundClip
===
"content-box"
;
// Support: Firefox<29, Android 2.3
// Vendor-prefix box-sizing
support
.
boxSizing
=
style
.
boxSizing
===
""
||
style
.
MozBoxSizing
===
""
||
style
.
WebkitBoxSizing
===
""
;
jQuery
.
extend
(
support
,
{
reliableHiddenOffsets
:
function
()
{
if
(
reliableHiddenOffsetsVal
==
null
)
{
...
...
@@ -41,13 +46,6 @@ define([
return
reliableHiddenOffsetsVal
;
},
boxSizing
:
function
()
{
if
(
boxSizingVal
==
null
)
{
computeStyleTests
();
}
return
boxSizingVal
;
},
boxSizingReliable
:
function
()
{
if
(
boxSizingReliableVal
==
null
)
{
computeStyleTests
();
...
...
@@ -94,12 +92,6 @@ define([
"box-sizing:border-box;display:block;margin-top:1%;top:1%;"
+
"border:1px;padding:1px;width:4px;position:absolute"
;
// Workaround failing boxSizing test due to offsetWidth returning wrong value
// with some non-1 values of body zoom, ticket #13543
jQuery
.
swap
(
body
,
body
.
style
.
zoom
!=
null
?
{
zoom
:
1
}
:
{},
function
()
{
boxSizingVal
=
div
.
offsetWidth
===
4
;
});
// Support: IE<9
// Assume reasonable values in the absence of getComputedStyle
pixelPositionVal
=
false
;
...
...
test/data/support/boxSizing.html
deleted
100644 → 0
View file @
4a6d1631
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<style>
body
{
zoom
:
0.87
;
}
</style>
</head>
<body>
<script
src=
"../../jquery.js"
></script>
<script>
jQuery
(
function
()
{
window
.
parent
.
iframeCallback
(
jQuery
.
support
.
boxSizing
()
);
});
</script>
</body>
</html>
test/unit/support.js
View file @
b5050dc4
...
...
@@ -45,11 +45,6 @@ if ( jQuery.css ) {
});
}
testIframeWithCallback
(
"A non-1 zoom on body doesn't cause WebKit to fail box-sizing test"
,
"support/boxSizing.html"
,
function
(
boxSizing
)
{
expect
(
1
);
equal
(
boxSizing
,
computedSupport
.
boxSizing
,
"box-sizing properly detected on page with non-1 body zoom"
);
});
testIframeWithCallback
(
"A background on the testElement does not cause IE8 to crash (#9823)"
,
"support/testElementCrash.html"
,
function
()
{
expect
(
1
);
ok
(
true
,
"IE8 does not crash"
);
...
...
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