Propagate writing-mode and direction from body to html. #19637
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Direction and writing-mode is propagated from body to the viewport, but
when the computed value of those properties are different between the
root and body elements, their used values are the computed values of the
body element. The computed values are not affected by this.
We implement this propagation by using a ComputedStyle on the
HTMLHtmlElement's LayoutObject which has the propagated values for
direction and writing-mode.
The modified tests relied on direction on #container being different
from the #container parent. That is no longer possible with body being
container and the used direction value of body propagated to html.
The tests were modified to use a child of body as container instead,
the removed 8px margin was just replicating the body margin and we do
not want that on the #container div.
Spec: https://drafts.csswg.org/css-writing-modes-3/#principal-flow
TEST=external/wpt/css/css-writing-modes/wm-propagation-002.html
TEST=external/wpt/css/css-writing-modes/wm-propagation-body-033.html
TEST=external/wpt/css/css-writing-modes/wm-propagation-body-037.html
Bug: 988585
Change-Id: I2879c8fdc082940d2baaf67e126b28915f9f1eca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1852786
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705218}