haikuwebkit/LayoutTests/fast/events/event-input-contentEditable...

29 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

This tests that the input events are dispatched when contentEditable nodes are edited
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS event.target.id is 'target0'
PASS event.target.innerHTML is 'Text'
PASS event.target.id is 'target2'
PASS event.target.innerHTML is 'This text should not be changed.'
PASS event.target.id is 'target3'
PASS event.target.innerHTML is '<br>'
PASS event.target.id is 'target4'
PASS event.target.innerHTML is '<a href="http://www.example.com/">This text should be a link.</a>'
PASS event.target.id is 'target6parent'
2010-09-30 Ryosuke Niwa <rniwa@webkit.org> Reviewed by Tony Chang. WebKit nests font element when applying different font styles https://bugs.webkit.org/show_bug.cgi?id=45568 The bug was caused by fixRangeAndApplyInlineStyle's not including fully selected ancestors, and addInlineStyleIfNeeded's always surrounding the contents by new elements as supposed to adding font attributes or style attribute. Fixed the bug by extending the node range in fixRangeAndApplyInlineStyle and finding the appropriate container node to add attributes in addInlineStyleIfNeeded. addInlineStyleIfNeeded now tires to add font and style attributes to the inner most font and span elements respectively. Also added an early exit check to removeStyleFromRunBeforeApplyingStyle so that WebKit does not modify the contents when the entire contents already have the desired style. Test: editing/style/inline-style-container.html * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): 2010-09-30 Ryosuke Niwa <rniwa@webkit.org> Reviewed by Tony Chang. WebKit nests font element when applying different font styles https://bugs.webkit.org/show_bug.cgi?id=45568 Added a test to ensure WebKit does not add extra font elements when the content already has an enclosing font element. The test also ensures WebKit tries to add style attribute to the inner most span. * editing/execCommand/createLink-expected.txt: The ordering of anchor and span changed. * editing/execCommand/unlink-expected.txt: Ditto. * editing/execCommand/query-font-size-expected.txt: Merged font elements. * editing/execCommand/script-tests/toggle-style-2.js: The ordering of s and u elements changed. * editing/execCommand/toggle-style-2-expected.txt: Ditto. * editing/style/inline-style-container-expected.txt: Added. * editing/style/inline-style-container.html: Added. * editing/style/make-text-writing-direction-inline-expected.txt: Removed some extraneous spans added by the bug 44359. * editing/style/script-tests/inline-style-container.js: Added. (testSingleToggle): * editing/style/style-3690704-fix-expected.txt: Merged two b elements. * fast/events/event-input-contentEditable-expected.txt: Merged anchor elements. * fast/events/script-tests/event-input-contentEditable-expected.txt: Ditto. Canonical link: https://commits.webkit.org/59462@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@68830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-30 21:37:17 +00:00
PASS event.target.innerHTML is '<a href="http://www.example.com/"><span id="target6start">Start,</span><span id="target6middle">Middle,</span><span id="target6end">End.</span></a>'
PASS event.target.id is 'target7'
PASS event.target.innerHTML is 'X'
PASS event.target.id is 'target8'
PASS event.target.innerHTML is '<br>'
PASS event.target.id is 'target9parent'
PASS event.target.innerHTML is '<div id="target9child" contenteditable="">Replacing</div>'
PASS event.target.id is 't10gch'
PASS event.target.innerHTML is 'Replacing'
PASS expectedInputEventCount is actualInputEventCount
PASS successfullyParsed is true
TEST COMPLETE