Re: for telecon: ISSUE-23 @profile order

On 05/27/2010 04:21 AM, Mark Birbeck wrote:
> Sorry, but I'm not sure that many of these tests are correct.

I'll explain further why they think they apply, below.

> But also, as I illustrate at the end, I think this may just come down
> to wording.

Perhaps... and I'm not strongly opposed or receptive to going either
way. I just wanted us to look at the state of the languages before
proceeding.

>> ID
>> --
>>
>> <p id="one">...</p>
>> ...
>> <p id="one">...</p>
>>
>> The first ID declared wins, the rest are ignored. (Firefox and Chrome)
> 
> I don't think this is a good test, since you're not supposed to have
> more than one @id. So in that context taking the first and ignoring
> any others is reasonable behaviour by a browser, but I'm afraid it
> doesn't tell us much about what authors would 'expect'.

Whether or not you're /supposed/ to have more than one attribute per
element, or whether or not the document is valid when you have more than
one attribute with the same value per document is not what I'm concerned
about.

The concern I have is what happens when there is more than one @id with
the same value. The page still loads and takes you to an offset in the
document. All browsers do the same thing, AFAIK - and that means that
there is an expectation set for web page authors.

Again - whether or not it is valid is not the point. We need to answer
the following question:

Do all web browsers react in the same way when you have more than one
@id with the same attribute?

If they do, and the behavior is consistent, there is a (written or
unwritten) expectation that is established.

>> STYLE
>> -----
>>
>> <p style="font-size: 18px; font-size: 8px; ">XYZ...</p>
>>
>> The last one declared wins (8px) (Firefox and Chrome)
> 
> Fair enough, but that's defined by CSS itself -- i.e., a separate
> language, which could have had different rules if its designers had
> chosen to do so.

RDFa is a separate language. Interpretation of RDFa attribute values is
in the purview of RDFa, just like interpretation of CSS attributes is in
the purview of CSS.

Sure, the language authors could have chosen different rules, like
first-declared-wins... but they didn't. They decided on last-declared
wins, and it is the same across all browsers (AFAIK)... thus setting an
expectation for web developers.

>> CLASS
>> -----
>>
>> <p class="blue red">XYZ...</p>
>>
>> This one surprised me. red always wins, regardless of whether it comes
>> first or last. (Firefox and Chrome)
> 
> I don't think this has anything to do with attribute value order, but
> arises from the order in which you defined your CSS rules. It sounds
> like you defined blue and then red in your stylesheet:

Yes, that's what happened, and it's good to know why this was happening.
Although, I'll note that last-declared-wins in this case as well. :)

>> Javascript
>> ----------
>>
>> <p onclick="javascript:var a = 4; var a=5; alert(a);">...</p>
>>
>> Last one declared wins (5) (Firefox and Chrome)
> 
> This has nothing to do with HTML or attribute values -- priorities are
> defined by JavaScript.

Just like the priorities are defined by RDFa.

> Of course the point is that you need to know the language in the
> attribute to know what is happening -- 'left-to-right' and
> 'right-to-left' rules are too simplistic, and no author would expect
> them to work in this context.

The pattern I am seeing is that /all/ languages that are embedded in
attribute values in HTML use the last-declared-wins pattern. RDFa is
just another one of those languages. RDFa should use the
last-declared-wins pattern as well because of the expectation set by CSS
and Javascript.

>> For attribute values, the last one declared wins.
> 
> ...that completely depends on the language used in the attribute.

... and it just so happens that all languages that are embedded in HTML
use the last-declared-wins pattern.

Again - I don't feel strongly one way or the other... but I don't think
that we can say that there isn't an established pattern for languages
that are embedded in HTML attribute values (Javascript and CSS).

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: Bitmunk 3.2.2 - Good Relations and Ditching Apache+PHP
http://blog.digitalbazaar.com/2010/05/06/bitmunk-3-2-2/2/

Received on Saturday, 29 May 2010 14:54:36 UTC