Specifying multiple cursor types - invalid, right? | | |
The following declaration was posted to a forum:
cursor: url('path/some.cur'), hand, pointer, text, default;
and I'm having a hard time convincing the poster that it's invalid.
First of all, I suppose it should be established that it /is/ invalid.
The following excerpt is taken from the CSS 2 specification (and
appears unaltered in CSS 2.1):
'cursor'
Value: [ [<uri> ,]* [ auto | crosshair | default | pointer | move
| e-resize | ne-resize | nw-resize | n-resize | se-resize
| sw-resize | s-resize | w-resize | text | wait | help ] ]
| inherit
Clearly, only one keyword may appear in a single declaration, and only
multiple URI values can appear, separated by commas. However, if a
user agent encounters a declaration that doesn't follow that pattern,
what is the expected behaviour?
I would have assumed that the declaration would be marked erroneous
and ignored, but it seems - at least with the W3C validator - that
anything after the first keyword is ignored[1]. Could the reason be
that the first keyword encountered simply stops the parser from
iterating over the remaining values? If that is so, shouldn't the
validator continue so it can alert the author to the problem?
I realise that validators are but tools and are no substitute for
sound knowledge of the language they attempt to test, but try
explaining that to some people...
Mike
[1] The order of the keywords in the example should be changed so that
'hand' isn't the first to be encountered.
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail. | | | | re: Specifying multiple cursor types - invalid, right?
Michael Winter schrieb:[color=blue]
> The following declaration was posted to a forum:
>
> cursor: url('path/some.cur'), hand, pointer, text, default;
>
> and I'm having a hard time convincing the poster that it's invalid.
>
> First of all, I suppose it should be established that it /is/ invalid.
> The following excerpt is taken from the CSS 2 specification (and appears
> unaltered in CSS 2.1):
>
> 'cursor'
>
> Value: [ [<uri> ,]* [ auto | crosshair | default | pointer | move
> | e-resize | ne-resize | nw-resize | n-resize | se-resize
> | sw-resize | s-resize | w-resize | text | wait | help ] ]
> | inherit
>
> Clearly, only one keyword may appear in a single declaration, and only
> multiple URI values can appear, separated by commas. However, if a user
> agent encounters a declaration that doesn't follow that pattern, what is
> the expected behaviour?
>
> I would have assumed that the declaration would be marked erroneous and
> ignored, but it seems - at least with the W3C validator - that anything
> after the first keyword is ignored[1]. Could the reason be that the
> first keyword encountered simply stops the parser from iterating over
> the remaining values? If that is so, shouldn't the validator continue so
> it can alert the author to the problem?
>
> I realise that validators are but tools and are no substitute for sound
> knowledge of the language they attempt to test, but try explaining that
> to some people...
>
> Mike
>
>
> [1] The order of the keywords in the example should be changed so that
> 'hand' isn't the first to be encountered.
>[/color]
To add: hand should not be used because it is M$ only and not recognized
by Firefox.
Klaus | | | | re: Specifying multiple cursor types - invalid, right?
Klaus Krtschil wrote:
[snip]
[color=blue]
> To add: hand should not be used[/color]
In general it shouldn't...
[color=blue]
> because it is M$ only [...][/color]
but if versions prior to IE6 are a concern, using 'hand' will be a
necessity.
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail. | | | | re: Specifying multiple cursor types - invalid, right?
On Wed, 09 Mar 2005 18:45:09 +0100 Klaus Krtschil wrote:
[color=blue]
> Michael Winter schrieb:[color=green]
>> The following declaration was posted to a forum:
>>
>> cursor: url('path/some.cur'), hand, pointer, text, default;
>>
>> and I'm having a hard time convincing the poster that it's invalid.
>>
>> First of all, I suppose it should be established that it /is/ invalid.
>> The following excerpt is taken from the CSS 2 specification (and appears
>> unaltered in CSS 2.1):
>>
>> 'cursor'
>>
>> Value: [ [<uri> ,]* [ auto | crosshair | default | pointer | move[/color]
> |> e-resize | ne-resize | nw-resize | n-resize | se-resize
> |> sw-resize | s-resize | w-resize | text | wait | help ] ]
> |> inherit[color=green]
>>
>> Clearly, only one keyword may appear in a single declaration, and only
>> multiple URI values can appear, separated by commas. However, if a user
>> agent encounters a declaration that doesn't follow that pattern, what is
>> the expected behaviour?
>>
>> I would have assumed that the declaration would be marked erroneous and
>> ignored, but it seems - at least with the W3C validator - that anything
>> after the first keyword is ignored[1]. Could the reason be that the
>> first keyword encountered simply stops the parser from iterating over
>> the remaining values? If that is so, shouldn't the validator continue so
>> it can alert the author to the problem?
>>
>> I realise that validators are but tools and are no substitute for sound
>> knowledge of the language they attempt to test, but try explaining that
>> to some people...
>>
>> Mike
>>
>>
>> [1] The order of the keywords in the example should be changed so that
>> 'hand' isn't the first to be encountered.
>>[/color]
>
> To add: hand should not be used because it is M$ only and not recognized
> by Firefox.
>
> Klaus[/color]
Firefox will accept the cursor statement.
I've done it before. | | | | re: Specifying multiple cursor types - invalid, right?
On Wed, 09 Mar 2005 16:15:01 GMT Michael Winter wrote:
[color=blue]
> The following declaration was posted to a forum:
>
> cursor: url('path/some.cur'), hand, pointer, text, default;
>
> and I'm having a hard time convincing the poster that it's invalid.
>
> First of all, I suppose it should be established that it /is/ invalid.
> The following excerpt is taken from the CSS 2 specification (and
> appears unaltered in CSS 2.1):
>
> 'cursor'
>
> Value: [ [<uri> ,]* [ auto | crosshair | default | pointer | move[/color]
|> e-resize | ne-resize | nw-resize | n-resize | se-resize
|> sw-resize | s-resize | w-resize | text | wait | help ] ]
|> inherit[color=blue]
>
> Clearly, only one keyword may appear in a single declaration, and only
> multiple URI values can appear, separated by commas. However, if a
> user agent encounters a declaration that doesn't follow that pattern,
> what is the expected behaviour?
>
> I would have assumed that the declaration would be marked erroneous
> and ignored, but it seems - at least with the W3C validator - that
> anything after the first keyword is ignored[1]. Could the reason be
> that the first keyword encountered simply stops the parser from
> iterating over the remaining values? If that is so, shouldn't the
> validator continue so it can alert the author to the problem?
>
> I realise that validators are but tools and are no substitute for
> sound knowledge of the language they attempt to test, but try
> explaining that to some people...
>
> Mike
>
>
> [1] The order of the keywords in the example should be changed so that
> 'hand' isn't the first to be encountered.[/color]
It would appear the person is attempting to create their own set of rules.
What would be the point of trying to force the use of a cursor style
enmasse?
Is the person thinking he can trick the browser into a multiple guess
situation and use which ever one is best suited or what?
Obviously the person hasn't even bothered to understand what can be applied
to the statement.
If I'm not sure of what's allowed in a condition, I will most certainly use
the resources of the WWW and find out.
And just maybe the person just does not understand what | means. | | | | re: Specifying multiple cursor types - invalid, right?
Richard wrote:
[snip]
[color=blue]
> Is the person thinking he can trick the browser into a multiple guess
> situation and use which ever one is best suited or what?[/color]
I believe the intent was to use the behaviour a user agent should
adopt when given a list of URI values: if the first resource is
unsupported, use the second, and so on.
[color=blue]
> Obviously the person hasn't even bothered to understand what can be applied
> to the statement.[/color]
The person is an idiot who refuses to accept he's wrong. The problem
is that he seems to think that the validator supports his case. That's
why I brought that up. He even thought that a W3C example - two URI
values, followed by a keyword - somehow proved me wrong.
[color=blue]
> If I'm not sure of what's allowed in a condition, I will most certainly use
> the resources of the WWW and find out.[/color]
There's no need. I was confident in my assessment, but it's nice to
have someone say, "You're right." I'm assuming (and it's generally a
fairly safe assumption on Usenet) that as none of the regulars have
jumped on what I've said as latently wrong, that I am in fact correct.
[color=blue]
> And just maybe the person just does not understand what | means.[/color]
No, I explained the notation and walked through what the specification
states, as a result.
[From your other post:]
[color=blue]
> Firefox will accept the cursor statement.[/color]
Klaus wasn't saying that the cursor property is proprietary, but that
the hand value (Microsoft's early equivalent to pointer) is, which is
correct.
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail. | | | | re: Specifying multiple cursor types - invalid, right?
*Michael Winter* <m.winter@blueyonder.co.invalid>:[color=blue]
>
> cursor: url('path/some.cur'), hand, pointer, text, default;
>
> First of all, I suppose it should be established that it /is/ invalid.[/color]
It is indeed, but you might want to ask on www-style whether it is really
intended to be. If it's not, it's not yet too late to be changed in
CSS*2.1.
Anyhow, the IE 'hand' issue is usually resolved with multiple 'cursor'
rules inside one ruleset.
--
"For every human problem, there is a neat, simple solution;
and it is always wrong." H. L. Mencken |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,467 network members.
|