Skip to content

When / how to generate a new SpatialId? #3705

@fschutt

Description

@fschutt
Contributor

I'm currently in the progress of upgrading from WR 58.0 to 60.0 - and I've noticed that there is a new parameter called SpaceAndClipInfo that is now needed almost everywhere. However, there doesn't seem to be a SpatialId::new() and most examples however just generate a SpaceAndClipInfo::root_scroll() and then copy the root_info.spatial_id to all the nodes. So what's the point?

  1. How is a SpatialId different from a PipelineId?
  2. Do scroll frames need a new scroll ID?
  3. Is it wrong if every node has a distinct SpatialId?
  4. Why is a SpatialId required to define a new clip?
  5. Can there be an example of when / how to generate a new SpatialId?

Also I've noticed that the scrolling example doesn't actually scroll anymore (at least on Windows), maybe it's because the spatial IDs of the scrolling and non-scrolling content are the same?

PS: A CHANGELOG.md or something like that would be great to have.

Activity

kvark

kvark commented on Jul 15, 2019

@kvark
Member

Spatial IDs are here to identify unique spatial nodes, i.e. elements that affect positioning. These are:

  • scroll frames
  • sticky frames
  • reference frames

How is a SpatialId different from a PipelineId?

Pipeline Id are entirely different things - they define the scopes of display lists. On the HTML level, they correspond to iframes.

Do scroll frames need a new scroll ID?

Yes. Scrolling is changing positions.

Is it wrong if every node has a distinct SpatialId?

Only the nodes that affect positions would have distinct spatial Ids.

Why is a SpatialId required to define a new clip?

A clip has a position somewhere. SpatialID defines what this position is relative to.

Can there be an example of when / how to generate a new SpatialId?

Any use of reference/sticky/scroll frames involve new spatial IDs. Do you see them not covered by existing examples?

Also I've noticed that the scrolling example doesn't actually scroll anymore (at least on Windows), maybe it's because the spatial IDs of the scrolling and non-scrolling content are the same?

I checked on Linux and also can see no scrolling. This is a bug.

A CHANGELOG.md or something like that would be great to have.

Agreed!

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

        Participants

        @kvark@fschutt

        Issue actions

          When / how to generate a new SpatialId? · Issue #3705 · servo/webrender