News for hackers. Stuff that matters.
Re:Stylo shipping in Firefox Nightly by NiLSPACE on Tuesday July 25, 2017 @04:48AM (#14846204)
There is also a discussion on the Rust reddit about this: https://www.reddit.com/r/rust/comments/6p9s24/psa_you_can_tr...
Re:Stylo shipping in Firefox Nightly by H4CK3RM4N on Tuesday July 25, 2017 @04:44AM (#14846185)
I really like this idea of switching over to servo bit by bit. It makes me happy that there might be a real WebKit alternative again.
Re:Stylo shipping in Firefox Nightly by NiLSPACE on Tuesday July 25, 2017 @04:47AM (#14846198)
I'd argue that Gecko is a real WebKit alternative. It has improved quite dramatically lately, have you tried Firefox Nightly?
Re:Stylo shipping in Firefox Nightly by wodenokoto on Tuesday July 25, 2017 @04:50AM (#14846220)
The problem with in its current state as a WebKit alternative is that it lacks stable api.

We don't see any gecko based apps like we see WebKit based apps (electron, etc) because gecko is so tightly developed around Firefox.

Re:Stylo shipping in Firefox Nightly by FreakyT on Tuesday July 25, 2017 @06:01AM (#14846488)
I remember way before Electron there was XULRunner, and there were a few ridiculously bloated non-Mozilla apps that were based on it. Like Songbird[1] -- anyone remember that?

I suppose the idea was largely ahead of its time; in 2006 computers just didn't have enough RAM/CPU to get away with running a full web browser stack for every app like we (sort of) can today.

[1]: https://en.wikipedia.org/wiki/Songbird_(software)

Re:Stylo shipping in Firefox Nightly by wodenokoto on Tuesday July 25, 2017 @06:35AM (#14846627)
Back then I was a big fan of the concept and I really enjoyed songbird.

I still think that building a html+javascript package, and have the default browser run it chromeless with some expanded privileges (or near chromeless) is a great approach for cross-platform apps, sadly it doesn't seem like anyone is working seriously on such an approach.

Re:Stylo shipping in Firefox Nightly by avian on Tuesday July 25, 2017 @08:12AM (#14847101)
HTA (basically a HTML page launched chromelessly with elevated privileges) was a thing back around the Windows 98 era. Everyone I knew at the time universally considered it a horrible and misguided idea by Microsoft. Funny how the history repeats itself.

https://en.wikipedia.org/wiki/HTML_Application

Re:Stylo shipping in Firefox Nightly by kilian on Tuesday July 25, 2017 @07:18AM (#14846814)
There's Electrino, which provides the Electron api but runs whatever your OS's built-in rendering engine is: https://github.com/pojala/electrino Still in development and relatively limited, but the idea's there!
Re:Stylo shipping in Firefox Nightly by ZenoArrow on Tuesday July 25, 2017 @09:56AM (#14847701)
There's also Sciter, which is supposedly very mature (even more so than Electron), but as it's closed source and released under a mixed licence (there are free and commercial versions), it's not got much traction outside of commercial apps:

https://sciter.com/

Re:Stylo shipping in Firefox Nightly by faaq on Thursday July 27, 2017 @11:35PM (#14871767)
OMG, I had never seen Sciter before, All I thought is a lie, ESET, Norton, Avast all were using HTML even before electron exist. I always thought theirs software was made by hand using native APIs and frameworks.
Re:Stylo shipping in Firefox Nightly by StavrosK on Tuesday July 25, 2017 @06:55AM (#14846710)
> I still think [it] is a great approach for cross-platform apps

You think so? I find that running a whole second OS for every process is hugely bloated and slow, and that we can do much, much better when there are already very good languages that run cross-platformly, they just need bindings to a good cross-platform UI toolkit.

Unfortunately, nothing looks as good on OS X as Cocoa does.

Re:Stylo shipping in Firefox Nightly by wodenokoto on Tuesday July 25, 2017 @10:51AM (#14848120)
Yes. Yes I do.

Look at R studio. Wonderful IDE, runs as a safari app. Having a whole extra browser and a node backend running for each app seems a waste, but using the browser that is already running as a runtime environment seems much saner.

I do most of my work in the browser, I wouldn't mind if some of that had better integrated UI.

I also wouldn't mind writing small, easy to produce apps that will work across systems.

Re:Stylo shipping in Firefox Nightly by StavrosK on Tuesday July 25, 2017 @11:08AM (#14848258)
I'm not saying programs written in it aren't useful or doable, I just don't think it's a great approach. I think it's a last-resort approach, because there just isn't a better cross-platform toolkit available.
Re:Stylo shipping in Firefox Nightly by maxsilver on Tuesday July 25, 2017 @07:07AM (#14846757)
> I still think that building a html+javascript package, and have the default browser run it

I think the thing that kills that approach is the default browser, which on Windows is IE 12 (Edge).

Edge isn't actually that bad to work with these days. But almost no web developers will use that when they could ship Chromium / Electron just as easily and get the exact same browser on all three platforms.

Even Microsoft's own teams will sometimes make that choice (VS Code using Electron.js and not Edge, for example)

Re:Stylo shipping in Firefox Nightly by WorldMaker on Tuesday July 25, 2017 @04:29PM (#14851573)
I don't think Edge is the problem: the problem is IE11 and people clutching to Windows 7 until the bitter end and whether or not to support them.

You can see bits and pieces where Microsoft's teams are also experimenting with Node on ChakraCore and Electron on Edge.

Re:Stylo shipping in Firefox Nightly by cptskippy on Tuesday July 25, 2017 @10:09AM (#14847789)
I don think it's quite the same thing though. Songbird was a XUL app with extension support and a built in browser. Aren't Electron based apps HTML based and running on Website?
Re:Stylo shipping in Firefox Nightly by tmzt on Tuesday July 25, 2017 @11:35AM (#14848517)
They don't run on a website, they are static files (usually) served from a zip file.
Re:Stylo shipping in Firefox Nightly by cptskippy on Tuesday July 25, 2017 @10:50PM (#14853384)
Argh, sorry phone auto-corrected Webkit to Website.
Re:Stylo shipping in Firefox Nightly by NiLSPACE on Tuesday July 25, 2017 @04:57AM (#14846253)
True, Gecko lacks a real API for embedding. Servo on the other hand has embedding in mind from the start. There is someone from the Servo team working on it: https://github.com/paulrouget/servoshell
Re:Stylo shipping in Firefox Nightly by krzyk on Tuesday July 25, 2017 @12:25PM (#14849056)
That's good. I don't see a point in having an app that embeds a browser to show an app. It's like having those silly Android apps that are just a wrapper around a web version of the service.

If I want to use a web version I can do it using a browser of my choosing not the one developers want.

Re:Stylo shipping in Firefox Nightly by charrondev on Tuesday July 25, 2017 @04:22PM (#14851516)
The browser rendering environment is only half of electron. Electron (and nw.js) provide a node.js / browser hybrid. You can use native node-modules, instead of browser-based workarounds and you have the same filesystem access a native application would have. You also have hooks into platform specific menu/dock/notifications.
Re:Stylo shipping in Firefox Nightly by agumonkey on Tuesday July 25, 2017 @06:07AM (#14846510)
It is, it's just hard to track what's going on in a way. The browser saw new ideas, and rollbacks (hello ? IIRC). There's the XUL layers, Electrolysis, the actual engine. I have to admit If you clean your mind from memories of high latency Firefox GUI, it's now near chrome-fast on the UX side. Memory use is adequate if not #1. Tabs are well handled too.
Re:Stylo shipping in Firefox Nightly by mintplant on Tuesday July 25, 2017 @11:21AM (#14848378)
Servo's WebRender is also in the Firefox tree. I've seen some crazy benchmarks using it. It's not ready to be enabled widely yet, though.
Re:Stylo shipping in Firefox Nightly by Manishearth on Tuesday July 25, 2017 @12:11PM (#14848896)
Note that the current webrender pref on nightly will be slower, since it runs stuff through webrender and then the regular renderer. They're focusing on getting it feature complete first, after which that pref will probably be switched over to be pure webrender.
Re:Stylo shipping in Firefox Nightly by chairmanwow on Tuesday July 25, 2017 @08:59AM (#14847331)
I'm new to frontend in general and wondering if I could trouble you for some context. Why is Firefox's CSS styling engine not already "in" the browser? To me it seems like Stylo is just a parallelized replacement for the old system, Servo. What am I missing here?

Also, why are you celebrating an alternative for WebKit? Isn't it already supported by most major browsers?

Re:Stylo shipping in Firefox Nightly by tolien on Tuesday July 25, 2017 @09:21AM (#14847486)
> Why is Firefox's CSS styling engine not already "in" the browser?

It is, Firefox can do CSS and styles just now. Stylo is a replacement for that.

> To me it seems like Stylo is just a parallelized replacement for the old system, Servo. What am I missing here?

Servo isn’t the old system. Servo is a research project to build a layout engine (analogous to Gecko which Firefox currently uses) in Rust, of which Stylo is a part.

> Also, why are you celebrating an alternative for WebKit? Isn't it already supported by most major browsers?

It sounds like you’re confused about what WebKit is. WebKit and its forks are used by a number of browsers (Chrome, Safari etc.).

EdgeHTML, Gecko and WebKit are, broadly speaking, competitors which attempt to implement certain standards and frequently disagree about how to do so. It’s important that there be alternatives to WebKit with significant market share because otherwise how WebKit implements a feature becomes the de facto reference implementation.

Re:Stylo shipping in Firefox Nightly by chairmanwow on Tuesday July 25, 2017 @07:43PM (#14852797)
Thanks to you (and all the other commenters) for the detailed answers! I learned a lot!
Re:Stylo shipping in Firefox Nightly by IamCarbonMan on Tuesday July 25, 2017 @09:22AM (#14847489)
Servo is a complete (although WIP) browser engine in Rust. Stylo is a project to plug the style parts of Servo into Firefox, which currently uses the Gecko browser engine. This is part of Mozilla's ongoing efforts to modernize Firefox by gradually rewriting it in Rust.

WebKit is technically only used by Safari. Chrome uses a WebKit fork called Blink, and MS Edge uses its own engine called Chakra.

I assume the above commenter was expressing relief that someone besides Google is making a fast, modern web browser these days.

Re:Stylo shipping in Firefox Nightly by bzbarsky on Tuesday July 25, 2017 @09:40AM (#14847614)
Chakra is just the JS implementation in Edge; it's the equivalent of JavaScriptCore in Safari, V8 in Chrome, or SpiderMonkey in Firefox.

The layout engine bits in Edge are https://en.wikipedia.org/wiki/EdgeHTML

Re:Stylo shipping in Firefox Nightly by Manishearth on Tuesday July 25, 2017 @12:13PM (#14848914)
Servo is not Firefox's browser engine. Gecko is. Servo is an experimental highly-parallel browser engine in Rust. It's a separate project.

Stylo takes Servo's styling engine and puts it inside Gecko.

Re:Stylo shipping in Firefox Nightly by jayflux on Tuesday July 25, 2017 @07:28AM (#14846868)
"again" ?

Was there a real alternative to WebKit in the embedded browser space before? (genuine question)

Re:Stylo shipping in Firefox Nightly by wodenokoto on Tuesday July 25, 2017 @04:50AM (#14846226)
Pretty cool that changing layout engine doesn't require a restart!
Re:Stylo shipping in Firefox Nightly by NiLSPACE on Tuesday July 25, 2017 @04:53AM (#14846238)
It's not the entire layout engine that changes. They only switch to the CSS Style system of Servo: https://www.reddit.com/r/rust/comments/6p9s24/psa_you_can_tr...

It's still pretty cool though :)

Re:Stylo shipping in Firefox Nightly by cornedor on Tuesday July 25, 2017 @08:24AM (#14847165)
Wow, I restarted my browser because I assumed it was necessary.
Re:Stylo shipping in Firefox Nightly by diegoperini on Tuesday July 25, 2017 @05:31AM (#14846364)
The proposed flag in about:config exists in Firefox Developer Edition too. I tried to enable it, then loaded some pages. There seems to be no distinction in visuals. Did it work seamlessly or is it currently NOP?
Re:Stylo shipping in Firefox Nightly by NiLSPACE on Tuesday July 25, 2017 @05:37AM (#14846388)
The flag exists in Firefox Developer Edition but it doesn't do anything yet. You have to be on Nightly for it to have an actual effect: https://www.reddit.com/r/rust/comments/6p9s24/psa_you_can_tr...
Re:Stylo shipping in Firefox Nightly by Manishearth on Tuesday July 25, 2017 @12:18PM (#14848968)
You can check in about:support to see if it's actually enabled.

It won't be for dev edition; dev edition didn't build it by default.

about:config isn't user-facing so it will show prefs that do nothing on the current release channel or build.

Re:Stylo shipping in Firefox Nightly by k__ on Tuesday July 25, 2017 @10:06AM (#14847774)
Very cool.

What parts of Servo are already in Firefox? What is missing? Is there a list of what will get into Firefox over time?

Re:Stylo shipping in Firefox Nightly by Manishearth on Tuesday July 25, 2017 @12:15PM (#14848935)
We have:

- Stylo, built by default, off by default

- Webrender, built by default, off by default, current pref makes it render things through both engines.

- rust-url for url parsing, built by default, off by default, current pref makes it parse through both parsers and compare. I intend to bring this across the finish line once done with stylo

- encoding_rs for dealing with string encodings. built and on by default. Not exactly a servo component (servo used to use rust-encoding), but i think servo uses it now.

Re:Stylo shipping in Firefox Nightly by hsivonen on Tuesday July 25, 2017 @02:30PM (#14850534)
A GitHub search suggests that Servo isn’t using encoding_rs.
Re:Stylo shipping in Firefox Nightly by NiLSPACE on Tuesday July 25, 2017 @10:28AM (#14847949)
There is a wiki page about Project Quantum: https://wiki.mozilla.org/Quantum

Currently Quantum CSS (Stylo) and Quantum Render (Webrender) are both in Firefox Nightly, but they are unstable and can cause really bad performance, especially Quantum Render. They won't be done until at least Firefox 57 and some most likely later.

Quantum Compositor is in Release already I believe. It's the out of process compositor for Firefox.

Changes from Quantum Flow are continuing to be implemented into Nightly and later on Beta.

I haven't ready much about the progress around Quantum DOM, and I have no idea for which release it is targeted.

Re:Stylo shipping in Firefox Nightly by k__ on Tuesday July 25, 2017 @10:37AM (#14848024)
Do I get this right.

Servo is the experimental browser (engine?)?

Quantum is the project that ports parts of Servo to Firefox over time?

Re:Stylo shipping in Firefox Nightly by mintplant on Tuesday July 25, 2017 @11:26AM (#14848439)
Quantum is now also a bit of an umbrella project for initiatives making Firefox faster. "Quantum Flow", for example, is an engine-wide effort to push performance in the bits that still C++.
Re:Stylo shipping in Firefox Nightly by sp332 on Tuesday July 25, 2017 @10:57AM (#14848168)
Right. Servo is an engine that will be embeddable into apps that need to render HTML, not just browsers.
Re:Stylo shipping in Firefox Nightly by k__ on Tuesday July 25, 2017 @11:58AM (#14848755)
Ah, so like the omni-present webkit view?
Re:Stylo shipping in Firefox Nightly by sp332 on Tuesday July 25, 2017 @12:44PM (#14849286)
Yeah, exactly. It doesn't include a JS engine so for now it uses SpiderMonkey, but eventually you should be able to plug others in.
Re:Stylo shipping in Firefox Nightly by infogulch on Tuesday July 25, 2017 @11:17AM (#14848340)
Whoa I didn't know webrender was shipping on nightly already, even if it's unstable.
Re:Stylo shipping in Firefox Nightly by NiLSPACE on Tuesday July 25, 2017 @11:34AM (#14848508)
Currently with Webrender enabled Firefox renders it both on Webrender and the old renderer which causes it to be really slow.
Re:Stylo shipping in Firefox Nightly by infogulch on Tuesday July 25, 2017 @11:43AM (#14848602)
I see, that would explain the performance issues. Why is it set up like that?
Re:Stylo shipping in Firefox Nightly by metajack on Tuesday July 25, 2017 @04:04PM (#14851381)
There's a lot of refactoring to do in Gecko's graphics stack to fit the new rendering model. While they do that, they can also accelerate one thing at a time with WebRender, testing incrementally. Things like SVG which WebRender doesn't have yet, can also use the old system and be included in WebRender as images.

The old system will still be needed post-WebRender for printing at the very least.

Re:Stylo shipping in Firefox Nightly by NiLSPACE on Wednesday July 26, 2017 @02:30AM (#14854033)
> The old system will still be needed post-WebRender for printing at the very least.

Isn't it possible to take a frame from WebRender and print that? Having two separate systems seems like allot of unnecessary maintenance. Especially if one of those systems is only used on rare occasions like printing.

Re:Stylo shipping in Firefox Nightly by steveklabnik on Tuesday July 25, 2017 @11:46AM (#14848628)
My understanding is that WebRender doesn't support everything yet, so right now it's mostly about validating correctness.
Re:Stylo shipping in Firefox Nightly by infogulch on Tuesday July 25, 2017 @11:59AM (#14848763)
Ah I see, so it basically enables a parallel run of webrender to gather compatibility/correctness stats.
Re:Stylo shipping in Firefox Nightly by k__ on Tuesday July 25, 2017 @11:57AM (#14848744)
So it renders it two times and compares the results?
Re:Stylo shipping in Firefox Nightly by Manishearth on Tuesday July 25, 2017 @12:16PM (#14848951)
It renders it in series -- stuff goes through webrender first, and then whatever webrender couldn't handle gets dealt with with the regular renderer.
Re:Stylo shipping in Firefox Nightly by the8472 on Tuesday July 25, 2017 @06:40AM (#14846652)
You can also try webrender, but it still has more issues than stylo in my experience. It gobbles up a lot of gfx memory for starters, which can actually slow things down if you don't have enough. But that's a known issue.

gfx.webrender.enabled = true (restart required)

Re:Stylo shipping in Firefox Nightly by hansjorg on Tuesday July 25, 2017 @06:48AM (#14846682)
According to the Reddit thread, enabling this will run both webrender and the regular renderer for now, so it will be both slower and more memory intensive.
Re:Stylo shipping in Firefox Nightly by blauditore on Tuesday July 25, 2017 @09:50AM (#14847674)
I cannot find the flag in about:config - my version is "56.0a1 (2017-07-23) (64-bit)", so it should be in there, no?
Re:Stylo shipping in Firefox Nightly by ronjouch on Tuesday July 25, 2017 @09:58AM (#14847716)
I have the flag in my about:config with build `56.0a1 (2017-07-25) (64-bit)` under Linux. You're SO two days ago! Update your Nightly :)
Re:Stylo shipping in Firefox Nightly by blauditore on Tuesday July 25, 2017 @10:03AM (#14847748)
Hmm, I got it through `ppa:ubuntu-mozilla-daily/ppa` on Ubuntu, so this is generally a couple days behind? Did you download it manually?
Re:Stylo shipping in Firefox Nightly by eridius on Tuesday July 25, 2017 @01:44PM (#14850039)
Looks like that disables Servo at build time. Someone on Reddit had the same problem - https://www.reddit.com/r/firefox/comments/6p9t83/psa_you_can...
Re:Stylo shipping in Firefox Nightly by blauditore on Wednesday July 26, 2017 @03:35AM (#14854276)
Indeed, same issue. Thanks for the pointer.
Re:Stylo shipping in Firefox Nightly by ronjouch on Tuesday July 25, 2017 @11:02AM (#14848210)
Yes, I like to run the official self-updating build from https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-c... , because it's the official build (which is appreciated when reporting bugs) and always fresh.

- You could switch to that too (I run it even on my job Ubuntu machine, never saw any benefit to using the official Ubuntu PPA apart from proper packaging, which I don't care about, this Firefox lives in /opt/firefox and that's okay with me, and getting updates are a matter of hitting Help -> About, easy).

- Or just wait a few days for the PPA to serve a fresher build. EDIT forget about this and read bzbarsky's answer above. Thanks, Boris :)

Re:Stylo shipping in Firefox Nightly by bzbarsky on Tuesday July 25, 2017 @12:02PM (#14848798)
It's entirely possible that Ubuntu is not compiling in stylo at all.

In fact it's likely: Firefox nightlies on Linux have been shipping stylo (preffed off) for close to three weeks, so if a two-day-old Ubuntu build doesn't have it, chances are neither will a newer one until they change their build configuration to use --enable-stylo.

Re:Stylo shipping in Firefox Nightly by Jayakumark on Tuesday July 25, 2017 @10:21AM (#14847892)
When will this be incorporated in Firefox Mainstream release ?
Re:Stylo shipping in Firefox Nightly by metajack on Tuesday July 25, 2017 @04:06PM (#14851402)
It should go out in Firefox 57 which is scheduled for November 14.
Re:Stylo shipping in Firefox Nightly by steveklabnik on Tuesday July 25, 2017 @10:31AM (#14847973)
The target, IIRC, is 57.
Re:Stylo shipping in Firefox Nightly by Jayakumark on Thursday July 27, 2017 @06:51PM (#14870407)
Cool, and when will servo go mainstream ?
Re:Stylo shipping in Firefox Nightly by rajnathani on Tuesday July 25, 2017 @11:45PM (#14853543)
Does anyone have any links to benchmarks?