-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE7 Invalid argument, unexpected call to method or property access. #17
Comments
So apparently sometimes the parameter n of setBorderBoxMinHeight is the dreaded NaN. When this occurs, IE7 throws a massive hissy fit. Maybe setting if(isNaN(n))
n = 0; would suffice as a fix? |
I'm also having the same error: Witch causes IE7 to crash... |
Was a solution ever found for: |
Not yet... |
As far as I can tell it happens when getPixelHeight returns 'auto', which it does for an awful lot of cases. I've worked around it using : @@ -467,7 +467,7 @@ function updateBorderBoxHeight() {
csh = element.currentStyle.minHeight;
if(csh != "none"){
csh = getPixelHeight(element,csh);
- if(csh !== "none"){
+ if(csh !== "none" && csh != "auto"){
if(getBoxSizing() == "border-box"){
setBorderBoxMinHeight(parseInt(csh));
} ... though I'm not entirely sure if that's the correct fix. |
I've also been getting the "Unexpected call to method or property access" error on trying to access 'element' from within the resizetimeout callback. It kinda seems like 'element' is no longer in scope once the timeout fires. I ended up capturing a local variable called 'theElement' - <attach event="onresize" for="window" onevent="update()" />
<script type="text/javascript">
//<![CDATA[
-var viewportwidth = (typeof window.innerWidth != 'undefined' ? window.innerWidth : element.document.documentElement.clientWidth);
+var theElement = element;
+var viewportwidth = (typeof window.innerWidth != 'undefined' ? window.innerWidth : theElement.document.documentElement.clientWidth);
// Shortcut for the document object
-var doc = element.document;
+var doc = theElement.document;
// Buffer for multiple resize events - and replacing all occurrences of 'element' with 'theElement', which appears to have fixed things. 😦 |
@jdelStrother it fixes the error but the CPU usage is still 100%. So I'm afraid it's unusable :( I also tried the theELement trick but that broke the script for me. |
@jdelStrother Thanks for the fix! I was going crazy trying to figure out how to get this polyfill to work with IE7, and your theElement solution worked. :) |
@jdelStrother - your comment above #17 (comment) fixed the js error for me in ie7. Thank you |
I was getting the error when body or html element had some sort of height. |
@marcoliverteschke your comment to check for isNaN worked solved many problemes (as well as CPU loads for us). Thanks a lot! This fix should go into the repository as well. |
I keep getting spammed with errors in IE7.
The page loads broken, then starts flickering between the working boxsizing version and the broken one. Every 0.5 seconds it shows me a working version, then goes back to broken.
I get the following error in IE7 (IE9 on IE7 mode, since the error message in IE7 tell me nothing useful at all.)
Line 374 is the line below which starts with element...
I also, sometimes, get the following error:
SCRIPT65535: Unexpected call to method or property access.
boxsizing.htc, line 323 character 2
These lines:
I'm testing this with the latest version of boxsizing.htc.
The text was updated successfully, but these errors were encountered: