Re: What is a "state"?

On 12 Jun 2007, at 22:51, Ian Hickson wrote:

> On Tue, 12 Jun 2007, Henrik Dvergsdal wrote:
>>
>> Section 3.2.7 says that keywords of enumerated attributes "are each
>> defined to map to a particular state". What does the term "state"
>> signify in this case? Is it just a named set of keyword values, or is
>> this a more comprehensive concept?
>
> http://www.whatwg.org/specs/web-apps/current-work/#enumerated

Since you're answering with a link to the section I was referring to,  
I assume there is nothing more to a "state" than is described there.  
That's ok. I just need to ask because in my experience things are not  
allways that simple.

Formally then, an enumerated attribute is said to be in a particular  
"state" when its value is a member of a particular set of strings or,  
possibly, when it is not set.

There is a little problem, however: I think its misleading to  
describe the invalid/missing value states as "defaults", as these  
don't specify default values in the usual sense, but rather  
particular states corresponding to particular situations, just like  
any other state:

The attribute is set to value which is a member of a set of illegal  
values => illegal value state

The attribute is not set => missing value state

For instance, that an attribute has the true state as a missing value  
state, does not mean it defaults to "true".

--
Henrik

Received on Tuesday, 12 June 2007 23:45:42 UTC