Closed
Bug 539323
Opened 15 years ago
Closed 14 years ago
Can't type in contentEditable
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
People
(Reporter: bmccann, Assigned: roc)
Details
Attachments
(3 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 Can't type in an empty contentEditable. See the attached file for a super tiny test case. Reproducible: Always Steps to Reproduce: 1. Open attached file Actual Results: Can't type in contentEditable Expected Results: Should be able to type in contentEditable
Comment 2•15 years ago
|
||
Works fine for me. Tab to the box, and type. Now _focusing_ the box with a mouseclick doesn't work, but that's because you're clicking on transparent parts of it (which don't get the click event), right?
Tabbing to the box half works. You can tab into it, but the cursor is invisible. Correct, focusing the box with a mouse click does not work. I expect that it should (not sure what you mean by it being transparent).
Comment 4•15 years ago
|
||
Hmm. I guess even transparent frames should get click events... Enn, any idea what's up with focus here?
Component: General → Editor
Product: Firefox → Core
QA Contact: general → editor
Updated•15 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•15 years ago
|
blocking2.0: --- → ?
Comment 5•15 years ago
|
||
Focus looks to be working fine. The caret just isn't drawing when it should. 1. Click the rectangle. 2. Start typing. The entered characters appear. The caret only appears when there are characters in the box. Possibly the caret is being rendered with no height or because there is no content.
If you click once in the box, you can type, but the cursor will not appear. If you click three or more times in the box then you cannot type in the box and the cursor is not visible.
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → roc
Assignee | ||
Updated•14 years ago
|
Assignee | ||
Comment 7•14 years ago
|
||
The problem is that on the initial click, the caret is shown but it's positioned at the left edge of the border-box. So if the element has a black border, you can't see the caret. Having it next to the dotted focus rect also makes it hard to see. We should at least position it relative to the padding-box, since that's where inserted content would appear.
Attachment #421333 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Attachment #421333 -
Attachment is obsolete: false
Assignee | ||
Comment 8•14 years ago
|
||
This patch makes the caret position use the container frame's content-box instead of the border-box. This makes sense to me since it more accurately represents where content would actually be rendered if it was to be inserted at the caret position. Mats, can we test this with reftests now? There's a remaining problem in this bug, which is that clicking in the element after it already has focus makes the caret disappear and you can't type into the element anymore.
Attachment #425777 -
Flags: review?(matspal)
Assignee | ||
Comment 9•14 years ago
|
||
When the div has focus, and I click again, we go into a state where the selection has no ranges. That's why there's no caret displayed and typing does nothing. Maybe that's more of a focus-related problem?
Assignee | ||
Updated•14 years ago
|
Whiteboard: [needs review]
Comment 10•14 years ago
|
||
I don't see any focus change on second click. The focus manager returns early and does nothing as the <div> is already focused. After the first click, the selection contains the range: <div>, 0 to <div>, 0 After the second click, the selection contains the range: <body>, 1 to <body>, 2 Seems like the caret position on click handling isn't dealing with an empty contenteditable perhaps?
Comment 11•14 years ago
|
||
Comment on attachment 425777 [details] [diff] [review] fix for part 1 Makes sense to me too, r=mats Reftest now draws the caret solid (non-blinking) by default. If you need privileges you can do it in mochitest too, see layout/base/tests/test_reftests_with_caret.html for an example. I assume you'll make a reftest of Testcase #2. Would be nice to also have tests for the edge cases "width:0; padding:0" and "width:0; padding:1em". Spawn off the remaining problem as a separate bug?
Attachment #425777 -
Flags: review?(matspal) → review+
Updated•14 years ago
|
OS: Windows XP → All
Hardware: x86 → All
Whiteboard: [needs review]
Assignee | ||
Updated•14 years ago
|
Whiteboard: [needs landing]
Assignee | ||
Comment 12•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/0a02b6c9d9b4 Remaining problem filed as bug 550434.
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs landing]
You need to log in
before you can comment on or make changes to this bug.
Description
•