Live data from Hacker News

CSS Paint API: New possibilities in Chrome 65

developers.google.com

41–50 of 59 posts

Re: CSS Paint API: New possibilities in Chrome 65

#41
post #30

Earlier quoted context omitted.

I would hardly call it secure. There have been too many failures with certificate authorities. The whole system is dependent on that weak point. Also do you keep track of the certificates issued to every website you visit? Then if you visit the website notice the certificate has changed. Do you check if it's a legitmate change ect.. If you don't keep track of certificates how do you even know you are not being MITM.…

> I would hardly call it secure. There have been too many failures with certificate authorities. The whole system is dependent on that weak point. Just because a system has flaws doesn't mean you should be using an even more flawed system like HTTP. With HTTPS, attackers can't read or modify traffic. If you really think certificate authorities are that unreliable, you can choose which certificates you trust yourself…

Of course you can keep track of Certificates. Honestly, if more people did that the better.

However, my problem is the browsers are forcing choices on people that are not part of the standard. They are acting as if they know best. They are also making it harder for advance users to alter these decisions. Try to enable plain text HTTP 2.0 in Firefox? No option exists in about:config.

Further, I don't see an option to disable Firefox's Secure contexts for new features. Might exist, but may need to look more.

Re: CSS Paint API: New possibilities in Chrome 65

#42

> As of now, text rendering methods are missing and for security reasons you cannot read back pixels from the canvas. Does anyone have an idea as to what those reasons might be? I've heard of JavaScript access to certain CSS features being limited (e.g. getComputedStyle()), but I'm not sure what the benefit is here. Is there any way that user information could be leaked through a paint worklet context?

