- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Sun, 07 Mar 2004 19:37:46 -0500
- 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: SIMPLE EXAMPLE: Say you have a document as follows: <html> <body style="font-size: 15px">text</body> </html> 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 said? MORE COMPLEX EXAMPLE: Now consider a user who has a script (in a bookmarklet) that does the following: 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. Boris -- Isn't it interesting that the same people who laugh at science fiction listen to weather forecasts and economists? -- Kelvin Throop III
Received on Sunday, 7 March 2004 19:38:03 UTC