Closed Bug 1173298 Opened 9 years ago Closed 9 years ago

Add rule button should be disabled for anonymous elements or non-element nodes

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox41 fixed)

RESOLVED FIXED
Firefox 41
Tracking Status
firefox41 --- fixed

People

(Reporter: ntim, Assigned: ntim)

References

Details

Attachments

(1 file, 3 obsolete files)

      No description provided.
Attached patch Patch (obsolete) — Splinter Review
Try push in previous comment
Assignee: nobody → ntim.bugs
Status: NEW → ASSIGNED
Attachment #8617859 - Flags: review?(bgrinstead)
Attached patch Patch v1.1 (obsolete) — Splinter Review
Small change in test.
Attachment #8617859 - Attachment is obsolete: true
Attachment #8617859 - Flags: review?(bgrinstead)
Attachment #8617860 - Flags: review?(bgrinstead)
Comment on attachment 8617860 [details] [diff] [review]
Patch v1.1

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

Looks good, would just like to see the test expanded to cover anonymous elements

::: browser/devtools/styleinspector/test/browser_ruleview_add-rule_04.js
@@ +3,5 @@
> + http://creativecommons.org/publicdomain/zero/1.0/ */
> +
> +"use strict";
> +
> +// Tests the behaviour of adding a new rule to the rule view and the

Please update this comment to reflect what the test is doing

@@ +31,5 @@
> +  ok(view.addRuleButton.disabled, "Add rule button should be disabled");
> +
> +  info("Selecting a real element");
> +  yield selectNode(node, inspector);
> +  ok(!view.addRuleButton.disabled, "Add rule button should be enabled");

You can also test an anonymous child by doing something like:

  <style type="text/css">
    #pseudo::before {
      content: "before";
    }
  </style>
  <div id="pseudo"><span></span></div>

  let pseudo = yield getNodeFront("#pseudo", inspector);
  let children = yield inspector.walker.children(pseudo);
  let before = children.nodes[0];

  // select node, check disabled state on button
Attachment #8617860 - Flags: review?(bgrinstead) → feedback+
Attached patch Patch v2 (obsolete) — Splinter Review
Haven't ran the test locally yet (Firefox is still building)
Attachment #8617860 - Attachment is obsolete: true
Attachment #8620376 - Flags: review?(bgrinstead)
(In reply to Tim Nguyen [:ntim] from comment #6)
> Haven't ran the test locally yet (Firefox is still building)
Passes fine locally.
Comment on attachment 8620376 [details] [diff] [review]
Patch v2

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

We should have some additional styling for disabled .devtools-button elements that are just using an icon.  Can't tell by looking at it that it's disabled.   Maybe some opacity on devtools-button[disabled]::before... what do you think?
Attachment #8620376 - Flags: review?(bgrinstead) → review+
Attached patch Patch v2.1Splinter Review
Added opacity: 0.5; for disabled buttons.
Attachment #8620376 - Attachment is obsolete: true
Attachment #8620453 - Flags: review+
Keywords: checkin-needed
Green try in comment 5
https://hg.mozilla.org/mozilla-central/rev/7517bf3c8b5c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 41
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: