2011-01-13 Emil Eklund <eae@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 22:49:44 +0000 (22:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 22:49:44 +0000 (22:49 +0000)
commit53f64344aca213ff6600fb7005164b5a4bd53599
treea3dbae7d16e1f26cce751605d49c622b1d8e82b6
parentcfdd612db94ae5dae6098e672a51416a4521026f
2011-01-13  Emil Eklund  <eae@chromium.org>

        Reviewed by Dimitri Glazkov.

        Setting outerText should convert CR/LF to <br>
        https://bugs.webkit.org/show_bug.cgi?id=52268

        Add test for setting Element.outerText.

        * fast/dom/set-outer-text-expected.txt: Added.
        * fast/dom/set-outer-text.html: Added.
        * fast/dom/text-node-append-data-remove-crash-expected.txt: Changed
            expectation to "didn't crash" from "threw dom exception" as test
            assumed the DOMCharacterDataModified event would fire before the node
            would be replaced.
        * fast/dom/text-node-append-data-remove-crash.html:
2011-01-13  Emil Eklund  <eae@chromium.org>

        Reviewed by Dimitri Glazkov.

        Setting outerText should convert CR/LF to <br>
        https://bugs.webkit.org/show_bug.cgi?id=52268

        Make set outerText support line breaks (sharing the text to fragment code
        with setInnerText) and handle empty text nodes the same way IE does.

        Test: fast/dom/set-outer-text.html

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::textToFragment): Shared between setInnerText and setOuterText
        (WebCore::HTMLElement::setInnerText): Split out text parsing code.
        (WebCore::mergeWithNextTextNode): Split out text node merging code.
        (WebCore::HTMLElement::setOuterText): Added support for line breaks.
        * html/HTMLElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/set-outer-text-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/set-outer-text.html [new file with mode: 0644]
LayoutTests/fast/dom/text-node-append-data-remove-crash-expected.txt
LayoutTests/fast/dom/text-node-append-data-remove-crash.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h