Closed Bug 53615 Opened 25 years ago Closed 25 years ago

XHTML title element content not appearing in window title bar

Categories

(Core :: XML, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.8

People

(Reporter: chrispetersen, Assigned: hjtoi-bugzilla)

Details

(Keywords: xhtml, Whiteboard: [fixinhand])

Attachments

(5 files)

Build: 2000092108 Platforms: All Expected results: Title content should displayed as window's title What I got: Title is not displayed in window title bar. Steps to reproduce: 1) Open attached test cases (title.xml) in N6. 2) Window's title show say "Hello XHTML" but doesn't.
This bug has been marked "future" because the original netscape engineer working on this is over-burdened. If you feel this is an error, that you or another known resource will be working on this bug, or if it blocks your work in some way -- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
Marking future...
Target Milestone: --- → Future
Keywords: xhtml
I am already owner of related things, taking.
Assignee: nisheeth → heikki
Status: ASSIGNED → NEW
Noticed that the TITLE element's content is displayed in the browser window now. Tested with the 2001010908 build.
Yes, but the bug is that the title does not appear in the title bar. Could you whip up a minimal regular XML file which has only the title element from the XHTML namespace?
Oops, pilot error .. Forget about the issue of the title's content being displayed in the window. I misspelled namespace as "xnlns" in the root element. When this was corrected to "xmlns", the text is no longer appearing in the browser.
Using xhtml namespace, the title element is not rendered correctly either. Title of window is using contents of title element.
Hmm, this is actually a dupe... *** This bug has been marked as a duplicate of 36790 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
36790 is about <style> elements in XHTML documents, this is about <title> elements. They may be related and/or dependent, but a duplicate?
*blush* I knew something weird had happened. I LOST this bug. I guess I must have read title=style. I'll reopen. Thanks, Robin!
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Target Milestone: Future → mozilla0.9
I basically copied the way we do the title for HTML documents. It is simpler than in the HTML case, though (for example we do not save the title in the document - I do not see a reason for it yet). Basically when we find an XHTML title element, we start collecting the text and when we see the title close we set the title for the document (which in turn sets it for the window). This works even if the title element contains newlines, multiple spaces (whitespace compressed) and even subelements. The first title element in the document wins (this should mimic the HTML case).
Whiteboard: [fixinhand]
Target Milestone: mozilla0.9 → mozilla0.8
patch looks good. r=harishd
Suggested (but not necessary changes): 1) Consider moving the SetTitle method to nsIDocument. If that doesn't seem like the right place, consider sharing the implementation for nsXMLDocument and nsHTMLDocument. 2) Consider using the text node created as a child of TITLE and TEXTAREA elements rather than accumulating separately in the XML content sink. Otherwise, sr=vidur. --Vidur
1) I don't want to move SetTitle() to nsIDocument because not all documents will want to try and set the window title. Sharing the code between XML and HTML world does not happen currently - I think it is better to do it in one big overhaul with content sink refactoring etc. to catch XUL and possibly other cases as well. 2) The problem with the title/textare child node approach is that it becomes more difficult if the elements contain subelements/several child nodes. Right, we do use a little more memory now than we could, but I consider the advantage of simpler code in this case to win. Fix checked in.
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
Verified fixed in the Feb 05 build (2001020513).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: