46. A bug on repaint flow - WebKit porting to Mona OS

Finally, I understand why my WebKit port crashes on doDeferredRepaints.
Here are steps to repaint.

  • (1) FrameView::doDeferredRepaints
  • (2) ScrollView::scrollContents
  • (3) ChromeClient::invalidateContentsAndWindow
  • (4) WevView::paint
  • (5) FrameView::updateLayoutAndStyleIfNeededRecursive
  • (6) FrameView::paint
  • (7) Native paint

Sometimes (6) calls (1) and it causes bad recursive calls. After looked into WinCE port, I found what was wrong.
Although calling (4) from (3) is necessary, we should not call it directly. At (3), we mark (4) as "should be called" using Messaging API. (4) should be called on a later context such as on the message loop.