W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > February 2011

Removal of empty div/spans in Firefox (re: ISSUE-67 was: Re: Golly gosh!)

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Wed, 02 Feb 2011 09:38:18 -0500
Message-ID: <4D496C5A.4000109@digitalbazaar.com>
To: public-rdfa-wg@w3.org
CC: Henri Sivonen <hsivonen@iki.fi>
For those of you that missed the call yesterday and haven't had a chance
to read the minutes yet, I mentioned that Firefox removes div/span
elements that don't have any content... stuff like this:

<div about="#foo"><span property="bar" content="baz"></span></div>

Those two nodes will be deleted from the DOM when the page is displayed
and any JavaScript-based RDFa processor will never be able to produce
that triple in all past and current versions of Firefox.

I was suggesting that the browser may see this as "whitespace" and thus
it removes what it deems to be superfluous whitespace. This had to do
with feedback from Henri Sivonen on RDFa Core that we were reviewing
yesterday, specifically:

Henri Sivonen: Under 4.1 the statement about whitespace seems to say
that authors should assume non-conforming processors.

Toby Inkster: Would anyone object to removing the second and third
sentances from the last paragraph of section 4.1? [EDIT]

It was just one demonstration where the RDFa Processor doesn't have
control over the previous stage in the processing pipeline that may or
may not remove "whitespace". Shane mentioned that this has nothing to do
with "whitespace" and instead we found this reference, where whitespace
may be removed when a document is being canonicalized (which may happen
before the RDFa processor can run on the document):


On 02/02/11 01:37, Toby Inkster wrote:
> Manu was right!

Why do people always sound so surprised when they find out that
something I'm telling them is actually true!? :P

> http://buzzword.org.uk/2011/test-empty-span.html
> Try in Firefox versus Opera. (I tested 3.6.2 and 11.0 respectively.)

Just tested this in Firefox 4.0 Beta 10 - that browser removes "empty"
div/spans as well, so it looks like Mozilla may not fix this bug (if
they even view it as a bug). Henri, is this being tracked as a bug in
Firefox? Is it not a bug?

-- manu

Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: The Rising Swell of Web Application Data
Received on Wednesday, 2 February 2011 14:38:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:23 UTC