Closed
Bug 832980
Opened 11 years ago
Closed 11 years ago
[Computed view] we see the template in the UI
Categories
(DevTools :: Inspector, defect, P1)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 834187
People
(Reporter: paul, Assigned: miker)
References
Details
(Whiteboard: [blocked])
Attachments
(1 file, 2 obsolete files)
102.07 KB,
image/png
|
Details |
Some errors in the console (there are hundreds): Expected selector.openStyleEditor to resolve to a function, but got undefined (In: div#templateMatchedSelectors > table > loop > foreach > 6 > tr > td > a > onclick) Expected selector.maybeOpenStyleEditor to resolve to a function, but got undefined (In: div#templateMatchedSelectors > table > loop > foreach > 6 > tr > td > a > onkeydown) "selectorInfo" is undefined (In: div#templateMatchedSelectors > table > loop > foreach > 6 > tr > td > a > title > ${selector.selectorInfo.href}) Template error evaluating 'selector.humanReadableText(__element)' (In: div#templateMatchedSelectors > table > loop > foreach > 7 > tr > td > #text > ${selector.humanReadableText(__element)} ) TypeError: selector.humanReadableText is not a function
Reporter | ||
Comment 1•11 years ago
|
||
STR: - go to paulrouget.com - inspector the round top left image - use the computed view - uncheck Only User Styles - unfold -moz-box-sizing It doesn't happen all the time.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Reporter | ||
Updated•11 years ago
|
Blocks: DevToolsPaperCuts
Assignee | ||
Comment 2•11 years ago
|
||
That was a difficult one to hunt down: http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#1387 contains the following: 1387 InsertRuleInternal(NS_LITERAL_STRING("*|*:-moz-any-link:not(svg|a){text-decoration:underline}"), 1388 sInsertPrefSheetRulesAt, &index); As of http://dev.w3.org/csswg/selectors4/#typenmsp using type selectors in :not() is fine and this is supported by Fx as illustrated by the preceding code. Unfortunately, the following works just fine: document.body.mozMatchesSelector("*|*:-moz-any-link:not(a)") // Returns false But as soon as we add the svg namespace it fails: document.body.mozMatchesSelector("*|*:-moz-any-link:not(svg|a)") // Exception: An invalid or illegal string was specified This exception then stops the template from processing.
Priority: -- → P1
Reporter | ||
Comment 3•11 years ago
|
||
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #2) > But as soon as we add the svg namespace it fails: > document.body.mozMatchesSelector("*|*:-moz-any-link:not(svg|a)") // > Exception: An invalid or illegal string was specified > > This exception then stops the template from processing. It doesn't fail because of svg, it fails because it's an invalid selector. :not(svg|a) doesn't mean anything. :not(svg):not(a) is, I think, what you want.
Comment 5•11 years ago
|
||
As a workaround, why not just wrap humanReadableText in a try catch, and return something better than an error message?
Reporter | ||
Comment 6•11 years ago
|
||
(In reply to Joe Walker [:jwalker] from comment #5) > As a workaround, why not just wrap humanReadableText in a try catch, and > return something better than an error message? What if we just bail on exception for mozMatchSelector and just consider it doesn't match? It makes me sad, but I think it's the best we can do until we get a better CSS logic.
Comment 7•11 years ago
|
||
So to be clear, a simple workaround would be: CssHtmlTree.jsm:1200 /** * A localized Get localized human readable info */ humanReadableText: function SelectorView_humanReadableText(aElement) { try { if (this.tree.getRTLAttr == "rtl") { return this.selectorInfo.value + " \u2190 " + this.text(aElement); } else { return this.text(aElement) + " \u2192 " + this.selectorInfo.value; } } catch (ex) { return "Unsupported selector"; } }, We can probably do better than this, but you get the idea...
Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Joe Walker [:jwalker] from comment #7) > So to be clear, a simple workaround would be: > > CssHtmlTree.jsm:1200 > > /** > * A localized Get localized human readable info > */ > humanReadableText: function SelectorView_humanReadableText(aElement) > { > try { > if (this.tree.getRTLAttr == "rtl") { > return this.selectorInfo.value + " \u2190 " + this.text(aElement); > } else { > return this.text(aElement) + " \u2192 " + this.selectorInfo.value; > } > } > catch (ex) { > return "Unsupported selector"; > } > }, > > We can probably do better than this, but you get the idea... That wouldn't quite work as this is not where we check whether the selector matches the node. This patch dumps a warning and should be fixed (Bug 834187) once Bug 833808 is implemented.
Attachment #705823 -
Flags: review?(paul)
Assignee | ||
Comment 9•11 years ago
|
||
Removed crud
Attachment #705823 -
Attachment is obsolete: true
Attachment #705823 -
Flags: review?(paul)
Attachment #705825 -
Flags: review?(paul)
Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 705825 [details] [diff] [review] Patch v2 Actually, the patch in bug 834187 fixes this.
Attachment #705825 -
Attachment is obsolete: true
Attachment #705825 -
Flags: review?(paul)
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Updated•11 years ago
|
Whiteboard: [blocked]
Assignee | ||
Comment 11•11 years ago
|
||
Because this was fixed as part of bug 834187 I am resolving it as a duplicate.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Updated•11 years ago
|
No longer blocks: DevToolsPaperCuts
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•