Source/WebCore: AX: fieldset should have GroupRole and legend should be description.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Oct 2013 00:38:10 +0000 (00:38 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Oct 2013 00:38:10 +0000 (00:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122534

Patch by Samuel White <samuel_white@apple.com> on 2013-10-14
Reviewed by Chris Fleizach.

Changes fieldset to derive AXDescription from legend if one is available. Added
convenience method to AccessibilityObject to fetch element if available.

Test: accessibility/fieldset-element.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canHaveChildren):
(WebCore::AccessibilityNodeObject::alternativeText):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::element):
(WebCore::AccessibilityObject::isARIAHidden):
(WebCore::AccessibilityObject::isDOMHidden):
(WebCore::AccessibilityObject::defaultObjectInclusion):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isHidden):
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::getAttribute):
(WebCore::AccessibilitySlider::valueForRange):
(WebCore::AccessibilitySlider::maxValueForRange):
(WebCore::AccessibilitySlider::minValueForRange):
(WebCore::AccessibilitySlider::setValue):
(WebCore::AccessibilitySlider::inputElement):
* accessibility/AccessibilitySlider.h:
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::legend):
* html/HTMLFieldSetElement.h:

LayoutTests: Crash in WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>::createBidiRunsForLine
https://bugs.webkit.org/show_bug.cgi?id=122776

Reviewed by Darin Adler.

* fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash-expected.txt: Added.
* fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157436 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp

index 41a1834..3b90c4f 100644 (file)
@@ -1,3 +1,13 @@
+2013-10-14  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Crash in WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>::createBidiRunsForLine
+        https://bugs.webkit.org/show_bug.cgi?id=122776
+
+        Reviewed by Darin Adler.
+
+        * fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash-expected.txt: Added.
+        * fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash.html: Added.
+
 2013-10-14  Samuel White  <samuel_white@apple.com>
 
         AX: fieldset should have GroupRole and legend should be description.
diff --git a/LayoutTests/fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash-expected.txt b/LayoutTests/fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash-expected.txt
new file mode 100644 (file)
index 0000000..2f695e8
--- /dev/null
@@ -0,0 +1 @@
+Test passes if there is no crash.
diff --git a/LayoutTests/fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash.html b/LayoutTests/fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash.html
new file mode 100644 (file)
index 0000000..8bc0416
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<body dir='rtl'>
+<div style='-webkit-rtl-ordering: visual;'><li><span style="margin: 2000;"> Test passes if there is no crash.
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</body>
+</html>
index bf90282..1d42616 100644 (file)
 
 2013-10-14  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Crash in WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>::createBidiRunsForLine
+        https://bugs.webkit.org/show_bug.cgi?id=122776
+
+        Reviewed by Darin Adler.
+
+        Merge https://chromium.googlesource.com/chromium/blink/+/aca89bc4d984705a1f94b623dae0ab03e239a248
+
+        Fix modification of whitespace endpoints to not assume it's operating on RenderTexts
+
+        During line layout, we use midpoints to identify RenderObjects, or parts of
+        RenderObjects, that don't need InlineBoxes, usually because of collapsed whitespace.
+
+        Prior to actually creating BidiRuns (the precursor to InlineBoxes), we use
+        checkMidpoints to fix up our lineMidpointState to handle the case where we start
+        ignoring spaces in our line, but don't stop until somewhere on the following line.
+        Previously, this function assumed that the final midpoint (called an endpoint)
+        was a RenderText, but this assumption is wrong if we have a beginning midpoint
+        created by shouldSkipWhitespaceAfterStartObject (which handles inlines and list
+        markers) and no endpoint on that line. In that case, we'd instead adjust the
+        position backwards on the beginning midpoint, which would cause us to fail to
+        create an InlineBox for the inline or list marker. In the new test added, this
+        would actually trigger a crash due to an assumption when visually re-ordering
+        BidiRuns that a non-empty line would actually contain at least one such run.
+
+        Test: fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::checkMidpoints):
+
+2013-10-14  Ryosuke Niwa  <rniwa@webkit.org>
+
         Assertion failure in Range::processContentsBetweenOffsets
         https://bugs.webkit.org/show_bug.cgi?id=122777
 
index 611ccf6..7bcc5e4 100644 (file)
@@ -207,7 +207,7 @@ static void checkMidpoints(LineMidpointState& lineMidpointState, InlineIterator&
         if (currpoint == lBreak) {
             // We hit the line break before the start point.  Shave off the start point.
             lineMidpointState.numMidpoints--;
-            if (endpoint.m_obj->style()->collapseWhiteSpace())
+            if (endpoint.m_obj->style()->collapseWhiteSpace() && endpoint.m_obj->isText())
                 endpoint.m_pos--;
         }
     }