Changeset 155428 in webkit
- Timestamp:
- Sep 10, 2013, 1:52:07 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/paragraph-with-linebreaks.html (added)
-
LayoutTests/platform/efl/accessibility/paragraph-with-linebreaks-expected.txt (added)
-
LayoutTests/platform/gtk/accessibility/paragraph-with-linebreaks-expected.txt (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityNodeObject.cpp (modified) (5 diffs)
-
Source/WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (2 diffs)
-
Source/WebCore/html/parser/HTMLParserIdioms.h (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/Scripts/run-gtk-tests (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r155425 r155428 1 2013-09-10 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 [GTK] Test /webkit/atk/getTextInParagraphAndBodyModerate fails 4 https://bugs.webkit.org/show_bug.cgi?id=105538 5 6 Reviewed by Chris Fleizach. 7 8 Added new Layout test and platform specific expectations. 9 10 * platform/efl/accessibility/paragraph-with-linebreaks-expected.txt: Added. 11 * platform/gtk/accessibility/paragraph-with-linebreaks-expected.txt: Added. 12 * accessibility/paragraph-with-linebreaks.html: Added. 13 1 14 2013-09-10 Arpita Bahuguna <a.bah@samsung.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r155425 r155428 1 2013-09-10 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 [GTK] Test /webkit/atk/getTextInParagraphAndBodyModerate fails 4 https://bugs.webkit.org/show_bug.cgi?id=105538 5 6 Reviewed by Chris Fleizach. 7 8 Expose '\n' for linebreaks when they were explicitly set by the 9 author of the web content with a <br> tag. 10 11 Tests: accessibility/paragraph-with-linebreaks.html 12 13 * accessibility/AccessibilityNodeObject.cpp: 14 (WebCore::shouldAddSpaceBeforeAppendingNextElement): Helper 15 function to decide when to append spaces when building the text 16 under an element, considering line breaks. 17 (WebCore::AccessibilityNodeObject::textUnderElement): Use the 18 shouldAddSpaceBeforeAppendingNextElement() function here. 19 * accessibility/AccessibilityRenderObject.cpp: 20 (WebCore::AccessibilityRenderObject::textUnderElement): Return the 21 renderer's text for accessibility objects exposing <br> elements. 22 * html/parser/HTMLParserIdioms.h: 23 (WebCore::isHTMLSpaceButNotLineBreak): New helper function, useful 24 to be passed to other functions like simplifyWhiteSpace(). 25 1 26 2013-09-10 Arpita Bahuguna <a.bah@samsung.com> 2 27 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r155191 r155428 55 55 #include "HTMLOptionElement.h" 56 56 #include "HTMLOptionsCollection.h" 57 #include "HTMLParserIdioms.h" 57 58 #include "HTMLPlugInImageElement.h" 58 59 #include "HTMLSelectElement.h" … … 1543 1544 } 1544 1545 1546 static bool shouldAddSpaceBeforeAppendingNextElement(StringBuilder& builder, String& childText) 1547 { 1548 if (!builder.length() || !childText.length()) 1549 return false; 1550 1551 // We don't need to add an additional space before or after a line break. 1552 return !(isHTMLLineBreak(childText[0]) || isHTMLLineBreak(builder[builder.length() - 1])); 1553 } 1554 1545 1555 String AccessibilityNodeObject::textUnderElement(AccessibilityTextUnderElementMode mode) const 1546 1556 { … … 1558 1568 toAccessibilityNodeObject(child)->alternativeText(textOrder); 1559 1569 if (textOrder.size() > 0 && textOrder[0].text.length()) { 1560 if ( builder.length())1570 if (shouldAddSpaceBeforeAppendingNextElement(builder, textOrder[0].text)) 1561 1571 builder.append(' '); 1562 1572 builder.append(textOrder[0].text); … … 1567 1577 String childText = child->textUnderElement(mode); 1568 1578 if (childText.length()) { 1569 if ( builder.length())1579 if (shouldAddSpaceBeforeAppendingNextElement(builder, childText)) 1570 1580 builder.append(' '); 1571 1581 builder.append(childText); … … 1573 1583 } 1574 1584 1575 return builder.toString().stripWhiteSpace().simplifyWhiteSpace( );1585 return builder.toString().stripWhiteSpace().simplifyWhiteSpace(isHTMLSpaceButNotLineBreak); 1576 1586 } 1577 1587 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r155374 r155428 66 66 #include "Page.h" 67 67 #include "ProgressTracker.h" 68 #include "RenderBR.h" 68 69 #include "RenderButton.h" 69 70 #include "RenderFieldset.h" … … 631 632 return toRenderFileUploadControl(m_renderer)->buttonValue(); 632 633 634 // Reflect when a content author has explicitly marked a line break. 635 if (m_renderer->isBR()) 636 return toRenderBR(*m_renderer).text(); 637 633 638 #if ENABLE(MATHML) 634 639 // Math operators create RenderText nodes on the fly that are not tied into the DOM in a reasonable way, -
trunk/Source/WebCore/html/parser/HTMLParserIdioms.h
r153733 r155428 39 39 bool isHTMLLineBreak(UChar); 40 40 bool isNotHTMLSpace(UChar); 41 bool isHTMLSpaceButNotLineBreak(UChar character); 41 42 42 43 // Strip leading and trailing whitespace as defined by the HTML specification. … … 93 94 } 94 95 96 inline bool isHTMLSpaceButNotLineBreak(UChar character) 97 { 98 return isHTMLSpace(character) && !isHTMLLineBreak(character); 99 } 100 95 101 bool threadSafeMatch(const QualifiedName&, const QualifiedName&); 96 102 #if ENABLE(THREADED_HTML_PARSER) -
trunk/Tools/ChangeLog
r155423 r155428 1 2013-09-10 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 [GTK] Test /webkit/atk/getTextInParagraphAndBodyModerate fails 4 https://bugs.webkit.org/show_bug.cgi?id=105538 5 6 Reviewed by Chris Fleizach. 7 8 Unskip passing test getTextInParagraphAndBodyModerate. 9 10 * Scripts/run-gtk-tests: 11 (TestRunner): Unskip pasing test. 12 1 13 2013-09-09 Mark Lam <mark.lam@apple.com> 2 14 -
trunk/Tools/Scripts/run-gtk-tests
r155038 r155428 67 67 SkippedTest("unittests/testwebresource", "/webkit/webresource/sub_resource_loading", "Test fails in GTK Linux 64-bit Release bot", 82330), 68 68 SkippedTest("unittests/testwebview", "/webkit/webview/icon-uri", "Test times out in GTK Linux 64-bit Release bot", 82328), 69 SkippedTest("unittests/testatk", "/webkit/atk/getTextInParagraphAndBodyModerate", "Test fails", 105538),70 69 SkippedTest("WebKit2APITests/TestResources", "/webkit2/WebKitWebView/resources", "Test is flaky in GTK Linux 32-bit Release bot", 82868), 71 70 SkippedTest("WebKit2APITests/TestWebKitWebView", SkippedTest.ENTIRE_SUITE, "Test times out after r150890", 117689),
Note:
See TracChangeset
for help on using the changeset viewer.