gehuangyi20 / ie7-js

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

Error when using Eric Meyers reset.css #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use Eric Meyers Reset.css
(http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/)
2. with (http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js)
3. Open up in IE 7 or IE 6

What is the expected output? What do you see instead?
I expected everything to work and not have JavaScript errors.

What version of the product are you using? On what operating system?
Windows Vista, XP + IE 8, IE 7, IE 6

Please provide any additional information below.
When you remove:
font-weight: inherit;
font-style: inherit;

from:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td
{
  /* eric's code here */
}

Then it works just fine :)

Original issue reported on code.google.com by mge...@gmail.com on 12 Aug 2008 at 10:10

GoogleCodeExporter commented 9 years ago
This problem also occurs with other CSS Frameworks (in my case Blueprint). 
Removing 
those lines fixes the problem.

Original comment by wouterbu...@gtempaccount.com on 3 Jan 2009 at 11:51

GoogleCodeExporter commented 9 years ago
The problem looks like it's in IE7.CSS.addRecalc.  It uses 
element.parentElement, without checking to see that 
the element actually has a parent.

This modified version seems to work for me

// -----------------------------------------------------------------------
// propertyName: inherit;
// -----------------------------------------------------------------------

IE7.CSS.addRecalc("[\\w-]+", "inherit", function(element, cssText) {
  var inherited = cssText.match(/[\w-]+\s*:\s*inherit/g);
  for (var i = 0; i < inherited.length; i++) {
    var propertyName = inherited[i].replace(/ie7\-|\s*:\s*inherit/g, "").replace(/\-([a-z])/g, function(match, 
chr) {
      return chr.toUpperCase()
    });
    // check if parent exists
    if (element.parentElement) {
        element.runtimeStyle[propertyName] = element.parentElement.currentStyle[propertyName];
    }
  }
});

Original comment by mjpizz on 20 Jun 2009 at 5:41

GoogleCodeExporter commented 9 years ago
I comment only the line "font-family: inherit;", then it works just fine.

Original comment by falecom...@gmail.com on 6 Oct 2009 at 8:01

GoogleCodeExporter commented 9 years ago
This is a duplicate of issue #104. It is fixed in the next release (2.1).

Original comment by dean.edw...@gmail.com on 11 Feb 2010 at 1:07