Empty elements in XHTML documents are not displayed correctly in DevTools Elements panel
Reported by
bernard.schleich@gmail.com,
Mar 16 2018
|
||||||
Issue description
Chrome Version : Version 64.0.3282.186 (Official Build) (64-bit)
Other browsers tested: Opera/IE 11
Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
Safari: ?
Firefox: ?
Edge: ?
Opera: FAIL
IE 11: OK
What steps will reproduce the problem?
(1) Load a HTML5 file using XHTML namespace that contains a </input> tag.
(2) Inspect element using Inspect menu of contextual menu.
(3) Go to <input/> tag defined in your HTML file.
(4) <input/> tag has been removed because Chromium display DOM has HTML5 structure and has forgot that the document displayed is a XHTML document. This is defined in namespaces.
What is the expected result?
I expect that Chrome display <input> element respecting namespaces user choice.
If document namespace is XHTML, <input> tag must be closed with </input> or <input/>
What happens instead?
</input> tag has been removed so that displayed structure is not more a XML file. If I make a Paste/Copy of the code and I put this code in another xhtml file, the code is refsued by any XML parser !
Please provide any additional information below. Attach a screenshot if
possible.
<input id="txtName" type="text"/>
or
<input id="txtName" type="text"></input>
are transformed to
<input id="txtName" type="text">
This bug is disturbing, because on Chrome/Opera, you think that the DOM is incorrect because you think having defined a XHTML document; but Chrome display a HTML document thas is not more XML parsable !
This is only a DISPLAY problem. This problem can easily be solved if Chrome now XHTML context.
Microsoft Internet Explorer 11 display correctly the XHTML page !
,
Mar 19 2018
,
Mar 21 2018
,
Mar 21 2018
,
Mar 22 2018
This happens with <input> tag but also with <br/> tag
,
Mar 29 2018
Thanks for filing the issue. Please check the issue on latest stable-65.0.3325.181 & if still issue persists, provide us clear steps or any sample html file to reproduce the issue from our end.
,
Apr 3 2018
Thanks for the report. DevTools' Elements panel displays a representation of the DOM that may differ from the source XHTML/HTML, which may visually add 'closing tags' to empty elements <br> and <input> as you mentioned. Given our current priorities, I don't think it's likely we will change the visually displayed representation to preserve HTML/XHTML validity. > If I make a Paste/Copy of the code and I put this code in another xhtml file, the code is refsued by any XML parser ! This part should work if you right click a node > 'Edit as HTML'. This opens an inline editor containing your original XHTML content without any modified/additional closing tags. Does this context menu option work for your copying use case?
,
Apr 4 2018
I have tested on Chrome version Version 65.0.3325.181 (Official Build) (64-bit) and this issue seems corrected. When I test the following .xhtml file <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test INPUT and BR tags in XHTML file</title> </head> <body> <p>Test BR<br/>Line break</p> <p>Test INPUT<input type="text" name="name"/></p> </body> </html> I can see that <br/> and <input/> tag has been splitted in OPEN and CLOSE tags. When I call "Edit as HTML", the tag BR is displayed as "<br />" (with space before /). Personally, I like this correction. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by bernard.schleich@gmail.com
, Mar 16 2018