Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6491 closed bug (patchwelcome)

Google Chrome vs. Firefox Ajax RSS Test

Reported by: jrevillini Owned by:
Priority: undecided Milestone:
Component: unfiled Version: 1.4.4
Keywords: rss, ajax Cc:
Blocked by: Blocking:


This may need to be filed on one of the browsers' bug trackers, but I thought I'd start here first to confirm the bug.

In using jQuery to parse RSS feeds, I'm seeing different behavior in Chrome and Firefox when using the $('item title') selector.

Chrome considers <title> within <item> and <media:title> within <item> to match the query.

Firefox does not consider a <media:title> within <item> to match the same query.

I've attached a test case which can be launched in both browsers to show the issue. I think it needs to be placed into a website folder and viewed over http to work. Loading the html file using the Open command in each browser did not run the code.

Attachments (1)

Google Chrome vs. Firefox Ajax RSS Test.tar.gz (3.6 KB) - added by jrevillini 13 years ago.
unzip this to a folder that you can access on a local web server, then access the html file over http in both chrome and firefox.

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by jrevillini

unzip this to a folder that you can access on a local web server, then access the html file over http in both chrome and firefox.

comment:1 Changed 13 years ago by dmethvin

Component: unfiledselector

comment:2 Changed 12 years ago by Rick Waldron

Milestone: 1.4.3
Owner: set to jrevillini
Priority: undecided
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!

Additionally, test against the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!

comment:3 Changed 12 years ago by jitter

Component: selectorunfiled
Owner: jrevillini deleted
Status: pendingnew

test case FF only return "item title" for first test. While Chrome and Opera return "item title" and "media title".

On the second test (of course) all 3 browsers return the same output.

comment:4 Changed 12 years ago by snover

Resolution: patchwelcome
Status: newclosed

So this the Selectors API spec doesn’t do a great job of defining its behaviour here, but I think I figured this out.

The CSS3 namespace spec states that if a namespace prefix is omitted from a selector, the namespace to select from is the null (default) namespace. It also states that the null namespace contains all elements with no explicitly defined namespace (namespaces here are defined using CSS @namespace rules and are not based on the namespace prefixes used in the XML).

The Selectors API specifies that it should throw an Error if someone tries to select from a namespace other than the null (default) namespace, and does not provide any mechanism for defining non-default namespaces. As such, the null namespace selector is always equivalent to the all namespaces selector in the Selectors API.

It would seem that Firefox is violating the spec here by not returning XML-namespaced elements, even though they belong to the null namespace. This is not a jQuery bug, and since namespaces are not something that people use very often, I’m going to close this as patchwelcome—though I am not actually convinced this can even be worked around.

Last edited 12 years ago by snover (previous) (diff)
Note: See TracTickets for help on using tickets.