Bug 1573166 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

When you refer to an empty line (in non-empty text), do you mean in a textarea or something more like a contentEditable containing an empty paragraph? 

The following three examples are all quite different, but all contain "empty" lines:

1. Simple empty input. This should be covered by your previous patch:
    `data:text/html,<input>`
2. textarea where the second line is empty (control+home then down arrow will land on the blank line, caret offset will be 2):
    `data:text/html,<textarea>a%0a%0ac</textarea>
3. contentEditable where the second paragraph is empty (control+home then down arrow will land on the blank line, caret will be in the second paragraph at offset 0):
    `data:text/html,<div contentEditable><p>a</p><p><br></p></div>`
    Your previous patch should handle this case as well, since the paragraph is empty (even though it's part of a larger whole).

Am I correct, then, that the only problematic case for empty lines here is case 2 above? In that case, there is a character as far as accessibility is concerned: the new line ("\n"). (There probably isn't a character as far as layout is concerned, though; I'm not sure.)

One concern I have with trying to use the caret bounds for a new line character is that we could only do that if the caret was actually at that offset. That means CharBounds might return a different result for a given offset based on whether the caret was at that offset or not.
When you refer to an empty line (in non-empty text), do you mean in a textarea or something more like a contentEditable containing an empty paragraph? 

The following three examples are all quite different, but all contain "empty" lines:

1. Simple empty input. This should be covered by your previous patch:
    `data:text/html,<input>`
2. textarea where the second line is empty (control+home then down arrow will land on the blank line, caret offset will be 2):
    `data:text/html,<textarea>a%0a%0ac</textarea>`
3. contentEditable where the second paragraph is empty (control+home then down arrow will land on the blank line, caret will be in the second paragraph at offset 0):
    `data:text/html,<div contentEditable><p>a</p><p><br></p></div>`
    Your previous patch should handle this case as well, since the paragraph is empty (even though it's part of a larger whole).

Am I correct, then, that the only problematic case for empty lines here is case 2 above? In that case, there is a character as far as accessibility is concerned: the new line ("\n"). (There probably isn't a character as far as layout is concerned, though; I'm not sure.)

One concern I have with trying to use the caret bounds for a new line character is that we could only do that if the caret was actually at that offset. That means CharBounds might return a different result for a given offset based on whether the caret was at that offset or not.

Back to Bug 1573166 Comment 1