Open Bug 254284 Opened 20 years ago Updated 2 years ago

XUL iframe name/id attribute

Categories

(Core :: XUL, enhancement)

enhancement

Tracking

()

People

(Reporter: MatsPalmgren_bugz, Unassigned)

Details

Attachments

(2 files, 2 obsolete files)

Followup from bug 183683.

There is some confusion regarding which attribute, "name" or "id",
that has the attribute type ID for XUL iframes.

I naively changed it in bug 183683 from being "name" to "id" for
everything that is not HTML4 at first, but that broke existing
XUL code in Mozilla, so I had to limit the fix to XHTML.

IMO, we should just drop the "name" attribute from XUL iframe
and clean up the code accordingly.
What do you think?
From a technical point of view this might be a nice change. But all applications
relying on this will be broken and need to be updated, because some people think
'id' is cleaner than 'name'.

Can't we deprecate NAME and support both until Mozilla 2.0 arrives?
I know you mentioned Account Central in bug 183683 but that's a simple fix, we
can even give that frame the same id for now to ease conversion later.

Perhaps we need some volunteers to test Mozilla with the proposed changes?

This change should also be announced on various newsgroups.
(In reply to comment #1)
> ...because some people think 'id' is cleaner than 'name'.

IMHO, this isn't just a matter of esthetics.

XML 1.0 http://www.w3.org/TR/REC-xml/#sec-attribute-types says:
"An element type MUST NOT have more than one ID attribute specified."

As I see it, the current handling of the iframe 'name' makes it have the
properties of an ID attribute type and thus we break the XML validity
contraint above.

See also what XHTML 1.0 has to say regarding name/id:
http://www.w3.org/TR/xhtml1/#h-4.10
"Both of these attributes are designed to be used as fragment identifiers."
and thus XUL (iframe) have the same problem as HTML4.
(In reply to comment #2)
> I know you mentioned Account Central in bug 183683 but that's a simple fix,
> we can even give that frame the same id for now to ease conversion later.

Or, we could add support for both 'name' and 'id' (in bug 183683) for
XUL iframes under a transition period...
The forthcoming 1.8 release seems like a good opportunity here?

This wouldn't break any existing code and at the same time support new
code that uses 'id' only.
Attached patch Removal of XUL iframe name (obsolete) — Splinter Review
Rather small changes actually... the changed files are:

Index: calendar/resources/content/pref/pref.xul
Index: calendar/resources/content/pref/prefBird.xul
Index: extensions/wallet/editor/resources/content/WalletViewer.xul
Index: extensions/xmlterm/ui/content/xmlterm.xul
Index: extensions/xmlterm/ui/content/xmlterm2.xul
Index: mailnews/base/prefs/resources/content/AccountManager.xul
Index: mailnews/base/resources/content/mail3PaneWindowVertLayout.xul
Index: mailnews/base/resources/content/messenger.xul
Index: toolkit/components/console/content/console.xul
Index: toolkit/content/widgets/optionsDialog.xml
Index: xpfe/components/console/resources/content/console.xul
Index: xpfe/components/prefwindow/resources/content/pref.xul
A post on the newsgroups attracted one reply, as due to a mistake in my phrasing
of the notice they thought that <iframe id="foo"> would not map to
window.frames; I have cleared that misunderstanding up :-)
This patch adds support for the ID attribute (NAME still has priority).
There is very little risc this will break any existing XUL code, but it allows
existing code to smoothly transition to using ID. I think it would be a good
idea to take this for 1.8 and then drop NAME support after the release.
Attachment #155325 - Attachment is obsolete: true
Attachment #158697 - Flags: superreview?(bzbarsky)
Attachment #158697 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 158697 [details] [diff] [review]
Add support for XUL iframe id attribute, rev. 2

sr=bzbarsky
Attachment #158697 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 158697 [details] [diff] [review]
Add support for XUL iframe id attribute, rev. 2

Sure, if that's the order in which you want to do it.
Attachment #158697 - Flags: review?(neil.parkwaycc.co.uk) → review+
Checked in the nsFrameLoader change (attachment 158697 [details] [diff] [review]) at 2004-10-01 11:32 PDT
Same as before except extensions/xmlterm/ui/content/xmlterm2.xul which
was actually a html:iframe so I left that file as is.
Attachment #155326 - Attachment is obsolete: true
Comment on attachment 160793 [details] [diff] [review]
Replace XUL iframe NAME with ID, rev. 2

Boris, can you do the review in Neil's absence?
Attachment #160793 - Flags: review?(bzbarsky)
Comment on attachment 160793 [details] [diff] [review]
Replace XUL iframe NAME with ID, rev. 2

r=bzbarsky
Attachment #160793 - Flags: review?(bzbarsky) → review+
Doesn't this just need sr=+, and then to be landed?
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.widgets
Probably not worth fixing anymore.
Assignee: matspal → nobody
Keywords: qawanted
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: