这是indexloc提供的服务,不要输入任何密码
Skip to content

Node with position: absolute; width: 100%; height: 100%; causes parent element to have scroll width/height #885

@PPakalns

Description

@PPakalns

taffy version

0.9.1

Platform

Bevy 0.17 with taffy 0.9.1 patch

What you did

Create overflow scroll node and add children elements that do not overflow parent element.
Then add node position: absolute; width: 100%; height: 100%; as one more children to overflow scroll node.

What went wrong

Scroll width, height calculation now reports that it is possible to scroll the element (it overflowed).

But from position: absolute documentation

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position#absolute

The element is removed from the normal document flow, and no space is created for the element in the page layout.

Layout shouldn't have changed.

If I add display: none; to this element. Scroll width, height calculation report 0 correctly.

Additional information

If I reduce position: absolute element size, problem dissapears too. Therefor I conclude that it impacts parent element page layout calculation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions