[GTK] Test /webkit/atk/getTextInParagraphAndBodyModerate fails
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Sep 2013 08:52:07 +0000 (08:52 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Sep 2013 08:52:07 +0000 (08:52 +0000)
commit817ad66428d23222155357e952caa6fa5b465416
tree264b4633659d47999662c0fb4acbf42f1bdad059
parent4e73323334425954f871dfb89e7a334ac40b729a
[GTK] Test /webkit/atk/getTextInParagraphAndBodyModerate fails
https://bugs.webkit.org/show_bug.cgi?id=105538

Reviewed by Chris Fleizach.

Source/WebCore:

Expose '\n' for linebreaks when they were explicitly set by the
author of the web content with a <br> tag.

Tests: accessibility/paragraph-with-linebreaks.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::shouldAddSpaceBeforeAppendingNextElement): Helper
function to decide when to append spaces when building the text
under an element, considering line breaks.
(WebCore::AccessibilityNodeObject::textUnderElement): Use the
shouldAddSpaceBeforeAppendingNextElement() function here.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement): Return the
renderer's text for accessibility objects exposing <br> elements.
* html/parser/HTMLParserIdioms.h:
(WebCore::isHTMLSpaceButNotLineBreak): New helper function, useful
to be passed to other functions like simplifyWhiteSpace().

Tools:

Unskip passing test getTextInParagraphAndBodyModerate.

* Scripts/run-gtk-tests:
(TestRunner): Unskip pasing test.

LayoutTests:

Added new Layout test and platform specific expectations.

* platform/efl/accessibility/paragraph-with-linebreaks-expected.txt: Added.
* platform/gtk/accessibility/paragraph-with-linebreaks-expected.txt: Added.
* accessibility/paragraph-with-linebreaks.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/paragraph-with-linebreaks.html [new file with mode: 0644]
LayoutTests/platform/efl/accessibility/paragraph-with-linebreaks-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/paragraph-with-linebreaks-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/html/parser/HTMLParserIdioms.h
Tools/ChangeLog
Tools/Scripts/run-gtk-tests