Title: [258346] trunk
Revision
258346
Author
[email protected]
Date
2020-03-12 11:43:02 -0700 (Thu, 12 Mar 2020)

Log Message

AX: Isolated tree: Crash in URL retrieval
https://bugs.webkit.org/show_bug.cgi?id=208942
<rdar://problem/60337588>

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/url-test.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::url const): Check for m_renderer
before dereferencing and re-use the associated Node. Also fixes the last
type check and downcast that were using different types.

LayoutTests:

Moved the url-test.html test to the root directory so that it is
executed in both Mac and iOS.

* accessibility/url-test-expected.txt: Renamed from LayoutTests/accessibility/ios-simulator/url-test-expected.txt.
* accessibility/url-test.html: Renamed from LayoutTests/accessibility/ios-simulator/url-test.html.
* platform/ios-simulator/TestExpectations:
* platform/win/TestExpectations:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (258345 => 258346)


--- trunk/LayoutTests/ChangeLog	2020-03-12 18:34:35 UTC (rev 258345)
+++ trunk/LayoutTests/ChangeLog	2020-03-12 18:43:02 UTC (rev 258346)
@@ -1,3 +1,19 @@
+2020-03-12  Andres Gonzalez  <[email protected]>
+
+        AX: Isolated tree: Crash in URL retrieval
+        https://bugs.webkit.org/show_bug.cgi?id=208942
+        <rdar://problem/60337588>
+
+        Reviewed by Chris Fleizach.
+
+        Moved the url-test.html test to the root directory so that it is
+        executed in both Mac and iOS.
+
+        * accessibility/url-test-expected.txt: Renamed from LayoutTests/accessibility/ios-simulator/url-test-expected.txt.
+        * accessibility/url-test.html: Renamed from LayoutTests/accessibility/ios-simulator/url-test.html.
+        * platform/ios-simulator/TestExpectations:
+        * platform/win/TestExpectations:
+
 2020-03-12  Simon Fraser  <[email protected]>
 
         REGRESSION (r257938): Some pointerevents/ios/touch-action-region tests started to fail

Deleted: trunk/LayoutTests/accessibility/ios-simulator/url-test-expected.txt (258345 => 258346)


--- trunk/LayoutTests/accessibility/ios-simulator/url-test-expected.txt	2020-03-12 18:34:35 UTC (rev 258345)
+++ trunk/LayoutTests/accessibility/ios-simulator/url-test-expected.txt	2020-03-12 18:43:02 UTC (rev 258346)
@@ -1,15 +0,0 @@
-
-test
-
-This test ensures that we can retrieve URLs for appropriate elements.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS element.url.indexOf('url-test1.html') != -1 is true
-PASS element.url.indexOf('url-test2.html') != -1 is true
-PASS element.url.indexOf('url-test3.png') != -1 is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/accessibility/ios-simulator/url-test.html (258345 => 258346)


--- trunk/LayoutTests/accessibility/ios-simulator/url-test.html	2020-03-12 18:34:35 UTC (rev 258345)
+++ trunk/LayoutTests/accessibility/ios-simulator/url-test.html	2020-03-12 18:43:02 UTC (rev 258346)
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script>
-var successfullyParsed = false;
-</script>
-<script src=""
-</head>
-<body id="body">
-
-<input id="element1" type="image" src=""
-<a id="element2" href=""
-<img id="element3" src="" width=100 height=100 alt="test"><BR>
-
-
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-
-    description("This test ensures that we can retrieve URLs for appropriate elements.");
-
-    if (window.accessibilityController) {
-
-        var element = accessibilityController.accessibleElementById("element1");
-        shouldBe("element.url.indexOf('url-test1.html') != -1", "true");
-
-        element = accessibilityController.accessibleElementById("element2");
-        shouldBe("element.url.indexOf('url-test2.html') != -1", "true");
-
-        element = accessibilityController.accessibleElementById("element3");
-        shouldBe("element.url.indexOf('url-test3.png') != -1", "true");
-    }
-
-    successfullyParsed = true;
-</script>
-
-<script src=""
-</body>
-</html>
-

Copied: trunk/LayoutTests/accessibility/url-test-expected.txt (from rev 258345, trunk/LayoutTests/accessibility/ios-simulator/url-test-expected.txt) (0 => 258346)


--- trunk/LayoutTests/accessibility/url-test-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/url-test-expected.txt	2020-03-12 18:43:02 UTC (rev 258346)
@@ -0,0 +1,15 @@
+
+test
+
+This test ensures that we can retrieve URLs for appropriate elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS element.url.indexOf('url-test1.html') != -1 is true
+PASS element.url.indexOf('url-test2.html') != -1 is true
+PASS element.url.indexOf('url-test3.png') != -1 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/accessibility/url-test.html (from rev 258345, trunk/LayoutTests/accessibility/ios-simulator/url-test.html) (0 => 258346)


