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

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

From: Henri Sivonen <hsivonen@iki.fi>
Date: Thu, 3 Feb 2011 10:26:45 +0200
Cc: public-rdfa-wg@w3.org
Message-Id: <5260F9FA-0F66-412A-A594-4410B7E45F6E@iki.fi>
To: Manu Sporny <msporny@digitalbazaar.com>
On Feb 2, 2011, at 16:38, Manu Sporny wrote:

> 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>

No, they aren't removed:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/820

> 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]
> """

This is unrelated.

>> 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?

The test isn't testing what you are trying to test. The test sets innerText. Firefox doesn't support innerText, so the test ends up setting a custom property on the node instead of assigning to the IE-ism. The property you are looking for is textContent.

Whether the non-support of innerText is a bug depends on whether one considers innerText to have become part of the platform. innerText is pretty weird in the sense that the computed style affects how a property on the content tree behaves. innerText hasn't been reverse engineered and specced properly, yet, so one might argue that it's not bug at least as long as there isn't a proper spec for innerText. 

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Thursday, 3 February 2011 08:27:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:19:50 UTC