// The apz-aware div (which has a non-passive wheel listener) is not visible
// and so the hit-test should just return the root scrollframe area that's
// covering it
checkHitResult(hitTest(centerOf(apzaware)),
APZHitResultFlags.VISIBLE,
utils.getViewId(document.scrollingElement),
utils.getLayersId(), "inactive scrollframe - apzaware block");
// Hit test where the scroll thumbs should be.
hitTestScrollbar({
element: scroller,
directions: { vertical: true, horizontal: true },
expectedScrollId: utils.getViewId(document.scrollingElement),
expectedLayersId: utils.getLayersId(),
trackLocation: ScrollbarTrackLocation.START,
expectThumb: true,
layerState: LayerState.INACTIVE,
});
// activate the scrollframe but keep the main-thread scroll position at 0.
// also apply a async scroll offset in the y-direction such that the
// scrollframe scrolls to the bottom of its range.
utils.setDisplayPortForElement(0, 0, 500, 500, scroller, 1);
await promiseApzFlushedRepaints(); var scrollY = scroller.scrollTopMax;
utils.setAsyncScrollOffset(scroller, 0, scrollY);
// Tick the refresh driver once to make sure the compositor has applied the
// async scroll offset (for WebRender hit-testing we need to make sure WR has
// the latest info).
utils.advanceTimeAndRefresh(16);
utils.restoreNormalRefresh();
var scrollerViewId = utils.getViewId(scroller);
// Now we again test the middle of the scrollframe, which is now active
checkHitResult(hitTest(centerOf(scroller)),
APZHitResultFlags.VISIBLE,
scrollerViewId,
utils.getLayersId(), "active scrollframe");
// Test the apz-aware block var apzawarePosition = centerOf(apzaware); // main thread position
apzawarePosition.y -= scrollY; // APZ position
checkHitResult(hitTest(apzawarePosition),
APZHitResultFlags.VISIBLE |
APZHitResultFlags.APZ_AWARE_LISTENERS,
scrollerViewId,
utils.getLayersId(), "active scrollframe - apzaware block");
// Test the scrollbars. Note that this time the vertical scrollthumb is
// going to be at the bottom of the track. We'll test both the top and the
// bottom.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.