Closed Bug 1545309 Opened 5 months ago Closed 5 months ago

Fix the intermittent failure of resize-observer/eventloop.html


(Core :: Layout, defect, P3)




Tracking Status
firefox68 --- fixed


(Reporter: boris, Assigned: boris)




(2 files)

After introducing the ResizeObserver in Bug 1272409, we still one failure in eventloop.html:
assert_equals(helper.rafCount, 1, "new loop"); in test0 [1].

We fire this event in the next Tick(), but we call the callback of requestAnimationFrame() after several Tick()s, so helper.rafCount is still 0 in this case. This may be a bug of the test because using requestAnimationFrame() cannot reflect the next event loop, or our scheduling of ResizeObserver is not correct.

I can reproduce this 100% in local build (on linux and mac), but on try servers, it is an intermittent failure on all platforms.


In test0(), we use the callback of requestAnimationFrame to know in which
eventloop (i.e. Tick()) we are. However, we may not trigger the callback
of requestAnimationFrame if we are not visible. This is an optimization
from Bug 1145439.

We use Document::ShouldThrottleFrameRequests() to check if we should throttle
the frame requests in the current Tick(). One of the cases is: if we didn't
get painted during the last paint, so we are not visible. We have to throttle
the frame requests. Note that because we have to paint this document at least
once to unthrottle it, we will drop one requestAnimationFrame frame when a
document that previously wasn't visible scrolls into view.

Therefore, we should make sure we got the first paint before running test0().

Assignee: nobody → boris.chiou
Attachment #9062375 - Attachment description: Bug 1545309 - Force first paint for ResizeObserver eventloop test. → Bug 1545309 - Run ResizeObserver eventloop test after loading successfully.
Pushed by
Make test function independent from others in eventloop.html. r=dholbert
Run ResizeObserver eventloop test after loading successfully. r=dholbert
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Created web-platform-tests PR for changes under testing/web-platform/tests
Upstream PR merged
You need to log in before you can comment on or make changes to this bug.