Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Braille display is blank in contenteditable elements when the field i…
…s followed by another element. https://bugs.webkit.org/show_bug.cgi?id=229713 rdar://82095237 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/mac/range-for-line-index.html We were making the length of line ranges in text fields 1 more than the number of characters in the line even when no line break character existed, like in the case of a single line text field. Clients like VoiceOver expect the length of the line ranges in text fields to match the number of charaters in the line including the line break if one exists. * accessibility/AccessibilityRenderObject.cpp: (WebCore::isHardLineBreak): Helper function used in doAXRangeForLine. Determines whether the given VisiblePosition corresponds to a hard line break. (WebCore::AccessibilityRenderObject::doAXRangeForLine const): Returns a PlainTextRange whose length matches the number of characters in the given line, accounting for line break characters. LayoutTests: * accessibility/mac/range-for-line-index-expected.txt: Added. * accessibility/mac/range-for-line-index.html: Added. * platform/mac/accessibility/content-editable-as-textarea-expected.txt: * platform/win/accessibility/content-editable-as-textarea-expected.txt: Canonical link: https://commits.webkit.org/241229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
a0b8a86
commit 03ae90e
Showing
7 changed files
with
161 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
LayoutTests/accessibility/mac/range-for-line-index-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS contenteditable.rangeForLine(0) is '{0, 15}' | ||
PASS multilineContenteditable.rangeForLine(0) is '{0, 16}' | ||
PASS multilineContenteditable.rangeForLine(1) is '{15, 1}' | ||
PASS multilineContenteditable.rangeForLine(0) is '{0, 16}' | ||
PASS multilineContenteditable.rangeForLine(1) is '{16, 6}' | ||
PASS multilineContenteditable.rangeForLine(2) is '{22, 5}' | ||
PASS textarea.rangeForLine(0) is '{0, 15}' | ||
PASS multilineTextarea.rangeForLine(0) is '{0, 16}' | ||
PASS multilineTextarea.rangeForLine(1) is '{16, 6}' | ||
PASS multilineTextarea.rangeForLine(2) is '{22, 5}' | ||
PASS textfield.rangeForLine(0) is '{0, 21}' | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
this is a test. | ||
this is a test. | ||
this is a test. | ||
hello | ||
world | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="contenteditable1" contenteditable="true">this is a test.</div> | ||
<div id="contenteditable2" contenteditable="true">this is a test.<br></div> | ||
<div id="contenteditable3" contenteditable="true">this is a test.<br>hello<br> | ||
<a href="#">world</a> | ||
</div> | ||
|
||
<textarea id="textarea1">this is a test.</textarea> | ||
<textarea id="textarea2">this is a test. | ||
hello | ||
world</textarea> | ||
|
||
<input type="text" id="textfield" value="this is a text field."></input> | ||
|
||
<script> | ||
if (window.accessibilityController) { | ||
description(""); | ||
|
||
// contenteditable | ||
var contenteditable = accessibilityController.accessibleElementById("contenteditable1"); | ||
shouldBe("contenteditable.rangeForLine(0)", "'{0, 15}'"); | ||
|
||
var multilineContenteditable = accessibilityController.accessibleElementById("contenteditable2"); | ||
shouldBe("multilineContenteditable.rangeForLine(0)", "'{0, 16}'"); | ||
shouldBe("multilineContenteditable.rangeForLine(1)", "'{15, 1}'"); | ||
|
||
multilineContenteditable = accessibilityController.accessibleElementById("contenteditable3"); | ||
shouldBe("multilineContenteditable.rangeForLine(0)", "'{0, 16}'"); | ||
shouldBe("multilineContenteditable.rangeForLine(1)", "'{16, 6}'"); | ||
shouldBe("multilineContenteditable.rangeForLine(2)", "'{22, 5}'"); | ||
|
||
// textarea | ||
var textarea = accessibilityController.accessibleElementById("textarea1"); | ||
shouldBe("textarea.rangeForLine(0)", "'{0, 15}'"); | ||
|
||
var multilineTextarea = accessibilityController.accessibleElementById("textarea2"); | ||
shouldBe("multilineTextarea.rangeForLine(0)", "'{0, 16}'"); | ||
shouldBe("multilineTextarea.rangeForLine(1)", "'{16, 6}'"); | ||
shouldBe("multilineTextarea.rangeForLine(2)", "'{22, 5}'"); | ||
|
||
// input text field | ||
var textfield = accessibilityController.accessibleElementById("textfield"); | ||
shouldBe("textfield.rangeForLine(0)", "'{0, 21}'"); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters