Changing the selection creates a Range object
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start by reviewing the current Selection API specification against the linked W3C bug, the cited editing revisions, and the public-webapps discussion. Determine the intended range-association behavior and whether the existing unload test covers it; done means the specification and relevant tests agree on the resolved behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15470
Anne 2012-01-09 14:59:07 UTC
Make it explicit that once the user changes the selection a Range object is created and associated with the selection.
Comment 1 Aryeh Gregor 2012-01-10 21:15:47 UTC
Browsers seem to differ here. Tested: IE9, Firefox 12.0a1, Chrome 17 dev, Opera Next 12.00 alpha.
Initial range: In IE, Chrome, and Opera, getSelection().rangeCount is initially 0. In Firefox, it's initially 1, with the range collapsed at (document, 0) like with all new ranges.
When the user changes the selection: All browsers replace the existing range with a new one (they don't mutate the old one).
When the user clicks somewhere without dragging, so the selection/cursor disappear: Opera sets rangeCount to 0. Firefox and Chrome make the selection's range collapse at the indicated place. IE make the range collapse to the indicated place if you actually click on some text, but sets rangeCount back to 0 if you click on empty space.
Conclusion: Firefox's behavior is simplest, because it means that if no one calls removeRange/removeAllRanges, rangeCount is always 1, and getRangeAt(0) never throws.
I wonder if we could get away with making removeRange/removeAllRanges actually reset the range to (document, 0)? Or maybe even (document.documentElement, 0)? That would be a significant additional simplification for authors -- then rangeCount is always 1. remove(All)Range(s) followed by addRange would still work as expected. Hmm . . .
More complicated than I expected! (Which just shows that I'm unreasonably optimistic, I guess.) I'll send out a mail and update the spec tomorrow.
Comment 2 Aryeh Gregor 2012-01-11 17:12:49 UTC
I clarified behavior requirements for how to associate ranges with selections, matching Firefox as noted in comment 1: http://dvcs.w3.org/hg/editing/rev/c989dd9e441d
Started a discussion for possible further change: http://lists.w3.org/Archives/Public/public-webapps/2012JanMar/0107.html
Comment 3 Aryeh Gregor 2012-01-11 19:35:25 UTC
(In reply to comment #1)
Initial range: In IE, Chrome, and Opera, getSelection().rangeCount is initially
0. In Firefox, it's initially 1, with the range collapsed at (document, 0)
like with all new ranges.
This turned out to be wrong. Actually, all browsers start rangeCount as 0. However, I was testing in Live DOM Viewer, and the range wasn't removed when the iframe got unloaded. IE9 and Opera Next 12.00 alpha do appear to remove the range on unload, which is what I'd expect; Firefox 12.0a1 and Chrome 17 dev do not. I fixed the spec so the range is initially null (matching all browsers), and specified the IE/Opera behavior for unload (with a test):
http://dvcs.w3.org/hg/editing/rev/6aaa4b8455c9
Comment 4 Ben Peters 2014-04-21 21:07:29 UTC
Moving to Selection API component.
Comment 5 Ryosuke Niwa 2014-09-16 01:20:54 UTC
Reopening the bug per https://bugzilla.mozilla.org/show_bug.cgi?id=671152
- Ngôn ngữ chính
- HTML
- Star
- 49
- Fork
- 30
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của w3c/selection-api
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
w3c/selection-api#354 ·
-
Agenda+
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
w3c/selection-api#362 ·
-
Agenda+
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
w3c/selection-api#361 · 3 bình luận ·
-
Remove single range restriction for selection interface apisCó thể làm lại được @sambandaru đã nhận 168 ngày trước và không có pull request nào đang mở. Đang mở
w3c/selection-api#358 · 2 bình luận · 1 người được giao ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
w3c/selection-api#355 ·
Tất cả issue của w3c/selection-api
Issue tương tự
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Eyevinn/open-videocore#1300 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
nextjs-tracking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
cloudflare/vinext#4390 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
googleapis/java-genai#1372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentĐang mởbug 優先: 低
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: heartbeat wakes every participants long-poll (emit users:change only on state transition)Có thể đã có người làm @birme đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Eyevinn/intercom-manager#425 ·
Maintainer thường phản hồi trong vòng 1 ngày