test_queryCaretRect.html caret-position assertions fail when Nova is enabled
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: sthompson, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
dom/tests/mochitest/chrome/test_queryCaretRect.html fails on Nova Tier-3 test runs, across all platforms, with repeated caret-position assertion failures.
Dashboard: https://tests.firefox.dev/test.html?test=dom/tests/mochitest/chrome/test_queryCaretRect.html
Failures observed:
- [win, linux, mac] "rect.top < 390" fails repeatedly across many caret-position sub-tests (queryCaretRectWin.html / queryCaretRectUnix.html)
Generally, the selection rect is further right or further down by a few more pixels than expected. The browser chrome takes up additional space under Nova, but that shouldn't affect measurements that occur only within the client area.
| Assignee | ||
Comment 1•2 months ago
|
||
Looks like the test assumes the editor's rect because the expectation is fixed values:
https://searchfox.org/firefox-main/rev/9822ee9dfe9be4851b0466ebf21646d66a5b7960/dom/tests/mochitest/chrome/queryCaretRectWin.html#89-92,112-113
but Nova changed that. I think the expected value should be changed to refer the editor's rect.
The browser chrome takes up additional space under Nova, but that shouldn't affect measurements that occur only within the client area.
The result is relative to the top level widget. Therefore, if the toolbar height is changed by applying Nova, this test may fail.
| Assignee | ||
Comment 2•2 months ago
|
||
The test is anyway not aware of HiDPI...
| Assignee | ||
Comment 3•2 months ago
|
||
The test checks the query result point relative to the root widget
with the fixed value. Therefore, if the widget is not at the top-left
corner of the top level widget, it fails to compare the expected values.
Additionally, the test is not HiDPI environment aware. Therefore, this
makes the test check window.devicePixelRatio.
Finally, we don't treat CRLF on Windows separately. Therefore, we don't
need to have the CRLF version of the test anymore.
| Assignee | ||
Comment 4•2 months ago
|
||
How can I test the result with enabling Nova?
| Assignee | ||
Comment 5•2 months ago
|
||
Ah, okay, --setpref browser.nova.enabled=true allows that. However, indeed, even the patched test fails with bigger left and top values.
| Assignee | ||
Comment 6•2 months ago
|
||
In my environment (200%), QUERY_EDITOR_RECT returns:
editor rect={x=8, y=7, width=1600, height=1200}
but with enabling Nova, the result is changed to:
editor rect={x=18, y=28, width=1600, height=1200}
So, the <textarea> was moved 5 CSS pixels right and 10.5 CSS pixels bottom.
However, window.mozInnerScreenX - window.top.mozInnerScreenX and window.mozInnerScreenY - window.top.mozInnerScreenY are 0. So, I'm not sure how to detect the actual offset of the window in the top level widget...
Emilio, do you know how to get it?
| Assignee | ||
Comment 7•2 months ago
|
||
Okay, using the offset of QUERY_EDITOR_RECT works, but I'm still interested in how to get the window offset in the top level widget in the JS world. So, not canceling the ni.
Updated•2 months ago
|
Comment 8•2 months ago
|
||
This is because window == window.top right? You're running in a <browser> that isn't a direct child of browser.xhtml... Does mozInnerScreenX - screenX work here? If not you'd need to use a privileged API (not .top) to get to the toplevel window. And of course it'd only work in the chrome mochitest in this case. I.e., this should work:
window.mozInnerScreenX - window.browsingContext.topChromeWindow.mozInnerScreenX
Doesn't it?
| Assignee | ||
Comment 9•2 months ago
|
||
Thanks, it gets different result in Nova. So, I guess it works. But simply using the value breaks the patch. I'll update the patch with it...
Comment 10•2 months ago
|
||
Comment 11•2 months ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•