webreflection / ie8 Goto Github PK
View Code? Open in Web Editor NEWsome damn DOM fix for this damned browser
License: MIT License
some damn DOM fix for this damned browser
License: MIT License
Hi Andrea,
incidentally, I created a very similar polyfill [1] with the same goals not long ago. I also created an exhaustive test suite, which passes in all contemporary browsers [2]. I tried running that suite against your polyfill (in IE8) and received quite a lot of errors. Would you mind checking if your impl conforms with the spec and the test suite?
[1] https://github.com/ondras/ie8eventtarget/
[2] https://github.com/ondras/ie8eventtarget/blob/master/tests/SpecRunner.html
If you are not familiar with the Jasmine BDD, let me know and I will provide any assistance to get your tests running.
Line 353 is
self.fireEvent(ontype, e);
In my case, this is submitting a form as soon as the listener gets added. I see in the comments that you want to perform the test on the actual element, but maybe there's a way to silence the event so it doesn't propagate or trigger the default behavior?
I think it's a great a idea to pollyfill getElementByClassName for standars in IE8
Some ideas: http://ejohn.org/blog/getelementsbyclassname-speed-comparison/
When I try to require() this package in my Browserified project I get a "Error: module "ie8" not found" error. From what I can tell this is because the "main" entry in the package.json file points to a file called ie8.node.js file which doesn't seem to exist after installing the package. I saw that the component.json file pointed to the ie8.max.js file, so I changed package.json to point to that file too and the error went away.
I hate to ask you to support YAPM (yet another package manager) but at least this one doesn't require YAJCF (yet another JSON config file) :-)
ie8 is not support indexOf and compareDocumentPosition function
defineProperties(HTMLSelectElement, {
value: {
get: function () {
return this.options[this.selectedIndex].value;
}
}
});
throw error in IE8
it must be?
defineProperties(window.HTMLSelectElement.prototype, {
value: {
get: function () {
return this.options[this.selectedIndex].value;
}
}
});
Hi Andrea!
What do you think about including fixes below into the project:
children
property fixgetElementsByClassName
fix via querySelectorAll
pageX
and pageY
properties for eventscloneNode
fixinnerHTML
fix for HTML5 elements (see html5shiv.js)insertRule
via addRule
I've an error with getters/setters. I investigated that babel polyfill check whether get/set methods are in attributes and throws exception.
It would be nice if you could add the script to http://www.cdnjs.com/.
I'm running aight v2 tests on IE8 and 9 (not pushed yet, but will be soon), and IE9 is failing as a result of the Text#nodeValue shim. I've followed this down into the guts of ie8.js
and found that the fallback descriptors are undefined in commonTextContent()
for both the Text#nodeValue and Comment#nodeValue, which causes the shimmed property getter and setter to throw an exception when the accessors are called, e.g. Unable to get value of the property 'get': object is null or undefined
. My patch just returns early from commonTextContent()
when the fallback descriptor is undefined, but this doesn't seem like quite the right thing to do.
I know that ie8.js
is intended for IE8, but I need a lot of those shims in aight for IE9 support as well. In this specific case, though, IE9's native Text#nodeValue implementation works. So, should I fork this repo and make some aight-specific patches for IE9 compatibility, or would you prefer to do some light-weight feature detection that ensures it'll just work in IE9?
Hi! I noticed that you updated ie8 to 2.3, but npm still only has 2.2.
Btw, I've been using Restyle, document-register-element, and dom4 over the last couple days. Fantastic stuff, thank you very much!
It seems that your lib does not support HTMLEvents.
Do you plan to implement it?
Webpage error details
Message: unsupported HTMLEvents
Line: 433
Char: 32
Code: 0
URI: http://192.168.7.51:8083/.../js/ext/ie8/build/ie8.max.js?1407943532
Would it make sense to add this?
This library causes select.onchange (and possibly other) React events to not fire in IE8. There was a ticket open over there, but they've closed it because they're dropping IE8 support starting with v0.15. I'm not sure if this can be fixed or not on this (ie8.js) end, but it'd be nice 😄
I think it would be better to specific the 'max' build as main
, as it makes debugging much easier, and anyone who uses the file via commonjs/npm likely will minify it as part of their own build.
I'm trying to evaluate what I need to be on the lookout for when updating. It would be really helpful to have a changelog to reference.
Attached a patch to normalize some event and window attributes.
Window: pageXOffset, pageYOffset, scrollX, scrollY, innerWidth, innerHeight
Event: which, charCode, buttons, button (as far as practicable)
button
properties differ from other browsers at IE8
I'm not sure if this is a bug, or a feature, but any calls to document.createEvent()
fail for any kind of event except the generic 'Event'
. This means that calls that would normally work in IE8 break while using this library. For example:
document.createEvent('Event')
-> worksdocument.createEvent('HTMLEvents')
-> Throws errorIt's right there in the code to do this, but is this behaviour intentional?
Hi,
i want to bundle ie8 with some other ie8 fixes. I tried it with browserify, but it seams not to work as expected. I think it's because of the package.json main entry. It is referring to the build/ie8.js file, which expects this to be windows. It would fix the problem If we change packages main to point to src/ie8.js?!
either include as dependency this file or implement similar logic in order to fix this property as meant by standards.
For reference: shawnbot/aight#38
All browsers support textContent:
https://developer.mozilla.org/en-US/docs/Web/API/Node.textContent
except IE6-8. You can polyfill it easily using the IE proprietary innerText:
http://msdn.microsoft.com/en-us/library/ie/ms533899(v=vs.85).aspx
Not sure if this would be appropriate for your library, but it would be easy to fix and wouldn't require users to branch for IE in this case. Note that there are differences between the two, as outlined on MDN.
I just include ie8.js in the page.
and browser console log this:
value failed on object: [object HTMLSelectElement] 对象不支持此操作
what can i do now?
I have the following code:
document.addEventListener "mousemove", (event = window.event) =>
alert "move"
However, in IE8, the callback never fires.
This worked in IE >= 9 as well as Chrome and Firefox.
shown in IE 8.0.6001.19587
on this:
defineProperty = Object.defineProperty ||
// just in case ...
function (object, property, descriptor) {
object[property] = descriptor.value;
},
I can't understand...
http://stackoverflow.com/questions/11042275/javascript-ie8-event-coordinates
IE8 don't support pageX/Y on Event.
Could you support pageX,pageY properties ?
please adjust your README.
Hi! What about adding the defaultPrevented
property to Event
? There is a simple example of implementation here: https://github.com/jwmcpeak/EventShim
I think this is due to the that in IE8, defineProperty only accept DOM objects (http://kangax.github.io/compat-table/es5/), although the MSDN link is not as clear...
Basically, in this case, IE8 does not like to call defineProperty
with XMLHttpRequest.prototype
The work around I have is to not call defineProperty
inside definedProperties
:
defineProperties = Object.defineProperties ||
// IE8 implemented defineProperty but not the plural...
function (object, descriptors) {
for(var key in descriptors) {
if (hasOwnProperty.call(descriptors, key)) {
object[key] = descriptors[key].value;
}
}
},
I have got issue with the following example. Then I tried to type anything into input I see error "StackOverflow ".
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<input />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Tech: webpack+reactjs
Is it known issue? Or may be anyone knows how it can be fixed?
I found error here
function onkeyup(e) {
var evt = document.createEvent('Event');
evt.initEvent('input', true, true);
(e.srcElement || e.fromElement || document).dispatchEvent(evt);
}
the error is not happening if I skip dispatchEvent handler from dispatch algorithm, but i would like to have fix for it. What do you think about it?
In the dispatch algorithm I see alot of recursion handling. As I understand it may cause errors with markup in the future.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.