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

pointer-events bug not mentioned #3094

Open
knod opened this issue Jan 5, 2017 · 5 comments
Open

pointer-events bug not mentioned #3094

knod opened this issue Jan 5, 2017 · 5 comments

Comments

@knod
Copy link

knod commented Jan 5, 2017

From what I can tell, if you set an iframe to pointer-events: none, you cannot get pointer events on any of its children, even if you set them to pointer-events: all. Maybe that's in the spec, but I don't know how to find it. This isn't mentioned on the pointer-events page: http://caniuse.com/#search=pointer-events.

This issue came up on Mac OSX 10.11, Chrome 55.0.2883.75.

@lpd-au
Copy link
Contributor

lpd-au commented Jan 6, 2017

I assume the pointer-events would go to the child document loaded within the iframe, (intentionally) not the parent document.

@knod
Copy link
Author

knod commented Jan 8, 2017

@lpd-au: Is this the behavior you're describing? https://jsfiddle.net/smy9oouj/3/ (try clicking on both halves of the iframe). The events are on the iframe's child element itself. I would expect the background to change when the lower half of the iframe is clicked, but not when the upper half of the iframe is clicked. Also, when the upper half is clicked, I'd expect the text color to turn white and a console message to be logged, which isn't the case.

@lpd-au
Copy link
Contributor

lpd-au commented Jan 8, 2017

Sorry I think I misunderstood what you were saying, you were going for something like this, right? https://jsfiddle.net/1oku60py/6/

Styles shouldn't inherit through iframes (excluding the defunct seamless version) so the root element of an iframe will already have pointer-events computed to auto, even if the iframe element itself has them set to none. I imagine the justification for the behaviour you see is that the iframe acts as a glorified blackbox UI widget, not a whitebox nested root node. Like eg an input element, if it doesn't receive pointer-events then it can't process them, which in this case means forwarding them into the child document.

This doesn't seem like a particularly good justification, though. The illusion/outcome that the parent page controls a css property of the child page must violate some separation principle. Though, if the above speculation is all correct, I question whether caniuse is the correct place to note it...

@thevictor13
Copy link

IE11 on Win7 does not support pointer-events: initial, while IE11 on Win10 does. pointer-events: visible shall be used instead in a non-SVG content. For SVG, its pointer-events: visiblePainted.

Just thought it's best to drop this in here as it's related.

@knod
Copy link
Author

knod commented Jan 11, 2017

@lpd-au: The behavior I was looking for was more like my example (except that pointer events would work on the internal elements of the iframe, as the css suggests). Your example, unfortunately, wasn't what I was looking for.

I don't know at this point if it belongs as a bug or what, but it at least seems like unexpected behavior and worth a note.

@thevictor13: Good to have the note. I think maybe you should make a new issue, though, because that detail doesn't really fit this title and so your note might not be noticed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants