Open Bug 1476232 Opened 7 years ago Updated 3 years ago

view source omits certain elements

Categories

(Toolkit :: View Source, defect, P4)

62 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: martijn, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0 Build ID: 20180712042337 Steps to reproduce: When I "view source" a page, certain elements are just gone. They are still in the DOM, and they are even present when I save the page as a html file. But in view source they are just vanished. I cannot reproduce this with a live page. But for me this is happening with a Bootstrap 3.3 tooltip (https://bootstrapdocs.com/v3.3.6/docs/javascript/#tooltips). The element that causes the tooltip and has the data attributes for it, is vanished in view source. Maybe it's to do with the fact I've got DevTools open, or because it's running on localhost, or some other weirdness. The fact of the matter is that view source is incorrect. It should always display the entire page in its entirety and not leave out stuff. Ever. Actual results: View source is incomplete. Certain elements are left out. They exist in the DOM and they exist in the true source. They exist in the file when saving the page. Expected results: View source should present absolutely everything always ever no exceptions.
Component: Untriaged → View Source
Product: Firefox → Toolkit
Can you please provide a test case, so we can reproduce this on our machines? Is it possible that the tooltip disappears (is removed from the DOM) before you actually view the source? Honza
Flags: needinfo?(martijn)
It's not easy for me to come up with a test case when I don't know what exactly reproduces the problem. Looking at your remark, what I can say is that the DOM should not have anything to do with the view source function. View source should display what the browser has been loaded from the server, and of course this cannot ever change without a fancy time machine :)
Flags: needinfo?(martijn)
Priority: -- → P4
I am pretty sure that the elements you miss within view source are dynamically generated. The "View Page Source" option displays the static HTML as it was returned by the server. The dynamic contents are only shown when you select something within the page and choose "View Selection Source". And when you save a page it also saves the dynamically generated content. So that's why you see them in the saved page. I've created a simple example to visualize that. So, to confirm that, please go to the Network panel, select the main HTML request, switch to the "Response" tab and check the HTML source within the "Response payload section". Do you see the element(s) there? Sebastian
Flags: needinfo?(martijn)
Absolutely not. I could simply refresh the view source tab, and get the correct source in there. I know for sure the server was returning the wrong html in the first place. The view source function was definitely genuinely absolutely positively omitting source that was sent by the server. It's just very hard to repro, because I have no way of knowing why or when it's happening.
Flags: needinfo?(martijn)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: