Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Core: Always reset browser default style for body #7934

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions css/structure/jquery.mobile.core.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.ui-mobile,
.ui-mobile body {
height: 99.9%;
margin: 0;
padding: 0;
}
.ui-mobile fieldset,
.ui-page {
Expand Down
16 changes: 10 additions & 6 deletions tests/integration/core/core_scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

(function($){
var libName = "core",
scrollTimeout = 20, // TODO expose timing as an attribute
scrollTimeout = 70, // TODO expose timing as an attribute
scrollStartEnabledTimeout = 150;

module(libName, {
setup: function(){
$("<div id='scroll-testing' style='height: 1000px'></div>").appendTo("body");
setup: function() {
$( "<div id='scroll-testing' " +
"style='height: " + ( screen.height * 3 ) + "px'></div>").appendTo( "body" );
},

teardown: function(){
Expand All @@ -18,16 +19,19 @@
});

var scrollUp = function( pos ){
$(window).scrollTop(1000);
ok($(window).scrollTop() > 0, $(window).scrollTop());
$( window ).scrollTop( screen.height );
deepEqual( $( window ).scrollTop() > 0, true,
"After setting scrollTop, it is " + $( window ).scrollTop() );
$.mobile.silentScroll(pos);
};

asyncTest( "silent scroll scrolls the page to the top by default", function(){
scrollUp();

setTimeout(function(){
deepEqual($(window).scrollTop(), 0);
deepEqual( $(window).scrollTop(), $.mobile.defaultHomeScroll,
"After parameterless silentScroll(), scrollTop is $.mobile.defaultHomescroll: " +
$.mobile.defaultHomeScroll );
start();
}, scrollTimeout);
});
Expand Down