Bug 147327

Summary: Allow lax MIME type parsing for same-origin CSS in quirks mode.
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, benjamin, ddkilzer, joepeck, kling, koivisto, simon.fraser
Priority: P1 Keywords: BlinkMergeCandidate
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: https://src.chromium.org/viewvc/blink?revision=196678&view=revision
Bug Depends on:    
Bug Blocks: 141501    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2015-07-27 11:23:25 PDT
Allow lax MIME type parsing for same-origin CSS in quirks mode.

Radar: <rdar://problem/22010303>
Comment 2 Chris Dumez 2015-07-27 15:23:50 PDT
Created attachment 257600 [details]
Patch
Comment 3 Chris Dumez 2015-07-27 16:06:43 PDT
Created attachment 257609 [details]
Patch
Comment 4 Chris Dumez 2015-07-27 16:56:02 PDT
Created attachment 257614 [details]
Patch
Comment 5 zalan 2015-07-28 09:37:00 PDT
Comment on attachment 257614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=257614&action=review

> Source/WebCore/css/StyleSheetContents.cpp:309
> +                if (isStrictParserMode(m_parserContext.mode))
> +                    page->console().addMessage(MessageSource::Security, MessageLevel::Error, "Did not parse stylesheet at '" + cachedStyleSheet->url().stringCenterEllipsizedToLength() + "' because its MIME type was invalid and we are in strict mode.");
> +                else
> +                    page->console().addMessage(MessageSource::Security, MessageLevel::Error, "Did not parse stylesheet at '" + cachedStyleSheet->url().stringCenterEllipsizedToLength() + "' because its MIME type was invalid and it is cross-origin.");
> +            }

- we were in strict mode?
- and it was cross-origin?
Comment 6 Chris Dumez 2015-07-28 10:23:59 PDT
Created attachment 257654 [details]
Patch
Comment 7 Chris Dumez 2015-07-28 10:25:51 PDT
Comment on attachment 257654 [details]
Patch

Clearing flags on attachment: 257654

Committed r187489: <http://trac.webkit.org/changeset/187489>
Comment 8 Chris Dumez 2015-07-28 10:25:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Darin Adler 2015-07-28 11:39:05 PDT
Comment on attachment 257614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=257614&action=review

> Source/WebCore/css/StyleSheetContents.h:43
>  class StyleRuleBase;
>  class StyleRuleImport;
> +class SecurityOrigin;

Not sorted correctly; Security should come before Style.
Comment 10 Chris Dumez 2015-07-28 12:49:44 PDT
(In reply to comment #9)
> Comment on attachment 257614 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=257614&action=review
> 
> > Source/WebCore/css/StyleSheetContents.h:43
> >  class StyleRuleBase;
> >  class StyleRuleImport;
> > +class SecurityOrigin;
> 
> Not sorted correctly; Security should come before Style.

Follow-up nit fix in <http://trac.webkit.org/changeset/187503>, thanks.
Comment 11 Chris Dumez 2015-07-28 14:21:06 PDT
Follow-up test baseline landed in <http://trac.webkit.org/changeset/187512>.
Comment 12 Chris Dumez 2015-07-28 15:39:52 PDT
Committed r187523: <http://trac.webkit.org/changeset/187523>