Closed
Bug 1040670
Opened 10 years ago
Closed 9 years ago
[e10s] rule-view links to inline styles do not work with e10s
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(e10s+)
RESOLVED
WORKSFORME
Tracking | Status | |
---|---|---|
e10s | + | --- |
People
(Reporter: pbro, Assigned: miker)
References
Details
(Whiteboard: [e10s-m7])
Attachments
(1 file, 1 obsolete file)
4.70 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
STR: - Open a new e10s window - Navigate to this bugzilla page - Open the inspector - In the "Rules" sidebar, you should see an 'element { }' rule with a link (on the right side) that says 'inline' - Click on that link Expected: A new browser window opens up with the source code of the HTML page, containing the inline style Actual: Nothing happens In non-e10s windows, this works fine.
Reporter | ||
Comment 1•10 years ago
|
||
Seems to be caused by 'viewSourceUtils.viewSource(href, null, contentDoc, rule.line || 0);' at http://mxr.mozilla.org/mozilla-central/source/browser/devtools/styleinspector/style-inspector.js#56
Reporter | ||
Comment 2•10 years ago
|
||
Actually, I was wrong, I think it is due to this line: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/styleinspector/style-inspector.js#53 It accesses the document getter from selection.js which isn't remote safe (http://mxr.mozilla.org/mozilla-central/source/browser/devtools/framework/selection.js#153) and the following error appears in the log: this.node is null selection.js:156
Reporter | ||
Comment 3•10 years ago
|
||
A very simple fix is to stop using the selection's document getter at all and replace style-inspector.js#56 with: let contentDoc = this.inspector.panelDoc; It seems that the document being passed to 'viewSourceUtils.viewSource(...)' is used to detect the charset and is passed via 'openDialog' to 'chrome://global/content/viewSource.xul' (see http://mxr.mozilla.org/mozilla-central/source/toolkit/components/viewsource/content/viewSourceUtils.js#39) I'm not sure what this is for exactly and if using a different document will cause problems. A solution could be to load a frame script before calling 'viewSourceUtils.viewSource(...)' to get charset and isForcedCharset from the content page directly.
Updated•10 years ago
|
tracking-e10s:
--- → +
Comment 4•10 years ago
|
||
I propose getting rid of the link entirely. It opens up a view source window that is a) jarring b) not even scrolled to the line where the element is defined and c) redundant because they can see inline styles in the markup view which has the element markup clearly highlighted.
Assignee | ||
Comment 5•10 years ago
|
||
Turns out that this bug is about inline styles and not inline stylesheets. Harth is right, we should get rid of the inline link when there is no line number attached.
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Summary: [e10s] rule-view links to inline stylesheets do not work with e10s → [e10s] rule-view links to inline styles do not work with e10s
Assignee | ||
Comment 6•10 years ago
|
||
This is a really simple one. We no longer create a link next to element {} in the rule view. Try: https://tbpl.mozilla.org/?tree=Try&rev=60daa0b609ef https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=60daa0b609ef
Attachment #8508639 -
Flags: review?(bgrinstead)
Comment 7•10 years ago
|
||
Comment on attachment 8508639 [details] [diff] [review] fix-rule-view-inline-styles-1040670.patch Review of attachment 8508639 [details] [diff] [review]: ----------------------------------------------------------------- Good idea, just requesting a minor change along with a test case ::: browser/devtools/styleinspector/rule-view.js @@ +1956,5 @@ > this.rule.sheet.href : this.rule.title; > let sourceLine = this.rule.ruleLine > 0 ? ":" + this.rule.ruleLine : ""; > > + if (sourceHref === "inline" && sourceLine === "") { > + return; I think it would be good to also set the unselectable attribute on the parent node (as it does for about:PreferenceStyleSheet) since that's what the event listener is actually looking for to ignore it. Just in case (a) the parent ends up with some other content in the future or gets styled in a way that it's clickable and (b) so that we could still have a test that clicks on it and expects nothing to happen ::: browser/devtools/styleinspector/test/browser_ruleview_style-editor-link.js @@ -67,5 @@ > yield testExternalStyleSheet(view, toolbox); > }); > > -function* testInlineStyle(view, inspector) { > - info("Testing inline style"); May as well keep a test here that instead makes sure that the source label is empty and/or that clicking on it doesn't do anything
Attachment #8508639 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #7) > Comment on attachment 8508639 [details] [diff] [review] > fix-rule-view-inline-styles-1040670.patch > > Review of attachment 8508639 [details] [diff] [review]: > ----------------------------------------------------------------- > > Good idea, just requesting a minor change along with a test case > > ::: browser/devtools/styleinspector/rule-view.js > @@ +1956,5 @@ > > this.rule.sheet.href : this.rule.title; > > let sourceLine = this.rule.ruleLine > 0 ? ":" + this.rule.ruleLine : ""; > > > > + if (sourceHref === "inline" && sourceLine === "") { > > + return; > > I think it would be good to also set the unselectable attribute on the > parent node (as it does for about:PreferenceStyleSheet) since that's what > the event listener is actually looking for to ignore it. Just in case (a) > the parent ends up with some other content in the future or gets styled in a > way that it's clickable and (b) so that we could still have a test that > clicks on it and expects nothing to happen > Done... and for good measure I have also set sourceLabel.parentNode.hidden = true > ::: > browser/devtools/styleinspector/test/browser_ruleview_style-editor-link.js > @@ -67,5 @@ > > yield testExternalStyleSheet(view, toolbox); > > }); > > > > -function* testInlineStyle(view, inspector) { > > - info("Testing inline style"); > > May as well keep a test here that instead makes sure that the source label > is empty and/or that clicking on it doesn't do anything We now test for an empty source label and also that the parent is hidden. The test harness is not good at clicking something to ensure nothing happens but if the links parent is completely hidden the link is not clickable anyhow.
Attachment #8508639 -
Attachment is obsolete: true
Attachment #8508739 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 9•10 years ago
|
||
BTW: The oranges can be ignored... they are from the highlighter patch.
Comment 10•10 years ago
|
||
Comment on attachment 8508739 [details] [diff] [review] fix-rule-view-inline-styles-1040670.patch Review of attachment 8508739 [details] [diff] [review]: ----------------------------------------------------------------- Please update comment to indicate that it's hiding the links for inline styles (and it's also not specific to e10s)
Attachment #8508739 -
Flags: review?(bgrinstead) → review+
Comment 11•10 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #10) > Comment on attachment 8508739 [details] [diff] [review] > fix-rule-view-inline-styles-1040670.patch > > Review of attachment 8508739 [details] [diff] [review]: > ----------------------------------------------------------------- > > Please update comment to indicate that it's hiding the links for inline > styles (and it's also not specific to e10s) I meant commit message, not comment
Comment hidden (obsolete) |
Assignee | ||
Comment 13•10 years ago
|
||
Some earlier test(s) had not removed their observers so I am doing a try run with my fix for bug 1090913 (tests should fail when there are no passes, fails or todos) to help track the observers back to source. https://tbpl.mozilla.org/?tree=Try&rev=686ad097c520
Comment hidden (obsolete) |
Assignee | ||
Comment 15•10 years ago
|
||
Try again: https://tbpl.mozilla.org/?tree=Try&rev=bcc70ea5e68b https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=bcc70ea5e68b
Comment 17•10 years ago
|
||
devtools bugs will block the e10s merge to Aurora, but blassey would like them to be tracked by dte10s meta bug 875871, not the tracking-e10s=m6+ flag.
Updated•10 years ago
|
Whiteboard: [e10s-m6]
Updated•10 years ago
|
Whiteboard: [e10s-m6] → [e10s-m7]
Mike, this looks close to landing. What happens with a fresh try run?
Flags: needinfo?(mratcliffe)
Reporter | ||
Comment 20•9 years ago
|
||
I'll let Mike answer when he gets a chance, but I was looking at this per chance today, and it seems to work in e10s now. Clicking on the "inline" link in an e10s window opens the page's source in a new tab.
Assignee | ||
Comment 21•9 years ago
|
||
Yes, I remember that somebody fixed this and meant to hunt this bug down and close it.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(mratcliffe)
Resolution: --- → WORKSFORME
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•