Closed Bug 482481 Opened 15 years ago Closed 15 years ago

Commands doesn't work on contained contentEditable elements

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1
Tracking Status
status1.9.1 --- ?

People

(Reporter: spam, Assigned: arno)

References

()

Details

(Keywords: testcase, Whiteboard: [needs response to comment 12 for 1.9.1 branch])

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2a1pre) Gecko/20090310 Minefield/3.2a1pre

execCommands like bold doesn't work correctly if a contentEditable element is contained within a wrapper element.

Reproducible: Always

Steps to Reproduce:
1. Open attached file or URL.
2. Select all contents using Ctrl+A.
3. Click the Bold link.
4. Notice that the bold doesn't apply.
Actual Results:  
The bold command doesn't do anything.

Expected Results:  
Should have wrapped the text in a strong or b element.
Flags: blocking1.9.2?
Keywords: testcase
If I understand correctly, problem happens because editor select  "any ancestors who's children are entirely selected" before applying a command. Then, outer div is selected, and as it's not editable, command does not apply.
Assignee: nobody → arno
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #366796 - Flags: review?(peterv)
I'm not sure that the container selection is the problem. I'm attaching a second test case could you verify that this scenario is resolved by the patch as well. It selects the text node contents of the paragraph.
Attached file Additional test case.
Additional test case selecting the text node contents and not the entire paragraph.
second testcase fails without patch and is successful with patch applied.
Comment on attachment 366796 [details] [diff] [review]
patch v1
[Checkin: Comment 11]

Please add the testcases to the testsuite.
Attachment #366796 - Flags: superreview+
Attachment #366796 - Flags: review?(peterv)
Attachment #366796 - Flags: review+
Keywords: checkin-needed
Should this patch be checked in without the tests, or do you want to make a new patch with tests?
I should probably add some tests.
Keywords: checkin-needed
I'd rather have the patch without tests than no patch at all.
Keywords: checkin-needed
Flags: blocking1.9.2? → wanted1.9.2+
Comment on attachment 366796 [details] [diff] [review]
patch v1
[Checkin: Comment 11]


http://hg.mozilla.org/mozilla-central/rev/0fe2dc64d480
Attachment #366796 - Attachment description: patch v1 → patch v1 [Checkin: Comment 11]
Attachment #366796 - Flags: approval1.9.1.3?
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
status1.9.1: --- → ?
Flags: in-testsuite?
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Comment on attachment 366796 [details] [diff] [review]
patch v1
[Checkin: Comment 11]

Can we get one of these testcases incorporated into our automated test-runs as part of the patch?
Attachment #366796 - Flags: approval1.9.1.3? → approval1.9.1.4?
Whiteboard: [needs response to comment 12 for 1.9.1 branch]
Attachment #366796 - Flags: approval1.9.1.4?
Comment on attachment 366796 [details] [diff] [review]
patch v1
[Checkin: Comment 11]

Please re-request approval after answering comment 12.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: