gehuangyi20 / ie7-js

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

Object Required Error in IE6 if HTML tag has any property set to "inherit" #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. set any css property to "inherit" for the html tag
2. load the script in ie6

What is the expected output? What do you see instead?
Expect no JS error. Get "Object Required" error message.

What version of the product are you using? On what operating system?
IE7.js 2.0 beta3 Windows XP

SOLUTION: 
on line 1354, check for element.parentElement before setting
element.runtimeStyle[propertyName]

    if (element.parentElement) {
      element.runtimeStyle[propertyName] =
element.parentElement.currentStyle[propertyName];
    }  

Original issue reported on code.google.com by k...@englishrules.com on 8 Aug 2008 at 7:17

GoogleCodeExporter commented 9 years ago
by the way, I realize it doesn't make any sense to have something like >> html
{font-weight: inherit;} << in a stylesheet, but I have a feeling that some of 
these
CSS "frameworks" are throwing in the html tag along with all the others when 
doing
their reset business. At least, I think that's what happened with the site I was
called on to "fix." 

Original comment by k...@englishrules.com on 8 Aug 2008 at 9:29

GoogleCodeExporter commented 9 years ago
Eric Meyer's reset.css has

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

defined for lots of things, including html, so this error might actually be 
fairly
prevalent.

Original comment by mawi...@gmail.com on 12 Aug 2008 at 4:18

GoogleCodeExporter commented 9 years ago
Yes, agreed. I use Eric Meyer's reset which has this same problem.

Original comment by tanc.whi...@gmail.com on 12 Oct 2008 at 3:15

GoogleCodeExporter commented 9 years ago
We also experienced this bug and used the IF statement as suggested to fix it. 

Original comment by jakerobe...@gmail.com on 23 Dec 2008 at 10:06

GoogleCodeExporter commented 9 years ago
I experience this error as well, but the if test does not fix anything.

Original comment by hhb...@gmail.com on 26 Jan 2009 at 11:14

GoogleCodeExporter commented 9 years ago
Never mind, it fixes the problem, but somehow this uncompressed version doesn't 
do
the same as the compressed one.

Original comment by hhb...@gmail.com on 26 Jan 2009 at 11:32

GoogleCodeExporter commented 9 years ago
The solution suggested in the initial post stops the error from occuring, but 
then 
this portion of the script still doesn't actually function as intended.

I'll see if I can illustrate it here.  Say we're using Meyer's reset, and I 
want to 
specify a font-weight to my <h2>s.

(part of the reset, appears first)
[...],h2,[...]{
[...]
font-weight:inherit;
[...]
}

(then later down the css file I specify the following:)
h2{font-weight: 700;}

The script doesn't seem to take into account I've actually specified a value 
for 
this, and wipes it back to default anyway.  Using the IE8 script, this occurs 
in 
both IE6 and IE7.  To get it to display properly, all instances of *:inherit 
need to 
be removed or commented out.

Original comment by schet...@gmail.com on 29 Jan 2009 at 11:39

GoogleCodeExporter commented 9 years ago
This appears to be fixed in the most recent versions of IE7-js.
I was able to stop this happening by using:

http://ie7-js.googlecode.com/svn/trunk/lib/IE7.js

instead of:

http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js

Original comment by adam.q.salter@gmail.com on 31 Jan 2009 at 11:27

GoogleCodeExporter commented 9 years ago
I can confirm that downloading the beta 4 version worked for me too.
I was also using Eric Meyers reset sheet.

Props for discovering that! Wouldn't have thought of it!

Original comment by janha...@gmail.com on 21 Feb 2009 at 6:13

GoogleCodeExporter commented 9 years ago
I too have confirmed that this fixes the problem. Hopefully this will make it 
into the next full release.

Original comment by timd.mac...@gmail.com on 31 Jul 2009 at 8:39

GoogleCodeExporter commented 9 years ago

Original comment by dean.edw...@gmail.com on 8 Feb 2010 at 3:40