Skip to content

CSS position: static incorrectly applies top/left/right/bottom properties #378

@EndlessJour9527

Description

@EndlessJour9527

According to the CSS standard (MDN Reference), when an element uses position: static, the properties top, left, right, and bottom should be ignored. However, in the current implementation of JSAR Runtime, these properties are still effective and alter layout for elements with position: static.

Expected behavior:

  • For elements with position: static, the properties top, left, right, and bottom must have no effect (should be ignored by the layout engine).

Actual behavior:

  • In JSAR Runtime, applying top, left, right, or bottom to a statically positioned element affects its rendered position, which is a deviation from the web standard.

References:

Steps to reproduce:

  1. Create a simple HTML file with an element styled as position: static and non-zero top/left values.
  2. Observe that the element is offset in JSAR but not in standard browsers.

Impact:

  • This results in layout incompatibility with web standards and other browsers (Chromium, Gecko, etc.).

Suggestion:

  • Update the layout engine so that when an element's position is static, the top, left, right, and bottom properties are ignored during layout calculation.

Web标准参考:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions