Save as Web Page, Complete adds meta charset tag when it's already present
Categories
(Core :: DOM: Serializers, defect, P5)
Tracking
()
People
(Reporter: u655930, Unassigned)
References
Details
Attachments
(1 file)
|
22.12 KB,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
Steps to reproduce:
- I created an html5 page file with the updated charset tag:
<meta charset="UTF-8"> - Note that this tag:
a) Is the short method;
b) Is the standard html5 specification to reduce file size and bandwidth;
c) Is used in the source code of most html5 sites, examples: bugzilla.mozilla.org and www.google.com;
d) See www.w3schools.com/tags/att_meta_charset.asp for more information. - I opened the page using Firefox.
- Open the context menu and click on the option "View Page Info".
- I saved the page locally using the "Web page, complete" option.
Actual results:
-
When opening the "View Page Info" context menu option:
a) The browser recognizes the <meta charset = "UTF-8"> tag, but the values are not displayed correctly because the tag is short and does not have the attributes "name" and "content";
b) Then there is an error and a blank space is displayed. -
When saving the page locally, the browser simply ignores the charset tag of the new html5 specification and adds the old charset tag, resulting in two different charset tags and an error in the code:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
Expected results:
-
The browser, by clicking on the "View Page Info" context menu option:
a) Recognize that the tag name is "charset";
b) Recognize that the tag value is "UTF-8". -
The browser, when saving the page locally using the "Web page, complete" option:
a) Do not add the old charset tag:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
b) Keep the html5 charset tag:
<meta charset="UTF-8">
Comment 1•6 years ago
|
||
Seems duplication of Bug 584285
Comment 2•6 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
20200117190643
STR:
- Ctrl+S.
- Save as Web Page, complete.
Actual results:
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> is added to the document although <meta charset="UTF-8"> is already present.
Expected results:
Either <meta http-equiv="content-type" content="text/html; charset=UTF-8"> is not added to the document or <meta charset="UTF-8"> is removed at the same time.
(In reply to Alice0775 White from comment #1)
Seems duplication of Bug 584285
That's for the blank line in the Page Info window. There's no existing report for the save bug that I could find.
Comment 3•6 years ago
|
||
Sounds like that this does not cause any inconvenience for users actually. So, setting P5, but Mirko may change it if this is more serious than I think.
I agree with Masayuki's comment.
I couldn't reproduce the issue with neither Firefox 72.0.2. nor with 73.0b12 on Ubuntu 18.04.
Comment 5•6 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
20200229214828
Why did you clear the See Also field? The bug that introduced this feature is relevant (though it might fit better in the Blocks field).
(In reply to Mirko Brodesser (:mbrodesser) (PTO until 1st of March) from comment #4)
I couldn't reproduce the issue with neither Firefox 72.0.2. nor with 73.0b12 on Ubuntu 18.04.
Both bugs are still reproducible in the latest Nightly on Windows as described at comment 2.
Updated•6 years ago
|
Comment 6•6 years ago
|
||
From what I can see issue 1 is no longer an issue now.
Issue 2 is still present and should be simple enough to fix.
My plan is to simply skip serialization of any <meta http-equiv="content-type" ...> tags present if mRewriteEncodingDeclaration is set. I also plan on switching the meta appending code to either append or update the <meta charset="..."> tag instead. It seems more fitting these days, it's shorter and cleaner.
I hope to have some time to look at this tomorrow.
Comment 8•4 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months.
:hsinyi, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Updated•3 years ago
|
Description
•