Closed Bug 1241046 Opened 4 years ago Closed 4 years ago
Editing an unmatched rule selector to match the current element doesn't do the right thing
58 bytes, text/x-review-board-request
STR: - Go to about:home - Open the inspector with the rule-view visible - In the rule-view, click on the 'html' rule selector and change it to 'span' - This makes the rule not match the current element, so it gets greyed-out as you would expect - Now edit again the same select and change it back to 'html' => Expected: the rule now matches the current element and should go back to its original styling (not greyed-out). => Actual: the rule's styling remains unchanged. The actual CSS rule is changed correctly on the content page though.
The problem occurs here: https://dxr.mozilla.org/mozilla-central/source/devtools/server/actors/styles.js#1637 For example if the node is the <body> and value is "html": >> node.rawNode <body dir="ltr" narrow="true"> >> node.rawNode.matches(value) false
This seems to do the right thing. I'll write a test next week sometime.
Triaging this as a P2 as quite important but not crashing the tools either. Tom, it looks like you had uploaded a patch that worked a couple of months ago. Do you still intend to work on this?
Priority: -- → P2
Yeah. I'm sorry about the delay here, I got sucked in by network throttling. I'll write the test this week.
Review commit: https://reviewboard.mozilla.org/r/45837/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/45837/
Attachment #8740614 - Flags: review?(pbrosset)
Attachment #8711159 - Attachment is obsolete: true
Attachment #8740614 - Flags: review?(pbrosset) → review+
Comment on attachment 8740614 [details] MozReview Request: Bug 1241046 - find inherited entry in modifySelector2; r=pbro https://reviewboard.mozilla.org/r/45837/#review42915 Looks good to me. Thanks for the very clear test. ::: devtools/client/inspector/rules/test/browser_rules_edit-selector_08.js:29 (Diff revision 1) > + > + info("Selecting the test element"); > + yield selectNode("#testid", inspector); > + > + let idRuleEditor = getRuleViewRuleEditor(view, 2); > + info("FOCUS WAT " + idRuleEditor.selectorText); This looks like a log you forgot to remove.
Comment on attachment 8740614 [details] MozReview Request: Bug 1241046 - find inherited entry in modifySelector2; r=pbro Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45837/diff/1-2/
Attachment #8740614 - Attachment description: MozReview Request: Bug 1241046 - find inherited entry in modifySelector2; r?pbro → MozReview Request: Bug 1241046 - find inherited entry in modifySelector2; r=pbro
You need to log in before you can comment on or make changes to this bug.