New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cssom-view] Remove caret range
concept from CaretPosition
interface#10230
Comments
Completely agree that caret position shouldn't be live or backed by a live range, because of the perf concerns you called out. I think the spec should be updated to explicitly mention that. |
Yeah, I think the current definition is broken as someone could mutate the range and that would impact the result, which isn't what you want to happen. |
@smaug---- @zcorpan Any thoughts? Firefox is the only browser that ships this API at the moment and even Firefox doesn't appear to use a live range in its implementation: https://searchfox.org/mozilla-central/source/dom/base/nsDOMCaretPosition.h#27. So I think we should update the spec, remove the "caret range" concept and explicitly mention that CaretPosition shouldn't be backed by a live range under the hood. |
yeah, the spec doesn't really make sense. Gecko does internally create a temporary Range just to call getBoundingClientRect and after that the Range is released, so it won't observe mutations to DOM. I think this stuff comes initially from 532723f I don't see that being discussed in Here https://lists.w3.org/Archives/Public/www-style/2009Nov/0244.html Oh, and looks like I complained about the range already 13 years ago :) https://lists.w3.org/Archives/Public/www-style/2011May/0051.html |
Thanks for the input. It seems that @smaug---- from Mozilla, @annevk from Apple, and @sanketj and myself from Microsoft all agree that @astearns Is it possible to get to resolution of this issue without bringing up to CSSWG meeting? Thanks. |
cc'ing Googler @mfreed7. |
LGTM. Incidentally, I'm also in favor of going back in time and making every range a static range, but that's a tougher lift. |
The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment. Proposed Resolution: Remove |
RESOLVED: Remove |
Current spec for
CaretPosition
interface has acaret range
concept which is a live range. Thecaret range
is only used to get the client rect of theCaretPosition
. We should avoid creating the live range upfront because:CaretPosition::getClientRect()
is invoked.)Propose to remove
caret range
concept fromCaretPosition
interface.The text was updated successfully, but these errors were encountered: