Re: Trumping bad proprietary code.

On 6 Nov 2012, at 15:25, Philip TAYLOR <P.Taylor@Rhul.Ac.Uk> wrote:
> 	.qmmc {position:relative;zoom:1;}
> 
> and so (rather naively) I inserted a later rule in my local
> customisations that reads :
> 
> 	.qmmc {position:relative}


> Unfortunately (of course) the Validator still barfs on the earlier
> entry.  If it had been a bad property value such as "position:
> sideways", I am reasonably confident that a subsequent re-definition
> as "position: relative" would have been fine

The redefinition of position would be fine (although meaningless as you don't change the value).iEven ff you could redefine "zoom" to be unset,  the original rule would still be invalid.

> , in that (presumably but not certainly) the validator evaluates the cascade before deciding
> which rules to validate (is this assertion true ?),

Each rule-set has to be parsed.

Each property is applied to each element matched by the selector in cascade order.

You can only override a property, never an entire ruleset (except on a property-by-property basis).

The validator reflects the way CSS works.

> but given that
> it is not a bad property value but a bad property, is there nothing
> I can do short of hacking proprietary code to make this site valid ?


You could use conditional comments (another proprietary hack, but one that is valid) to load an IE-only stylesheet with the IE-specific hacks in it. Then the validator would treat that stylesheet as being commented out and not validate it.

That does feel like creating valid code for the sake of validity instead of as part of a QA process though. 

-- 
David Dorward
http://dorward.me.uk

Received on Tuesday, 6 November 2012 15:42:47 UTC