Bug Tracker

Ticket #6491 (closed bug: patchwelcome)

Opened 4 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

Description

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

Google Chrome vs. Firefox Ajax RSS Test.tar.gz Download (3.6 KB) - added by jrevillini 4 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.

Change History

Changed 4 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 4 years ago by dmethvin

  • Component changed from unfiled to selector

comment:2 Changed 4 years ago by rwaldron

  • Owner set to jrevillini
  • Priority set to undecided
  • Status changed from new to pending
  • Milestone 1.4.3 deleted

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 4 years ago by jitter

  • Owner jrevillini deleted
  • Status changed from pending to new
  • Version changed from 1.4.2 to 1.4.4
  • Component changed from selector to unfiled

 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 4 years ago by snover

  • Status changed from new to closed
  • Resolution set to patchwelcome

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 4 years ago by snover (previous) (diff)
Note: See TracTickets for help on using tickets.