We made a mistake in the article there. (There aren't any security issues with pixel read-back here) I'll ping Surma on Monday to get it fixed.

The primary reason we did this is to ensure there wasn't a performance cliff if you did read-back pixels. With the current API surface you can record all of the canvas commands, and play them back when you need to raster. Additionally it doesn't leak how many pixels we are actually rastering to.

(hope this helps).

Re: CSS Paint API: New possibilities in Chrome 65

#43
post #30

Earlier quoted context omitted.

Or maybe Google and Mozilla actually want to make the web more secure? Not everything has to be a conspiracy.

I would hardly call it secure. There have been too many failures with certificate authorities. The whole system is dependent on that weak point. Also do you keep track of the certificates issued to every website you visit? Then if you visit the website notice the certificate has changed. Do you check if it's a legitmate change ect.. If you don't keep track of certificates how do you even know you are not being MITM.…

The certificate transparency initiative is going to make MITM really hard.

Re: CSS Paint API: New possibilities in Chrome 65

#44
post #13

we already had this all the way back in 2008. It's called webkit css canvas! Iconapp.io is using that heavily! background: -webkit-canvas(mycanvas);

with the CSS Paint API you instantiate a new canvas like object for every time your reference the painter, while this was referencing one specific instance of a canvas, right?

Yes, the only downside is that you have to procedurally instantiate a canvas. You get to control when the render event should happen though. With CSS Paint API, it feels like declaring webgl shader.

Re: CSS Paint API: New possibilities in Chrome 65

#45
post #7

You've always been able to use a canvas normally and then create a url to it using toDataUrl. Alternatively toBlob then createObjectURL which I think might be more performant than data url which requires encoding/decoding base64. So I guess the main thing added is convenience? Am I missing something here? Adding CSS that requires corresponding JS code is also new territory isn't it (I can't think of anything else tha…

There are a few extra performance tricks we can do behind the scenes here.

- Chrome's implementation won't actually perform a raster at this stage, instead we'll raster later on a background thread. toDataUrl, etc will raster.

- We'll only invoke the paint method for things which we actually need to paint. E.g. if you have a long list, we won't invoke the method for things that are outside the paint window (things off-screen).

- We'll have the ability to add a bunch of caching later on. From memory the servo folks in their experimental implementation actually speculatively generated a bunch of images ahead of time.

- We are actively investigating moving this to a background thread. So even if your main thread is janked, an animation which triggers a paint worklet, will still run at 60fps.

edit - formatting.

Re: CSS Paint API: New possibilities in Chrome 65

#46

> Note: As with almost all new APIs, CSS Paint API is only available over HTTPS (or localhost). This feels ridiculous. I understand why certain features would be gated behind https (camera access, stuff like that). But this feature doesn't look dangerous at all. I don't always want to deploy https. What about local websites (not localhost, but LAN) ? Am I not allowed to use those APIs then ?

From a purely technical perspective I agree. There's no reason this has to be behind HTTPS.

I don't think this was done for technical reasons though. Rather, it's an attempt to drive further adoption of HTTPS with the ultimate goal of phasing plain HTTP out of mainstream use entirely.

For websites on LAN you can either install your own root cert on client devices, or assign the site a public domain name (even if the site itself isn't accessible from the public internet) and get a publicly-trusted cert that way.

Re: CSS Paint API: New possibilities in Chrome 65

#47
post #22

Quit bloating the web... Also I am sick the HTTPs everywhere movement. What if I for what ever reason don't want to use HTTPs. We have so few browsers, that basically what they do is the defacto standard.

I am sorry that you are sick of the HTTPS everywhere movement.

But forcing your sites to use HTTPS will also prevent your users from unwittingly participating in DDOS attacks on other sites (e.g. https://en.wikipedia.org/wiki/Great_Cannon). Consider it herd immunity.

Also, to respond to some of your other anti-HTTPS comments:

regarding overhead: people are also working hard to minimize the amount of overhead inherent to TLS. For instance, TLS 1.3 will establish an encrypted connection in a single roundtrip, and is capable of resuming encrypted connections in zero roundtrips with application opt-in (see https://blog.cloudflare.com/tls-1-3-overview-and-q-and-a/). The encryption itself has fairly ubiquitous support in hardware, making most of them ridiculously fast.

regarding CAs: with HTTP you are implicitly relying on the honesty of people in the network path. With HTTPS you are implicitly relying on the honesty of the intersection of a) people in the network path, b) people who control a CA. This is strictly fewer people than with HTTP. People are also working hard to solidify our faith in the set (b), by requiring Certificate Transparency for all new certificates, thereby ensuring that misbehaving CAs can be detected, and drastically raising the cost of mounting a CA-based attack.

You say "What if I for what ever reason don't want to use HTTPs", I you'll have to layout some of those reasons explicitly. You'll probably find that people are working on all of them.

In general, the default expectation on the web should be encrypted and authenticated (i.e. only both endpoints can read/write the data). Once we live in that future, asking for the ability to allow plaintext network traffic will seem a lot like asking modern programming languages to explicitly allow buffer overflows. The language designer would be justified in saying "No", and ignoring you. The considerate language designer might ask "why would you want that", and try to address your real need. But they would still never actually give you what you ask for. This may be "taking away choice" in the same sense that mandating airbags is "taking away choice", but people shrug and accept it because the baseline has moved.

Re: CSS Paint API: New possibilities in Chrome 65

#48
post #46

> Note: As with almost all new APIs, CSS Paint API is only available over HTTPS (or localhost). This feels ridiculous. I understand why certain features would be gated behind https (camera access, stuff like that). But this feature doesn't look dangerous at all. I don't always want to deploy https. What about local websites (not localhost, but LAN) ? Am I not allowed to use those APIs then ?

From a purely technical perspective I agree. There's no reason this has to be behind HTTPS. I don't think this was done for technical reasons though. Rather, it's an attempt to drive further adoption of HTTPS with the ultimate goal of phasing plain HTTP out of mainstream use entirely. For websites on LAN you can either install your own root cert on client devices, or assign the site a public domain name (even if the…

> install your own root cert on client devices...

That’s a pain in the ass just to test a local website.

Re: CSS Paint API: New possibilities in Chrome 65

#49
post #46

Earlier quoted context omitted.

From a purely technical perspective I agree. There's no reason this has to be behind HTTPS. I don't think this was done for technical reasons though. Rather, it's an attempt to drive further adoption of HTTPS with the ultimate goal of phasing plain HTTP out of mainstream use entirely. For websites on LAN you can either install your own root cert on client devices, or assign the site a public domain name (even if the…

> install your own root cert on client devices... That’s a pain in the ass just to test a local website.

If you're just testing on localhost, there should be no need for a cert. As the article says, localhost is treated the same as https here. In the future, I expect all features that require a secure context will start treating localhost as secure, if they don't already.

Re: CSS Paint API: New possibilities in Chrome 65

#50
post #19

Earlier quoted context omitted.

"Https only" ensures Google's future (via AdSense, Double click, Chrome, Android, and Analytics) as the only sort of MITM that sees what mostly everyone is doing. While the https movement has benefits, don't misunderstand Google's interest as altruism. Good cause, murky motivation.

Or maybe Google and Mozilla actually want to make the web more secure? Not everything has to be a conspiracy.

It's not a conspiracy to suggest Google wants to know what sites/pages we are all visiting. And that being the only entity with a way to do that broadly helps them. No need to do actual MITM when a majority of sites are running your JS via Adsense or Analytics.

Https only shuts down the ability for ISPs and mobile carriers to do that. And many of them were doing so. I suspect that backbone providers were doing it as well. Good thing to shut down, sure, but it's also good for G.

Post reply on HN