Closed Bug 564151 Opened 14 years ago Closed 14 years ago

nsHTMLEditor::HasFocus() failed if <HTML> is editable

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

Attached patch Patch v1.0Splinter Review
nsEditor::GetRoot() returns body element if the HTML document has body element. But when HTML element is editable, focused content is the HTML element. So, the current nsHTMLEditor::HasFocus() returns FALSE when such editor has focus.

If the focused content is in contenteditable editor and editable and not input field, HasFocus() needs to check only whether the document/window is focused or not.
Attachment #443860 - Flags: review?(Olli.Pettay)
Summary: nsHTMLEditor::HasFocus() failed if HTML is editable → nsHTMLEditor::HasFocus() failed if <HTML> is editable
Attachment #443860 - Flags: review?(Olli.Pettay) → review-
Comment on attachment 443860 [details] [diff] [review]
Patch v1.0

Yeah, I think we want this.

Before landing could you check what webkit does in this case.
Comment on attachment 443860 [details] [diff] [review]
Patch v1.0

Er, I meant +, not - :)
Attachment #443860 - Flags: review- → review+
(In reply to comment #1)
> (From update of attachment 443860 [details] [diff] [review])
> Yeah, I think we want this.
> 
> Before landing could you check what webkit does in this case.

Excuse me, what did you mean? What's behavior of webkit?
I meant basically how contentEditable works in webkit when window or document
has focus (not body for example).
That's not a matter for this bug because content script cannot make readonly HTML editor, therefore, the new tests are not realistic. And our HTML editor focus handling is still odd. I'm working on that, I'll check the compatibility with chrome when I change the focus handling.
http://hg.mozilla.org/mozilla-central/rev/d02a2244462f
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: