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

Conversation

Projects
None yet
3 participants
@niksy
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

patrickkettner commented Sep 21, 2015

@niksy so sorry you were ignored :[[[

Would you be able to rebase this off of master?

@modernizr-savage

This comment has been minimized.

Copy link

modernizr-savage commented Oct 30, 2015

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

patrickkettner commented Oct 30, 2015

hey @niksy!

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

thanks!

@niksy

This comment has been minimized.

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

Merge pull request #1557 from niksy/flash-attach-fake-body
Flash: Attach fake body only when actually needed

@patrickkettner patrickkettner merged commit 161a16e into Modernizr:master Nov 4, 2015

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@patrickkettner

This comment has been minimized.

Copy link
Member

patrickkettner commented Nov 4, 2015

thanks so much!

@niksy niksy deleted the niksy:flash-attach-fake-body branch Jan 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.