Bug 203503 - Make testharnessreport.js report the results correctly inside an SVG document
Summary: Make testharnessreport.js report the results correctly inside an SVG document
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on: 201731
Blocks:
  Show dependency treegraph
 
Reported: 2019-10-28 13:23 PDT by Said Abou-Hallawa
Modified: 2019-10-30 10:21 PDT (History)
8 users (show)

See Also:


Attachments
Patch (220.56 KB, patch)
2019-10-28 15:34 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (222.11 KB, patch)
2019-10-29 12:40 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (222.11 KB, patch)
2019-10-29 14:07 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2019-10-28 13:23:59 PDT
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.
Comment 1 Said Abou-Hallawa 2019-10-28 15:34:42 PDT
Created attachment 382120 [details]
Patch
Comment 2 Dirk Schulze 2019-10-29 01:19:03 PDT
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.
Comment 3 Said Abou-Hallawa 2019-10-29 12:40:16 PDT
Created attachment 382206 [details]
Patch
Comment 4 Said Abou-Hallawa 2019-10-29 12:49:42 PDT
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.
Comment 5 Said Abou-Hallawa 2019-10-29 14:07:54 PDT
Created attachment 382220 [details]
Patch
Comment 6 WebKit Commit Bot 2019-10-30 10:20:25 PDT
Comment on attachment 382220 [details]
Patch

Clearing flags on attachment: 382220

Committed r251777: <https://trac.webkit.org/changeset/251777>
Comment 7 WebKit Commit Bot 2019-10-30 10:20:27 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-10-30 10:21:21 PDT
<rdar://problem/56748905>