Backed out changeset e62454ab7c04 (bug 893677) for mochitest-bc timeouts.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 12 Sep 2013 18:09:56 -0400
changeset 159730 6d0aeb76987988454a80929ed8664b257f4358f4
parent 159729 7b346620c74354b1adc932cd119ea4eecce4a660
child 159779 cdfeb4aaea9ca1bcb3e208e743c0d0c37ae38ba8
child 159877 57249b332b69abab1f3a8834e58aac74df18a7bf
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs893677
milestone26.0a1
backs oute62454ab7c0421cac581b50905a8f6425cc27367
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e62454ab7c04 (bug 893677) for mochitest-bc timeouts.
browser/devtools/markupview/markup-view.js
browser/devtools/markupview/test/browser_inspector_markup_edit.html
browser/devtools/markupview/test/browser_inspector_markup_edit.js
--- a/browser/devtools/markupview/markup-view.js
+++ b/browser/devtools/markupview/markup-view.js
@@ -5,19 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {Cc, Cu, Ci} = require("chrome");
 
 // Page size for pageup/pagedown
 const PAGE_SIZE = 10;
 const PREVIEW_AREA = 700;
 const DEFAULT_MAX_CHILDREN = 100;
-const COLLAPSE_ATTRIBUTE_LENGTH = 120;
-const COLLAPSE_DATA_URL_REGEX = /^data.+base64/;
-const COLLAPSE_DATA_URL_LENGTH = 60;
 
 const {UndoStack} = require("devtools/shared/undo");
 const {editableField, InplaceEditor} = require("devtools/shared/inplace-editor");
 const promise = require("sdk/core/promise");
 
 Cu.import("resource://gre/modules/devtools/LayoutHelpers.jsm");
 Cu.import("resource://gre/modules/devtools/Templater.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
@@ -1363,26 +1360,18 @@ ElementEditor.prototype = {
     // Remove the old version of this attribute from the DOM.
     let oldAttr = this.attrs[aAttr.name];
     if (oldAttr && oldAttr.parentNode) {
       oldAttr.parentNode.removeChild(oldAttr);
     }
 
     this.attrs[aAttr.name] = attr;
 
-    let collapsedValue;
-    if (aAttr.value.match(COLLAPSE_DATA_URL_REGEX)) {
-      collapsedValue = truncateString(aAttr.value, COLLAPSE_DATA_URL_LENGTH);
-    }
-    else {
-      collapsedValue = truncateString(aAttr.value, COLLAPSE_ATTRIBUTE_LENGTH);
-    }
-
     name.textContent = aAttr.name;
-    val.textContent = collapsedValue;
+    val.textContent = aAttr.value;
 
     return attr;
   },
 
   /**
    * Parse a user-entered attribute string and apply the resulting
    * attributes to the node.  This operation is undoable.
    *
@@ -1473,25 +1462,16 @@ ElementEditor.prototype = {
     }).then(null, console.error);
   }
 };
 
 function nodeDocument(node) {
   return node.ownerDocument || (node.nodeType == Ci.nsIDOMNode.DOCUMENT_NODE ? node : null);
 }
 
-function truncateString(str, maxLength) {
-  if (str.length <= maxLength) {
-    return str;
-  }
-
-  return str.substring(0, Math.ceil(maxLength / 2)) +
-         "…" +
-         str.substring(str.length - Math.floor(maxLength / 2));
-}
 /**
  * Parse attribute names and values from a string.
  *
  * @param  {String} attr
  *         The input string for which names/values are to be parsed.
  * @param  {HTMLDocument} doc
  *         A document that can be used to test valid attributes.
  * @return {Array}
--- a/browser/devtools/markupview/test/browser_inspector_markup_edit.html
+++ b/browser/devtools/markupview/test/browser_inspector_markup_edit.html
@@ -37,12 +37,10 @@
     <div id="node23"></div>
     <div id="node24"></div>
     <div id="retag-me">
       <div id="retag-me-2"></div>
     </div>
     <div id="node25"></div>
     <div id="node26" style='background-image: url("moz-page-thumb://thumbnail?url=http%3A%2F%2Fwww.mozilla.org%2F");'></div>
     <div id="node27" class="Double &quot; and single &apos;"></div>
-    <img id="node-data-url" />
-    <div id="node-data-url-style"></div>
   </body>
 </html>
--- a/browser/devtools/markupview/test/browser_inspector_markup_edit.js
+++ b/browser/devtools/markupview/test/browser_inspector_markup_edit.js
@@ -29,25 +29,16 @@ function test() {
   waitForExplicitFinish();
 
   // Will hold the doc we're viewing
   let doc;
 
   // Holds the MarkupTool object we're testing.
   let markup;
 
-  let LONG_ATTRIBUTE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-  let LONG_ATTRIBUTE_COLLAPSED = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEF\u2026UVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
-  let DATA_URL_INLINE_STYLE='color: red; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC");';
-  let DATA_URL_INLINE_STYLE_COLLAPSED='color: red; background: url("data:image/png;base64,iVBORw0KG\u2026NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC");';
-
-  let DATA_URL_ATTRIBUTE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC";
-  let DATA_URL_ATTRIBUTE_COLLAPSED = "data:image/png;base64,iVBORw0K\u20269/AFGGFyjOXZtQAAAAAElFTkSuQmCC";
-
   /**
    * Edit a given editableField
    */
   function editField(aField, aValue)
   {
     aField.focus();
     EventUtils.sendKey("return", inspector.panelWin);
     let input = inplaceEditor(aField).input;
@@ -209,138 +200,16 @@ function test() {
         assertAttributes(doc.querySelector("#node24"), {
           id: "node24",
           class: ""
         });
       }
     },
 
     {
-      desc: "Try to add long attribute to make sure it is collapsed in attribute editor.",
-      before: function() {
-        assertAttributes(doc.querySelector("#node24"), {
-          id: "node24",
-          class: ""
-        });
-      },
-      execute: function(after) {
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node24")).editor;
-        let attr = editor.newAttr;
-        editField(attr, 'data-long="'+LONG_ATTRIBUTE+'"');
-        inspector.once("markupmutation", after);
-      },
-      after: function() {
-
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node24")).editor;
-        let visibleAttrText = editor.attrs["data-long"].querySelector(".attrvalue").textContent;
-        is (visibleAttrText, LONG_ATTRIBUTE_COLLAPSED)
-
-        assertAttributes(doc.querySelector("#node24"), {
-          id: "node24",
-          class: "",
-          'data-long':LONG_ATTRIBUTE
-        });
-      }
-    },
-
-    {
-      desc: "Try to modify the collapsed long attribute, making sure it expands.",
-      before: function() {
-        assertAttributes(doc.querySelector("#node24"), {
-          id: "node24",
-          class: "",
-          'data-long': LONG_ATTRIBUTE
-        });
-      },
-      execute: function(after) {
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node24")).editor;
-        let attr = editor.attrs["data-long"].querySelector(".editable");
-
-        // Check to make sure it has expanded after focus
-        attr.focus();
-        EventUtils.sendKey("return", inspector.panelWin);
-        let input = inplaceEditor(attr).input;
-        is (input.value, 'data-long="'+LONG_ATTRIBUTE+'"');
-        EventUtils.sendKey("escape", inspector.panelWin);
-
-        editField(attr, input.value  + ' data-short="ABC"');
-        inspector.once("markupmutation", after);
-      },
-      after: function() {
-
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node24")).editor;
-        let visibleAttrText = editor.attrs["data-long"].querySelector(".attrvalue").textContent;
-        is (visibleAttrText, LONG_ATTRIBUTE_COLLAPSED)
-
-        assertAttributes(doc.querySelector("#node24"), {
-          id: "node24",
-          class: "",
-          'data-long': LONG_ATTRIBUTE,
-          "data-short": "ABC"
-        });
-      }
-    },
-
-    {
-      desc: "Try to add long data URL to make sure it is collapsed in attribute editor.",
-      before: function() {
-        assertAttributes(doc.querySelector("#node-data-url"), {
-          id: "node-data-url"
-        });
-      },
-      execute: function(after) {
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node-data-url")).editor;
-        let attr = editor.newAttr;
-        editField(attr, 'src="'+DATA_URL_ATTRIBUTE+'"');
-        inspector.once("markupmutation", after);
-      },
-      after: function() {
-
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node-data-url")).editor;
-        let visibleAttrText = editor.attrs["src"].querySelector(".attrvalue").textContent;
-        is (visibleAttrText, DATA_URL_ATTRIBUTE_COLLAPSED);
-
-        let node = doc.querySelector("#node-data-url");
-        is (node.width, 16, "Image width has been set after data url src.");
-        is (node.height, 16, "Image height has been set after data url src.");
-
-        assertAttributes(node, {
-          id: "node-data-url",
-          "src": DATA_URL_ATTRIBUTE
-        });
-      }
-    },
-
-    {
-      desc: "Try to add long data URL to make sure it is collapsed in attribute editor.",
-      before: function() {
-        assertAttributes(doc.querySelector("#node-data-url-style"), {
-          id: "node-data-url-style"
-        });
-      },
-      execute: function(after) {
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node-data-url-style")).editor;
-        let attr = editor.newAttr;
-        editField(attr, "style='"+DATA_URL_INLINE_STYLE+"'");
-        inspector.once("markupmutation", after);
-      },
-      after: function() {
-
-        let editor = getContainerForRawNode(markup, doc.querySelector("#node-data-url-style")).editor;
-        let visibleAttrText = editor.attrs["style"].querySelector(".attrvalue").textContent;
-        is (visibleAttrText, DATA_URL_INLINE_STYLE_COLLAPSED)
-
-        assertAttributes(doc.querySelector("#node-data-url-style"), {
-          id: "node-data-url-style",
-          'style':DATA_URL_INLINE_STYLE
-        });
-      }
-    },
-
-    {
       desc: "Edit text",
       before: function() {
         let node = doc.querySelector('.node6').firstChild;
         is(node.nodeValue, "line6", "Text should be unchanged");
       },
       execute: function(after) {
         inspector.once("markupmutation", after);
         let node = doc.querySelector('.node6').firstChild;