Earlier quoted context omitted.
The same way Servo (and the work-in-progress Servo port to Gecko) does it. Compute styles for every DOM node in parallel, using a work-stealing scheduler to distribute nodes among threads in a thread pool. Parent nodes must have their styles computed before children, but other than that constraint it's an embarrassingly parallel problem.
In css sibling nodes can certainly affect the position of each other, but that might be ok. A harder problem will be siblings that "run in" to each other, and overlap in various ways.
A new approach to text rendering
41–50 of 112 posts
Re: A new approach to text rendering
#42Earlier quoted context omitted.
I can't reply to the above comment because it's dead (and no, I didn't flag it), but you can try parallel styling out by building Firefox Nightly with --enable-stylo and enabling the preference in about:config.
It should be a pref switch in the next nightly on 64 bit linux and windows, fwiw.
Re: A new approach to text rendering
#43> One frustrating component of the above breakdown is the time spent recalculating styles. At this point, it looks like the only way to solve this within the current paradigm is to use CSS less and reduce the number of selectors in the application, but that’s going to be a hard fought battle given the huge number of themes in the ecosystem. This is a perfect example of why we need parallel restyling. :)
I dunno, I'd say it's more an example of why CSS isn't the right abstraction for styles in a text editor…
Is it worth restricting an editor to only styles that don't influence block layout? For example, should it be impossible for a theme to make comment lines taller or shorter? I don't know; it's a tradeoff between performance and flexibility. My feeling is that there's a lot more room to improve the implementation before we have to resort to reducing capabilities, but reasonable people can disagree.
Re: A new approach to text rendering
#44Earlier quoted context omitted.
Games are at an advantage because they can do a lot of up-front processing. They can statically schedule their content based on knowledge of the hardware, and programmers can and do even tell the artists to tailor their content directly to the system. Conversely, on the Web, we can't do any of this: we have no idea what the content is going to be like until we receive it, and we have to handle specifications that wer…
> But every proposed replacement for CSS I've seen (e.g. Cassowary) has made the complexity problem worse. Hi, what other proposed replacements for CSS do you know about? I'm interested in seeing what problems they ran into. I need to go look at Cassowary again. IIRC it's a solver, so sometimes the layout won't be what you expected, and it's very hard to know what to change such that it does what you want.
Re: A new approach to text rendering
#45Earlier quoted context omitted.
I dunno, I'd say it's more an example of why CSS isn't the right abstraction for styles in a text editor…
CSS is more powerful than anything that popular native text editors can do. As far as I'm aware, in native text editors, generally, style can't influence (block-direction) layout, and that's why they can get away with determining what's visible before restyling. Once you have styles that can influence layout, this dependency is reversed, so any native text editor will have to restyle off-screen lines just as a browse…
Of course not; everyting should be in the same damned monospaced font in a text editor for writing code.
Re: A new approach to text rendering
#46Earlier quoted context omitted.
You may also want to give VSCode a go. I haven't used a Microsoft product (willingly) for decades, but it is a really, really nice and much snappier than Atom in my experience with things like key echos. Their integration for TypeScript and GoLang are first class as well. Overall though I held the same excitement for Atom as you did (and I used to use Emacs for everything because I wanted an open editor in my tool be…
I'm not sure why it was, but I couldn't use vs code because all the vim plugins available made it lag like crazy (~1sec per cursor movement). It's also worth noting that it only lagged on my work machine, not at all sure why :/ it was fine on my personal machine but it dissuaded me from switching because of it
Re: A new approach to text rendering
#47Earlier quoted context omitted.
I dunno, I'd say it's more an example of why CSS isn't the right abstraction for styles in a text editor…
CSS is more powerful than anything that popular native text editors can do. As far as I'm aware, in native text editors, generally, style can't influence (block-direction) layout, and that's why they can get away with determining what's visible before restyling. Once you have styles that can influence layout, this dependency is reversed, so any native text editor will have to restyle off-screen lines just as a browse…
Based on my limited experience, most text editors don't have correct information for off-screen content anyways, as they tend to do lazy syntax highlighting, which you can sometimes see adjusting while you scroll.
Re: A new approach to text rendering
#48Earlier quoted context omitted.
Or to put it in other words: browser technology is asked to do so much that they had to go invent a new language to keep up. So that they could serve ads. For us ordinary folks trying to write good applications that can be maintained by one person and scale reasonably well, there's justifiable reason to jump off this rollercoaster and work in a more humble environment with modest perf/safety tradeoffs and native code…
The "so they could serve ads" meme is facile, reductionist, sophomoric. Actually, the fact that Google et al. were able to identify a profit function that could be optimized to fund the last 15 years of technology is an incredible achievement. In ~2000 it wasn't at all obvious that the internet could find a robust funding model. Where the funding comes from is practically irrelevant, specially if it is a feedback fun…
The SV camp has said nothing to convince me otherwise.
Re: A new approach to text rendering
#49Seems like Atom will eventually just be a native app.
Re: A new approach to text rendering
#50Earlier quoted context omitted.
CSS is more powerful than anything that popular native text editors can do. As far as I'm aware, in native text editors, generally, style can't influence (block-direction) layout, and that's why they can get away with determining what's visible before restyling. Once you have styles that can influence layout, this dependency is reversed, so any native text editor will have to restyle off-screen lines just as a browse…
Should it be impossible for a theme to make comment lines taller or shorter? Of course not; everyting should be in the same damned monospaced font in a text editor for writing code.