PIE icon indicating copy to clipboard operation
PIE copied to clipboard

IE8 crashes with inclusion of PIE and prototype.js

Open lojjic opened this issue 14 years ago • 22 comments

Inclusion of prototype.js (just inclusion, not even calling anything in it) crashes IE8 when PIE.htc is applied.

Forum post: http://css3pie.com/forum/viewtopic.php?f=3&t=19

Testcase committed at tests/submitted/forum-f3-t19.html

lojjic avatar Jul 18 '10 15:07 lojjic

The crash only happens with Prototype 1.6.1.0. Downgrading to 1.6.0.* makes the crashing stop.

Also, IE7 is fine with either version.

lojjic avatar Jul 18 '10 15:07 lojjic

Downgrading doesn't seem like a good fix to me =\

jamsi avatar Jul 20 '10 06:07 jamsi

Yeah, I'm not saying it's a fix, just wanted to mention it here for informational/debugging purposes.

lojjic avatar Jul 22 '10 15:07 lojjic

Any word on if or when this issue might be fixed. I would love to use this solution for an upcoming site launch but I use prototype 1.6.1 and downgrading is not an option.

ecunningham avatar Aug 05 '10 16:08 ecunningham

Unfortunately I've got no clue how to proceed working around this. It appears that Prototype 1.6.1 causes the crash when used with similar HTC-based products, so getting it fixed in Prototype itself is probably our best bet.

I see someone has already opened a ticket in Prototype's tracker about crashing with curved-corner.htc -- perhaps you could inquire there and add a note that the same happens with PIE.

lojjic avatar Aug 05 '10 16:08 lojjic

Thank you

ecunningham avatar Aug 06 '10 13:08 ecunningham

I'm Andrew Dupont, one of the co-maintainers of Prototype.

From what I gather about this bug, neither PIE nor Prototype appears to be at fault. The bug has been reported with Prototype and other HTCs (like the popular PNG fix), and with PIE and MooTools 1.3. It seems to be a specific sort of conflict between HTCs and augmenting DOM node host objects (the constructors for specific node types, like HTMLDivElement). The latter has been present in other browsers for years, but was a new feature to IE8.

So, in other words, it's IE's fault, but it has implications for both Prototype and HTCs like PIE.

savetheclocktower avatar Aug 14 '10 23:08 savetheclocktower

Thanks for the info, Andrew. I had figured as much. shakes fist at IE

So, that said, do you have any ideas how to proceed getting around this? I'm happy to help trying code changes or whatnot, but since it's a crash is there even a way to get good debugging info to trace the exact code triggering the crash?

I'd hate for the answer to be to not use PIE with Prototype or MooTools.

lojjic avatar Aug 15 '10 00:08 lojjic

Right, and neither do we want that to be the answer, since HTCs are a useful (if arcane) tool in many web developers' toolboxes.

One commenter on our bug says he's in the middle of a deep dive into this issue. I might end up doing my own as well. I'm perfectly willing to change our code to work around the problem, as long as I can do so without losing our ability to define methods directly on DOM nodes' prototypes (since that feature makes Prototype far more performant on IE8 than otherwise). If not, I should at least be able to create an "opt-in" workaround.

savetheclocktower avatar Aug 15 '10 00:08 savetheclocktower

Excellent, thanks. I'll keep an eye on your ticket for progress. Please let me know if there's anything you need me to do from my end to help out.

The ticket: https://prototype.lighthouseapp.com/projects/8886/tickets/1107-ie8-fatal-crash-when-prototypejs-is-loaded-with-rounded-cornershtc

lojjic avatar Aug 15 '10 00:08 lojjic

Has anyone found a fix for this yet? I have a photo gallery that needs prototype and I'm having the same crashing problem on IE8

bghouse avatar Jan 24 '11 02:01 bghouse

From the Prototype bug report it doesn't look like there's a fix yet.

lojjic avatar Jan 28 '11 23:01 lojjic

So this recent StackOverflow comment explains the problem. I have no way of knowing whether this is true, but it sounds convincing.

The suggested fix appears sound. It's ugly — it requires modifying the Prototype source code — but if I understand the flaw correctly, there's no way around that.

lojjic, does the testcase still crash IE8 on your machine? I can't get it to do so in my XP virtual machine. If it's still a crasher for you, hopefully we can figure out a way to detect whether the fix has been applied — even something ugly like a version string sniff — so that I can tell those versions of IE8 not to try to extend the prototypes of DOM nodes.

savetheclocktower avatar Jan 28 '11 23:01 savetheclocktower

Yeah the testcase still elicits the crash for me, even after updating it to use the more recent Prototype 1.7.0.0 version. I'm using a XP VM with IE8 as well, but I haven't applied updates to it in a while so that makes sense if it has indeed been fixed by a recent Windows update.

lojjic avatar Jan 29 '11 00:01 lojjic

My version of IE8 is 8.0.6001.18702. What's yours?

savetheclocktower avatar Jan 29 '11 00:01 savetheclocktower

The same.

lojjic avatar Jan 29 '11 00:01 lojjic

HOW INFURIATING

I don't suppose there's any fool-proof way to detect the use of PIE on a page, is there? I can fix this by preventing IE8 from extending DOM prototypes across the board, but I really don't want to do that.

savetheclocktower avatar Jan 29 '11 00:01 savetheclocktower

Indeed it is! :/

The closest you could get is to test for the presence of the window.PIE object, but I'm not sure you could reliably use that as an indicator due to the way HTC files load in and get initialized asynchronously. There's no guarantee the object will have been initialized by the time Prototype's feature detection gets executed.

I should point out that PIE now ships with a standalone JavaScript version which can be used instead of the HTC: http://css3pie.com/documentation/pie-js/ -- using this instead of the HTC, while less convenient, does avoid the crash. So this issue is somewhat less severe than when this ticket was created since there is at least another option.

lojjic avatar Jan 29 '11 00:01 lojjic

HAHAHA DISREGARD THAT (I can reproduce it now)

Researching a workaround. If I can't find one, "use PIE.js" will be the official way to resolve this godforsaken issue.

savetheclocktower avatar Jan 29 '11 02:01 savetheclocktower

Here's an even-more-basic testcase, one which demonstrates that the problem is far deeper than either of our libraries. Simply trying to read a property within an HTC produces a crash if a node's prototype has been augmented.

If I wrap the code that adds HTMLDivElement.prototype.foo in a setTimeout, or defer its execution some other way, everything works fine. But that's not feasible for Prototype because the methods need to be there by the time the next script is evaluated.

I'll keep thinking about it, but I'm damn near out of ideas.

savetheclocktower avatar Jan 29 '11 03:01 savetheclocktower

I cannot recreate this. According to a stackoverflow article, a Windows Update fixed this issue by fixing IE itself.

I have tried prototype 1.6.1 and prototype 1.7.0, both with PIE.htc included, and no crash.

brandonramirez avatar Feb 23 '11 19:02 brandonramirez

I have the latest windows update. but it still crashed... I've also tried using IETester, crashed too I've also tried IE8 browser mode on IE9, the same crash appear

so, does "use pie.js" still the official way of doing this or is there any other new solution?

emkamal avatar Jun 04 '12 09:06 emkamal