merge mozilla-inbound to mozilla-central a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 08 May 2017 10:07:27 +0200
changeset 357002 1fda52a1f3b81cf1a821155998dca637bb64e3d9
parent 356988 81977c96c6ff49e4b70f88a55f38d47f5e54a08b (current diff)
parent 357001 f30e35f881920a7acdb1dd1eb6deaa2f37a785b6 (diff)
child 357003 73e1d0f338a991162db944cb4fa2dea7c76f8ba2
child 357048 f18b86d87dc5f45125e5c788003e9a3d843a7838
child 357052 1f24285a7c0a40b0ec60c3df180c17373a565bb0
child 357084 f9478c461818ee382e3a659b2af2518bc329b027
push id31778
push usercbook@mozilla.com
push dateMon, 08 May 2017 08:07:41 +0000
treeherdermozilla-central@1fda52a1f3b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone55.0a1
first release with
nightly linux32
1fda52a1f3b8 / 55.0a1 / 20170508100218 / files
nightly linux64
1fda52a1f3b8 / 55.0a1 / 20170508100218 / files
nightly mac
1fda52a1f3b8 / 55.0a1 / 20170508030204 / files
nightly win32
1fda52a1f3b8 / 55.0a1 / 20170508030204 / files
nightly win64
1fda52a1f3b8 / 55.0a1 / 20170508030204 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge mozilla-inbound to mozilla-central a=merge
dom/base/test/test_selection_with_anon_trees.html
--- a/devtools/client/jsonview/converter-child.js
+++ b/devtools/client/jsonview/converter-child.js
@@ -160,20 +160,20 @@ Converter.prototype = {
         }
       });
     }
 
     let outputDoc = "";
 
     try {
       headers = JSON.stringify(headers);
-      outputDoc = this.toHTML(this.data, headers, this.uri);
+      outputDoc = this.toHTML(this.data, headers);
     } catch (e) {
       console.error("JSON Viewer ERROR " + e);
-      outputDoc = this.toErrorPage(e, this.data, this.uri);
+      outputDoc = this.toErrorPage(e, this.data);
     }
 
     let storage = Cc["@mozilla.org/storagestream;1"]
       .createInstance(Ci.nsIStorageStream);
 
     storage.init(SEGMENT_SIZE, 0xffffffff, null);
     let out = storage.getOutputStream(0);
 
