Closed
Bug 86894
Opened 23 years ago
Closed 23 years ago
Context menus etc. not namespace-aware
Categories
(Core :: XML, defect, P2)
Core
XML
Tracking
()
VERIFIED
FIXED
mozilla0.9.3
People
(Reporter: hjtoi-bugzilla, Assigned: hjtoi-bugzilla)
References
()
Details
(Keywords: xhtml, Whiteboard: [nsBranch+][PDT+])
Attachments
(2 files)
11.20 KB,
patch
|
Details | Diff | Splinter Review | |
11.81 KB,
patch
|
Details | Diff | Splinter Review |
This applies mostly to XHTML. If you compare the behaviour of our context menus and metadata on HTML and XHTML elements, you will notice things will not work in XHTML if you have non-default namespace. The reason is that the context menus and metadata use tagName property, when they should use localName. <prefix:localname> node.tagName = prefix:localname node.localName = localname I'll attach a fix, I expect some people on Cc: should be able to review.
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Comment 2•23 years ago
|
||
Cool. sr=blake
Comment 3•23 years ago
|
||
I may have rewritten metadata.js, but I don't understand namespaces at all. the r= you need is definitely sicking's. Gerv
Comment 4•23 years ago
|
||
Note that .localName may be null on certain nodes (doesn't work yet, but we'll make this change soon, hopefully), so every call to element.localName.toCaseUpper() n' friends need to do a check for a null element.localName before calling toUpperCase().
Assignee | ||
Comment 5•23 years ago
|
||
In what situation can localName be null? Should I be using something else that is guaranteed to return the tag name without prefix?
Comment 6•23 years ago
|
||
localName is (should be) null for every type of node except for Element and Attr nodes, and even with those types of nodes localName *should* by the spec be null if the element/attribute in question was created with a DOM Level 1 method, i.e. document.createElement(), and not document.createElementNS(). I don't see how we could possibly implement the latter (i.e. localName being null on some elements and attributes), and IMO that doesn't make sense, but the former (i.e. localName being null on non element and attribute nodes) will be implemented in mozilla.
Comment 7•23 years ago
|
||
Oh, and no, there's nothing else that is guaranteed to return the tagname w/o the prefix in the DOM.
Assignee | ||
Comment 8•23 years ago
|
||
I think metadata.js is ok, but I need to work a little on the context menu. We are usually checking the node type (NODE_ELEMENT) before doing anything else.
Status: NEW → ASSIGNED
Assignee | ||
Comment 9•23 years ago
|
||
Comment 10•23 years ago
|
||
sr=jst
metadata.js should be ok wrt namespace, I spent a lot of effort making sure it was. However if elements would return NULL for localName it will throw an exception. Is this something we should worry about jst (sounds like no)?
grmbl. I just read the new metadata.js code, and it is not xhtml compatible :(((
Assignee | ||
Comment 13•23 years ago
|
||
So Jonas, could you review my changes to metadata.js?
Comment 14•23 years ago
|
||
Jonas, I don't think it's worth worrying about .localName ever being null on *elements* in mozilla, if we choose to make that change somethime we'll have lots of problems like these, things like this will be lost in the noice, should we ever choose to go down that path :-) What's not "xhtml compatible" in these changes?
r=sicking on the metadata.js changes
Assignee | ||
Comment 16•23 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: [fixinhand]
Comment 18•23 years ago
|
||
Compared a XHTML and HTML docunment that both contained a image file. http://slip/projects/marvin/xhtml/transitional/img_align_middle.xml http://slip/projects/marvin/html/img_align_middle.html Right clicking on the image displayed the same popup menu. Verified on the June 28th (2001062804) branch build.
Comment 20•23 years ago
|
||
The fix for this bug has been checked in on the trunk for more than a week and is low risk. QA has verified the fix on the trunk. This is a high impact fix for bringing the user experience of XHTML on par with HTML and allows us to claim that our client supports the web's migration from HTML to XHTML. Without this fix, context menus did not display tag specific actions (for example, right clicking on an image tag did not display the option to save the image). Marking nsBranch+.
Whiteboard: [nsBranch+]
Comment 21•23 years ago
|
||
Steve granted this PDT+ status in today's PDT meeting.
Whiteboard: [nsBranch+] → [nsBranch+][PDT+]
You need to log in
before you can comment on or make changes to this bug.
Description
•