Bug 147327 - Allow lax MIME type parsing for same-origin CSS in quirks mode.
Summary: Allow lax MIME type parsing for same-origin CSS in quirks mode.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Chris Dumez
URL: https://src.chromium.org/viewvc/blink...
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 141501
  Show dependency treegraph
 
Reported: 2015-07-27 11:23 PDT by Chris Dumez
Modified: 2015-07-28 15:39 PDT (History)
7 users (show)

See Also:


Attachments
Patch (41.68 KB, patch)
2015-07-27 15:23 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (59.15 KB, patch)
2015-07-27 16:06 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (58.41 KB, patch)
2015-07-27 16:56 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (58.32 KB, patch)
2015-07-28 10:23 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>