Closed Bug 1733285 Opened 3 years ago Closed 3 years ago

List xhtml pages (application/xhtml+xml) also in HTML filter

Categories

(DevTools :: Netmonitor, defect, P3)

Firefox 92
defect

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: ddpm, Assigned: angelinasen1)

References

Details

(Keywords: good-first-bug, Whiteboard: dt-outreachy-2021)

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

Visit a website that delivers their sites with a content-type application/xhtml+xml instead of text/html.

Open the Firfox devtools and select the Network tab there. Choose the HTML filter.

Actual results:

The Filter on the Netmonitor has a filter 'HTML', but HTML sites that are delivered as XHTML (application/xhtml+xml) are not listed there. Instead they are listed in the other/sonstiges filter.

Expected results:

The xhtml pages should also be listed in the 'HTML' filter, not in the others (or how they are named in english) filter.

Hello ddpm,

Would you have an example of such website we could check?

Keywords: good-first-bug

S3

Severity: -- → S3
Priority: -- → P3
Flags: needinfo?(ddpm)

Ok, demo: https://www.liscovius.de/tech/demos/bugzilla.mozilla.org_bug1733285.pl

#!/usr/bin/perl -wT

use CGI;
$cgi=new CGI;

print $cgi->header(
        -type=>'application/xhtml+xml',
        -charset=>'UTF-8',
);

print '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de-DE" xml:lang="de-DE">
<head>
<title>demo for bug 1733285</title>
</head>
<body>
demo for <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1733285">bug 1733285</a>
</body>
</html>';
Flags: needinfo?(ddpm)

Thank you for the test case, I can reproduce the issue on my machine.

Status: UNCONFIRMED → NEW
Ever confirmed: true

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #5)
Hello! I'd love to work on this

Assinged to you

Thanks

Assignee: nobody → angelinasen1

Depends on D128114

Bug 1727753 is very similar (just about different mime type). The automated test (that we need for both) will also be similar. Perhaps we could just extend one of the following tests in both cases:

https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02

See Also: → 1727753

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #9)

Bug 1727753 is very similar (just about different mime type). The automated test (that we need for both) will also be similar. Perhaps we could just extend one of the following tests in both cases:

https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02

So Do I understand right I should add two objects to EXPECTED_REQUESTS in https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01.js or https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js
(for ogg and xhtml),
one object to BASIC_REQUESTS (for xhtml), run tests and submit in case of success?
It is my first time with tests :)

Or I guess no need for separate basic request

(In reply to Angelina from comment #10)

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #9)

Bug 1727753 is very similar (just about different mime type). The automated test (that we need for both) will also be similar. Perhaps we could just extend one of the following tests in both cases:

https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02

So Do I understand right I should add two objects to EXPECTED_REQUESTS in https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01.js or https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js
(for ogg and xhtml),
one object to BASIC_REQUESTS (for xhtml), run tests and submit in case of success?
It is my first time with tests :)

Yes, this is the "client" side of the test.
Also, you need to execute the request in the following HTML file, that is loaded by the test:

Here is the line where the test loads a HTML page:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js#135
(the page executes bunch of requests, you need to add one for the ogg file)

The page is implemented here:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/html_filter-test-page.html

You should also implement proper logic on the "server" side of the test.
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/sjs_content-type-test-server.sjs
This file represents the backend that is handling requests and sending back responses with proper mime type.
You need to support the new "application/ogg" mime type.

(for ogg and xhtml),

Sorry for not being clear, you should only do it for the "ogg" case at this moment
(the XHTML support should be done in the other bug, but very similarly)

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #12)

(In reply to Angelina from comment #10)

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #9)

Bug 1727753 is very similar (just about different mime type). The automated test (that we need for both) will also be similar. Perhaps we could just extend one of the following tests in both cases:

https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02

So Do I understand right I should add two objects to EXPECTED_REQUESTS in https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01.js or https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js
(for ogg and xhtml),
one object to BASIC_REQUESTS (for xhtml), run tests and submit in case of success?
It is my first time with tests :)

Yes, this is the "client" side of the test.
Also, you need to execute the request in the following HTML file, that is loaded by the test:

Here is the line where the test loads a HTML page:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js#135
(the page executes bunch of requests, you need to add one for the ogg file)

The page is implemented here:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/html_filter-test-page.html

You should also implement proper logic on the "server" side of the test.
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/sjs_content-type-test-server.sjs
This file represents the backend that is handling requests and sending back responses with proper mime type.
You need to support the new "application/ogg" mime type.

(for ogg and xhtml),

Sorry for not being clear, you should only do it for the "ogg" case at this moment
(the XHTML support should be done in the other bug, but very similarly)

Hi Honza, I'm working on the Bug 1727753. I'm a bit confused. So should I add the tests for the "ogg" case in my patch or not?

(In reply to Nadinda Rachmat [:nadinda] from comment #13)

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #12)

(In reply to Angelina from comment #10)

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #9)

Bug 1727753 is very similar (just about different mime type). The automated test (that we need for both) will also be similar. Perhaps we could just extend one of the following tests in both cases:

https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02

So Do I understand right I should add two objects to EXPECTED_REQUESTS in https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-01.js or https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js
(for ogg and xhtml),
one object to BASIC_REQUESTS (for xhtml), run tests and submit in case of success?
It is my first time with tests :)

Yes, this is the "client" side of the test.
Also, you need to execute the request in the following HTML file, that is loaded by the test:

Here is the line where the test loads a HTML page:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js#135
(the page executes bunch of requests, you need to add one for the ogg file)

The page is implemented here:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/html_filter-test-page.html

You should also implement proper logic on the "server" side of the test.
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/sjs_content-type-test-server.sjs
This file represents the backend that is handling requests and sending back responses with proper mime type.
You need to support the new "application/ogg" mime type.

(for ogg and xhtml),

Sorry for not being clear, you should only do it for the "ogg" case at this moment
(the XHTML support should be done in the other bug, but very similarly)

Hi Honza, I'm working on the Bug 1727753. I'm a bit confused. So should I add the tests for the "ogg" case in my patch or not?

I guess you add for ogg and I add for xhtml since I worked on xhtml bug.
Lets see

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #12)

I tried to run some tests on my local machine before making any changes, but every tests crashes
MOZ CRASH: attempting to connect to non-local address. Trying to figure out why it happens and how to fix that

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #12)

By the way, thank you for the explanation, now the structure is very clear!

Whiteboard: dt-outreachy-2021

(In reply to Angelina from comment #14)

Hi Honza, I'm working on the Bug 1727753. I'm a bit confused. So should I add the tests for the "ogg" case in my patch or not?

I guess you add for ogg and I add for xhtml since I worked on xhtml bug.

Yes, that's exactly what I had in mind.

Depends on D128114

I extended https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_filter-02.js for XHTML.
Tests passed :) Please check, hope I did everything right

Attachment #9246177 - Attachment is obsolete: true
Attachment #9246177 - Attachment is obsolete: false
Attachment #9246177 - Attachment is obsolete: true

Problem still exists in Firefox 94.0.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
QA Whiteboard: [qa-96b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: