Bug 17532

Summary: HTML5 spec violation: Webkit imports styles from <link> element which doesn't have rel=stylesheet defined
Product: WebKit Reporter: Robert Blaut <webkit>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: VERIFIED FIXED    
Severity: Normal Keywords: HasReduction, InRadar
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: All   
OS: All   
URL: http://www.filmweb.pl/Bracia+Coen+zwyciêzcami%2C+Kamiñski+i+Wajda+bez+Oscarów,News,id=41205
Attachments:
Description Flags
minimal test case
none
test case for all of combination rel="stylesheet" vs. text/css
none
proposed patch
hyatt: review-
updated patch darin: review+

Description Robert Blaut 2008-02-25 04:33:14 PST
HTML5 spec says: "The type of link indicated (the relationship) is given by the value of the rel attribute, which must be present, and must have a value that is a set of space-separated tokens. [...] If the rel attribute is absent, or if the value used is not allowed according to the definitions in this specification, then the element does not define a link." [http://www.whatwg.org/specs/web-apps/current-work/#link]

Webkit doesn't honor this regulation and imports styles from such defined links:

<link type="text/css" href="style.css" /> This violation causes broken rendering of a one of the top Polish sites fimweb.pl.

Test case attached.
Comment 1 Robert Blaut 2008-02-25 04:34:20 PST
Created attachment 19343 [details]
minimal test case
Comment 2 Robert Blaut 2008-02-25 04:36:03 PST
Gecko and Presto engines honor above mentioned regulation.
Comment 3 Robert Blaut 2008-02-25 04:57:11 PST
<rdar://problem/5762891>
Comment 4 Robert Blaut 2008-02-25 06:37:30 PST
Created attachment 19347 [details]
test case for all of combination rel="stylesheet" vs. text/css
Comment 5 Robert Blaut 2008-02-25 15:28:08 PST
Created attachment 19359 [details]
proposed patch

This patch matches Webkit behavior to Firefox and Opera.

These two existing tests should be updated to match the new re=stylesheet requirements:

fast/media/mq-simple-query-02.html
fast/media/mq-width-absolute-02.html
Comment 6 Dave Hyatt 2008-02-25 15:32:28 PST
Comment on attachment 19359 [details]
proposed patch

I need to see how you changed the existing tests.  Just want to make sure you are patching them to still load the same set of stylesheets they did before.
Comment 7 Robert Blaut 2008-02-25 15:39:49 PST
(In reply to comment #6)
> (From update of attachment 19359 [details] [edit])
> I need to see how you changed the existing tests.  Just want to make sure you
> are patching them to still load the same set of stylesheets they did before.
> 

Dave, I only informed that these two tests should be updated. The proposed patch only  contains the new layout test. These two tests updates are omitted in the patch.
Comment 8 Robert Blaut 2008-02-25 16:32:23 PST
Created attachment 19362 [details]
updated patch

Updated patch to reflect David's expectations.
Comment 9 Darin Adler 2008-02-29 10:09:07 PST
Comment on attachment 19362 [details]
updated patch

+</html>
\ No newline at end of file

New tests should have newlines at the end of the file.

r=me
Comment 10 Mark Rowe (bdash) 2008-02-29 14:11:44 PST
Landed in r30673.