michael@0: // |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 127243; michael@0: var summary = 'Do not crash on watch'; michael@0: var actual = 'No Crash'; michael@0: var expect = 'No Crash'; michael@0: michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: if (typeof window != 'undefined' && typeof document != 'undefined') michael@0: { michael@0: // delay test driver end michael@0: gDelayTestDriverEnd = true; michael@0: window.addEventListener('load', handleLoad, false); michael@0: } michael@0: else michael@0: { michael@0: printStatus('This test must be run in the browser'); michael@0: reportCompare(expect, actual, summary); michael@0: michael@0: } michael@0: michael@0: var div; michael@0: michael@0: function handleLoad() michael@0: { michael@0: div = document.createElement('div'); michael@0: document.body.appendChild(div); michael@0: div.setAttribute('id', 'id1'); michael@0: div.style.width = '50px'; michael@0: div.style.height = '100px'; michael@0: div.style.overflow = 'auto'; michael@0: michael@0: for (var i = 0; i < 5; i++) michael@0: { michael@0: var p = document.createElement('p'); michael@0: var t = document.createTextNode('blah'); michael@0: p.appendChild(t); michael@0: div.appendChild(p); michael@0: } michael@0: michael@0: div.watch('scrollTop', wee); michael@0: michael@0: setTimeout('setScrollTop()', 1000); michael@0: } michael@0: michael@0: function wee(id, oldval, newval) michael@0: { michael@0: var t = document.createTextNode('setting ' + id + michael@0: ' value ' + div.scrollTop + michael@0: ' oldval ' + oldval + michael@0: ' newval ' + newval); michael@0: var p = document.createElement('p'); michael@0: p.appendChild(t); michael@0: document.body.appendChild(p); michael@0: michael@0: return newval; michael@0: } michael@0: michael@0: function setScrollTop() michael@0: { michael@0: div.scrollTop = 42; michael@0: michael@0: reportCompare(expect, actual, summary); michael@0: michael@0: gDelayTestDriverEnd = false; michael@0: jsTestDriverEnd(); michael@0: michael@0: }