rc452860 / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

“font: inherit;” (as used in Eric Meyer’s CSS Reset 2.0) causes JavaScript error in IE 6 and 7 #307

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. In IE 6 or 7, visit http://www.pauldwaite.co.uk/test-pages/ie7-reset2/

What is the expected output?

No JavaScript errors.

What do you see instead?

Line: 2080
Char: 11
Error: Invalid argument
Code: 0

What version of the product are you using? On what operating system?

ie7-2.1(beta 4)/src/IE9.js

Please provide any additional information below.

Version 2 of Eric Meyer’s CSS reset uses the CSS rule “font: inherit” in 
its first declaration. When ie7-js encounters this, the following line throws 
an “invalid argument” error in IE 6 and 7.

    element.runtimeStyle[propertyName] = element.parentElement.currentStyle[propertyName];

I’ve put a reduced test page up at 
http://www.pauldwaite.co.uk/test-pages/ie7-reset2/. This uses a stylesheet that 
only applies the CSS rule to the <body> element, and does nothing else.

If the rule is applied to an HTML element not on the page, the error disappears.

Original issue reported on code.google.com by pauldwai...@gmail.com on 2 Mar 2011 at 4:31

GoogleCodeExporter commented 9 years ago
This avoids this bug:

change
font: inherit;
to
font-weight: inherit;
font-style: inherit;
font-family: inherit;

Original comment by espe...@gmail.com on 7 Mar 2011 at 2:32

GoogleCodeExporter commented 9 years ago
Hey, that it does: excellent.

Original comment by pauldwai...@gmail.com on 7 Mar 2011 at 11:01

GoogleCodeExporter commented 9 years ago
That does provide a temp fix to the bug but we really need an actual fix for 
this. I believe this issue is also related to Issue #300 (or at least was for 
me).

Original comment by twofivet...@gmail.com on 14 Apr 2011 at 2:37

GoogleCodeExporter commented 9 years ago
I'm also using v2 of Eric Meyer's reset and was having the same JS error with 
IE9.js - thanks for posting the temporary workaround.

Original comment by michael....@gmail.com on 14 Apr 2011 at 5:35

GoogleCodeExporter commented 9 years ago
Solution is in this ticket: http://code.google.com/p/ie7-js/issues/detail?id=354

Original comment by var...@gmail.com on 20 Dec 2011 at 12:38

GoogleCodeExporter commented 9 years ago
Aha, good spot. Excellent.

Original comment by pauldwai...@gmail.com on 20 Dec 2011 at 12:46