← Another post?
Available languages:
English

Firefox code memo

Table of Contents

I leave findings about the Firefox code here for future reference.

General

base points

flow

code patterns

Variant Matching

https://searchfox.org/firefox-main/rev/fdd583cd5a10d051053acda8b760c3bd5d800034/gfx/layers/apz/util/APZTaskRunnable.cpp#23-51

auto requests = std::move(mPendingRequestQueue);
[...]
while (!requests.empty()) {
    struct RequestProcessor {
        GeckoContentController* mController;
        void operator()(const RepaintRequest& aRequest) {
            mController->RequestContentRepaint(aRequest);
        }
        void operator()(const APZStateChangeRequest& aRequest) {
            mController->NotifyAPZStateChange(aRequest.mGuid, aRequest.mChange,
                                                aRequest.mArg,
                                                aRequest.mInputBlockId);
        }
    };
    requests.front().match(RequestProcessor{controller.get()});
    requests.pop_front();
}

caviats

APZ

base points

flow

How are scrolls happened on the APZ side reflected on the content process?

  1. APZ controller on the compositor thread calls RemoteContentController::RequestContentRepaint().
  2. Via IPC, that makes APZ child on the main thread put an early runner.
  3. The early runner is processed at the beginning of nsRefreshDriver::Tick(), which is almost equivalent to "update the rendering".
  4. The early runner eventually calls ScrollContainerFrame::ScrollToImpl() and it sets the received APZ scroll info to ScrollContainerFrame::mApzScrollPos.

caviats

Servo

base points

flow

caviats

← Another post?