зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset a31ad3a90e4a on suspicion of causing mochitest-1 and 3 permaorange
This commit is contained in:
Родитель
ec6b45a1b3
Коммит
e6d582d51e
|
@ -867,11 +867,7 @@ function ElementEditor(aContainer, aNode)
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this._applyAttributes(aVal);
|
||||
} catch (x) {
|
||||
return;
|
||||
}
|
||||
this._applyAttributes(aVal);
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
|
@ -966,16 +962,11 @@ ElementEditor.prototype = {
|
|||
this.undo.startBatch();
|
||||
|
||||
// Remove the attribute stored in this editor and re-add any attributes
|
||||
// parsed out of the input element. Restore original attribute if
|
||||
// parsing fails.
|
||||
this._removeAttribute(this.node, aAttr.name);
|
||||
try {
|
||||
this._applyAttributes(aVal, attr);
|
||||
this.undo.endBatch();
|
||||
} catch (e) {
|
||||
this.undo.endBatch();
|
||||
this.undo.undo();
|
||||
}
|
||||
// parsed out of the input element.
|
||||
this._removeAttribute(this.node, aAttr.name)
|
||||
this._applyAttributes(aVal, attr);
|
||||
|
||||
this.undo.endBatch();
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
|
@ -996,7 +987,6 @@ ElementEditor.prototype = {
|
|||
* @param Element aAttrNode the attribute editor that created this
|
||||
* set of attributes, used to place new attributes where the
|
||||
* user put them.
|
||||
* @throws SYNTAX_ERR if aValue is not well-formed.
|
||||
*/
|
||||
_applyAttributes: function EE__applyAttributes(aValue, aAttrNode)
|
||||
{
|
||||
|
@ -1006,7 +996,6 @@ ElementEditor.prototype = {
|
|||
let parseTag = (this.node.namespaceURI.match(/svg/i) ? "svg" :
|
||||
(this.node.namespaceURI.match(/mathml/i) ? "math" : "div"));
|
||||
let parseText = "<" + parseTag + " " + aValue + "/>";
|
||||
// Throws exception if parseText is not well-formed.
|
||||
dummyNode.innerHTML = parseText;
|
||||
let parsedNode = dummyNode.firstChild;
|
||||
|
||||
|
|
|
@ -33,9 +33,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="node22" class="unchanged"></div>
|
||||
<div id="node23"></div>
|
||||
<div id="node24"></div>
|
||||
<div id="retag-me">
|
||||
<div id="retag-me-2"></div>
|
||||
</div>
|
||||
|
|
|
@ -73,28 +73,6 @@ function test() {
|
|||
}
|
||||
},
|
||||
|
||||
// Try change an attribute to a badly formed string
|
||||
{
|
||||
before: function() {
|
||||
assertAttributes(doc.querySelector("#node22"), {
|
||||
id: "node22",
|
||||
class: "unchanged"
|
||||
});
|
||||
},
|
||||
execute: function() {
|
||||
let editor = markup.getContainer(doc.querySelector("#node22")).editor;
|
||||
let attr = editor.attrs["class"].querySelector(".editable");
|
||||
editField(attr, 'class="""');
|
||||
},
|
||||
after: function() {
|
||||
assertAttributes(doc.querySelector("#node22"), {
|
||||
id: "node22",
|
||||
class: "unchanged"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Remove an attribute
|
||||
{
|
||||
before: function() {
|
||||
|
@ -136,25 +114,6 @@ function test() {
|
|||
}
|
||||
},
|
||||
|
||||
// Try add a badly formed attribute by clicking the empty space after a node
|
||||
{
|
||||
before: function() {
|
||||
assertAttributes(doc.querySelector("#node23"), {
|
||||
id: "node23",
|
||||
});
|
||||
},
|
||||
execute: function() {
|
||||
let editor = markup.getContainer(doc.querySelector("#node23")).editor;
|
||||
let attr = editor.newAttr;
|
||||
editField(attr, 'class="newclass" style="""');
|
||||
},
|
||||
after: function() {
|
||||
assertAttributes(doc.querySelector("#node23"), {
|
||||
id: "node23",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Add attributes by adding to an existing attribute's entry
|
||||
{
|
||||
setup: function() {
|
||||
|
@ -181,25 +140,6 @@ function test() {
|
|||
}
|
||||
},
|
||||
|
||||
// Try add attributes by adding to an existing attribute's entry
|
||||
{
|
||||
before: function() {
|
||||
assertAttributes(doc.querySelector("#node24"), {
|
||||
id: "node24",
|
||||
});
|
||||
},
|
||||
execute: function() {
|
||||
let editor = markup.getContainer(doc.querySelector("#node24")).editor;
|
||||
let attr = editor.attrs["id"].querySelector(".editable");
|
||||
editField(attr, attr.textContent + ' class="""');
|
||||
},
|
||||
after: function() {
|
||||
assertAttributes(doc.querySelector("#node24"), {
|
||||
id: "node24",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Remove an element with the delete key
|
||||
{
|
||||
before: function() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче