Changeset 156764 in webkit


Ignore:
Timestamp:
Oct 1, 2013 10:11:44 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

contenteditable justify commands applied to next paragraph as well
https://bugs.webkit.org/show_bug.cgi?id=90611

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-10-01
Reviewed by Ryosuke Niwa.

Source/WebCore:

When the selection extends from first paragraph to start of next
paragraph then Justify command is applied to both the paragraph,
Instead it should be applied only to first paragraph.

Co-author: Sudarshan C P <sudarshan.cp@samsung.com>

Test: editing/execCommand/contenteditable-justify-next-paragraph.html

  • editing/ApplyStyleCommand.cpp:

(WebCore::ApplyStyleCommand::applyBlockStyle):
Adjusted visibleEnd to previous position.

LayoutTests:

Added a test for selecting one paragraph and the beginning of another
paragraph to ensure that only the first fully-selected paragraph should
be justified when justifying the selection.

  • editing/execCommand/align-in-span-expected.txt: Updated.
  • editing/execCommand/contenteditable-justify-next-paragraph-expected.txt: Added.
  • editing/execCommand/contenteditable-justify-next-paragraph.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156763 r156764  
     12013-10-01  Santosh Mahto  <santosh.ma@samsung.com>
     2
     3        contenteditable justify commands applied to next paragraph as well
     4        https://bugs.webkit.org/show_bug.cgi?id=90611
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added a test for selecting one paragraph and the beginning of another
     9        paragraph to ensure that only the first fully-selected paragraph should
     10        be justified when justifying the selection.
     11
     12        * editing/execCommand/align-in-span-expected.txt: Updated.
     13        * editing/execCommand/contenteditable-justify-next-paragraph-expected.txt: Added.
     14        * editing/execCommand/contenteditable-justify-next-paragraph.html: Added.
     15
    1162013-10-01  Alexey Proskuryakov  <ap@apple.com>
    217
  • trunk/LayoutTests/editing/execCommand/align-in-span-expected.txt

    r50433 r156764  
    22Select all text in this line and use justify command.
    33Line 3.
    4 
  • trunk/Source/WebCore/ChangeLog

    r156761 r156764  
     12013-10-01  Santosh Mahto  <santosh.ma@samsung.com>
     2
     3        contenteditable justify commands applied to next paragraph as well
     4        https://bugs.webkit.org/show_bug.cgi?id=90611
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        When the selection extends from first paragraph to start of next
     9        paragraph then Justify command is applied to both the paragraph,
     10        Instead it should be applied only to first paragraph.
     11
     12        Co-author: Sudarshan C P <sudarshan.cp@samsung.com>
     13
     14        Test: editing/execCommand/contenteditable-justify-next-paragraph.html
     15
     16        * editing/ApplyStyleCommand.cpp:
     17        (WebCore::ApplyStyleCommand::applyBlockStyle):
     18        Adjusted visibleEnd to previous position.
     19
    1202013-10-01  Andreas Kling  <akling@apple.com>
    221
  • trunk/Source/WebCore/editing/ApplyStyleCommand.cpp

    r156705 r156764  
    272272    VisiblePosition paragraphStart(startOfParagraph(visibleStart));
    273273    VisiblePosition nextParagraphStart(endOfParagraph(paragraphStart).next());
     274    if (visibleEnd != visibleStart && isStartOfParagraph(visibleEnd))
     275        visibleEnd = visibleEnd.previous(CannotCrossEditingBoundary);
    274276    VisiblePosition beyondEnd(endOfParagraph(visibleEnd).next());
    275277    while (paragraphStart.isNotNull() && paragraphStart != beyondEnd) {
Note: See TracChangeset for help on using the changeset viewer.