Bug 9017 - Weather2.css incorrectly treated as JavaScript file @ www.live.com
Summary: Weather2.css incorrectly treated as JavaScript file @ www.live.com
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Anders Carlsson
URL: http://www.live.com
: 7677 (view as bug list)
Depends on:
Blocks: 6628 7788
  Show dependency treegraph
Reported: 2006-05-20 14:18 PDT by Geoffrey Garen
Modified: 2006-05-28 05:44 PDT (History)
1 user (show)

See Also:

Patch (17.81 KB, patch)
2006-05-23 08:49 PDT, Anders Carlsson
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2006-05-20 14:18:58 PDT
1. Navigate to www.live.com
2. --> JS Console: SyntaxError: Parse error for Weather2.css

gdb confirms that the file is treated as a CachedScript instead of a CachedCSSStyleSheet.
Comment 1 Geoffrey Garen 2006-05-20 14:59:41 PDT
Strangely, it looks like the JS code creates a script element to load the CSS file:

URL: "http://www.live.com/"

(gdb) p this->Node::toString(exec).ascii()
$44 = 0x138d9c00 "\n{\n  el = document.createElement(\"script\");\n  el.onreadystatechange = doCallback;\n  el.src = o.url;\n  if (!Web.Browser.isIE())\n    {\n      el.readyState = \"loaded\";\n      doCallback();\n    }\n}"

So the question is, why does the JS code take this path in Safari but not FF? Or does FF just know that CSS is CSS, even if it's loaded into a script element? (Seems unlikely.)
Comment 2 Geoffrey Garen 2006-05-22 22:31:20 PDT
Anders mentioned on IRC that the script gets confused because we lack support for namespace attributes.
Comment 3 Anders Carlsson 2006-05-23 08:49:43 PDT
Created attachment 8482 [details]

This patch makes us match Firefox in terms of how getAttribute/setAttribute etc work with attributes that have prefixes
Comment 4 Maciej Stachowiak 2006-05-23 09:12:48 PDT
Comment on attachment 8482 [details]

Comment 5 Anders Carlsson 2006-05-28 00:47:06 PDT
*** Bug 7677 has been marked as a duplicate of this bug. ***