diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-22 20:58:36 +0000 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-22 20:58:36 +0000 |
commit | ab5f78afbdbf3b37f89c06dcd59ff9442d6ecf14 (patch) | |
tree | 55a1e7c2bf2007f88cc5518052419bee63126688 /layout/style | |
parent | 9ffed6e8bfb35c090caf5f8bca7a0f8bd4cbec94 (diff) | |
parent | 1d7664d3a1db098024c7624650b0d272a26635e0 (diff) | |
download | UXP-ab5f78afbdbf3b37f89c06dcd59ff9442d6ecf14.tar UXP-ab5f78afbdbf3b37f89c06dcd59ff9442d6ecf14.tar.gz UXP-ab5f78afbdbf3b37f89c06dcd59ff9442d6ecf14.tar.lz UXP-ab5f78afbdbf3b37f89c06dcd59ff9442d6ecf14.tar.xz UXP-ab5f78afbdbf3b37f89c06dcd59ff9442d6ecf14.zip |
Merge branch 'master' into Pale_Moon-release
# Conflicts:
# application/palemoon/config/version.txt
# old-configure.in
Diffstat (limited to 'layout/style')
-rw-r--r-- | layout/style/Loader.cpp | 4 | ||||
-rw-r--r-- | layout/style/nsCSSScanner.cpp | 22 | ||||
-rw-r--r-- | layout/style/nsRuleNode.cpp | 3 | ||||
-rw-r--r-- | layout/style/test/test_csslexer.js | 3 |
4 files changed, 22 insertions, 10 deletions
diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index a1a0fcfd9..0ce337e29 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -1677,10 +1677,6 @@ Loader::LoadSheet(SheetLoadData* aLoadData, nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel)); if (httpChannel) { - // Send a minimal Accept header for text/css - httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"), - NS_LITERAL_CSTRING("text/css,*/*;q=0.1"), - false); nsCOMPtr<nsIURI> referrerURI = aLoadData->GetReferrerURI(); if (referrerURI) httpChannel->SetReferrerWithPolicy(referrerURI, diff --git a/layout/style/nsCSSScanner.cpp b/layout/style/nsCSSScanner.cpp index 771c8936b..2110be78c 100644 --- a/layout/style/nsCSSScanner.cpp +++ b/layout/style/nsCSSScanner.cpp @@ -1164,6 +1164,7 @@ nsCSSScanner::NextURL(nsCSSToken& aToken) // aToken.mIdent may be "url" at this point; clear that out aToken.mIdent.Truncate(); + bool hasString = false; int32_t ch = Peek(); // Do we have a string? if (ch == '"' || ch == '\'') { @@ -1173,7 +1174,7 @@ nsCSSScanner::NextURL(nsCSSToken& aToken) return; } MOZ_ASSERT(aToken.mType == eCSSToken_String, "unexpected token type"); - + hasString = true; } else { // Otherwise, this is the start of a non-quoted url (which may be empty). aToken.mSymbol = char16_t(0); @@ -1193,6 +1194,25 @@ nsCSSScanner::NextURL(nsCSSToken& aToken) } else { mSeenBadToken = true; aToken.mType = eCSSToken_Bad_URL; + if (!hasString) { + // Consume until before the next right parenthesis, which follows + // how <bad-url-token> is consumed in CSS Syntax 3 spec. + // Note that, we only do this when "url(" is not followed by a + // string, because in the spec, "url(" followed by a string is + // handled as a url function rather than a <url-token>, so the + // rest of content before ")" should be consumed in balance, + // which will be done by the parser. + // The closing ")" is not consumed here. It is left to the parser + // so that the parser can handle both cases. + do { + if (IsVertSpace(ch)) { + AdvanceLine(); + } else { + Advance(); + } + ch = Peek(); + } while (ch >= 0 && ch != ')'); + } } } diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 6bcef02a0..08400635b 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -67,9 +67,6 @@ #define alloca _alloca #endif #endif -#ifdef SOLARIS -#include <alloca.h> -#endif using std::max; using std::min; diff --git a/layout/style/test/test_csslexer.js b/layout/style/test/test_csslexer.js index a71c02d8f..4ba3b9c5c 100644 --- a/layout/style/test/test_csslexer.js +++ b/layout/style/test/test_csslexer.js @@ -55,8 +55,7 @@ var LEX_TESTS = [ ["url:http://example.com"]], // In CSS Level 3, this is an ordinary URL, not a BAD_URL. ["url(http://example.com", ["url:http://example.com"]], - // See bug 1153981 to understand why this gets a SYMBOL token. - ["url(http://example.com @", ["bad_url:http://example.com", "symbol:@"]], + ["url(http://example.com @", ["bad_url:http://example.com"]], ["quo\\ting", ["ident:quoting"]], ["'bad string\n", ["bad_string:bad string", "whitespace"]], ["~=", ["includes"]], |