Closed
Bug 303781
Opened 19 years ago
Closed 19 years ago
Bidi: In RTL text in a textarea, deleting a blank line requires pressing "Backspace" twice
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
mozilla1.8beta5
People
(Reporter: uriber, Assigned: uriber)
References
()
Details
(Keywords: rtl, verified1.8)
Attachments
(2 files)
|
1.05 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.03 KB,
patch
|
smontagu
:
review+
roc
:
superreview+
mtschrep
:
approval1.8b5+
|
Details | Diff | Splinter Review |
In the following testcase: https://bugzilla.mozilla.org/attachment.cgi?id=128681 , use the arrow keys to place the caret on any of the blank lines (in either of the textareas). Press "Backspace" (or "Delete") once. The caret will move (until bug 203399 is fixed), but the empty line will not be deleted. Pressing "Backspace" (or "Delete") again will delete the blank line.
| Assignee | ||
Comment 1•19 years ago
|
||
When the caret is next to a BRFrame, aSelNode contains the textarea itself (not a text node), and aSeloffset is the offset of the BRFrame inside the textarea (not the offset of the caret inside the text node). In this case, looking at the bidi properties of aSelNode's content and its neighbours is useless - we need to drill down to the BRFrame itself. The patch was inspired by nsSelection::GetFrameForNodeOffset(), which basically does the same thing before calling GetChildFrameContainingOffset().
| Assignee | ||
Updated•19 years ago
|
Attachment #191887 -
Flags: review?(smontagu)
| Assignee | ||
Comment 2•19 years ago
|
||
In comment #0, I meant to say "until bug 303399 is fixed".
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•19 years ago
|
||
I did some testing in designmode (HTML editor), and I found that my patch works, without having to do recursive drilling-down into the node, because the node passed to CheckBidiLevelForDeletion() (as aSelNode) is always either a text node, or the immediate container of the non-text node to be deleted. e.g, for: "a<br/><br/>b", when deleting the empty line, aSelNode is the nsHTMLBodyElement (and aSelOffset is 2). But for "a<i>b<br/><br/>c</i>d", aSelNode is the nsHTMLSpanElement (for the <i>), and aSelOffset is again 2.
| Assignee | ||
Comment 4•19 years ago
|
||
Same patch, updated for changes made in the meantime.
Attachment #191887 -
Attachment is obsolete: true
Attachment #194088 -
Flags: review?(smontagu)
| Assignee | ||
Updated•19 years ago
|
Attachment #191887 -
Flags: review?(smontagu)
Comment 5•19 years ago
|
||
Comment on attachment 194088 [details] [diff] [review] patch, updated r = me since this patch improves behaviour (though the more I look at this code the more fundamental problems I see with it, but we already have bugs about that)
Attachment #194088 -
Flags: review?(smontagu) → review+
| Assignee | ||
Comment 6•19 years ago
|
||
Comment on attachment 194088 [details] [diff] [review] patch, updated Thnaks, Simon. Would you mind pointing out the bug numbers for the fundamental problems you mention?
Attachment #194088 -
Flags: superreview?(roc)
Attachment #194088 -
Flags: superreview?(roc) → superreview+
| Assignee | ||
Comment 7•19 years ago
|
||
Comment on attachment 194088 [details] [diff] [review] patch, updated Requesting approval1.8b5, as this is a simple fix to an annoying problem.
Attachment #194088 -
Flags: approval1.8b5?
Comment 8•19 years ago
|
||
Checking in editor/libeditor/text/nsTextEditRulesBidi.cpp; /cvsroot/mozilla/editor/libeditor/text/nsTextEditRulesBidi.cpp,v <-- nsTextEditRulesBidi.cpp new revision: 1.15; previous revision: 1.14 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Flags: blocking1.8b5+
Comment 9•19 years ago
|
||
Comment on attachment 194088 [details] [diff] [review] patch, updated Approved for 1.8b5 per bug meeting
Attachment #194088 -
Flags: approval1.8b5? → approval1.8b5+
| Assignee | ||
Updated•19 years ago
|
Target Milestone: --- → mozilla1.8beta5
Comment 10•19 years ago
|
||
Comment on attachment 191887 [details] [diff] [review] patch (1.8 branch) 1.8 Branch: Checking in nsTextEditRulesBidi.cpp; /cvsroot/mozilla/editor/libeditor/text/nsTextEditRulesBidi.cpp,v <-- nsTextEditRulesBidi.cpp new revision: 1.13.20.1; previous revision: 1.13 done
Attachment #191887 -
Attachment description: patch → patch (1.8 branch)
Attachment #191887 -
Attachment is obsolete: false
Updated•19 years ago
|
Keywords: fixed1.8 → verified1.8
Comment 11•17 years ago
|
||
Mass-assigning the new rtl keyword to RTL-related (see bug 349193).
Keywords: rtl
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: zach → layout.fonts-and-text
You need to log in
before you can comment on or make changes to this bug.
Description
•