CSS3 PIE Forums

Javascript Error IE8
Page 1 of 1

Author:  Daniel1990 [ Wed Apr 18, 2012 12:02 am ]
Post subject:  Javascript Error IE8

Hi guys.
I use PIE.htc in my Project but it don't work as it should.
An error ('null' is null or not an object) occurs only on 2 buttons on my website.
I used the uncompressed version for debugging a little bit and so i got that cs=null, but el.currentStyle isn't.

Here the Code from PIE_uncompressed.htc (starting at Row 1311)
* Get the raw CSS value for the target style
* @return {string}
getCss: cacheWhenLocked( function() {
var el = this.targetElement,
ctor = this.constructor,
s = el.style,
cs = el.currentStyle,
cssProp = this.cssProperty,
styleProp = this.styleProperty,
prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ),
prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) );
return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp );
} ),

So please anyone who has an idea about this problem help me please.

Error_PIE_uncompressed.jpg [106.37 KiB]
Not downloaded yet

Author:  jason [ Wed Apr 18, 2012 9:49 am ]
Post subject:  Re: Javascript Error IE8

Can you put together a standalone testcase that triggers this error? There have been several users reporting this issue, but without a reliable way to reproduce the issue it is extremely difficult to implement a proper fix.

Author:  Daniel1990 [ Thu Apr 19, 2012 11:54 pm ]
Post subject:  Re: Javascript Error IE8

I don't think that i can make standalone testcase.
But i found the <div> (my toolbar) which throws the error but only on 2/4 buttons.

I'v got a main.css in my site which sets styles for this <div>:
#ToolBar1__div {
background-color: #FFFFFF;
-webkit-box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);

And i'v got a mainIE.css:
#ToolBar1__div {
box-shadow: 0px 4px 4px 0px rgb(200, 200, 200);
behavior: url(Skins/PIE.htc);

and on the .html site i referenced like this:
<link rel="stylesheet" type="text/css" href="Skins/main.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="Skins/mainIE.css" />

is there anything PIE.htc could have a problem with?

Author:  dansmith [ Mon Apr 23, 2012 5:13 pm ]
Post subject:  Re: Javascript Error IE8

I am having a similar issue, and am unsure how to find the root cause.

    getCss: PIE.StyleInfoBase.cacheWhenLocked( function() {
        var el = this.targetElement,
            cs = el.currentStyle,

        // Don't redraw or hide borders for cells in border-collapse:collapse tables   
        if( !( el.tagName in PIE.tableCellTags && el.offsetParent.currentStyle.borderCollapse === 'collapse' ) ) {

The error I am getting is that IE8 cannot find the offsetParent of any THs in my table (in console-based debugging, offsetParent == null).

My understanding is that offsetParent is the closest parent element with a CSS 'position'.

I tried adding position:relative to my table element in the CSS file, but this did not help.

I imagine that I could add a check for el.offsetParent to PIE.js, but would prefer to avoid hacking this file if possible, hence I've been trying to find the situation in which the bug occurs, but as this is a CSS + JS heavy site it is not a straightforward task.

Things are being hidden and shown on the problematic page, so I wonder if the CSS 'position' is being removed by jQuery at some point.

Another interesting twist is that I don't actually have any PIE applied to my TH elements, so it seems strange that PIE wants to do anything with the parent table.

Will post again if I get any closer to the cause.


Author:  dansmith [ Mon Apr 23, 2012 5:44 pm ]
Post subject:  Re: Javascript Error IE8

Hi again,

I created a test case but could not reproduce the issue so am parking this for now.

However, I discovered that my TH elements did have a PIE style applied in a global stylesheet, but this was disabled (via behavior:none !important) in a page-specific stylesheet.

Removing the PIE styling from THs in the global stylesheet resolved my issue.

Perhaps this gives a clue as to how to resolve this?


Author:  jaydubs [ Fri Oct 11, 2013 5:48 pm ]
Post subject:  Re: Javascript Error IE8

I've got a repeatable test case, but I'd rather not post the code to the public. How do I get you the files to recreate the error?

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group