Skip to content
Permalink
Browse files
WebCore:
2008-05-16  Antti Koivisto  <antti@apple.com>

        Reviewed by Anders.

        Fix <rdar://problem/5934400>
        Movie controller does not update on first load of http://www.apple.com/getamac/ads/

        The issue is that we execute scripts while there are still pending stylesheet loads.
        If the script depends on a stylesheet having been applied it may fail.

        This will make external script execution block on external stylesheet loads. A full
        fix (as discussed with Hyatt) will also need to block inline script execution.

        Test: http/tests/local/stylesheet-and-script-load-order-http.html

        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::notifyFinished):

LayoutTests:

2008-05-16  Antti Koivisto  <antti@apple.com>

        Reviewed by Anders.

        Test for <rdar://problem/5934400>
        Movie controller does not update on first load of http://www.apple.com/getamac/ads/

        * http/tests/local/stylesheet-and-script-load-order-http-expected.txt: Added.
        * http/tests/local/stylesheet-and-script-load-order-http.html: Added.



Canonical link: https://commits.webkit.org/26408@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@33544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
anttijk committed May 17, 2008
1 parent 6327454 commit 98825ad5485d362659973f5efccaff228d3ad7b4
@@ -1,3 +1,13 @@
2008-05-16 Antti Koivisto <antti@apple.com>

Reviewed by Anders.

Test for <rdar://problem/5934400>
Movie controller does not update on first load of http://www.apple.com/getamac/ads/

* http/tests/local/stylesheet-and-script-load-order-http-expected.txt: Added.
* http/tests/local/stylesheet-and-script-load-order-http.html: Added.

2008-05-16 Anders Carlsson <andersca@apple.com>

Reviewed by Mitz.
@@ -0,0 +1,3 @@
Test that stylesheet loads complete before external scripts are executed.

PASS
@@ -0,0 +1,13 @@
<html>
<head>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<link rel=stylesheet href="http://127.0.0.1:8000/local/slow-css-pass.cgi">
</head>
<body>
<p>Test that stylesheet loads complete before external scripts are executed.</p>
<script src="http://127.0.0.1:8000/local/stylesheet-dependent.js"></script>
</body>
</html>
@@ -1,3 +1,21 @@
2008-05-16 Antti Koivisto <antti@apple.com>

Reviewed by Anders.

Fix <rdar://problem/5934400>
Movie controller does not update on first load of http://www.apple.com/getamac/ads/

The issue is that we execute scripts while there are still pending stylesheet loads.
If the script depends on a stylesheet having been applied it may fail.

This will make external script execution block on external stylesheet loads. A full
fix (as discussed with Hyatt) will also need to block inline script execution.

Test: http/tests/local/stylesheet-and-script-load-order-http.html

* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::notifyFinished):

2008-05-16 chris fleizach <cfleizach@apple.com>

Reviewed by Jon Honeycutt
@@ -1954,11 +1954,9 @@ void HTMLTokenizer::notifyFinished(CachedResource*)

ASSERT(!pendingScripts.isEmpty());

// Make scripts loaded from file URLs wait for stylesheets to match Tiger behavior where
// file loads were serialized in lower level.
// FIXME: this should really be done for all script loads or the same effect should be achieved by other
// means, like javascript suspend/resume
m_hasScriptsWaitingForStylesheets = !m_doc->haveStylesheetsLoaded() && protocolIs(pendingScripts.head()->url(), "file");
// Make external scripts wait for external stylesheets.
// FIXME: This needs to be done for inline scripts too.
m_hasScriptsWaitingForStylesheets = !m_doc->haveStylesheetsLoaded();
if (m_hasScriptsWaitingForStylesheets)
return;

0 comments on commit 98825ad

Please sign in to comment.