Created attachment 417131 [details] direction-rtl.png STR: 1. Load this URL: data:text/html,<body style="direction: rtl">text</body> 2. Open the inspector and uncheck the CSS rule, or use the JS console and run `document.body.style.direction = ""` Alternative STR: 1. Load this URL: data:text/html,<body style="direction: rtl">text<script>setTimeout(() => document.body.style.direction = "", 1000)</script></body> Expected: The direction should flip to ltr (default) Actual: The page stays at rtl.
<rdar://problem/72866732>
STP Release 118 (Safari 14.1, WebKit 15611.1.9) macOS 10.15.7 (19H15)
Setting document.body.style.direction to "ltr" works; removeProperty("direction") also fails to update the direction.
Seems to be an issue on the root (body or html) only.
I think this is about this code in resolveForDocument(): if (bodyRenderer && !docElementRenderer->style().hasExplicitlySetDirection()) documentStyle.setDirection(bodyRenderer->style().direction()); else documentStyle.setDirection(docElementRenderer->style().direction()); which seems to put the old body style on the document.