[Webkit-unassigned] [Bug 90611] New: contenteditable justify commands applied to next paragraph as well

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 5 07:50:05 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=90611

           Summary: contenteditable justify commands applied to next
                    paragraph as well
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: sjmulder at gmail.com


Created an attachment (id=150937)
 --> (https://bugs.webkit.org/attachment.cgi?id=150937&action=review)
Sample case

When executing the justifyLeft, justifyRight or justifyFull command when a paragraph is selected in a contenteidtable element, the justification is applied to the paragraph after the selected paragraph as well.

Steps to reproduce:

1. Create a contenteditable element.
2. Have three paragraphs as its contents: <p>Paragraph one</p><p>Paragraph two</p><p>Paragraph three</p>
3. Select the first paragraph by triple-clicking on it or by dragging down from the start of the paragraph to the start of the next paragraph.
4. Call document.execCommand('justfiyRight', false, null)

Expected results:

* The first paragraph is justified to the right.

Actual results:

* The first and second paragraphs are both justified to the right, even though the second was not selected.

Note that if the paragraph is only selected up to and including the final character, and not the newline, the justification works correctly.

I’ve done some digging and this is what I’ve found: when a paragraph is selected in its entirely, the selection range (window.getSelection().range) extends until position 0 of the next paragraph. Perhaps that’s why the justification is applied to that paragraph as well, however, it’s not the user intention.

Find attached a sample page that demonstrates the issue.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list