Closed Bug 306016 Opened 20 years ago Closed 15 years ago

Fails to follow link when page served as application/xhtml+xml

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: cwitte, Unassigned)

References

()

Details

(Keywords: xhtml)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 If you click on the "add new item" menu at http://www.ph.unimelb.edu.au/~cwitte/test.xhtml and then select an item from the menu, hte menu closes but it fails to follow the link. If the page is served as html instead of application/xhtml+xml, see http://www.ph.unimelb.edu.au/~cwitte/test.html, the problem disappears. The xhtml and css both validate. Curiously if you use the javascript debugger and put a breakpoint in the function resetButton(), then the link gets followed. Reproducible: Always Steps to Reproduce: 1. open http://www.ph.unimelb.edu.au/~cwitte/test.xhtml 2. click on "add new item" 3. select "document" from the menu 4. menu closes but link fails to get followed 5. open javascript debugger and set breakpoint in function resetButton() 6. click on "add new item" 7. select "document" from the menu 8. menu closes and link gets followed (nb. the file that is linked to doesn't exist) Actual Results: Link fails to be follwed without the breakpoint set in the debugger Expected Results: Followed the link.
I am guessing here but first you have the doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> and then then xmlns="http://www.w3.org/1999/xhtml <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> It seesm liek the second one overrides it and forces the xhtml parsing.
(In reply to comment #1) > I am guessing here but > > first you have the doctype > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > and then then xmlns="http://www.w3.org/1999/xhtml > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > lang="en"> As I understand it this is required in an xhtml document. > It seesm liek the second one overrides it and forces the xhtml parsing. I think you miss understand, I want the document parsed as xhtml but when it is, it fails to follow the links in the menu.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050831 Firefox/1.0+ ID:2005083106 WFM in the above build. Please note that your pages do not actually validate because of a malformed link. The output from tidy follows: line 162 column 21 - Warning: <a> escaping malformed URI reference
Keywords: xhtml
(In reply to comment #3) > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050831 > Firefox/1.0+ ID:2005083106 > > WFM in the above build. what does WFM mean? > Please note that your pages do not actually validate because of a malformed > link. The output from tidy follows: > > line 162 column 21 - Warning: <a> escaping malformed URI reference sorry I used the w3 validator and it says its valid, see http://validator.w3.org/check?uri=www.ph.unimelb.edu.au%2F%7Ecwitte%2Ftest.xhtml but after further investigation it appears to be a javascript problem. Commenting out the following line from the script plone_menu.js document.addEventListener("mousedown", pageMousedown, true); seams to fix things. This has been implemented in www.ph.unimelb.edu.au/~cwitte/test2.xhtml why this should be a problem when the page is served as xhtml and not when served as html I don't know why.
WFM = worksforme There are fairly substantial differences in the way javascript works in XHTML and HTML. For example, document.write() doesn't work any more. I haven't taken a look at your javascript to see if that's where the problem is, but that's the first place I suspect. For more info on the changes between HTML 4 and XHTML, see [1]. Another good resource (geared toward bloggers, but generally applicable) can be found at [2]. Please review those documents and your javascript and see if the problem clears up. [1] http://www.w3.org/MarkUp/2004/xhtml-faq [2] http://www.43things.com/entries/view/26933
In the getContainerWith function [1], you're comparing node.tagName to the tagName parameter, which is specified in uppercase by the callers. However, the string returned by node.tagName is uppercase in HTML, and lowercase in XHTML. The fix would be to replace node.tagName == tagName by node.tagName.toLowerCase() == tagName.toLowerCase() [1] http://www.ph.unimelb.edu.au/~cwitte/plone_menu.js
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.