Skip to content
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

Flash: Attach fake body only when actually needed #1557

Merged
merged 1 commit into from
Nov 4, 2015
Merged

Flash: Attach fake body only when actually needed #1557

merged 1 commit into from
Nov 4, 2015

Conversation

niksy
Copy link
Contributor

@niksy niksy commented Mar 16, 2015

I was getting the infamous IE8 error HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917) when trying to use and attach fake body to html. Little testing and trying and I came to the solution that attached body only when it’s actually needed for checking, and that’s in two places, but with additional check to se if it’s available inside docElement.

Is this making any sense? :)

@patrickkettner
Copy link
Member

@niksy so sorry you were ignored :[[[

Would you be able to rebase this off of master?

@modernizr-savage
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: d258ae4
Build details: https://travis-ci.org/modernizr-savage/Modernizr/builds/88341676

(Please note that this is a fully automated comment.)

@niksy
Copy link
Contributor Author

niksy commented Oct 30, 2015

@patrickkettner now I’m sorry for keeping this unchecked :)

I’ve rebased this with the master and pushed the changes.

Again, I suppose this adjustment is valid, method only attaches fake body if it doesn’t exist on page and it does that only in blocks where there is a call for removeFakeBody.

Also, I’m working on a project which uses Flash detection and from time to time I would get two body elements which probably come from lack of proper cleanup. It’s really rare, but when checking for existence of body elements via document.querySelectorAll('body'), I get two elements and problems start to happen then (some scripts look for body at specific time and they get fake body which doesn’t have any children). If there is only one body element, everything works OK.

@patrickkettner
Copy link
Member

hey @niksy!

The fix looks good, but could you fixup the style issues?

thanks!

@niksy
Copy link
Contributor Author

niksy commented Oct 31, 2015

@patrickkettner sure! I’ve made amends to the commit and now everything should be fine.

patrickkettner added a commit that referenced this pull request Nov 4, 2015
Flash: Attach fake body only when actually needed
@patrickkettner patrickkettner merged commit 161a16e into Modernizr:master Nov 4, 2015
@patrickkettner
Copy link
Member

thanks so much!

@niksy niksy deleted the flash-attach-fake-body branch January 25, 2019 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants