forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/WebKit/WebKit
- Loading branch information
Showing
53 changed files
with
463 additions
and
269 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
LayoutTests/accessibility/dirty-style-and-relations-crash-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This test passes ensures we don't crash after performing accessibility tree updates with dirty style and object relations. | ||
|
||
PASS: No crash. | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
69 changes: 69 additions & 0 deletions
69
LayoutTests/accessibility/dirty-style-and-relations-crash.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<main aria-label="content here"> | ||
<div> | ||
<div id="container" role="group" aria-label="container"> | ||
<button id="button">Foo</button> | ||
</div> | ||
|
||
<div id="container-2" role="group" aria-label="container2" aria-owns="button"> | ||
</div> | ||
|
||
<div id="container-3" role="group" aria-labelledby="text" aria-owns="abc"> | ||
</div> | ||
<div> | ||
</main> | ||
|
||
<div id="a"></div> | ||
<div id="b"></div> | ||
<div id="c"></div> | ||
<div id="d"></div> | ||
<div id="e"></div> | ||
|
||
<div role="group" id="text">hello world</div> | ||
|
||
<script> | ||
var output = "This test passes ensures we don't crash after performing accessibility tree updates with dirty style and object relations.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
touchAccessibilityTree(accessibilityController.rootElement); | ||
setTimeout(async function() { | ||
// Wait out any tree updates that result from the initial page load that didn't already happen during the | ||
// touchAccessibilityTree call above. | ||
await sleep(100); | ||
|
||
// Changing the id attribute unconditionally dirties relations, so do that to setup for the crash. | ||
document.getElementById("button").setAttribute("id", "abc"); | ||
// Dirty the style of #text and #abc, which are involved in relations — this is necesssary to trigger the crash. | ||
// The goal is to get `Element::computedStyle()` to call `resolveComputedStyle()` at an invalid time. | ||
document.getElementById("text").style.fontSize = "16px"; | ||
document.getElementById("c").setAttribute("id", "c1"); | ||
document.getElementById("text").style.display = "none" | ||
document.getElementById("abc").style.fontSize = "16px"; | ||
document.getElementById("abc").style.display = "block"; | ||
// Now that style and relations are dirty, perform a DOM mutation, which should cause AXIsolatedTree::removeNode | ||
// to run and try to un-dirty relations as a result of a parentObject() call. This will then cause isIgnored() | ||
// to run, which depends on style. If we resolve style eagerly at this point, we will RELEASE_ASSERT in RenderTreeBuilder | ||
// because a render tree update is already happening higher up in the stack. | ||
document.getElementById("container").removeChild(document.getElementById("abc")); | ||
document.getElementById("d").setAttribute("id", "d1"); | ||
document.getElementById("e").setAttribute("id", "e1"); | ||
|
||
touchAccessibilityTree(accessibilityController.rootElement); | ||
|
||
output += "PASS: No crash." | ||
debug(output); | ||
finishJSTest(); | ||
}, 0); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
LayoutTests/media/media-source/media-source-reopen-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
RUN(video.src = URL.createObjectURL(source)) | ||
EVENT(sourceopen) | ||
RUN(audiosb = source.addSourceBuffer("audio/mp4; codecs=mp4a.40.2")) | ||
RUN(videosb = source.addSourceBuffer("video/mp4; codecs=avc1.4d401e")) | ||
RUN(audiosb.appendWindowEnd = 0.4) | ||
RUN(videosb.appendWindowEnd = 0.5) | ||
EXPECTED (video.buffered.end(video.buffered.length-1) == Math.min(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1)) == 'true') OK | ||
RUN(source.endOfStream()) | ||
EXPECTED (source.readyState == 'ended') OK | ||
EXPECTED (video.buffered.end(video.buffered.length-1) == Math.max(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1)) == 'true') OK | ||
EXPECTED (video.duration == Math.max(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1)) == 'true') OK | ||
EVENT(sourceended) | ||
EXPECTED (source.readyState == 'open') OK | ||
EXPECTED (video.buffered.end(video.buffered.length-1) == Math.min(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1)) == 'true') OK | ||
EVENT(update) | ||
RUN(source.endOfStream()) | ||
EVENT(ended) | ||
END OF TEST | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>media-source-reopen</title> | ||
<script src="../video-test.js"></script> | ||
<script> | ||
var loader; | ||
var source; | ||
var audiosb; | ||
var videosb; | ||
var audiodata; | ||
var videodata; | ||
|
||
async function startTest() | ||
{ | ||
findMediaElement(); | ||
video.disableRemotePlayback = true; | ||
video.muted = true; | ||
|
||
const MediaSource = self.ManagedMediaSource || self.MediaSource; | ||
|
||
source = new MediaSource(); | ||
run('video.src = URL.createObjectURL(source)'); | ||
await waitFor(source, 'sourceopen'); | ||
waitFor(video, 'error').then(failTest); | ||
|
||
run('audiosb = source.addSourceBuffer("audio/mp4; codecs=mp4a.40.2")'); | ||
run('videosb = source.addSourceBuffer("video/mp4; codecs=avc1.4d401e")'); | ||
|
||
let audioResponse = await fetch('content/test-48kHz.m4a'); | ||
let audiodata = await audioResponse.arrayBuffer(); | ||
let videoResponse = await fetch('content/test-fragmented-video.mp4'); | ||
let videodata = await videoResponse.arrayBuffer(); | ||
|
||
run('audiosb.appendWindowEnd = 0.4'); | ||
run('videosb.appendWindowEnd = 0.5'); | ||
|
||
audiosb.appendBuffer(audiodata); | ||
videosb.appendBuffer(videodata); | ||
await Promise.all([waitFor(audiosb, 'update', true), waitFor(videosb, 'update', true)]); | ||
|
||
testExpected('video.buffered.end(video.buffered.length-1) == Math.min(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1))', true); | ||
run('source.endOfStream()'); | ||
testExpected('source.readyState', "ended"); | ||
testExpected('video.buffered.end(video.buffered.length-1) == Math.max(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1))', true); | ||
testExpected('video.duration == Math.max(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1))', true); | ||
await waitFor(source, 'sourceended'); | ||
|
||
audiosb.appendBuffer(audiodata); | ||
testExpected('source.readyState', "open"); | ||
testExpected('video.buffered.end(video.buffered.length-1) == Math.min(audiosb.buffered.end(audiosb.buffered.length-1), videosb.buffered.end(videosb.buffered.length-1))', true); | ||
await waitFor(audiosb, 'update'); | ||
run('source.endOfStream()'); | ||
|
||
await video.play(); | ||
waitForEventAndEnd('ended'); | ||
} | ||
</script> | ||
</head> | ||
<body onload="startTest()"> | ||
<video controls></video> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.