[LayoutNG] In quirks mode, BODY with vertical-rl rendered differently from legacy |
|||
Issue descriptionSeems to be caused by a hit test error in 'vertical-rl'. Hit test point: "626,161" Legacy hit test result: Inner node: #text "\n The quick brown fox jumped over the lazy dog.\n" Local point: "6,153" Position: #text "\n The quick brown fox jumped over the lazy dog.\n"@offsetInAnchor[18]/TextAffinity::Upstream LayoutNG hit test result: Inner node: BODY Local point: "18,153" Position: #text "\n The quick brown fox jumped over the lazy dog.\n"@offsetInAnchor[50]/TextAffinity::Upstream
,
Nov 22
Even further investigation shows that the issue is due to quirks mode.
Test HTML:
<style>
body { writing-mode: vertical-rl }
</style>
The quick brown fox jumped over the lazy dog.
Quirks mode:
- legacy: there a vertical scrollbar at the right side regardlessly, and a gap between text and scrollbar
- NG: No vertical scrollbar, and no gap between text and page's right side
Standards mode:
- Legacy and NG: no vertical scrollbar, and there's an 8px gap between text and page's right side
Hence, switching the test to standards mode should fix the test.
,
Nov 22
,
Nov 22
,
Nov 26
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3ba29ef51bb0ddc480a9ca23ba9c6a347217456b commit 3ba29ef51bb0ddc480a9ca23ba9c6a347217456b Author: Xiaocheng Hu <xiaochengh@chromium.org> Date: Mon Nov 26 17:51:28 2018 Use Standards Mode for CompositedSelectionBoundsTest.VerticalRightToLeft The unit test currently fails in LayoutNG due to different location/size of BODY element from legacy layout, which occurs only in quirks mode. Since quirks mode is not of priority, this patch changes the test to use standards mode so that it also passes in LayoutNG. Bug: 906190 Change-Id: If655826bd8ddd641c4dc6ce04f3a5acb10d1b5d9 Reviewed-on: https://chromium-review.googlesource.com/c/1347775 Commit-Queue: Emil A Eklund <eae@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#610878} [modify] https://crrev.com/3ba29ef51bb0ddc480a9ca23ba9c6a347217456b/third_party/blink/renderer/core/testing/data/composited_selection_bounds_vertical_rl.html |
|||
►
Sign in to add a comment |
|||
Comment 1 by xiaoche...@chromium.org
, Nov 22Further investigation shows that it's not a hit test issue, but due to wrong location/size of BODY. Legacy: layer at (0,0) size 640x640 backgroundClip at (0,0) size 640x480 clip at (0,0) size 640x480 LayoutBlockFlow {HTML} at (0,0) size 640x640 LayoutBlockFlow {BODY} at (8,8) size 624x464 LayoutInline {SPAN} at (0,0) size 24x420 LayoutText {#text} at (0,0) size 24x420 text run at (0,0) width 420: "The quick brown fox jumped over the" text run at (12,0) width 108: "lazy dog." LayoutText {#text} at (0,0) size 0x0 The right edge of BODY is at x = 632 LayoutNG: layer at (600,0) size 40x480 LayoutNGBlockFlow {HTML} at (0,0) size 40x480 LayoutNGBlockFlow {BODY} at (8,8) size 32x464 LayoutInline {SPAN} at (0,0) size 24x420 LayoutText {#text} at (0,0) size 24x420 text run at (0,0) width 420: "The quick brown fox jumped over the" text run at (12,0) width 108: "lazy dog." LayoutText {#text} at (0,0) size 0x0 The right edge of BODY is at x = 640 Since text is in vertical-rl writing mode, NG places it 8px to the right compared to legacy, which results in the hit test difference and hence test failure.