Title: [220463] trunk
Revision
220463
Author
n_w...@apple.com
Date
2017-08-09 10:52:36 -0700 (Wed, 09 Aug 2017)

Log Message

AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
https://bugs.webkit.org/show_bug.cgi?id=175340
<rdar://problem/33782159>

Reviewed by Chris Fleizach.

Source/WebCore:

When adding a psuedo element child to a RenderBlockFlow element, there might be a chance where
the element has already been layed out but we are still holding onto its stale children. Fixed it
by notifying AX correctly when inserting/removing children during layout.

Test: accessibility/add-children-pseudo-element.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::removeFloatingObject):

LayoutTests:

* accessibility/add-children-pseudo-element-expected.txt: Added.
* accessibility/add-children-pseudo-element.html: Added.
* accessibility/resources/svg-circle.svg: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (220462 => 220463)


--- trunk/LayoutTests/ChangeLog	2017-08-09 17:46:27 UTC (rev 220462)
+++ trunk/LayoutTests/ChangeLog	2017-08-09 17:52:36 UTC (rev 220463)
@@ -1,3 +1,15 @@
+2017-08-09  Nan Wang  <n_w...@apple.com>
+
+        AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
+        https://bugs.webkit.org/show_bug.cgi?id=175340
+        <rdar://problem/33782159>
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/add-children-pseudo-element-expected.txt: Added.
+        * accessibility/add-children-pseudo-element.html: Added.
+        * accessibility/resources/svg-circle.svg: Added.
+
 2017-08-09  Ms2ger  <ms2...@igalia.com>
 
         WPE-focused test gardening.

Added: trunk/LayoutTests/accessibility/add-children-pseudo-element-expected.txt (0 => 220463)


--- trunk/LayoutTests/accessibility/add-children-pseudo-element-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/add-children-pseudo-element-expected.txt	2017-08-09 17:52:36 UTC (rev 220463)
@@ -0,0 +1,12 @@
+Language Email 
+Make sure that we are updating the render block flow element's children correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS element.childrenCount is 3
+PASS element.childrenCount is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/add-children-pseudo-element.html (0 => 220463)


--- trunk/LayoutTests/accessibility/add-children-pseudo-element.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/add-children-pseudo-element.html	2017-08-09 17:52:36 UTC (rev 220463)
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+
+<style>
+.pseudo::after {
+  content: url(resources/svg-circle.svg);
+  width: 18px;
+  height: 20px;
+  position: absolute;
+  margin-top: 6px;
+  right: 6px
+}
+
+.pseudo.hidden::after {
+    content: ' ';
+}
+</style>
+
+<body id="body">
+
+<div id="container">
+<div id="test" style="float : left;">
+<span>Language</span>
+<input id="test">
+</div>
+
+<div id="float" style="display: inline-block;" class="pseudo">
+<span required="" style="color: rgb(194, 0, 0);">Email</span>
+<input type="text" required="" aria-required="true" value="" _onkeyup_="hidePseudo();">
+</div>
+
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("Make sure that we are updating the render block flow element's children correctly.");
+
+    if (window.accessibilityController) {
+        var element = accessibilityController.accessibleElementById("float");
+        shouldBe("element.childrenCount", "3");
+        
+        eventSender.keyDown('\t');
+        eventSender.keyDown('\t');
+        
+        shouldBe("element.childrenCount", "2");
+        showPseudo();
+        
+        function hidePseudo() {
+            document.getElementById("float").className += "hidden"
+        }
+        
+        function showPseudo() {
+            document.getElementById("float").className = "pseudo";
+        }
+                
+        // Make sure getting the attributes of its children won't cause crash
+        element.attributesOfChildren();
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/accessibility/resources/svg-circle.svg (0 => 220463)


--- trunk/LayoutTests/accessibility/resources/svg-circle.svg	                        (rev 0)
+++ trunk/LayoutTests/accessibility/resources/svg-circle.svg	2017-08-09 17:52:36 UTC (rev 220463)
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+     <g>
+        <text style="float:right"></text>
+        <text>circle</text>
+    </g>
+</svg>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (220462 => 220463)


--- trunk/Source/WebCore/ChangeLog	2017-08-09 17:46:27 UTC (rev 220462)
+++ trunk/Source/WebCore/ChangeLog	2017-08-09 17:52:36 UTC (rev 220463)
@@ -1,3 +1,21 @@
+2017-08-09  Nan Wang  <n_w...@apple.com>
+
+        AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
+        https://bugs.webkit.org/show_bug.cgi?id=175340
+        <rdar://problem/33782159>
+
+        Reviewed by Chris Fleizach.
+
+        When adding a psuedo element child to a RenderBlockFlow element, there might be a chance where
+        the element has already been layed out but we are still holding onto its stale children. Fixed it
+        by notifying AX correctly when inserting/removing children during layout.
+
+        Test: accessibility/add-children-pseudo-element.html
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::insertFloatingObject):
+        (WebCore::RenderBlockFlow::removeFloatingObject):
+
 2017-08-09  Charlie Turner  <ctur...@igalia.com>
 
         [GStreamer][MSE] Add missing lock around getStreamByTrackId

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (220462 => 220463)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-08-09 17:46:27 UTC (rev 220462)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-08-09 17:52:36 UTC (rev 220463)
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "RenderBlockFlow.h"
 
+#include "AXObjectCache.h"
 #include "Editor.h"
 #include "FloatingObjects.h"
 #include "Frame.h"
@@ -2352,6 +2353,9 @@
     }
 
     setLogicalWidthForFloat(*floatingObject, logicalWidthForChild(floatBox) + marginStartForChild(floatBox) + marginEndForChild(floatBox));
+    
+    if (AXObjectCache* cache = document().existingAXObjectCache())
+        cache->childrenChanged(this);
 
     return m_floatingObjects->add(WTFMove(floatingObject));
 }
@@ -2389,6 +2393,9 @@
                 markLinesDirtyInBlockRange(0, logicalBottom);
             }
             m_floatingObjects->remove(&floatingObject);
+            
+            if (AXObjectCache* cache = document().existingAXObjectCache())
+                cache->childrenChanged(this);
         }
     }
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to