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:
- Create a simple HTML file with an element styled as
position: static and non-zero top/left values.
- 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标准参考:
According to the CSS standard (MDN Reference), when an element uses
position: static, the propertiestop,left,right, andbottomshould be ignored. However, in the current implementation of JSAR Runtime, these properties are still effective and alter layout for elements withposition: static.Expected behavior:
position: static, the propertiestop,left,right, andbottommust have no effect (should be ignored by the layout engine).Actual behavior:
top,left,right, orbottomto a statically positioned element affects its rendered position, which is a deviation from the web standard.References:
Steps to reproduce:
position: staticand non-zerotop/leftvalues.Impact:
Suggestion:
positionisstatic, thetop,left,right, andbottomproperties are ignored during layout calculation.Web标准参考: