Define `Selection.rangeCount` when an input field is focused
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
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- html
- Lĩnh vực
- web-dev
Hướng nghiên cứu
Start with the two reduced HTML/JavaScript test cases in issue #166 and compare their rangeCount results when focus moves into an input. Read the related Selection API issue #83 and the reported browser behavior; done means the specification clearly defines the expected rangeCount behavior and captures the relevant cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello!
In the process of investigating a web compat issue in WebKit that affects Quip's editor, I stumbled into the fact that Selection.rangeCount behaves differently across FF, Chrome and Safari when the selection is moved into a text field.
Consider the following reduced test case:
<input />
<script>
document.querySelector("input").focus();
document.write(`rangeCount := ${getSelection().rangeCount}`);
</script>
Safari 16 and Chrome will show a rangeCount of 1. However, Safari 17 (with Live Range Selection enabled, at time of writing) and Firefox both show a rangeCount of 0. However, if I adjust the test case to additionally set the DOM selection prior to focusing the input:
<input />
<script>
getSelection().setPosition(document.body, 0);
document.querySelector("input").focus();
document.write(`rangeCount := ${getSelection().rangeCount}`);
</script>
...then Firefox outputs 1 instead of 0. The behavior in Firefox seems to be that moving focus into an input field doesn't affect selection ranges, whereas behavior in Safari 16 and Chrome is that the selection will move to the start of the containing shadow host (in this case, the input element). In Safari 17, with Live Range Selection enabled, we'll now expose a rangeCount of 0 after moving focus into a text field.
Edit: this is essentially a small piece of https://github.com/w3c/selection-api/issues/83, that's just about the rangeCount.
- 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ó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
w3c/selection-api#361 · 2 bình luận ·
-
Remove single range restriction for selection interface apisCó thể làm lại được @sambandaru đã nhận 139 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 ·
-
the steps of Selection.extend() does not check whether the given offset is valid in the containerĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 55/100
w3c/selection-api#353 · 1 bình luận ·
Tất cả issue của w3c/selection-api
Issue tương tự
-
needs:triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
txn2/mcp-data-platform#1984 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-discovered
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-canvas bug llm priority:low ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
OpenHands/OpenHands#17806 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
todo
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
RocketChat/Rocket.Chat#42442 ·
Maintainer thường phản hồi trong vòng 1 ngày