[webkit-dev] Nesting Level of DOMTimer (non-one-shot timer)

陈浩 chenhao at ucweb.com
Fri Oct 10 08:19:49 PDT 2014

Hi, all,

I am confused about the nesting level of DOMTimer.

First, there is a long story which come from:

Current situation is the timer could forward the gesture state only if 
the nesting level is zero. The problem is the nesting level is managed 
in the Document (ScriptExecutionContext), that means all timers in the 
same document share one nesting level. If one repeat timer was launched, 
all other timers after that could not forward the gesture state, due to 
all of them has a non-zero nesting level.

Below is my testing page, three images at the end of page could delay 
the onload event. You could follow below steps to reproduce what I met:
  1. Click "Start repeating timer" first
  2. After the text change to "Running...", click "Goto next page"
  3. When WebKit page come out, click back button.

What I see is the page before the testing page, because the 
NavigationScheduler::mustLockBackForwardList refused the creation of new 
history item.
   <input type="button" value="Goto next page" onclick="gotoNextPage();">
   <input type="button" value="Start repeating timer" 
   <div id="Timer">Paused</div>
   <script type="text/javascript">

   function gotoNextPage(){

   function startRepeatingTimer(){

width="640" height="480">
width="640" height="480">
width="640" height="480">

According to Web App APIs 
the nesting level of repeating timer will be increased in the loop. I 
doubt that the nesting level should owned by the timer itself, do not 
share with others. Just as described in the defintion, that is task's 
nesting level.

That's appreciate to get your comment!

Thanks & Best Regards!

More information about the webkit-dev mailing list