Closed Bug 1184628 Opened 9 years ago Closed 9 years ago

[Rule View] Editing a disabled property should enable it

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: gl, Assigned: gl)

References

Details

(Whiteboard: [rule-view-correctness])

Attachments

(1 file, 7 obsolete files)

When we are editing any property, we are previewing the changes. It is especially strange when editing a disabled property to see the previewed changes as well. Chrome currently will enable a modified property even if it was disabled as long as the new value != old value.

I propose we should do the following for close to chrome parity:
(1) Hide the checkbox for enabling/disabling property when editing the property
(2) Enable the property if the property was modified
Assignee: nobody → gabriel.luong
Status: NEW → ASSIGNED
Attached patch 1184628.patch (obsolete) — Splinter Review
Attached patch 1184628.patch (obsolete) — Splinter Review
Attachment #8634805 - Attachment is obsolete: true
Depends on: 1186138
Attached patch 1184628.patch [1.0] (obsolete) — Splinter Review
Attachment #8636340 - Attachment is obsolete: true
Attachment #8637572 - Flags: review?(bgrinstead)
Attachment #8637572 - Attachment description: 1184628.patch → 1184628.patch [1.0]
Attachment #8637572 - Flags: review?(bgrinstead)
Attached patch 1184628.patch [2.0] (obsolete) — Splinter Review
Attachment #8637572 - Attachment is obsolete: true
Attachment #8638431 - Flags: review?(bgrinstead)
Attached patch 1184628.patch [3.0] (obsolete) — Splinter Review
Attachment #8638431 - Attachment is obsolete: true
Attachment #8638431 - Flags: review?(bgrinstead)
Attachment #8638827 - Flags: review?(bgrinstead)
Attached patch 1184628.patch [4.0] (obsolete) — Splinter Review
Attachment #8638827 - Attachment is obsolete: true
Attachment #8638827 - Flags: review?(bgrinstead)
Attachment #8638845 - Flags: review?(bgrinstead)
Attached patch 1184628.patch [5.0] (obsolete) — Splinter Review
Attachment #8638845 - Attachment is obsolete: true
Attachment #8638845 - Flags: review?(bgrinstead)
Attachment #8639088 - Flags: review?(bgrinstead)
See Also: → 1188125
Whiteboard: [rule-view-correctness]
Comment on attachment 8639088 [details] [diff] [review]
1184628.patch [5.0]

Review of attachment 8639088 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, just a few notes

::: browser/devtools/styleinspector/test/browser_ruleview_edit-property_05.js
@@ +3,5 @@
> + http://creativecommons.org/publicdomain/zero/1.0/ */
> +
> +"use strict";
> +
> +// Tests that a disabled property is re-enable if the property name or value is

"re-enabled"

@@ +30,5 @@
> +  info("Disabling background-color property");
> +  propEditor.enable.click();
> +  yield ruleEditor.rule._applyingModifications;
> +
> +  let newValue = yield executeInContent("Test:GetRulePropertyValue", {

I'd extract this into a helper for this test just to make it a bit easier to read, something like:

function* getRulePropertyValue(name) {
  let newValue = yield executeInContent("Test:GetRulePropertyValue", {
    styleSheetIndex: 0,
    ruleIndex: 0,
    name: name
  });
  return newValue;
}

::: browser/devtools/styleinspector/test/browser_ruleview_edit-property_06.js
@@ +29,5 @@
> +  let target = getNode("body");
> +  let ruleEditor = getRuleViewRuleEditor(view, 1);
> +  let propEditor = ruleEditor.rule.textProps[0].editor;
> +
> +  is(content.getComputedStyle(target).backgroundColor, "rgb(0, 128, 0)",

Calls to content.getComputedStyle in all tests should be replaced with the message Test:GetComputedStylePropertyValue - https://dxr.mozilla.org/mozilla-central/source/browser/devtools/styleinspector/test/doc_frame_script.js#85
Attachment #8639088 - Flags: review?(bgrinstead)
Attachment #8639088 - Attachment is obsolete: true
Attachment #8639610 - Flags: review?(bgrinstead)
Attachment #8639610 - Flags: review?(bgrinstead) → review+
https://hg.mozilla.org/mozilla-central/rev/2316676f94d5
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: