Firefox show title of former document if new document has no title.
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox87 | --- | fixed |
People
(Reporter: erwinmoller, Assigned: saschanaz)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
I found this issue during development of a website.
- Created a page with a hyperlink to a non-existent document.
- Loaded that page in Firefox
- Clicked on the link
--> I got the (expected) not-found page of my webserver (IIS in this case) - Create the document with that name WITHOUT a title.
- Reload in firefox
Actual results:
The title of the former document was still displayed.
Expected results:
An empty title
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
| Assignee | ||
Comment 2•4 years ago
•
|
||
Somehow couldn't reproduce it with the steps in the comment #0, but got another set of steps:
- Load an existing HTML file on the local server, with its content
<title>Title</title> - Remove
Titlefrom the title element - Reload
Expected: The title should change to the path
Actual: It keeps showing the previous title
I tested using serve as the server.
| Assignee | ||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
hmm, this is surprising at least from DOM side, since
https://searchfox.org/mozilla-central/rev/07342ce09126c513540c1c343476e026cfa907bf/dom/base/nsContentSink.cpp#1379 should reset title.
Kagami, could you perhaps check the title of the relevant docshell.
Browser Toolbox, select the right process and then
tabs[<the index of the tab>].content.docShell.QueryInterface(Components.interfaces.nsIBaseWindow).title
| Assignee | ||
Comment 4•4 years ago
|
||
Both document.title and tabs[0].content.docShell.QueryInterface(Components.interfaces.nsIBaseWindow).title becomes an empty string.
It's WindowGlobalParent::RecvUpdateDocumentTitle that ignores empty string. if (mDocumentTitle == aTitle) becomes true and thus does not fire pagetitlechanged event.
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Comment 5•4 years ago
|
||
| Assignee | ||
Comment 6•4 years ago
|
||
This probably needs a test but not sure how to write one. The address shouldn't change but only the content should, do we currently have such tests?
Comment 8•4 years ago
|
||
You mean the address shouldn't change but the title should?
Could the test be a mochitest which opens a new window where the actual test is run. After reload the test would check the title of the WindowGlobalParent in the parent process by using SpecialPowers' loadChromeScript.
Something like https://searchfox.org/mozilla-central/rev/03224522336f60a1a61a87e1fcd4feb0a0315a9b/dom/events/test/file_coalesce_touchmove.html#26-27
| Assignee | ||
Comment 9•4 years ago
|
||
No, WindowGlobalParent already gets an empty string (as its initial value, as reloading seemingly constructs a new WindowGlobalParent, or am I misunderstanding?) but it just doesn't fire the event, so getting WindowGlobalParent's title won't be helpful.
I think the test would have to access _gBrowser or alternatively directly listen the event, but the question is, can the test mutate the file before reloading?
Updated•4 years ago
|
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
Backed out for failures on browser_bug1686194.js
backout: https://hg.mozilla.org/integration/autoland/rev/a0f08b3d66e9ffd23c054f109d3d456ec855acaa
failure log: https://treeherder.mozilla.org/logviewer?job_id=328098392&repo=autoland&lineNumber=6765
[task 2021-01-28T16:53:48.986Z] 16:53:48 INFO - TEST-PASS | dom/ipc/tests/browser_bug1686194.js | The title should be the raw path -
[task 2021-01-28T16:53:48.986Z] 16:53:48 INFO - Buffered messages finished
[task 2021-01-28T16:53:48.986Z] 16:53:48 INFO - TEST-UNEXPECTED-FAIL | dom/ipc/tests/browser_bug1686194.js | The title should change - Got "mochi.test:8888/browser/dom/ipc/tests/file_dummy.html", expected "Title"
[task 2021-01-28T16:53:48.986Z] 16:53:48 INFO - Stack trace:
[task 2021-01-28T16:53:48.986Z] 16:53:48 INFO - chrome://mochikit/content/browser-test.js:test_is:1351
[task 2021-01-28T16:53:48.986Z] 16:53:48 INFO - chrome://mochitests/content/browser/dom/ipc/tests/browser_bug1686194.js:null:31
[task 2021-01-28T16:53:48.986Z] 16:53:48 INFO - Not taking screenshot here: see the one that was previously logged
[task 2021-01-28T16:53:48.987Z] 16:53:48 INFO - TEST-UNEXPECTED-FAIL | dom/ipc/tests/browser_bug1686194.js | The title should be the raw path again -
[task 2021-01-28T16:53:48.987Z] 16:53:48 INFO - Stack trace:
[task 2021-01-28T16:53:48.987Z] 16:53:48 INFO - chrome://mochikit/content/browser-test.js:test_ok:1323
[task 2021-01-28T16:53:48.987Z] 16:53:48 INFO - chrome://mochitests/content/browser/dom/ipc/tests/browser_bug1686194.js:null:37
[task 2021-01-28T16:53:48.987Z] 16:53:48 INFO - Leaving test bound
[task 2021-01-28T16:53:49.017Z] 16:53:49 INFO - GECKO(8040) | MEMORY STAT | vsize 2104176MB | vsizeMaxContiguous 65587074MB | residentFast 238MB | heapAllocated 80MB
[task 2021-01-28T16:53:49.017Z] 16:53:49 INFO - TEST-OK | dom/ipc/tests/browser_bug1686194.js | took 426ms
| Assignee | ||
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 14•4 years ago
|
||
I LOVE to see this community in action. :-)
Good job and thank you all!
| Assignee | ||
Comment 15•4 years ago
|
||
Thank you for filing this issue! 😍
Description
•