Repository: servo/servo
File: components/paint/painter.rs (Rust)

Code before:
    pub(crate) fn page_zoom(&self, webview_id: WebViewId) -> f32 {
        self.webview_renderers
            .get(&webview_id)
            .map(|webview_renderer| webview_renderer.page_zoom.get())
            .unwrap_or_default()
    }

    pub(crate) fn notify_input_event(&mut self, webview_id: WebViewId, event: InputEventAndId) {
        if let Some(webview_renderer) = self.webview_renderers.get_mut(&webview_id) {
            match &event.event {
                InputEvent::MouseMove(event) => {
                    // We only track the last mouse move position for non-touch events.
                    if !event.is_compatibility_event_for_touch {
                        let event_point = event
                            .point
                            .as_device_point(webview_renderer.device_pixels_per_page_pixel());
                        self.last_mouse_move_position = Some(event_point);
                    }
                },
                InputEvent::MouseLeftViewport(_) => {
                    self.last_mouse_move_position = None;
                },
                _ => {},
            }

            webview_renderer.notify_input_event(&self.webrender_api, &self.needs_repaint, event);
        }
        self.disable_lcp_calculation_for_webview(webview_id);
    }

    pub(crate) fn notify_scroll_event(
        &mut self,
        webview_id: WebViewId,
        scroll: Scroll,
        point: WebViewPoint,
    ) {
        if let Some(webview_renderer) = self.webview_renderers.get_mut(&webview_id) {
            webview_renderer.notify_scroll_event(scroll, point);
        }
        self.disable_lcp_calculation_for_webview(webview_id);
    }

    pub(crate) fn pinch_zoom(
        &mut self,
        webview_id: WebViewId,
        pinch_zoom_delta: f32,
        center: DevicePoint,
    ) {
        if let Some(webview_renderer) = self.webview_renderers.get_mut(&webview_id) {
            webview_renderer.adjust_pinch_zoom(pinch_zoom_delta, center);
        }

Review comment (suggestion):
Any reason not to call `disable_lcp_calculation_for_webview` here directly? Additionally, this comment should explain why you are disabling LCP here and not just what the code is doing:

```suggestion
                _ => {
                    self.disable_lcp_calculation_for_webview(webview_id);
                },
```

Code after:
    pub(crate) fn page_zoom(&self, webview_id: WebViewId) -> f32 {
        self.webview_renderers
            .get(&webview_id)
            .map(|webview_renderer| webview_renderer.page_zoom.get())
            .unwrap_or_default()
    }

    pub(crate) fn notify_input_event(&mut self, webview_id: WebViewId, event: InputEventAndId) {
        if let Some(webview_renderer) = self.webview_renderers.get_mut(&webview_id) {
            match &event.event {
                InputEvent::MouseMove(event) => {
                    // We only track the last mouse move position for non-touch events.
                    if !event.is_compatibility_event_for_touch {
                        let event_point = event
                            .point
                            .as_device_point(webview_renderer.device_pixels_per_page_pixel());
                        self.last_mouse_move_position = Some(event_point);
                    }
                },
                InputEvent::MouseLeftViewport(_) => {
                    self.last_mouse_move_position = None;
                },
                _ => {
                    // Disable LCP calculation on any other input event except mouse moves.
                    self.lcp_calculator.disable_for_webview(webview_id);
                },
            }

            webview_renderer.notify_input_event(&self.webrender_api, &self.needs_repaint, event);
        }
    }

    pub(crate) fn notify_scroll_event(
        &mut self,
        webview_id: WebViewId,
        scroll: Scroll,
        point: WebViewPoint,
    ) {
        if let Some(webview_renderer) = self.webview_renderers.get_mut(&webview_id) {
            webview_renderer.notify_scroll_event(scroll, point);
        }
        // Disable LCP calculation on any scroll event.
        self.lcp_calculator.disable_for_webview(webview_id);
    }

    pub(crate) fn pinch_zoom(
        &mut self,
        webview_id: WebViewId,
        pinch_zoom_delta: f32,
        center: DevicePoint,
    ) {