diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-04 18:21:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-04 18:21:04 +0200 |
commit | dee00a8a79394559e0e868cc72464c2de24583ac (patch) | |
tree | 18dc2e3db8127ceabcf9b03416b135bced2976ad /devtools/shared | |
parent | 851cfd198bc01020cd411d4f1cd6586222700269 (diff) | |
parent | 363bfeb2c06e5f57136ebdab8da1ebeba0591520 (diff) | |
download | UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.gz UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.lz UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.xz UXP-dee00a8a79394559e0e868cc72464c2de24583ac.zip |
Merge branch 'master' into Basilisk-release
Diffstat (limited to 'devtools/shared')
-rw-r--r-- | devtools/shared/css/lexer.js | 21 | ||||
-rw-r--r-- | devtools/shared/qrcode/moz.build | 9 | ||||
-rw-r--r-- | devtools/shared/tests/unit/test_csslexer.js | 3 | ||||
-rw-r--r-- | devtools/shared/touch/simulator-core.js | 15 |
4 files changed, 26 insertions, 22 deletions
diff --git a/devtools/shared/css/lexer.js b/devtools/shared/css/lexer.js index 9013b63ea..192fa95b3 100644 --- a/devtools/shared/css/lexer.js +++ b/devtools/shared/css/lexer.js @@ -1067,6 +1067,7 @@ Scanner.prototype = { // aToken.mIdent may be "url" at this point; clear that out aToken.mIdent.length = 0; + let hasString = false; let ch = this.Peek(); // Do we have a string? if (ch == QUOTATION_MARK || ch == APOSTROPHE) { @@ -1075,6 +1076,7 @@ Scanner.prototype = { aToken.mType = eCSSToken_Bad_URL; return; } + hasString = true; } else { // Otherwise, this is the start of a non-quoted url (which may be empty). aToken.mSymbol = 0; @@ -1093,6 +1095,25 @@ Scanner.prototype = { } } else { 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)) { + this.AdvanceLine(); + } else { + this.Advance(); + } + ch = this.Peek(); + } while (ch >= 0 && ch != RIGHT_PARENTHESIS); + } } }, diff --git a/devtools/shared/qrcode/moz.build b/devtools/shared/qrcode/moz.build index c9493a538..293bbcc93 100644 --- a/devtools/shared/qrcode/moz.build +++ b/devtools/shared/qrcode/moz.build @@ -5,15 +5,10 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DIRS += [ - 'encoder' + 'decoder', + 'encoder', ] -# Save file size on Fennec until there are active plans to use the decoder there -if not CONFIG['MOZ_FENNEC']: - DIRS += [ - 'decoder' - ] - DevToolsModules( 'index.js', ) diff --git a/devtools/shared/tests/unit/test_csslexer.js b/devtools/shared/tests/unit/test_csslexer.js index 35855640b..b2dfdf5aa 100644 --- a/devtools/shared/tests/unit/test_csslexer.js +++ b/devtools/shared/tests/unit/test_csslexer.js @@ -128,8 +128,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"]], diff --git a/devtools/shared/touch/simulator-core.js b/devtools/shared/touch/simulator-core.js index 6933f9207..fff7d2e78 100644 --- a/devtools/shared/touch/simulator-core.js +++ b/devtools/shared/touch/simulator-core.js @@ -18,19 +18,8 @@ var systemAppOrigin = (function () { return systemOrigin; })(); -var threshold = 25; -try { - threshold = Services.prefs.getIntPref("ui.dragThresholdX"); -} catch (e) { - // Fall back to default value -} - -var delay = 500; -try { - delay = Services.prefs.getIntPref("ui.click_hold_context_menus.delay"); -} catch (e) { - // Fall back to default value -} +var threshold = Services.prefs.getIntPref("ui.dragThresholdX", 25); +var delay = Services.prefs.getIntPref("ui.click_hold_context_menus.delay", 500); function SimulatorCore(simulatorTarget) { this.simulatorTarget = simulatorTarget; |