W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2011

[whatwg] Microdata - Handling the case where a string is upgraded to an object

From: Philip Jägenstedt <philipj@opera.com>
Date: Tue, 19 Jul 2011 18:00:07 +0200
Message-ID: <op.vyviqhu7sr6mfa@kirk>
On Mon, 18 Jul 2011 22:01:37 +0200, Tab Atkins Jr. <jackalmage at gmail.com>  
wrote:

> On Mon, Jul 18, 2011 at 4:20 AM, Philip J?genstedt <philipj at opera.com>

>> As for the solution, are you suggesting that .itemValue return a special
>> object which is like HTMLElement in all regards except for how it
>> toString()s?
>
> Yes.

Currently, it's spec'd as returning the element itself. This isn't  
terribly useful, at least I've just checked e.itemScope and then accessed  
e.properties directly rather than going through e.itemValue.properties.  
Given this, a simpler fix would be to let .itemValue act like .textContent  
when an itemscope attribute is present.

Still, I'm not sure if it's a good idea. It makes the Microdata model kind  
of odd if a property is both an item and has a fallback text  
representation. It will also mask the fact that a text property has been  
upgraded to an item, somewhat decreasing the chance that the consuming  
code will be updated.

-- 
Philip J?genstedt
Core Developer
Opera Software
Received on Tuesday, 19 July 2011 09:00:07 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:34 UTC