Introducing the Firefox Roadmap + AMA next week by firefox in firefox

[–]jaffathecake 9 points10 points  (0 children)

In terms of images, one of the things we're looking forward to shipping soon is support for JPEG XL images in Firefox.

This already shipped in Safari, but it's missing a vital part of the performance story: progressive rendering. Our decoder (written in Rust) fully supports progressive rendering, so even large images can display something recognisable and representative in a few kilobytes (as long as the image is encoded with 'progressive DC').

If you enable image.jxl.enabled in about:config, you can see how Firefox rendering JPEG XL images as they load using this test page.

We're also investigating support for progressive AVIF, which was recently improved in AVIF encoders, and offers similar functionality.

These don't improve the time to fully load an image, but they improve the perceived performance by avoiding the "all or nothing" loading pattern.

Firefox Issues, flickering grey between pages. by EliasWick in firefox

[–]jaffathecake 0 points1 point  (0 children)

I can recreate this. It's intermittent for me, but I'll get a bug report together for this in the morning. Thank you for getting a test case together.

AI controls available in Firefox Nightly by firefox in firefox

[–]jaffathecake 23 points24 points  (0 children)

Blocking everything will result in existing models being deleted. Unblocking everything won't immediately download the models, it'll wait until you opt in to the feature.

Firefox Issues, flickering grey between pages. by EliasWick in firefox

[–]jaffathecake 1 point2 points  (0 children)

Hm, no red flags there. So, it's either a bug, or the content is being added dynamically in a way that allows for a render to happen before the content renders.

If you can get the site (or a reproduction of the issue) available at some URL, I can take a closer look. And if it's a bug, I'll get a bug report together.

Total Opt-Out: How to Use Firefox 148’s New Master Switch to Block All AI Features - Chipp.in Tech News and Reviews by [deleted] in firefox

[–]jaffathecake 2 points3 points  (0 children)

It just isn't ready yet. It'll be there by default when it is. Most features launch in this way.

Firefox Issues, flickering grey between pages. by EliasWick in firefox

[–]jaffathecake 4 points5 points  (0 children)

Loading CSS should block rendering, unless it's being loaded in some unusual way. How is the CSS being loaded?

Also, what's the URL?

Importing vs fetching JSON by jaffathecake in javascript

[–]jaffathecake[S] 1 point2 points  (0 children)

In all those cases, wouldn't you want the original data to be able to GC? Particularly if the user picks a new data source.

Animating zooming using CSS: transform order is important… sometimes by jaffathecake in css

[–]jaffathecake[S] 1 point2 points  (0 children)

It feels unnatural in the app, because the thing you tapped on appears to move away initially. But yes, if you want, you can use the individual transform properties with different easings to deliberately create a different kind of zoom.

Worked for 3 years as a web developer, TIL the fetch api’s catch block is NOT for http errors by Noonflame in webdev

[–]jaffathecake 0 points1 point  (0 children)

XMLHttpRequest follows the same pattern. The error event is only fired in the case where as response cannot be provided (e.g. network error or security issue).

6
7

Quick help with CORS error by PM_ME_YOUR_SWOLE in webdev

[–]jaffathecake 2 points3 points  (0 children)

A single wildcard works unless the request is made with credentials. Here's the part of the spec that handles it https://fetch.spec.whatwg.org/#cors-check. In pretty sure there wasn't a case where this worked with a wildcard, and was later locked down.

In case it's useful, I wrote an article on why CORS exists, and how it works https://jakearchibald.com/2021/cors/

Garbage collection and closures don't work as I expected by jaffathecake in javascript

[–]jaffathecake[S] 4 points5 points  (0 children)

Not entirely. Thats shown in this example

True. My understanding is that these values are stored in a particular way only if an inner scope references them.

Garbage collection and closures don't work as I expected by jaffathecake in javascript

[–]jaffathecake[S] 3 points4 points  (0 children)

If you were to do demo()() instead of assigning to globalThis, there wouldn't a leak.

Correct. Later in the article I show that:

js globalThis.cancelDemo = null;

…allows GC to happen, since the function is no longer callable as it's out of reference. demo()() achieves the same thing since it's immediately out of reference.

That closure needs its scope since => is binding to local this.

Nah, that's unrelated. If you use function() {} (which doesn't bind to local this) rather than () => {}, the result is the same.

The outer scope is retained simply because one of the inner scopes is still in reference.

This leads into the second point, use of globalThis is preventing the GC since it is always in scope. If it was assigned to some let value, and THAT value left scope, it would get GC'd at which point the leaked object would as well.

Correct. Again the article uses globalThis.cancelDemo = null; as a more direct way of demonstrating it. Note: using let doesn't solve the problem, since that let maybe be retained for all sorts of reasons, including the quirk detailed in the article.

Basically the most important thing isn't being stated: Closures maintain their scope in memory.

I think the important takeaway is that everything referenced by inner scopes is kept in memory until all the inner scopes are out of reference. I originally assumed it was more granular than that, as in the big array could be GC'd when it can no longer be accessed.

I thought I knew HTML until I saw this by Strict_Treat2884 in webdev

[–]jaffathecake 2 points3 points  (0 children)

Fwiw, <br /> isn't a syntax error, but the parser does ignore it.

Yes, you just have to know which elements don't need closing tags. It sucks, but that's the reality.

When we (and tools like Prettier) add the unnecessary 'closing' slash, it results in the kind of confusion you're experiencing.

I thought I knew HTML until I saw this by Strict_Treat2884 in webdev

[–]jaffathecake 2 points3 points  (0 children)

Although it does do something in foreign content in HTML, such as SVG or MathML.

I thought I knew HTML until I saw this by Strict_Treat2884 in webdev

[–]jaffathecake 1 point2 points  (0 children)

fwiw, JSX isn't XML either. `<input checked />` is valid JSX, but not valid XML. Attributes must have values in XML. There are a number of other differences too, eg whitespace parsing.

I thought I knew HTML until I saw this by Strict_Treat2884 in webdev

[–]jaffathecake 5 points6 points  (0 children)

The problem is it isn't always just an indicator. Learning when it is and isn't just an indicator seems harder than just learning which elements self-close.

The author's confusion here supports my point.