Skip to content

Comment on It's surprisingly simple to click jack using CSS4

Comments

The trick is to overlay an element over the top of a link, with the CSS of "pointer-events: none;".

Clicking the div will click the underlying link, which will (if you're logged into facebook) "like" the Facebook Developer group.

Is this an issue with HTML5, or is it really an issue with how easy sites can manipulate your Facebook account?

Neither. The problem is that your browser handles click events on an invisible layer.

Well, no; there's two problems now. The first one is that your browser will handle click events on invisible and near-invisible layers. The second one is that your browser will allow click events to flow through opaque and near-opaque layers.

Those are not bugs, IMO.

A lot of web Javascript would be useless if events didn't bubble, and being able to define invisible click areas is useful in a variety of contexts.

Sucks that a few people are going to be malicious about it but I think the benefits outweigh the drawbacks.

The problem is not that events bubble, but that clicks fall through visible layers to lower ones and get caught invisible ones on top of what you intended to click on.

Invisible click areas as you called it are not the same as multi-layered click targets imho.

Yes, there is a different term for each case, but both boils down to "if I can't see it, why would I click it".

I hope this doesn't mean the end of niche browsers, or at least not those built on well-known rendering engines like WebKit.

This is just another brick in the wall. The web is /not/ a platform that's friendly to new implementations, and it never will be; the complexity that's constantly being added ensures this. It also means we're all going to have a lot fewer guarantees of anything like sane behavior when using the web in the years to come.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.