@@ -200,17 +200,17 @@ Converter.prototype = {
   htmlEncode: function (t) {
     return t !== null ? t.toString()
       .replace(/&/g, "&amp;")
       .replace(/"/g, "&quot;")
       .replace(/</g, "&lt;")
       .replace(/>/g, "&gt;") : "";
   },
 
-  toHTML: function (json, headers, title) {
+  toHTML: function (json, headers) {
     let themeClassName = "theme-" + JsonViewUtils.getCurrentTheme();
     let clientBaseUrl = "resource://devtools/client/";
     let baseUrl = clientBaseUrl + "jsonview/";
     let themeVarsUrl = clientBaseUrl + "themes/variables.css";
     let commonUrl = clientBaseUrl + "themes/common.css";
     let toolbarsUrl = clientBaseUrl + "themes/toolbars.css";
 
     let os;
@@ -223,51 +223,51 @@ Converter.prototype = {
       os = "linux";
     }
 
     let dir = Services.locale.isAppLocaleRTL ? "rtl" : "ltr";
 
     return "<!DOCTYPE html>\n" +
       "<html platform=\"" + os + "\" class=\"" + themeClassName +
         "\" dir=\"" + dir + "\">" +
-      "<head><title>" + this.htmlEncode(title) + "</title>" +
+      "<head>" +
       "<base href=\"" + this.htmlEncode(baseUrl) + "\">" +
       "<link rel=\"stylesheet\" type=\"text/css\" href=\"" +
         themeVarsUrl + "\">" +
       "<link rel=\"stylesheet\" type=\"text/css\" href=\"" +
         commonUrl + "\">" +
       "<link rel=\"stylesheet\" type=\"text/css\" href=\"" +
         toolbarsUrl + "\">" +
       "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/main.css\">" +
       "<script data-main=\"viewer-config\" src=\"lib/require.js\"></script>" +
       "</head><body>" +
       "<div id=\"content\"></div>" +
       "<div id=\"json\">" + this.htmlEncode(json) + "</div>" +
       "<div id=\"headers\">" + this.htmlEncode(headers) + "</div>" +
       "</body></html>";
   },
 
-  toErrorPage: function (error, data, uri) {
+  toErrorPage: function (error, data) {
     // Escape unicode nulls
     data = data.replace("\u0000", "\uFFFD");
 
     let errorInfo = error + "";
 
     let output = "<div id=\"error\">" + "error parsing";
     if (errorInfo.message) {
       output += "<div class=\"errormessage\">" + errorInfo.message + "</div>";
     }
 
     output += "</div><div id=\"json\">" + this.highlightError(data,
       errorInfo.line, errorInfo.column) + "</div>";
 
     let dir = Services.locale.isAppLocaleRTL ? "rtl" : "ltr";
 
     return "<!DOCTYPE html>\n" +
-      "<html><head><title>" + this.htmlEncode(uri + " - Error") + "</title>" +
+      "<html><head>" +
       "<base href=\"" + this.htmlEncode(this.data.url()) + "\">" +
       "</head><body dir=\"" + dir + "\">" +
       output +
       "</body></html>";
   },
 
   // Chrome <-> Content communication
 
--- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js
+++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js
@@ -73,24 +73,25 @@ stubPreparedMessages.set("1 + @", new Co
   "timeStamp": 1479159921399,
   "type": "result",
   "level": "error",
   "messageText": "SyntaxError: illegal character",
   "parameters": {
     "type": "undefined"
   },
   "repeat": 1,
-  "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"timeStamp\":null,\"type\":\"result\",\"level\":\"error\",\"messageText\":\"SyntaxError: illegal character\",\"parameters\":{\"type\":\"undefined\"},\"repeat\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"debugger eval code\",\"line\":1,\"column\":4},\"groupId\":null,\"userProvidedStyles\":null,\"notes\":null}",
+  "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"timeStamp\":null,\"type\":\"result\",\"level\":\"error\",\"messageText\":\"SyntaxError: illegal character\",\"parameters\":{\"type\":\"undefined\"},\"repeat\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"debugger eval code\",\"line\":1,\"column\":4},\"groupId\":null,\"exceptionDocURL\":\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default\",\"userProvidedStyles\":null,\"notes\":null}",
   "stacktrace": null,
   "frame": {
     "source": "debugger eval code",
     "line": 1,
     "column": 4
   },
   "groupId": null,
+  "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default",
   "userProvidedStyles": null,
   "notes": null
 }));
 
 stubPreparedMessages.set("longString message Error", new ConsoleMessage({
   "id": "1",
   "allowRepeating": true,
   "source": "javascript",
@@ -194,16 +195,17 @@ stubPackets.set("1 + @", {
       "message": "illegal character",
       "stack": "",
       "fileName": "debugger eval code",
       "lineNumber": 1,
       "columnNumber": 4
     }
   },
   "exceptionMessage": "SyntaxError: illegal character",
+  "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default",
   "frame": {
     "source": "debugger eval code",
     "line": 1,
     "column": 4
   },
   "helperResult": null,
   "notes": null
 });
--- a/devtools/client/webconsole/test/browser_webconsole_hpkp_invalid-headers.js
+++ b/devtools/client/webconsole/test/browser_webconsole_hpkp_invalid-headers.js
@@ -7,17 +7,17 @@
 // console.
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf-8,Web Console HPKP invalid " +
                  "header test";
 const SJS_URL = "https://example.com/browser/devtools/client/webconsole/" +
                 "test/test_hpkp-invalid-headers.sjs";
-const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/Security/" +
+const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/HTTP/" +
                        "Public_Key_Pinning" + DOCS_GA_PARAMS;
 const NON_BUILTIN_ROOT_PREF = "security.cert_pinning.process_headers_from_" +
                               "non_builtin_roots";
 
 add_task(function* () {
   registerCleanupFunction(() => {
     Services.prefs.clearUserPref(NON_BUILTIN_ROOT_PREF);
   });
--- a/devtools/client/webconsole/test/browser_webconsole_hsts_invalid-headers.js
+++ b/devtools/client/webconsole/test/browser_webconsole_hsts_invalid-headers.js
@@ -7,18 +7,18 @@
 //  to the web console.
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf-8,Web Console HSTS invalid " +
                  "header test";
 const SJS_URL = "https://example.com/browser/devtools/client/webconsole/" +
                 "test/test_hsts-invalid-headers.sjs";
-const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/Security/" +
-                       "HTTP_strict_transport_security" + DOCS_GA_PARAMS;
+const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/HTTP/Headers/" +
+                       "Strict-Transport-Security" + DOCS_GA_PARAMS;
 
 add_task(function* () {
   yield loadTab(TEST_URI);
 
   let hud = yield openConsole();
 
   yield* checkForMessage({
     url: SJS_URL + "?badSyntax",
--- a/devtools/server/actors/errordocs.js
+++ b/devtools/server/actors/errordocs.js
@@ -45,23 +45,54 @@ const ErrorDocs = {
   JSMSG_PAREN_AFTER_ARGS: "Missing_parenthesis_after_argument_list",
   JSMSG_MORE_ARGS_NEEDED: "More_arguments_needed",
   JSMSG_BAD_LEFTSIDE_OF_ASS: "Invalid_assignment_left-hand_side",
   JSMSG_UNTERMINATED_STRING: "Unterminated_string_literal",
   JSMSG_NOT_CONSTRUCTOR: "Not_a_constructor",
   JSMSG_CURLY_AFTER_LIST: "Missing_curly_after_property_list",
   JSMSG_DEPRECATED_FOR_EACH: "For-each-in_loops_are_deprecated",
   JSMSG_STRICT_NON_SIMPLE_PARAMS: "Strict_Non_Simple_Params",
+  JSMSG_DEAD_OBJECT: "Dead_object",
+  JSMSG_NOT_NONNULL_OBJECT: "No_non-null_object",
+  JSMSG_IDSTART_AFTER_NUMBER: "Identifier_after_number",
+  JSMSG_DEPRECATED_EXPR_CLOSURE: "Deprecated_expression_closures",
+  JSMSG_ILLEGAL_CHARACTER: "Illegal_character",
+  JSMSG_BAD_REGEXP_FLAG: "Bad_regexp_flag",
+  JSMSG_INVALID_FOR_IN_DECL_WITH_INIT: "Invalid_for-in_initializer",
+  JSMSG_CANT_REDEFINE_PROP: "Cant_redefine_property",
+  JSMSG_COLON_AFTER_ID: "Missing_colon_after_property_id",
+  JSMSG_IN_NOT_OBJECT: "in_operator_no_object",
+  JSMSG_CURLY_AFTER_BODY: "Missing_curly_after_function_body",
+  JSMSG_NAME_AFTER_DOT: "Missing_name_after_dot_operator",
+  JSMSG_DEPRECATED_OCTAL: "Deprecated_octal",
+  JSMSG_PAREN_AFTER_COND: "Missing_parenthesis_after_condition",
+  JSMSG_JSON_CYCLIC_VALUE: "Cyclic_object_value",
+  JSMSG_NO_VARIABLE_NAME: "No_variable_name",
+  JSMSG_UNNAMED_FUNCTION_STMT: "Unnamed_function_statement",
+  JSMSG_CANT_DEFINE_PROP_OBJECT_NOT_EXTENSIBLE:
+    "Cant_define_property_object_not_extensible",
+  JSMSG_TYPED_ARRAY_BAD_ARGS: "Typed_array_invalid_arguments",
+  JSMSG_GETTER_ONLY: "Getter_only",
+  JSMSG_INVALID_DATE: "Invalid_date",
+  JSMSG_DEPRECATED_STRING_METHOD: "Deprecated_String_generics",
+  JSMSG_DEPRECATED_TOLOCALEFORMAT: "Deprecated_toLocaleFormat",
+  JSMSG_RESERVED_ID: "Reserved_identifier",
+  JSMSG_BAD_CONST_ASSIGN: "Invalid_const_assignment",
+  JSMSG_BAD_CONST_DECL: "Missing_initializer_in_const",
+  JSMSG_OF_AFTER_FOR_LOOP_DECL: "Invalid_for-of_initializer",
+  JSMSG_BAD_URI: "Malformed_URI",
+  JSMSG_DEPRECATED_DELETE_OPERAND: "Delete_in_strict_mode",
+  JSMSG_MISSING_FORMAL: "Missing_formal_parameter",
 };
 
 const MIXED_CONTENT_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Mixed_content";
 const TRACKING_PROTECTION_LEARN_MORE = "https://developer.mozilla.org/Firefox/Privacy/Tracking_Protection";
 const INSECURE_PASSWORDS_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Insecure_passwords";
-const PUBLIC_KEY_PINS_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Public_Key_Pinning";
-const STRICT_TRANSPORT_SECURITY_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/HTTP_strict_transport_security";
+const PUBLIC_KEY_PINS_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Public_Key_Pinning";
+const STRICT_TRANSPORT_SECURITY_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security";
 const WEAK_SIGNATURE_ALGORITHM_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Weak_Signature_Algorithm";
 const MIME_TYPE_MISMATCH_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Content-Type-Options";
 const ErrorCategories = {
   "Insecure Password Field": INSECURE_PASSWORDS_LEARN_MORE,
   "Mixed Content Message": MIXED_CONTENT_LEARN_MORE,
   "Mixed Content Blocker": MIXED_CONTENT_LEARN_MORE,
   "Invalid HPKP Headers": PUBLIC_KEY_PINS_LEARN_MORE,
   "Invalid HSTS Headers": STRICT_TRANSPORT_SECURITY_LEARN_MORE,
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -735,18 +735,16 @@ skip-if = toolkit == 'android'
 [test_script_loader_js_cache.html]
 support-files =
   file_js_cache.html
   file_js_cache_with_sri.html
   file_js_cache.js
   file_js_cache_save_after_load.html
   file_js_cache_save_after_load.js
 skip-if = (os == 'linux' || toolkit == 'android') # mochitest are executed on a single core
-[test_selection_with_anon_trees.html]
-skip-if = (toolkit == 'android' || asan) # bug 1330526
 [test_setInterval_uncatchable_exception.html]
 skip-if = debug == false
 [test_settimeout_extra_arguments.html]
 [test_settimeout_inner.html]
 [test_setTimeoutWith0.html]
 [test_setting_opener.html]
 [test_simplecontentpolicy.html]
 skip-if = e10s # Bug 1156489.
deleted file mode 100644
--- a/dom/base/test/test_selection_with_anon_trees.html
+++ /dev/null
@@ -1,445 +0,0 @@
-<!DOCTYPE>
-<html>
-<head>
-<title>selection over trees of anonymous nodes</title>
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script src="/tests/SimpleTest/EventUtils.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-
-<style type="text/css">
-@font-face {
-  font-family: Ahem;
-  src: url("Ahem.ttf");
-}
-* { font-family: Ahem; font-size: 20px; }
-</style>
-
-</head>
-<body>
-
-<div id="test1">
-aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa
-<table>
-  <tbody>
-    <tr>
-      <td>
-        <input value="1111">
-      </td>
-    </tr>
-  <tbody>
-</table>
-bbbbbbbb
-<br>
-<br>
-</div>
-
-<div id="test2">
-ccccc ccccccc cccccccccccc ccccccccc
-<div>
-  <input value="2222">
-</div>
-dddddd
-</div>
-
-<div id="test3">
-aaaaa
-<br>
-<input type="button"><br>
-<br>
-<input type="button"><br>
-BBBBB BB<br>
-<br>
-</div>
-
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-const kIsWin = navigator.platform.indexOf("Win") == 0;
-
-function test()
-{
-  function clear(w)
-  {
-    var sel = (w ? w : window).getSelection();
-    sel.removeAllRanges();
-  }
-  function doneTest(e)
-  {
-    // We hide the elements we're done with so that later tests
-    // are inside the rather narrow iframe mochitest gives us.
-    // It matters for synthesizeMouse event tests.
-    e.style.display = 'none';
-    e.offsetHeight;
-  }
-  function show(e) { e.style.display = ''; }
-
-  function dragSelectWithKey(e, clickCount, shiftKey, pointsArray)
-  {
-    const kMove = { type:"mousemove", shiftKey:shiftKey };
-    let pt = pointsArray[0];
-    let x = pt[0];
-    let y = pt[1];
-    synthesizeMouse(e, x, y, { type:"mousedown", clickCount:clickCount, shiftKey:shiftKey });
-    pointsArray.forEach(function(pt) {
-      let x = pt[0];
-      let y = pt[1];
-      synthesizeMouse(e, x, y, kMove);
-    });
-    pt = pointsArray[pointsArray.length - 1];
-    x = pt[0];
-    y = pt[1];
-    synthesizeMouse(e, x, y, kMove);
-    synthesizeMouse(e, x, y, { type:"mouseup", shiftKey:shiftKey });
-  }
-
-  function shiftDragSelect(e, clickCount, pointsArray)
-  {
-    dragSelectWithKey(e, clickCount, true, pointsArray);
-  }
-  function dragSelect(e, clickCount, pointsArray)
-  {
-    dragSelectWithKey(e, clickCount, false, pointsArray);
-  }
-
-  function shiftClick(e, x, y)
-  {
-    synthesizeMouse(e, x, y, { type: "mousedown", shiftKey: true });
-    synthesizeMouse(e, x, y, { type: "mouseup", shiftKey: true });
-  }
-
-  function click(e, x, y)
-  {
-    synthesizeMouse(e, x, y, { type: "mousedown" });
-    synthesizeMouse(e, x, y, { type: "mouseup" });
-  }
-
-  function repeatShiftKey(k, n) {
-    for (let i = 0; i < n; ++i) {
-      synthesizeKey(k, { shiftKey:true });
-    }
-  }
-
-  function init(arr, e)
-  {
-    clear();
-    var sel = window.getSelection();
-    for (i = 0; i < arr.length; ++i) {
-      var data = arr[i];
-      var r = new Range()
-      r.setStart(node(e, data[0]), data[1]);
-      r.setEnd(node(e, data[2]), data[3]);
-      sel.addRange(r);
-    }
-  }
-
-  function NL(s) { return s.replace(/(\r\n|\n\r|\r)/g, '\n'); }
-
-  function checkText(text, e)
-  {
-    var sel = window.getSelection();
-    is(NL(sel.toString()), text, e.id + ": selected text")
-  }
-
-  function checkRangeText(text, index)
-  {
-    var r = window.getSelection().getRangeAt(index);
-    is(NL(r.toString()), text, e.id + ": range["+index+"].toString()")
-  }
-
-  function node(e, arg)
-  {
-    if (typeof arg == "number")
-      return arg == -1 ? e : e.childNodes[arg];
-    return arg;
-  }
-
-  function checkRangeCount(n, e)
-  {
-    var sel = window.getSelection();
-    is(sel.rangeCount, n, e.id + ": Selection range count");
-  }
-
-  function checkRange(r, expected, e) {
-    is(r.startContainer, node(e, expected[0]), e.id + ": range["+i+"].startContainer");
-    is(r.startOffset, expected[1], e.id + ": range["+i+"].startOffset");
-    is(r.endContainer, node(e, expected[2]), e.id + ": range["+i+"].endContainer");
-    is(r.endOffset, expected[3], e.id + ": range["+i+"].endOffset");
-  }
-
-  function checkRanges(arr, e)
-  {
-    let sel = window.getSelection();
-    checkRangeCount(arr.length, e);
-    for (i = 0; i < arr.length; ++i) {
-      let expected = arr[i];
-      let r = sel.getRangeAt(i);
-      checkRange(r, expected, e);
-    }
-  }
-
-  // ======================================================
-  // ================== dragSelect tests ==================
-  // ======================================================
-
-  // Downward word-select with SHIFT
-  clear();
-  var e = document.getElementById('test1');
-  shiftDragSelect(e, 2, [[20,5], [30,5], [250,5], [250,20], [250,50], [60,110], [10,110]]);
-  checkText('aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbbbbbb ', e);
-  checkRanges([[0,1,-1,3]], e);
-
-  // Downward word-select without SHIFT
-  clear();
-  dragSelect(e, 2, [[20,5], [30,5], [250,5], [250,20], [250,50], [60,110], [10,110]]);
-  checkText('aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbbbbbb ', e);
-  checkRanges([[0,1,-1,3]], e);
-
-  // Downward char-select with SHIFT
-  clear();
-  click(e, 1, 1);
-  shiftDragSelect(e, 1, [[30,5], [250,5], [250,20], [250,50], [60,110], [20,110]]);
-  checkText('aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nb', e);
-  checkRanges([[0,1,2,2]], e);
-
-  // Downward char-select without SHIFT
-  clear();
-  dragSelect(e, 1, [[40,5], [60,70], [30,110]]);
-  checkText('aaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nb', e);
-  checkRanges([[0,3,2,2]], e);
-
-  // Upward word-select with SHIFT
-  clear();
-  shiftDragSelect(e, 2, [[20,110], [60,110], [250,50], [250,20], [250,5], [30,5], [30,5]]);
-  checkText('aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbbbbbb ', e);
-  checkRanges([[0,1,-1,3]], e);
-
-  // Upward word-select without SHIFT
-  clear();
-  dragSelect(e, 2, [[20,110], [60,110], [250,50], [250,20], [250,5], [30,5], [30,5]]);
-  checkText('aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbbbbbb ', e);
-  checkRanges([[0,1,-1,3]], e);
-
-  // Upward char-select with SHIFT
-  clear();
-  click(e, 100, 110);
-  shiftDragSelect(e, 1, [[20,110], [250,50], [250,20], [250,5], [30,5]]);
-  checkText('aaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbbb', e);
-  checkRanges([[0,2,2,6]], e);
-
-  // Upward char-select without SHIFT
-  clear();
-  dragSelect(e, 1, [[30,110], [60,110], [40,5]]);
-  checkText('aaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nb', e);
-  checkRanges([[0,3,2,2]], e);
-
-  doneTest(e);
-
-  // Downward word-select with SHIFT
-  var e = document.getElementById('test2');
-  shiftDragSelect(e, 2, [[20,5], [30,5], [250,5], [250,20], [250,50], [60,100], [10,100]]);
-  checkText('ccccc ccccccc cccccccccccc ccccccccc\ndddddd', e);
-  checkRanges([[0,1,2,7]], e);
-
-  // Downward word-select without SHIFT
-  clear();
-  dragSelect(e, 2, [[20,5], [30,5], [250,5], [250,20], [250,50], [60,100], [10,100]]);
-  checkText('ccccc ccccccc cccccccccccc ccccccccc\ndddddd', e);
-  checkRanges([[0,1,2,7]], e);
-
-  // Downward char-select with SHIFT
-  clear();
-  click(e, 1, 1);
-  shiftDragSelect(e, 1, [[30,5], [30,5], [250,5], [250,20], [250,50], [60,100], [20,100]]);
-  checkText('ccccc ccccccc cccccccccccc ccccccccc\nd', e);
-  checkRanges([[0,1,2,2]], e);
-
-  // Downward char-select without SHIFT
-  clear();
-  dragSelect(e, 1, [[40,5], [250,5], [250,20], [250,50], [60,100], [20,100]]);
-  checkText('ccc ccccccc cccccccccccc ccccccccc\nd', e);
-  checkRanges([[0,3,2,2]], e);
-
-  // Upward word-select with SHIFT
-  var e = document.getElementById('test2');
-  shiftDragSelect(e, 2, [[10,100], [60,100], [250,50], [250,20], [250,5], [30,5], [20,5]]);
-  checkText('ccccc ccccccc cccccccccccc ccccccccc\ndddddd', e);
-  checkRanges([[0,1,2,7]], e);
-
-  // Upward word-select without SHIFT
-  clear();
-  shiftDragSelect(e, 2, [[10,100], [60,100], [250,50], [250,20], [250,5], [30,5], [20,5]]);
-  checkText('ccccc ccccccc cccccccccccc ccccccccc\ndddddd', e);
-  checkRanges([[0,1,2,7]], e);
-
-  // Upward char-select with SHIFT
-  clear();
-  click(e, 100, 100);
-  shiftDragSelect(e, 1, [[20,100], [250,50], [250,20], [250,5], [60,5]]);
-  checkText('cc ccccccc cccccccccccc ccccccccc\nddddd', e);
-  checkRanges([[0,4,2,6]], e);
-
-  // Upward char-select without SHIFT
-  clear();
-  dragSelect(e, 1, [[20,100], [60,100], [60,5]]);
-  checkText('cc ccccccc cccccccccccc ccccccccc\nd', e);
-  checkRanges([[0,4,2,2]], e);
-
-  doneTest(e);
-
-  // On Windows word-selection also selects the space after the word.
-  kSpaceAfterWord = kIsWin ? ' ' : '';
-
-  // Downward word-select with SHIFT
-  e = document.getElementById('test3');
-  clear();
-  shiftDragSelect(e, 2, [[50,5], [60,125], [10,125]]);
-  checkText('aaaaa\n\n\n\nBBBBB' + kSpaceAfterWord, e);
-  checkRanges([[0,1,-1,3], [4,0,-1,8], [9,0,10,6 + kSpaceAfterWord.length]], e);
-
-  // Downward word-select without SHIFT
-  e = document.getElementById('test3');
-  clear();
-  dragSelect(e, 2, [[40,5], [30,5], [50,5], [60,125], [10,125]]);
-  checkText('aaaaa\n\n\n\nBBBBB' + kSpaceAfterWord, e);
-  checkRanges([[0,1,-1,3], [4,0,-1,8], [9,0,10,6 + kSpaceAfterWord.length]], e);
-
-  // Downward char-select without SHIFT
-  e = document.getElementById('test3');
-  clear();
-  dragSelect(e, 1, [[60,5], [60,125], [20,125]]);
-  checkText('aa\n\n\n\nB', e);
-  checkRanges([[0,4,-1,3], [4,0,-1,8], [9,0,10,2]], e);
-
-  // Upward word-select with SHIFT
-  e = document.getElementById('test3');
-  clear();
-  shiftDragSelect(e, 2, [[10,125], [60,125], [50,5]]);
-  checkText('aaaaa\n\n\n\nBBBBB' + kSpaceAfterWord, e);
-  checkRanges([[0,1,-1,3], [4,0,-1,8], [9,0,10,6 + kSpaceAfterWord.length]], e);
-
-  // Upward word-select without SHIFT
-  e = document.getElementById('test3');
-  clear();
-  dragSelect(e, 2, [[40,125], [60,125], [50,5], [30,5], [20,5]]);
-  checkText('aaaaa\n\n\n\nBBBBB' + kSpaceAfterWord, e);
-  checkRanges([[0,1,-1,3], [4,0,-1,8], [9,0,10,6 + kSpaceAfterWord.length]], e);
-
-  // Upward char-select without SHIFT
-  e = document.getElementById('test3');
-  clear();
-  dragSelect(e, 1, [[60,125], [60,125], [50,5], [30,5], [40,5]]);
-  checkText('aaa\n\n\n\nBBB', e);
-  checkRanges([[0,3,-1,3], [4,0,-1,8], [9,0,10,4]], e);
-
-  doneTest(e);
-
-
-  // ======================================================
-  // ================== shift+click tests =================
-  // ======================================================
-
-  e = document.getElementById('test1');
-  show(e);
-
-  clear();
-  init([[0,0,0,1]], e);
-  shiftClick(e, 100, 100);
-  checkText(' aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbbb', e);
-  checkRanges([[0,0,2,6]], e);
-  
-  clear();
-  init([[2,6,2,6]], e);
-  shiftClick(e, 60, 5);
-  checkText('aa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbbb', e);
-  checkRanges([[0,4,2,6]], e);
-  
-  doneTest(e);
-  e = document.getElementById('test2');
-  show(e);
-
-  clear();
-  init([[0,4,0,4]], e);
-  shiftClick(e, 100, 100);
-  checkText('cc ccccccc cccccccccccc ccccccccc\nddddd', e);
-  checkRanges([[0,4,2,6]], e);
-
-  clear();
-  init([[2,6,2,6]], e);
-  shiftClick(e, 1, 5);
-  checkText('ccccc ccccccc cccccccccccc ccccccccc\nddddd', e);
-  checkRanges([[0,1,2,6]], e);
-
-  doneTest(e);
-  e = document.getElementById('test3');
-  show(e);
-
-  clear();
-  init([[0,4,0,4]], e);
-  shiftClick(e, 70, 125);
-  checkText('aa\n\n\n\nBBB', e);
-  checkRanges([[0,4,-1,3], [4,0,-1,8], [9,0,10,4]], e);
-
-  // ======================================================
-  // ================== Kbd command tests =================
-  // ======================================================
-
-  doneTest(e);
-  e = document.getElementById('test1');
-  show(e);
-
-  clear();
-  init([[0,0,0,0]], e);
-  repeatShiftKey("VK_RIGHT", 45);
-  checkText(' aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbb', e);
-  checkRanges([[0,0,2,4]], e);
-
-  clear();
-  init([[2,5,2,5]], e);
-  repeatShiftKey("VK_LEFT", 45);
-  checkText('aaaaa aaaaa aaaaaaa aaaaaaaa aaaaaaaa\nbbbb', e);
-  checkRanges([[0,1,2,5]], e);
-
-  doneTest(e);
-  e = document.getElementById('test2');
-  show(e);
-
-  clear();
-  init([[0,0,0,0]], e);
-  repeatShiftKey("VK_RIGHT", 45);
-  checkText(' ccccc ccccccc cccccccccccc ccccccccc\ndddd', e);
-  checkRanges([[0,0,2,5]], e);
-
-  clear();
-  init([[2,6,2,6]], e);
-  repeatShiftKey("VK_LEFT", 45);
-  checkText('ccccc ccccccc cccccccccccc ccccccccc\nddddd', e);
-  checkRanges([[0,1,2,6]], e);
-
-  doneTest(e);
-  e = document.getElementById('test3');
-  show(e);
-
-  clear();
-  init([[0,0,0,0]], e);
-  repeatShiftKey("VK_RIGHT", 15);
-  checkText(' aaaaa\n\n\n\nBBB', e);
-  checkRanges([[0,0,-1,3], [4,0,-1,8], [9,0,10,4]], e);
-
-  clear();
-  init([[10,4,10,4]], e);
-  repeatShiftKey("VK_LEFT", 10);
-  checkText('aaaa\n\n\n\nBBB', e);
-  checkRanges([[0,2,-1,3], [4,0,-1,8], [9,0,10,4]], e);
-
-  clear();
-  SimpleTest.finish();
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(test);
-
-</script>
-</pre>
-</body>
-</html>
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -8554,37 +8554,22 @@ nsIFrame::GetFrameFromDirection(nsDirect
                                   aVisual && presContext->BidiEnabled(),
                                   aScrollViewStop,
                                   true,  // aFollowOOFs
                                   false  // aSkipPopupChecks
                                   );
     if (NS_FAILED(result))
       return result;
 
-    auto Advance = [&frameTraversal, aDirection] () {
-      if (aDirection == eDirNext) {
-        frameTraversal->Next();
-      } else {
-        frameTraversal->Prev();
-      }
-      return frameTraversal->CurrentItem();
-    };
-
-    traversedFrame = Advance();
-
-    if (nsIContent* content = GetContent()) {
-      // Advance until the frame is inside the same tree as 'this'.
-      for (nsIContent* traversedContent;
-           traversedFrame &&
-             !traversedFrame->IsGeneratedContentFrame() &&
-             (traversedContent = traversedFrame->GetContent()) &&
-             !nsContentUtils::IsInSameAnonymousTree(content, traversedContent);) {
-        traversedFrame = Advance();
-      }
-    }
+    if (aDirection == eDirNext)
+      frameTraversal->Next();
+    else
+      frameTraversal->Prev();
+
+    traversedFrame = frameTraversal->CurrentItem();
 
     // Skip anonymous elements, but watch out for generated content
     if (!traversedFrame ||
         (!traversedFrame->IsGeneratedContentFrame() &&
          traversedFrame->GetContent()->IsRootOfNativeAnonymousSubtree())) {
       return NS_ERROR_FAILURE;
     }
 
@@ -9461,41 +9446,33 @@ nsFrame::DoGetParentStyleContext(nsIFram
     return *aProviderFrame ? (*aProviderFrame)->StyleContext() : nullptr;
   }
   return placeholder->GetParentStyleContextForOutOfFlow(aProviderFrame);
 }
 
 void
 nsFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
 {
-  if (!aFrame || !*aFrame) {
+  if (!aFrame || !*aFrame)
     return;
-  }
-
-  nsIFrame* child = *aFrame;
-  while (true) {
+  nsIFrame *child = *aFrame;
+  //if we are a block frame then go for the last line of 'this'
+  while (1){
     child = child->PrincipalChildList().FirstChild();
-    if (!child) {
-      return; // done
-    }
-
-    // Ignore anonymous elements, e.g. mozTableAdd* mozTableRemove*
-    // see bug 278197 comment #12 #13 for details.
-    nsIFrame* nonAnonymousChild = nullptr;
-    const nsIContent* content;
-    while (child &&
-           (content = child->GetContent()) &&
-           !content->IsRootOfNativeAnonymousSubtree()) {
-      nonAnonymousChild = child;
-      child = child->GetNextSibling();
-    }
-    if (!nonAnonymousChild) {
-      return;
-    }
-    *aFrame = child = nonAnonymousChild;
+    if (!child)
+      return;//nothing to do
+    nsIFrame* siblingFrame;
+    nsIContent* content;
+    //ignore anonymous elements, e.g. mozTableAdd* mozTableRemove*
+    //see bug 278197 comment #12 #13 for details
+    while ((siblingFrame = child->GetNextSibling()) &&
+           (content = siblingFrame->GetContent()) &&
+           !content->IsRootOfNativeAnonymousSubtree())
+      child = siblingFrame;
+    *aFrame = child;
   }
 }
 
 void
 nsFrame::GetFirstLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
 {
   if (!aFrame || !*aFrame)
     return;
--- a/mobile/android/tests/browser/robocop/testAccessibleCarets.html
+++ b/mobile/android/tests/browser/robocop/testAccessibleCarets.html
@@ -34,17 +34,17 @@
 
     <br>
     <input id="LTRphone" style="direction: ltr;" size="40"
       value="09876543210 .-.)(wp#*1034103410341034X">
     <br>
     <input id="RTLphone" style="direction: rtl;" size="40"
       value="התקשר +972 3 7347514 במשך זמן טוב">
     <br><br><br>
-    <div>x<input value="DDs12">3 45<em id="bug1265750"> 678</em> 90</div>
+    <div><input value="DDs12">3 45<em id="bug1265750"> 678</em> 90</div>
 
     <br><br><br>
     <tr><td>cell</td><td><p id="bug1338445-1">012345p</p></td><td>cell</td></tr>
     <br><br><br>
     <div><p>p12</p><p id="bug1338445-2">p34</p><p>p56</p></div>
     </tr>
   </body>
 </html>
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -471,16 +471,28 @@ NS_MakeAbsoluteURI(nsAString       &resu
 }
 
 int32_t
 NS_GetDefaultPort(const char *scheme,
                   nsIIOService *ioService /* = nullptr */)
 {
   nsresult rv;
 
+  // Getting the default port through the protocol handler has a lot of XPCOM
+  // overhead involved.  We optimize the protocols that matter for Web pages
+  // (HTTP and HTTPS) by hardcoding their default ports here.
+  if (strncmp(scheme, "http", 4) == 0) {
+    if (scheme[4] == 's' && scheme[5] == '\0') {
+      return 443;
+    }
+    if (scheme[4] == '\0') {
+      return 80;
+    }
+  }
+
   nsCOMPtr<nsIIOService> grip;
   net_EnsureIOService(&ioService, grip);
   if (!ioService)
       return -1;
 
   nsCOMPtr<nsIProtocolHandler> handler;
   rv = ioService->GetProtocolHandler(scheme, getter_AddRefs(handler));
   if (NS_FAILED(rv))
--- a/uriloader/exthandler/nsHandlerService-json.js
+++ b/uriloader/exthandler/nsHandlerService-json.js
@@ -117,21 +117,33 @@ HandlerService.prototype = {
   },
 
   /**
    * Injects new default protocol handlers if the version in the preferences is
    * newer than the one in the data store. If we just imported data from the RDF
    * back-end, we only need to update the version in the data store.
    */
   _injectDefaultProtocolHandlersIfNeeded(alreadyInjected) {
+    let prefsDefaultHandlersVersion;
     try {
+      prefsDefaultHandlersVersion = Services.prefs.getComplexValue(
+        "gecko.handlerService.defaultHandlersVersion",
+        Ci.nsIPrefLocalizedString);
+    } catch (ex) {
+      if (ex instanceof Components.Exception &&
+          ex.result == Cr.NS_ERROR_UNEXPECTED) {
+        // This platform does not have any default protocol handlers configured.
+        return;
+      }
+      throw ex;
+    }
+
+    try {
+      prefsDefaultHandlersVersion = Number(prefsDefaultHandlersVersion.data);
       let locale = Services.locale.getAppLocaleAsLangTag();
-      let prefsDefaultHandlersVersion = Number(Services.prefs.getComplexValue(
-        "gecko.handlerService.defaultHandlersVersion",
-        Ci.nsIPrefLocalizedString).data);
 
       let defaultHandlersVersion =
           this._store.data.defaultHandlersVersion[locale] || 0;
       if (defaultHandlersVersion < prefsDefaultHandlersVersion) {
         if (!alreadyInjected) {
           this._injectDefaultProtocolHandlers();
         }
         this._store.data.defaultHandlersVersion[locale] =