Closed Bug 1550635 Opened 7 years ago Closed 6 months ago

window.document.caretRangeFromPoint is not supported in Firefox

Categories

(Core :: DOM: Core & HTML, defect, P3)

66 Branch
Unspecified
Windows 10
defect

Tracking

()

RESOLVED FIXED
150 Branch
Webcompat Priority P3
Tracking Status
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- wontfix
firefox150 --- fixed

People

(Reporter: karlcow, Assigned: ltenenbaum)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

(4 keywords, Whiteboard: [platform-feature], [wptsync upstream])

User Story

webcompat-risk:high

Attachments

(1 file, 1 obsolete file)

The lack of window.document.caretRangeFromPoint might get us blocked from using the site https://coda.io/

Reported initially on https://webcompat.com/issues/30408

Steps to reproduce:

On https://coda.io/signin
Firefox is redirected to https://coda.io/unsupported-browser?continueTo=%2Fsignin
On this page, they are pledging they are in the process of supporting other platforms.

Impersonating Chrome UA we can avoid the redirection, and access the application. After the sign up process, the application fails because of the lack of window.document.caretRangeFromPoint

That doesn't mean that if Firefox supported it, it would solve all issues for this case, but that's a starting point it seems.

This is currently supported by Blink, WebKit, EdgeHTML
not supported by Trident and Gecko.
https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint

Here an example of polyfill for it
https://github.com/Abel-Jr/OurSite/blob/55c221dd8abf474a1075c5d3a817eaae97b73fce/wp-includes/js/dist/dom.js#L614-L647

Flags: webcompat?
Webcompat Priority: --- → ?
Flags: webcompat?

We should file a bug in the compat standard for this, at least.

Flags: needinfo?(miket)
Webcompat Priority: ? → revisit
Flags: needinfo?(miket)

Coda now is working on Firefox (even still without the caretRangeFromPoint support) , but not on Fenix.
Hi Karl, do you think you can help us do further investigation to understand the root cause of the issue on Android/Fenix? Thank you.

URL: https://coda.io/ → https://coda.io/
Flags: needinfo?(karlt)

Guessing Hsin-Yi may have meant other Karl.

Flags: needinfo?(karlt) → needinfo?(kdubost)
Flags: needinfo?(htsai)

Let's see if Adam has an opinion about Fenix and Coda.
Does the site work or is used on Google Chrome too?

Hsin-Yi, When you say this is not supported on Fenix? In which ways?

Flags: needinfo?(kdubost)
Flags: needinfo?(htsai)
Flags: needinfo?(astevenson)
Webcompat Priority: revisit → P3

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit auto_nag documentation.

Flags: needinfo?(a.stevenson82)
Severity: normal → S3

This would help us to pass the WPT https://wpt.fyi/results/css/css-contain/content-visibility/content-visibility-080.html, which Safari and Chrome both pass.

Blocks: 1887054

Happened to notice this bug. Are you planning to ask review for the patch?

Flags: needinfo?(gregp)

Happened to notice this bug. Are you planning to ask review for the patch?

Yes.

This would help us to pass the WPT https://wpt.fyi/results/css/css-contain/content-visibility/content-visibility-080.html, which Safari and Chrome both pass.

I investigated this test a few months ago and it still fails even with the caretRangeFromPoint implementation. My memory is a bit fuzzy but I think the problem is content-visibility: hidden nodes get returned by nsLayoutUtils::GetFramesForArea, which is strange.

Probably, a new bug needs to be filed for this test.

Flags: needinfo?(gregp)
Attachment #9397753 - Attachment is obsolete: true
Assignee: nobody → gregp
Status: NEW → ASSIGNED
Whiteboard: webcompat:risk-high

Link to jira https://mozilla-hub.atlassian.net/browse/FFXP-3167, also adding tentative scheduling info.

User Story: (updated)
User Story: (updated)
Attachment #9434118 - Attachment description: Bug 1550635 - Implement document.caretRangeFromPoint → Bug 1550635 - Implement document.caretRangeFromPoint r?#dom-core,smaug
No longer blocks: 1927838
Assignee: gregp → mozilla
No longer blocks: 1988830
Depends on: 1988830
Whiteboard: webcompat:risk-high → [platform-feature][webcompat:risk-high]
Attachment #9434118 - Attachment description: Bug 1550635 - Implement document.caretRangeFromPoint r?#dom-core,smaug → WIP: Bug 1550635 - Implement document.caretRangeFromPoint r?#dom-core,smaug
Attachment #9434118 - Attachment description: WIP: Bug 1550635 - Implement document.caretRangeFromPoint r?#dom-core,smaug → Bug 1550635 - Implement document.caretRangeFromPoint r?#dom-core,smaug
Assignee: mozilla → ltenenbaum
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/58097 for changes under testing/web-platform/tests
Whiteboard: [platform-feature][webcompat:risk-high] → [platform-feature][webcompat:risk-high], [wptsync upstream]
Pushed by asilaghi@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fec1ab02b20c https://hg.mozilla.org/integration/autoland/rev/004666b6406e Revert "Bug 1550635 - Implement document.caretRangeFromPoint r=webidl,gregp,layout-reviewers,emilio" for causing web failures at caretRangeFromPoint

Backed out for causing web failures at caretRangeFromPoint
Backout Link
Push with failures
Failure Log
Failure line TEST-UNEXPECTED-FAIL | /css/cssom/caretRangeFromPoint.tentative.html | document.caretRangeFromPoint() should return a client rect close to the given coords - assert_approx_equals: expected 21 +/- 1 but got 19

Flags: needinfo?(ltenenbaum)
Pushed by rperta@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8d0f55f3e633 https://hg.mozilla.org/mozilla-central/rev/69326b7edf81 Revert "Bug 1550635 - Implement document.caretRangeFromPoint r=webidl,gregp,layout-reviewers,emilio" for causing web failures at caretRangeFromPoint
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Upstream PR merged by moz-wptsync-bot

(Probably should not be marked as fixed given that it was backed out…)

Status: RESOLVED → REOPENED
Flags: needinfo?(ltenenbaum)
Resolution: FIXED → ---
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/58182 for changes under testing/web-platform/tests
Status: REOPENED → RESOLVED
Closed: 7 months ago → 6 months ago
Resolution: --- → FIXED
Upstream PR merged by moz-wptsync-bot
Regressions: 2020655

:ltenenbaum did you want to include this in the Fx150 release notes? Feel free to nominate if so.

Flags: needinfo?(ltenenbaum)

No, I don't think it's relevant to many people since an API which basically does the same thing (caretPositionFromPoint) is already supported.

Flags: needinfo?(ltenenbaum)
QA Whiteboard: [qa-triage-done-c151/b150]

FF150 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/43550

User Story: (updated)
Whiteboard: [platform-feature][webcompat:risk-high], [wptsync upstream] → [platform-feature], [wptsync upstream]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: