Closed Bug 321558 Opened 15 years ago Closed 15 years ago
.write not Honoring TITLE
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051219 Firefox/1.6a1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051219 Firefox/1.6a1 There are major issues with document.write * It is not Honoring TITLE tag * It is not parsing after SCRIPT, LINK tag with a src attribute, src can be from HTTP, FTP, FILE or DATA This is very major because it will mak problem in many bank sites which use popup. Reproducible: Always Steps to Reproduce: go thru each test in js_doc_write.html test 0 look, title on new window test 2 look, content on new window test 4 look, content on new window Actual Results: test 0 title show url test 2 content empty test 4 content empty Expected Results: test 0 title Hello test 2 should show content test 4 should show content in red
Assignee: general → general
QA Contact: general → ian
Taking this bug to fix the title problem only. On testcase 0, I see: ###!!! ASSERTION: More UnblockOnload() calls than BlockOnload() calls. I'll file new bugs on the <script> and <link> problems and the assertion.
Assignee: general → mrbkap
Severity: critical → normal
Priority: -- → P3
Summary: document.write not Honoring TITLE and parsing breaks after SCRIPT, LINK → document.write not Honoring TITLE
Target Milestone: --- → mozilla1.9alpha
The problem here is that when we create the new document (from the window.open call) we load about:blank into it, which gives the document a non-void title, so when we parse the <title> from the document.write, we see that the document already has a title, and don't overwrite it.
Status: NEW → ASSIGNED
Comment on attachment 207057 [details] [diff] [review] Void the title We probably want this on 1.8.x, 1.8.0.x, 1.7.x, and Aviary 1.0.x branches... :(
is this same? bug 318401 (no title) also there is unconformed bug 308667 - document.open permission issue
*** Bug 318401 has been marked as a duplicate of this bug. ***
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
bz, any reason you didn't nominate? I'll let mrbkap nominate the patch. /be
Comment on attachment 207057 [details] [diff] [review] Void the title This is a safe patch that allows entirely document.written documents to write out <title> tags. If the title is never set, then nsHTMLContentSink::DidBuildModel makes sure to set a non-void title.
When did this break? Does it occur in 1.0.6 or 1.0.7?
Actually, 1.0.x isn't affected by this because it used a different (buggy) method of tracking whether the title had been set or not already (see bug 271996).
(In reply to comment #12) > Actually, 1.0.x isn't affected by this because it used a different (buggy) > method of tracking whether the title had been set or not already (see bug > 271996). > So, to be clear, this is a regression from 1.0.x (namely from bug 271996 and bug 304388).
Comment on attachment 207057 [details] [diff] [review] Void the title a=dveditz for drivers
verified on the branch using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20060111 Firefox/126.96.36.199. I ran through the set of test cases in https://bugzilla.mozilla.org/attachment.cgi?id=206870 and everything looked good.
I wanted to note that the JS console did catch an exception when you run the second test case in the example: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.focus]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://browser/content/browser.js :: delayedStartup :: line 779" data: no]
You need to log in before you can comment on or make changes to this bug.