Bug 32445 - REGRESSION: http://www.mcafee.com/japan/ displays unstyled
Summary: REGRESSION: http://www.mcafee.com/japan/ displays unstyled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh All
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2009-12-11 13:34 PST by Alexey Proskuryakov
Modified: 2009-12-11 17:12 PST (History)
3 users (show)

See Also:


Attachments
proposed fix (3.83 KB, patch)
2009-12-11 13:38 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2009-12-11 13:34:42 PST
http://www.mcafee.com/japan/ stylesheets are served with two Content-Type headers, which confuses WebKit:

$ curl -I http://www.mcafee.com/japan/css2009/masthead.css
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=Shift_jis
X-Powered-By: ASP.NET
Date: Mon, 20 Jul 2009 00:54:00 GMT
Content-Type: text/css
Accept-Ranges: bytes
Last-Modified: Tue, 03 Mar 2009 05:54:10 GMT
ETag: "1bb93179c49bc91:e79"
Content-Length: 1079

WebKit sees Content-Type as "text/html; charset=Shift_jis, text/css", which is not a proper CSS MIME type, so the stylesheet gets ignored in strict mode.

Handling of HTTP headers is performed by closed source Apple libraries, but we can work around the issue for now.
Comment 1 Alexey Proskuryakov 2009-12-11 13:38:10 PST
Created attachment 44706 [details]
proposed fix
Comment 2 Alexey Proskuryakov 2009-12-11 13:38:28 PST
<rdar://problem/7068303>
Comment 3 WebKit Review Bot 2009-12-11 13:43:00 PST
style-queue ran check-webkit-style on attachment 44706 [details] without any errors.
Comment 4 David Levin 2009-12-11 13:56:30 PST
The brace on line 274 in WebCore/html/HTMLLinkElement.cpp should be inside the ifdef.
Comment 5 Darin Adler 2009-12-11 13:57:27 PST
Comment on attachment 44706 [details]
proposed fix

> +    bool needsSiteSpecificQuirks = parent && parent->doc() && parent->doc()->settings() && parent->doc()->settings()->needsSiteSpecificQuirks();

The old code had the nice property that it would evaluate this only when strict mode was on.

> +    bool needsSiteSpecificQuirks = document()->page() && document()->page()->settings()->needsSiteSpecificQuirks();

Same here.

Could we structure things so that is still true?

r=me
Comment 6 Darin Adler 2009-12-11 13:58:01 PST
Comment on attachment 44706 [details]
proposed fix

> +        if (url.contains("mcafee.com/japan/", false))

It's a little strange to do this as a substring check. But I can't think of anything better.
Comment 7 Alexey Proskuryakov 2009-12-11 14:12:30 PST
> The old code had the nice property that it would evaluate this only when strict
> mode was on.

I noticed that it was lost, but couldn't come up with a better idea. One constraint was that I wanted the new code to be easily removable once it's no longer needed. Also, I doubt that this is such hot code.

Not landing this right away, maybe a fresh look will help.


(In reply to comment #4)
> The brace on line 274 in WebCore/html/HTMLLinkElement.cpp should be inside the
> ifdef.

Oops, thanks!
Comment 8 Alexey Proskuryakov 2009-12-11 17:12:39 PST
Committed <http://trac.webkit.org/changeset/52032> without re-arranging the code. I added a comment about the reason we use such a strange URL check to both places where we do now.