--- trunk/LayoutTests/accessibility/url-test.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/url-test.html	2020-03-12 18:43:02 UTC (rev 258346)
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<input id="element1" type="image" src=""
+<a id="element2" href=""
+<img id="element3" src="" width=100 height=100 alt="test"><BR>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This test ensures that we can retrieve URLs for appropriate elements.");
+
+    if (window.accessibilityController) {
+        var element = accessibilityController.accessibleElementById("element1");
+        shouldBe("element.url.indexOf('url-test1.html') != -1", "true");
+
+        element = accessibilityController.accessibleElementById("element2");
+        shouldBe("element.url.indexOf('url-test2.html') != -1", "true");
+
+        element = accessibilityController.accessibleElementById("element3");
+        shouldBe("element.url.indexOf('url-test3.png') != -1", "true");
+    }
+</script>
+<script src=""
+</body>
+</html>
+

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (258345 => 258346)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2020-03-12 18:34:35 UTC (rev 258345)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2020-03-12 18:43:02 UTC (rev 258346)
@@ -5,6 +5,7 @@
 
 accessibility/insert-newline.html [ Pass ]
 accessibility/misspelling-range.html [ Pass ]
+accessibility/url-test.html [ Pass ]
 css3/font-variant-small-caps-synthesis-coverage.html [ ImageOnlyFailure ]
 fast/frames/sandboxed-iframe-close-top-noclose.html [ Failure ]
 fast/multicol/flexbox-rows.html [ Skip ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (258345 => 258346)


--- trunk/LayoutTests/platform/win/TestExpectations	2020-03-12 18:34:35 UTC (rev 258345)
+++ trunk/LayoutTests/platform/win/TestExpectations	2020-03-12 18:43:02 UTC (rev 258346)
@@ -1595,6 +1595,7 @@
 [ Debug ] accessibility/hang-in-isignored.html [ Skip ] # Crash (Debug Assertion)
 [ Debug ] accessibility/heading-title-includes-links.html [ Skip ]
 webkit.org/b/140867 [ Debug ] accessibility/spinbutton-value.html [ Skip ]
+accessibility/url-test.html [ Skip ]
 
 # Missing support for scrollTo* methods.
 accessibility/scroll-to-global-point-iframe-nested.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (258345 => 258346)


--- trunk/Source/WebCore/ChangeLog	2020-03-12 18:34:35 UTC (rev 258345)
+++ trunk/Source/WebCore/ChangeLog	2020-03-12 18:43:02 UTC (rev 258346)
@@ -1,3 +1,18 @@
+2020-03-12  Andres Gonzalez  <[email protected]>
+
+        AX: Isolated tree: Crash in URL retrieval
+        https://bugs.webkit.org/show_bug.cgi?id=208942
+        <rdar://problem/60337588>
+
+        Reviewed by Chris Fleizach.
+
+        Test: accessibility/url-test.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::url const): Check for m_renderer
+        before dereferencing and re-use the associated Node. Also fixes the last
+        type check and downcast that were using different types.
+
 2020-03-12  Alex Christensen  <[email protected]>
 
         WKWebView.hasOnlySecureContent should be correct after back/forward navigations

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (258345 => 258346)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2020-03-12 18:34:35 UTC (rev 258345)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2020-03-12 18:43:02 UTC (rev 258346)
@@ -1641,20 +1641,21 @@
 
 URL AccessibilityRenderObject::url() const
 {
-    if (isLink() && is<HTMLAnchorElement>(*m_renderer->node())) {
+    auto* node = this->node();
+    if (isLink() && is<HTMLAnchorElement>(node)) {
         if (HTMLAnchorElement* anchor = downcast<HTMLAnchorElement>(anchorElement()))
             return anchor->href();
     }
-    
-    if (isWebArea())
+
+    if (m_renderer && isWebArea())
         return m_renderer->document().url();
-    
-    if (isImage() && is<HTMLImageElement>(m_renderer->node()))
-        return downcast<HTMLImageElement>(*m_renderer->node()).src();
-    
-    if (isInputImage())
-        return downcast<HTMLInputElement>(*m_renderer->node()).src();
-    
+
+    if (isImage() && is<HTMLImageElement>(node))
+        return downcast<HTMLImageElement>(node)->src();
+
+    if (isInputImage() && is<HTMLInputElement>(node))
+        return downcast<HTMLInputElement>(node)->src();
+
     return URL();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to