Bug 1187681 - [Rule View] Ensure the property value copied also includes the priority r=mikeratcliffe

This commit is contained in:
Gabriel Luong 2015-07-26 19:37:49 -07:00
parent 85a86a8c8c
commit 4335253456
3 changed files with 33 additions and 1 deletions

View File

@ -1110,7 +1110,8 @@ TextProperty.prototype = {
*/
stringifyProperty: function() {
// Get the displayed property value
let declaration = this.name + ": " + this.editor.committed.value + ";";
let declaration = this.name + ": " + this.editor.valueSpan.textContent +
";";
// Comment out property declarations that are not enabled
if (!this.enabled) {

View File

@ -52,6 +52,20 @@ add_task(function*() {
copyRule: false
}
},
{
desc: "Test Copy Property Value with Priority",
node: ruleEditor.rule.textProps[3].editor.valueSpan,
menuItem: contextmenu.menuitemCopyPropertyValue,
expectedPattern: "#00F !important",
hidden: {
copyLocation: true,
copyPropertyDeclaration: false,
copyPropertyName: true,
copyPropertyValue: false,
copySelector: true,
copyRule: false
}
},
{
desc: "Test Copy Property Declaration",
node: ruleEditor.rule.textProps[2].editor.nameSpan,
@ -66,6 +80,20 @@ add_task(function*() {
copyRule: false
}
},
{
desc: "Test Copy Property Declaration with Priority",
node: ruleEditor.rule.textProps[3].editor.nameSpan,
menuItem: contextmenu.menuitemCopyPropertyDeclaration,
expectedPattern: "border-color: #00F !important;",
hidden: {
copyLocation: true,
copyPropertyDeclaration: false,
copyPropertyName: false,
copyPropertyValue: true,
copySelector: true,
copyRule: false
}
},
{
desc: "Test Copy Rule",
node: ruleEditor.rule.textProps[2].editor.nameSpan,
@ -74,6 +102,7 @@ add_task(function*() {
"\tcolor: #F00;[\\r\\n]+" +
"\tbackground-color: #00F;[\\r\\n]+" +
"\tfont-size: 12px;[\\r\\n]+" +
"\tborder-color: #00F !important;[\\r\\n]+" +
"}",
hidden: {
copyLocation: true,
@ -124,6 +153,7 @@ add_task(function*() {
"\t\/\\* color: #F00; \\*\/[\\r\\n]+" +
"\tbackground-color: #00F;[\\r\\n]+" +
"\tfont-size: 12px;[\\r\\n]+" +
"\tborder-color: #00F !important;[\\r\\n]+" +
"}",
hidden: {
copyLocation: true,

View File

@ -6,4 +6,5 @@ html, body, #testid {
color: #F00;
background-color: #00F;
font-size: 12px;
border-color: #00F !important;
}