Closed Bug 834187 Opened 12 years ago Closed 12 years ago

[Computed view] Restore processing of namespaced type selectors e.g. :not(svg|a)

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: miker, Assigned: miker)

References

Details

Attachments

(2 files, 3 obsolete files)

In bug 832980 we decided to skip CSS selectors which contain namespaced type selectors e.g. :not(svg|a). This is because element.mozMatchesSelector(selector.text) raises an exception if we pass it one of these selectors.

Once we have an API from platform we need to make these rules visible again.
Blocks: 832980
No longer depends on: 832980
Attached patch Patch (obsolete) (deleted) — Splinter Review
Changes that take advantage of the new API.
Attachment #707681 - Flags: review?(jwalker)
No longer depends on: 700061
Attached patch Patch v2 (obsolete) (deleted) — Splinter Review
Fixed failing specificity test
Attachment #707681 - Attachment is obsolete: true
Attachment #707681 - Flags: review?(jwalker)
Attachment #708146 - Flags: review?(jwalker)
Whiteboard: [has-patch]
Comment on attachment 708146 [details] [diff] [review]
Patch v2

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

::: browser/devtools/styleinspector/CssLogic.jsm
@@ +470,5 @@
>  
>        rule.selectors.forEach(function (aSelector) {
>          if (aSelector._matchId !== this._matchId &&
> +           (aSelector.elementStyle ||
> +            this._selectorMatchesElement(rule._domRule, aSelector.selectorIndex))) {

It feels like we're invading someone else's _privates here. Perhaps this should be public?

::: browser/devtools/styleinspector/CssRuleView.jsm
@@ +1354,5 @@
>    this._create();
>  }
>  
>  RuleEditor.prototype = {
> +  domUtils: Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils),

Should this be a member of RuleEditor? Isn't it a jsm local variable declared at the top of the file?
Same for CssLogic.jsm
Attachment #708146 - Flags: review?(jwalker) → review+
Blocks: 836233
Attached patch Patch v3 (obsolete) (deleted) — Splinter Review
(In reply to Joe Walker [:jwalker] from comment #4)
> Comment on attachment 708146 [details] [diff] [review]
> Patch v2
> 
> Review of attachment 708146 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: browser/devtools/styleinspector/CssLogic.jsm
> @@ +470,5 @@
> >  
> >        rule.selectors.forEach(function (aSelector) {
> >          if (aSelector._matchId !== this._matchId &&
> > +           (aSelector.elementStyle ||
> > +            this._selectorMatchesElement(rule._domRule, aSelector.selectorIndex))) {
> 
> It feels like we're invading someone else's _privates here. Perhaps this
> should be public?
> 

It is fiddling with it's own privates but I have made it public instead.

> ::: browser/devtools/styleinspector/CssRuleView.jsm
> @@ +1354,5 @@
> >    this._create();
> >  }
> >  
> >  RuleEditor.prototype = {
> > +  domUtils: Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils),
> 
> Should this be a member of RuleEditor? Isn't it a jsm local variable
> declared at the top of the file?
> Same for CssLogic.jsm

Agreed, I have made them lazy getters.
Attachment #708146 - Attachment is obsolete: true
Whiteboard: [has-patch] → [land-in-fx-team]
Need to wait for a blocker.
Whiteboard: [land-in-fx-team] → [has-patch]
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Comment on attachment 709739 [details] [diff] [review]
Patch v3

[Approval Request Comment]
Regression caused by (bug #): 
User impact if declined: 
Testing completed (on m-c, etc.): 
Risk to taking this patch (and alternatives if risky):

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: 
Testing completed (on m-c, etc.): 
Risk to taking this patch (and alternatives if risky): 
String or UUID changes made by this patch:
Attachment #709739 - Flags: approval-mozilla-release?
Attachment #709739 - Flags: approval-mozilla-beta?
Attachment #709739 - Flags: approval-mozilla-aurora?
[Approval Request Comment]
Regression caused by (bug #): ?
User impact if declined: Browser styles in devtools computed view throw error and display template content.
Testing completed (on m-c, etc.): yes
Risk to taking this patch (and alternatives if risky): None, this source code has not changed in a long time.
Comment on attachment 709739 [details] [diff] [review]
Patch v3

I don't think we want that in release, and merging is soon.
Attachment #709739 - Flags: approval-mozilla-release?
Really? Release version is broken but if we are not fixing it I am more than happy.
Attachment #709739 - Flags: approval-mozilla-beta?
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #10)
> Really? Release version is broken but if we are not fixing it I am more than
> happy.

I don't think shipping a chemspill release for such a bug is on the table.
Blocks: :PaulFx21
Comment on attachment 709739 [details] [diff] [review]
Patch v3

This is old code, existing issue for many releases - we'll wait and let it ride the trains, there's no clear impetus here for uplift.
Attachment #709739 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Will land after the next m-c -> fx-team merge
Whiteboard: [has-patch] → [land-in-fx-team][wait-for-m-c-merge]
Attached patch rebase (deleted) — Splinter Review
Attachment #709739 - Attachment is obsolete: true
Whiteboard: [land-in-fx-team][wait-for-m-c-merge] → [fixed-in-fx-team]
This patch removes `domUtils` definition but uses it in `selectorMatchesElement`.
We use a lazy getter instead of the instance member.
Attached patch Test fix (deleted) — Splinter Review
Fixes domUtils reference in tests
https://hg.mozilla.org/mozilla-central/rev/53d22797d694
https://hg.mozilla.org/mozilla-central/rev/63f8d59ad8b9
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 22
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: