Skip to content

Missing return_rw_data calls in LayoutTask? #8358

Closed as not planned
Closed as not planned

Description

@Ms2ger

Some RPC queries (in particular, hit_test/get_nodes_under_mouse) are made from script without requesting a reflow first. In order to prevent these queries finishing before the first reflow, we lock the LayoutTaskData in LayoutTask::start.

We still want to allow layout code to update the LayoutTaskData before the first reflow, so we allow it to call LayoutTask::lock_rw_data to take the lock, and then calling LayoutTask::return_rw_data to return the lock (keeping the script code waiting).

However, some callers (at least GetCurrentEpoch, GetWebFontLoadState and CollectReports) don't call LayoutTask::return_rw_data, and thus leave the script thread free to read from the LayoutTaskData.

As far as I can tell, there is no fundamental reason none of those can happen before the first reflow.

Activity

  1. Ms2ger commented on Nov 5, 2015

    @Ms2ger
    ContributorAuthor
  2. mrobinson commented on Aug 5, 2025

    @mrobinson
    Member

    I think this is no longer applicable since we do trigger layouts for most queries and layout and script aren't separated by RPC any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions