When importing the SVG wpt tests r250276, many tests were timing out. It turned out the reason is because of the completion_callback in LayoutTests/resources/testharnessreport.js. This function assumes the test has to be an HTML page. So it creates a "pre" element and adds it to the document.body element. If the test is an SVG document, a foreignObject has to be created and appended to the root element. Then the "pre" element has to be appended to this foreignObject.
Created attachment 382120 [details] Patch
Comment on attachment 382120 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382120&action=review Looks good to me overall but am not a reviewer at the moment. > LayoutTests/resources/testharnessreport.js:114 > + root.appendChild(foreignObject); How does the <svg> root look like? Is width and height 100% of the viewport? Just want to make sure results are visible in the browser.
Created attachment 382206 [details] Patch
Comment on attachment 382120 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382120&action=review >> LayoutTests/resources/testharnessreport.js:114 >> + root.appendChild(foreignObject); > > How does the <svg> root look like? Is width and height 100% of the viewport? Just want to make sure results are visible in the browser. If the SVG test looks like this: <svg width="0" height="0" xmlns="http://www.w3.org/2000/svg"> ... </svg> Or the HTML test looks like this: <style> html, body { width: 0; height: 0; } </style> <body> ... </body> I do not think we need to change the dimension of the root element to ensure the results are visible. It should be the responsibility of the test author. Also there is no easy way to guarantee the results will fit in the foreignObject.
Created attachment 382220 [details] Patch
Comment on attachment 382220 [details] Patch Clearing flags on attachment: 382220 Committed r251777: <https://trac.webkit.org/changeset/251777>
All reviewed patches have been landed. Closing bug.
<rdar://problem/56748905>