📜 ⬆️ ⬇️

Saving hypertext documents in different browsers


The topic of “crookedness” of browsers often rises, in this topic I propose to consider the browser not from the point of view of the visual user agent, but as a “black” box, to the input of which one document is submitted, but another output is obtained (after saving).

Input data


In order not to be as in the saying “What we have watered with, then it has grown” we will submit a valid XHTML 1.0 Strict document, style sheet, and one image in PNG format to the input.

sample.html


sample.css

')
image.png


Archive with these files can be downloaded here .

Experimental technique


1. Open the file from the hard disk in the browser
2. Save
3. We look what happened
All browsers were the latest release versions at the time of the experiment (a couple of weeks ago).

results


Opera



The file remained valid XHTML 1.0 Strict document. At the end of the line is added, where the document is saved.
CSS and PNG neatly stacked in a separate folder.
There is nothing to complain about.

Firefox



The file ceased to be valid (5 errors on validator.w3.org) - did not close meta and link tags.
CSS saved, forgot about PNG - lost background.

Chrome



The file ceased to be valid (18 errors on validator.w3.org) - left the document type, but brought all the tags to upper case. Meta and link are not closed, i.e. you can calculate that Chrome tried to save the document in good old HTML 4.01. After DOCTYPE added a comment, where the page is saved.
CSS saved, PNG forgot.

Internet Explorer



The file is no longer valid (4 errors on validator.w3.org). Changed DOCTYPE to HTML 4.0. Led all tags to uppercase, meta and link are not closed. Added “from myself” meta tag. After DOCTYPE added a comment, where the page is saved from.
CSS saved, PNG forgot.

My development environment :)


Valid code




Invalid code




Conclusion


Only Opera managed the task excellently, the rest did all sorts of “amateur activities,” which led to the fact that the saved document would not be displayed in the same way as the original one.
Chrome, FF, IE - get a “deuce” for not saving the CSS image.
Also, if I'm not mistaken, of all the browsers listed above, only Opera has the item “Whether web standards are met” in the context menu.

I hope this topic will attract the attention of browser developers and they will ensure that their creations will save beautiful, valid documents.

Source: https://habr.com/ru/post/109476/


All Articles