[Webkit-unassigned] [Bug 39026] Recognize async attribute on script tags

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 2 10:14:30 PDT 2010


--- Comment #11 from Tony Gentilcore <tonyg at chromium.org>  2010-06-02 10:14:28 PST ---
(In reply to comment #10)
> Created an attachment (id=57631)
 --> (https://bugs.webkit.org/attachment.cgi?id=57631) [details]
> Patch

(In reply to comment #9)
> (From update of attachment 57624 [details])
> We haven't yet shown you the wonderful world of script-tests it seems.
> Your long mass of:
> +<script>
> +if (isParserInsertedScriptAsync("async") === true)
> +    writePass("p1");
> +</script>
> Could be fixed by making isParserInsertedScriptAsync work on an iframe (newly created or otherwise), and then using:
> shouldBeTrue("isParserInsertedScriptAsync('async')");
> That will do all the beautiful "PASS", "FAIL" stuff for you.  script-tests are javascript files only.
> You can see lots of examples in LayoutTests looking in the script-tests directory.  Sadly they only work (easily) for .html files, however you can use the scirpt-test scripts (fast/js/resources/js-test-pre.js and -post.js) in any file, including a .svg file.

Thanks for showing me the light. That is so much cleaner!

However, for the HTMLScriptElement test, I went back to actually writing the <script> tags in the source HTML rather than document.writing them. This was for two reasons:
 1 There seems to be a bug with:
        document.write('<script id=foo></scri'+'pt>');
        document.write('<script id=bar></scri'+'pt>');
    The first getElementById('foo') will succeed but the second getElementById('bar') will return NULL. I plan to file a bug and look into that separately. But it is orthogonal to this patch and there is no reason to complicate this LayoutTest with that issue.
 2 It turns out to be fewer lines overall and, IMHO, easier to read.

For the SVGScriptElement test, I just left it as-is because the test case is so simple. Let me know if you think I should try to use script-tests there.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list