W3C home > Mailing lists > Public > www-style@w3.org > March 2004

Re: thoughts on non-compliant browsers

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 07 Mar 2004 19:37:46 -0500
Message-Id: <200403080037.i280blgw003938@nerd-xing.mit.edu>
To: Robert Koberg <rob@koberg.com>
Cc: www-style@w3.org

> Why should this be the responsibility of the browser? Shouldn't it be 
> the responsibility of the user to simply not use?
> has the meaning of pixel changed?

Let's look at two examples:


Say you have a document as follows:

  <body style="font-size: 15px">text</body>

And the user has a user stylesheet with a rule that says:

* { font-size: 20px !important }

What size will the text be?  Why?  Does it matter what your styles actually


Now consider a user who has a script (in a bookmarklet) that does the

1)  Walks the DOM in a postorder traversal.
2)  For each node, gets its computed font-size in pixels.
3)  Gives the node a unique classname it creates (eg. it uses a counter that it
    appends to the end of a string like "MyFontSizes").  This classname would
    be appended to whatever other classes the node already belongs to.
4)  Inserts a !important rule into the user stylesheet that sets the font-size
    for that class to 1.5 times the computed font size the script got in step 2
    (all in pixels).

Once this script finishes executing on the page in the simple example, what
size will the text be?  Why?  Does it matter what the page styles said?  How?
Is there any violation of the CSS specification there?

What Mozilla does, from the point of view of a page author, is to just provide
a menuitem that runs that script.

Isn't it interesting that the same people who laugh at
science fiction listen to weather forecasts and
                          -- Kelvin Throop III
Received on Sunday, 7 March 2004 19:38:03 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:12 UTC