#32109 closed defect (bug) (fixed)
Emoji: JavaScript error in Internet Explorer 9 and 10
| Reported by: | germozy | Owned by: | azaozz |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2.2 |
| Component: | Formatting | Version: | 4.2 |
| Severity: | normal | Keywords: | fixed-major has-patch |
| Cc: | Focuses: | javascript |
Description
There is a javascript error in wp-includes/js/twemoji.min.js. The problem appears in Internet Explorer 9 and 10.
Unable to get property 'childNodes' of undefined or null reference.
Attachments (4)
Change History (19)
This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.
11 years ago
#3
@
11 years ago
Looks like wp-emoji.js was passing document.body to be parsed before it existed.
Per discussion in slack, I've changed the IE8 check to for IE8, IE9 or IE10.
As a fail safe, in the looping waiting for twemoji to load, I've added a check that document.body is defined.
#4
@
11 years ago
32109.1.diff changes all IE < 11 to wait for body.onload which can fire much later if there is a slow loading image, etc.
A better solution seems to be to use DOMContentLoaded which is supported everywhere except IE < 9. Then keep document.readyState === 'complete' for IE8. For this we will need to set a var in case DOMContentLoaded fires before twemoji.js is loaded (unlikely but possible).
#5
@
11 years ago
In 32109.2.diff:
- Use
DOMContentLoadedto initialize wp-emoji. - Use
readystatechangeanddocument.readyState === 'complete'as fallback in caseDOMContentLoadedis not supported (IE < 9 and other really outdated browsers).
Tested in Firefox, Chrome, IE11, IE8. Needs testing in IE10 and 9 just in case, and perhaps in other obscure browsers if somebody has one handy.
#6
@
11 years ago
WFM on BrowserStack instances of:
Win7/IE10
Win7/IE9
Win7/FF3.6
Win7/Old Safaris and Operas
Win8/IE10
Win8/IE10metro
#7
@
11 years ago
- Milestone Awaiting Review → 4.2.1
In 32109.3.diff: use the same events as jQuery( document ).ready() (the compat branch).
Tested in Firefox, Chrome, IE11 and 8. Still good to test in native/not-emulated browsers.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Ensure document.body is defined