Closed Bug 1182083 Opened 9 years ago Closed 9 years ago

In the Network tab of the Developer Panel, the Preview tab is blank despite there being HTML in the Response tab.

Categories

(DevTools :: Netmonitor, defect)

39 Branch
x86_64
macOS
defect
Not set
major

Tracking

(firefox42 fixed)

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: andrew, Assigned: sjakthol)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324

Steps to reproduce:

Perform a POST or GET request to a resource (via Angular HTTP in my case). The resource has a problem (It's not been finished yet!) so it replies with HTML errors instead of JSON. This bug also applies to Firefox Developer Edition. I have only tested it on OSX.


Actual results:

The Preview window of the Network panel is blank. It used to work and generate the rendered HTML of the error. Now there is nothing. It looks like a regression of 956357.


Expected results:

It should have displayed the HTML of the error message that I got through response in the preview, as trying to work out what went wrong from just the raw HTML is difficult.
Severity: normal → major
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64
Could you attach a minimal testcase showing up the issue, please.
Flags: needinfo?(andrew)
The issue appears to be with any malformed HTML.

As an example open the network panel and then go to http://www.cs.sfu.ca/~ggbaker/165-draft/files/invalid.html

You'll see that there is the HTML in the response tab, but the preview tab is entirely empty.
Flags: needinfo?(andrew)
Regression range:
good=2015-01-19
bad=2015-01-20
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6446c26b45f9&tochange=93f526d85b47
Component: Untriaged → Developer Tools: Netmonitor
Pushlog:
https://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=27b7a7867e1c&tochange=942bd6bf0cd0

Triggered by:
a7de66143752	Patrick Brosset — Bug 1122507 - Fix the way the new network security tab toggles in the network panel now that we have the allTabs menu. r=past
Blocks: 1122507
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(pbrosset)
This may be a duplicate of bug 1175427.
See Also: → 1175427
I unfortunately won't have time to take a look at this in the coming weeks. Transferring to Panos who, I think, should have some time next week.
Flags: needinfo?(pbrosset) → needinfo?(past)
So, I did have some time to take a quick look.

In the netmonitor sidebar, the #preview-tabpanel element is present and contains the expected HTML response.

If I compare this with another test case that works correctly, the only difference I see is that the "security" tab is shown when it works, and not shown when it fails.
In fact, I managed to have an empty preview tab even with a well-formed HTML page served by HTTP (not HTTPS):

- open http://firefox-dev.tools/
- open the netmonitor and reload
- try to display the preview tab

So my take on this is that the new security tab is somehow messing with the 'selectedIndex' of the tabpanel.
When clicking on the "preview" tab, the <tabpanels> gets a selectedIndex of 6, which is the index of the security tab, not the one of the preview tab. So it should be 7 instead.
This confirms that it's due to bug 1122507, but only started to occur when the security tab was added (which might have been at the same time, I don't remember).

If the above is correct, then the code here is to blame: https://dxr.mozilla.org/mozilla-central/source/browser/devtools/framework/sidebar.js#352
Patrick's analysis seems plausible and corroborates the observations made in bug 1175427 and bug 1164196. Unfortunately I won't have time to look into this in the near future, but perhaps Sami can?
Flags: needinfo?(past) → needinfo?(sjakthol)
I'll take a look. I remember when adding the security tab there was similar issues that we resolved by changing the order of the tabs (i.e. Security before Preview). Too bad we never got to bottom of the issues then...
Flags: needinfo?(sjakthol)
Gah, this is the very same issue I saw when working on bug 932179. I tried to argue that the way netmonitor hides the __tabpanel__ is wrong (bug 932179 comment 11) but eventually lost my case.

Here's what MDN says [1] for hiding tabpanels inside a tabbox:
> Panels should never be hidden;

Let me repeat that since last time I made the same quote made no difference:
> Panels should never be hidden;

That's pretty explicit and leaves little to doubt. And indeed, if the tabpanel is __not__ hidden, the previews is shown. Bugs 1164196 and 1175427 are duplicates. Since this bug has the most information, I'll do the work on this bug.

I'll attach a patch one I get it trough try and fix tests that might rely on this incorrect behavior.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/tabpanels
Assignee: nobody → sjakthol
Status: NEW → ASSIGNED
Here's the patch. Previews are once again visible on non-https sites.

Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8775b5db7cc0
Attachment #8638870 - Flags: review?(vporof)
Attachment #8638870 - Flags: review?(vporof) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d73454e9c889
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: