From 8af2b7897582fe4deec2bcd1a7204a22c1dcea24 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Wed, 6 Sep 2023 21:24:32 +0300 Subject: [PATCH] Backed out 3 changesets (bug 1802466) for mochitest failure on test_composition_text_querycontent.xhtml . CLOSED TREE Backed out changeset 1af6a9b30e2c (bug 1802466) Backed out changeset 9461b0e136d3 (bug 1802466) Backed out changeset 59c6e8943e53 (bug 1802466) --- dom/base/Selection.cpp | 41 ++------ ...input-vertical-overflow-no-scroll.html.ini | 98 +++++++++++++++++++ ...ext-input-vertical-overflow-no-scroll.html | 17 +--- 3 files changed, 108 insertions(+), 48 deletions(-) create mode 100644 testing/web-platform/meta/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html.ini diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index 97fbcf08a690..283cb93b54de 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -3236,7 +3236,7 @@ nsIFrame* Selection::GetSelectionEndPointGeometry(SelectionRegion aRegion, nsFrameSelection::AdjustFrameForLineStart(frame, frameOffset); // Figure out what node type we have, then get the - // appropriate rect for its nodeOffset. + // appropriate rect for it's nodeOffset. bool isText = node->IsText(); nsPoint pt(0, 0); @@ -3250,42 +3250,19 @@ nsIFrame* Selection::GetSelectionEndPointGeometry(SelectionRegion aRegion, frame = childFrame; - // Get the coordinates of the offset into the text frame. + // Get the x coordinate of the offset into the text frame. rv = GetCachedFrameOffset(frame, nodeOffset, pt); if (NS_FAILED(rv)) return nullptr; } - // Return the rect relative to the frame, with zero inline-size. The - // inline-position is either 'pt' (if we're a text node) or otherwise just - // the physical "end" edge of the frame (which we express as the frame's own - // width or height, since the returned position is relative to the frame). - // The block position and size are set so as to fill the frame in that axis. - // (i.e. block-position of 0, and block-size matching the frame's own block - // size). - const WritingMode wm = frame->GetWritingMode(); - // Helper to determine the inline-axis position for the aRect outparam. - auto GetInlinePosition = [&]() { - if (isText) { - return wm.IsVertical() ? pt.y : pt.x; - } - // Return the frame's physical end edge of its inline axis, relative to the - // frame. That's just its height or width. - // TODO(dholbert): This seems to work, but perhaps we really want the - // inline-end edge (rather than physical end of inline axis)? (i.e. if we - // have direction:rtl, maybe this code would want to return 0 instead of - // height/width?) - return frame->ISize(wm); - }; - - // Set the inline position and block-size. Leave inline size and block - // position set to 0, as discussed above. - if (wm.IsVertical()) { - aRect->y = GetInlinePosition(); - aRect->SetWidth(frame->ISize(wm)); - } else { - aRect->x = GetInlinePosition(); - aRect->SetHeight(frame->ISize(wm)); + // Return the rect relative to the frame, with zero width. + if (isText) { + aRect->x = pt.x; + } else if (mFrameSelection->GetHint() == CARET_ASSOCIATE_BEFORE) { + // It's the frame's right edge we're interested in. + aRect->x = frame->GetRect().Width(); } + aRect->SetHeight(frame->GetRect().Height()); return frame; } diff --git a/testing/web-platform/meta/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html.ini b/testing/web-platform/meta/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html.ini new file mode 100644 index 000000000000..0625a3c8faa1 --- /dev/null +++ b/testing/web-platform/meta/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html.ini @@ -0,0 +1,98 @@ +[text-input-vertical-overflow-no-scroll.html] + [input[type=text\] in vertical-lr: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=text\] in vertical-rl: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=text\] in sideways-lr: typing characters in input should not cause the page to scroll] + expected: + if (os == "android") and debug and swgl: [PASS, FAIL] + if (os == "android") and debug and not swgl: PASS + if (os == "win") and not debug and (processor == "x86_64"): [PASS, FAIL] + if (os == "linux") and debug: FAIL + if (os == "android") and not debug: [PASS, FAIL] + if os == "mac": PASS + [FAIL, PASS] + + [input[type=text\] in sideways-rl: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=password\] in vertical-lr: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=password\] in vertical-rl: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=password\] in sideways-lr: typing characters in input should not cause the page to scroll] + expected: + if (os == "win") and debug and (processor == "x86_64"): [PASS, FAIL] + if (os == "android") and debug and not swgl: PASS + if (os == "android") and debug and swgl: [PASS, FAIL] + if (os == "linux") and debug: FAIL + if (os == "android") and not debug: [PASS, FAIL] + if os == "mac": PASS + [FAIL, PASS] + + [input[type=password\] in sideways-rl: typing characters in input should not cause the page to scroll] + expected: + if (os == "linux") and not debug: [FAIL, PASS] + if (os == "win") and not debug: [FAIL, PASS] + if os == "mac": [FAIL, PASS] + FAIL + + [input[type=search\] in vertical-lr: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=search\] in vertical-rl: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=search\] in sideways-lr: typing characters in input should not cause the page to scroll] + expected: + if (os == "win") and not debug and (processor == "x86_64"): [PASS, FAIL] + if (os == "android") and debug and not swgl: PASS + if (os == "android") and debug and swgl: [PASS, FAIL] + if (os == "linux") and debug: FAIL + if (os == "android") and not debug: [PASS, FAIL] + if os == "mac": PASS + [FAIL, PASS] + + [input[type=search\] in sideways-rl: typing characters in input should not cause the page to scroll] + expected: + if not debug and (os == "linux"): [FAIL, PASS] + if not debug and (os == "mac"): [FAIL, PASS] + if not debug and (os == "win"): [FAIL, PASS] + FAIL + + [input[type=number\] in vertical-lr: typing characters in input should not cause the page to scroll] + expected: + if not debug and (os == "linux"): [FAIL, PASS] + if not debug and (os == "win"): [FAIL, PASS] + if not debug and (os == "mac"): [FAIL, PASS] + FAIL + + [input[type=number\] in vertical-rl: typing characters in input should not cause the page to scroll] + expected: [FAIL, PASS] + + [input[type=number\] in sideways-lr: typing characters in input should not cause the page to scroll] + expected: + if (os == "linux") and debug and swgl and not fission: FAIL + if (os == "linux") and not debug and not asan and not fission: [PASS, FAIL] + if (os == "linux") and debug and not swgl: FAIL + if (os == "win") and not debug and (processor == "x86"): [PASS, FAIL] + if (os == "android") and debug and not swgl: PASS + if (os == "android") and debug and swgl: [PASS, FAIL] + if (os == "android") and not debug: [PASS, FAIL] + if os == "mac": PASS + [FAIL, PASS] + + [input[type=number\] in sideways-rl: typing characters in input should not cause the page to scroll] + expected: + if not debug and (os == "linux") and (processor == "x86_64") and fission and not asan and tsan: [FAIL, PASS] + if not debug and (os == "linux") and (processor == "x86_64") and fission and not asan and not tsan: [FAIL, PASS] + if not debug and (os == "linux") and (processor == "x86_64") and fission and asan: [FAIL, PASS] + if not debug and (os == "linux") and (processor == "x86_64") and not fission: [FAIL, PASS] + if not debug and (os == "linux") and (processor == "x86"): [FAIL, PASS] + if not debug and (os == "win"): [FAIL, PASS] + if not debug and (os == "mac"): [FAIL, PASS] + FAIL diff --git a/testing/web-platform/tests/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html b/testing/web-platform/tests/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html index 601acb17e0c1..50d2cb44ea66 100644 --- a/testing/web-platform/tests/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html +++ b/testing/web-platform/tests/css/css-writing-modes/forms/text-input-vertical-overflow-no-scroll.html @@ -12,22 +12,7 @@ .spacer { height: 100vh; } - input { - font-family: monospace; - - /* Use an explicit whole-number-of-pixels height, to avoid tripping - Mozilla bug 1851066, regarding fractional scroll positions - triggering an async 1px adjustment to scrollTop. We can remove this - once that bug is fixed. - (Without this hack, the input element may end up with a height - that's a fractional number of pixels, depending on the font. - And then this test's call to 'scrollIntoView' puts us at a - fractional scroll-position, to bottom-align the input element. And - that's sufficient to trigger bug 1851066 and get an asynchronous 1px - adjustment to scrollTop, which this test doesn't expect. - */ - height: 200px; - } + input { font-family: monospace; }