mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Tests: test element position outside view
Ref a0f5c357c4
Ref gh-2828
Ref gh-2836
Fixes gh-2909
This commit is contained in:
parent
a0f5c357c4
commit
c3b1d9c07e
@ -1,127 +1,127 @@
|
|||||||
/* for testing opacity set in styles in IE */
|
/* for testing opacity set in styles in IE */
|
||||||
ol#empty {
|
ol#empty {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
filter:Alpha(opacity=0) progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffff0000', EndColorStr='#ffffffff');
|
filter:Alpha(opacity=0) progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffff0000', EndColorStr='#ffffffff');
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests h4 {
|
div#fx-tests h4 {
|
||||||
background: red;
|
background: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests h4.pass {
|
div#fx-tests h4.pass {
|
||||||
background: green;
|
background: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests div.box {
|
div#fx-tests div.box {
|
||||||
background: red;
|
background: red;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 2px solid #000;
|
border: 2px solid #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests div.overflow {
|
div#fx-tests div.overflow {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.inline {
|
div.inline {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.autoheight {
|
div.autoheight {
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.autowidth {
|
div.autowidth {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.autoopacity {
|
div.autoopacity {
|
||||||
opacity: auto;
|
opacity: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.largewidth {
|
div.largewidth {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.largeheight {
|
div.largeheight {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.largeopacity {
|
div.largeopacity {
|
||||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
|
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.medwidth {
|
div.medwidth {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.medheight {
|
div.medheight {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.medopacity {
|
div.medopacity {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
|
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.nowidth {
|
div.nowidth {
|
||||||
width: 0px;
|
width: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.noheight {
|
div.noheight {
|
||||||
height: 0px;
|
height: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.noopacity {
|
div.noopacity {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);
|
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.hidden {
|
div.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests div.widewidth {
|
div#fx-tests div.widewidth {
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests div.wideheight {
|
div#fx-tests div.wideheight {
|
||||||
background-repeat: repeat-y;
|
background-repeat: repeat-y;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests div.widewidth.wideheight {
|
div#fx-tests div.widewidth.wideheight {
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests div.noback {
|
div#fx-tests div.noback {
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chain-test,
|
.chain-test,
|
||||||
.chain-test div {
|
.chain-test div {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
.chain-test div {
|
.chain-test div {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chain-test {
|
.chain-test {
|
||||||
background: red;
|
background: red;
|
||||||
}
|
}
|
||||||
.chain-test div {
|
.chain-test div {
|
||||||
background: green;
|
background: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chain-test-out {
|
.chain-test-out {
|
||||||
background: green;
|
background: green;
|
||||||
}
|
}
|
||||||
.chain-test-out div {
|
.chain-test-out div {
|
||||||
background: red;
|
background: red;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tests to ensure jQuery can determine the native display mode of elements
|
/* tests to ensure jQuery can determine the native display mode of elements
|
||||||
@ -159,7 +159,19 @@ section { background:#f0f; display:block; }
|
|||||||
|
|
||||||
/* fix get alpha opacity in IE8 */
|
/* fix get alpha opacity in IE8 */
|
||||||
.fix-get-alpha-opacity-in-ie8 {
|
.fix-get-alpha-opacity-in-ie8 {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||||
|
}
|
||||||
|
|
||||||
|
#div-gh-2836 {
|
||||||
|
position: relative;
|
||||||
|
overflow: auto;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
#div-gh-2836 div {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -497,4 +497,34 @@ QUnit.test( "allow modification of coordinates argument (gh-1848)", function( as
|
|||||||
"coordinates are modified (got offset.top: " + offsetTop + ")" );
|
"coordinates are modified (got offset.top: " + offsetTop + ")" );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
QUnit.test( "outside view position (gh-2836)", function( assert ) {
|
||||||
|
|
||||||
|
// This test ported from gh-2836 example
|
||||||
|
assert.expect( 1 );
|
||||||
|
|
||||||
|
var parent,
|
||||||
|
html = [
|
||||||
|
"<div id=div-gh-2836>",
|
||||||
|
"<div></div>",
|
||||||
|
"<div></div>",
|
||||||
|
"<div></div>",
|
||||||
|
"<div></div>",
|
||||||
|
"<div></div>",
|
||||||
|
"</div>"
|
||||||
|
].join( "" ),
|
||||||
|
stop = assert.async();
|
||||||
|
|
||||||
|
parent = $( html );
|
||||||
|
parent.appendTo( "#qunit-fixture" );
|
||||||
|
|
||||||
|
parent.one( "scroll", function() {
|
||||||
|
var pos = parent.find( "div" ).eq( 3 ).position();
|
||||||
|
|
||||||
|
assert.strictEqual(pos.top, -100);
|
||||||
|
stop();
|
||||||
|
});
|
||||||
|
|
||||||
|
parent.scrollTop( 400 );
|
||||||
|
} );
|
||||||
|
|
||||||
} )();
|
} )();
|
||||||
|
Loading…
Reference in New Issue
Block a user