Scoped styling being resurrected (but not in HTML)

Discussions about the development and maturation of the platform code (UXP).
Warning: may contain highly-technical topics.

Moderators: trava90, athenian200

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Scoped styling being resurrected (but not in HTML)

Unread post by Moonchild » 2024-02-29, 21:27

So, after 8 years, the powers that be are finally considering resurrecting scoped styling without JS/Shadow DOM and the overly complex mechanisms related to it, but they won't be doing it in HTML like was initially proposed and implemented. Instead the proposal is now a new meta @-rule @scope in CSS, with Mozilla letting Chrome and Webkit once again take the lead and working it up in Rust. In other words: an existing feature is being reimplemented in a slightly different way. While I am happy for the reintroduction of a feature for styling that won't depend on complex scripting, it still feels wrong to place the burden of this in CSS (and tack on more classes and indirection instead of just defining the style where it is supposed to be styled; K.I.S.S.) rather than the document structure (HTML) where scopes are defined. Especially the main use case where scoped styling would be defined in embeds/imported snippets, this would be making things a lot more complex.

Chrome is planning to ship this in M118 (~October) and it is soon to be enabled by default in Canary. Their intent to ship: https://groups.google.com/a/chromium.or ... X-2hhRAAAJ

Safari has also shipped this in the latest Tech Preview: https://developer.apple.com/documentati ... elease-185
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Scoped styling being resurrected (but not in HTML)

Unread post by athenian200 » 2024-02-29, 22:06

This is actually them doing what I assumed they were doing in the first place incorrectly. I misunderstood what was going on with WebComponents, and somehow got a mistaken impression that a large portion of it was in CSS because it was being used to replace scoped styles. It turns out that most of it was actually implemented in in JS and HTML, and most of this wasn't in the CSS parser like I was worried it was. I had just assumed if they were getting rid of HTML scoped styles, it would be logical to assume they would be using CSS for that instead... but it turns out I was really confused. Now, they are actually doing what I thought WebComponents was supposed to do in the first place, which means it's really going to be hard on our CSS parser...
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Piotr Kostrzewski
Lunatic
Lunatic
Posts: 280
Joined: 2018-08-14, 15:08

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Piotr Kostrzewski » 2024-02-29, 22:10

Is there any point in implementing support in Pale Moon?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Moonchild » 2024-02-29, 22:41

athenian200 wrote:
2024-02-29, 22:06
but it turns out I was really confused
No, you got it right. A large part of the push for removing scoped styles was that they wanted to push for SD/CE instead to do the same thing in a much more convoluted way (making subtrees in the document structure be the scopes instead of the document structure that was already there in HTML).
Our implementation has shown that it can be done both ways (since we retained scoped styling in HTML, while also implementing SD/CE) in parallel without interference. Webdesigners also rather used CSS workarounds than going the convoluted JS way with scoped styling just being desired and ignored.

What's being done now with @scope is, as far as I can tell, exactly what we retained but being plugged in a different part of the standards body (CSS lv 6 instead of html5). I'm not sure what the advantages of using a @scope meta are in CSS over indicating in HTML where styles apply, since it seems like it'd just cause more indirection requiring unique classes which could be avoided in the html tag way, but it seems that's what Chrome/Apple have decided to do after 8 years of people asking for it.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Moonchild » 2024-02-29, 22:42

Piotr Kostrzewski wrote:
2024-02-29, 22:10
Is there any point in implementing support in Pale Moon?
Yes, because once it ships in Chrome, people will use it. If we don't support it, styling of websites will start breaking.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Piotr Kostrzewski
Lunatic
Lunatic
Posts: 280
Joined: 2018-08-14, 15:08

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Piotr Kostrzewski » 2024-03-01, 02:49

Moonchild wrote:
2024-02-29, 22:42
Yes, because once it ships in Chrome, people will use it. If we don't support it, styling of websites will start breaking.
Thank you very much.
It may sound strange, but I feel sorry that we have a Chrome monopoly on the browser market that influences the development of other browsers.
Have a nice weekend.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4983
Joined: 2015-12-09, 15:45

Re: Scoped styling being resurrected (but not in HTML)

Unread post by moonbat » 2024-03-01, 06:23

Piotr Kostrzewski wrote:
2024-03-01, 02:49
It may sound strange
Why would it sound strange, and over here of all places? :wtf:
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Piotr Kostrzewski
Lunatic
Lunatic
Posts: 280
Joined: 2018-08-14, 15:08

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Piotr Kostrzewski » 2024-03-01, 07:03

moonbat wrote:
2024-03-01, 06:23
Why would it sound strange, and over here of all places? :wtf:
You know, even though there are people here who probably have similar views on browsers, etc., there can always be someone who will laugh at you.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Scoped styling being resurrected (but not in HTML)

Unread post by athenian200 » 2024-03-01, 07:43

Piotr Kostrzewski wrote:
2024-03-01, 02:49
It may sound strange, but I feel sorry that we have a Chrome monopoly on the browser market that influences the development of other browsers.
Have a nice weekend.
Well, maybe it sounds strange to average smartphone users, but around here we have spent years complaining about Chrome's monopoly and their control over standards organizations, the browser engine monoculture, how much harder it makes life for us, how much it limits choice, etc. Even Mozilla complains about some of that stuff, though they hypocritically go along with a lot of it claiming not to have a choice.

But yeah, no one will laugh at you for saying things like that here. At worst they will yawn, because we've been complaining about the injustice of the situation for years and people have gotten a bit numb to it.

So that kind of comment is very on-brand for the Pale Moon community, and probably wouldn't be shocking even to Mozilla Firefox users... they used to complain about IE in the same way, and some of them still complain about Chrome as if Mozilla is making a difference.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Piotr Kostrzewski
Lunatic
Lunatic
Posts: 280
Joined: 2018-08-14, 15:08

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Piotr Kostrzewski » 2024-03-01, 07:52

athenian200 wrote:
2024-03-01, 07:43

Well, maybe it sounds strange to average smartphone users, but around here we have spent years complaining about Chrome's monopoly and their control over standards organizations, the browser engine monoculture, how much harder it makes life for us, how much it limits choice, etc. Even Mozilla complains about some of that stuff, though they hypocritically go along with a lot of it claiming not to have a choice.

But yeah, no one will laugh at you for saying things like that here. At worst they will yawn, because we've been complaining about the injustice of the situation for years and people have gotten a bit numb to it.

So that kind of comment is very on-brand for the Pale Moon community, and probably wouldn't be shocking even to Mozilla Firefox users...
Thank you for your words.
You're right, Mozilla is a hypocrite, but if it weren't for it, maybe we wouldn't have Pale Moon.
Thank you very much. Out of curiosity, what browser do you use on your smartphone? I have been trying to switch to DuckDuckGo for some time to have the same search results as on Pale Moon (I use the DuckDuckGo search engine)

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Scoped styling being resurrected (but not in HTML)

Unread post by athenian200 » 2024-03-01, 08:00

Piotr Kostrzewski wrote:
2024-03-01, 07:52
Thank you very much. Out of curiosity, what browser do you use on your smartphone? I have been trying to switch to DuckDuckGo for some time to have the same search results as on Pale Moon (I use the DuckDuckGo search engine)
Honestly? I use Microsoft Edge, which is also my backup browser on Windows. However, that's mostly because I adopted Windows 10 early, and was a diehard Windows Phone user until 2021. So all my bookmarks and passwords are already stored in Edge, it's not any kind of principled decision. Though I do like the fact that it uses SmartScreen instead of Google Safe Browsing, which ironically makes it one of the only smartphone browsers that isn't 100% controlled by Google's opinions in terms of what sites it assumes are malicious. Admittedly, that's not as helpful on Android because Google controls the whole OS anyway... but I still just don't want Chrome and don't like Firefox, so I use Edge... just to be edgy. LOL.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Piotr Kostrzewski
Lunatic
Lunatic
Posts: 280
Joined: 2018-08-14, 15:08

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Piotr Kostrzewski » 2024-03-01, 08:13

athenian200 wrote:
2024-03-01, 08:00
However, that's mostly because I adopted Windows 10 early, and was a diehard Windows Phone user until 2021. Though I do like the fact that it uses SmartScreen instead of Google Safe Browsing, which ironically makes it one of the only smartphone browsers that isn't 100% controlled by Google's opinions in terms of what sites it assumes are malicious.
I was also interested in Windows for smartphones. #Nokia Lumia.
Do you think that if Windows for smartphones survived, what would the proportions be between it, Android and IOS?
It's a pity that no one decided to re-release Pale Moon for Android.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4983
Joined: 2015-12-09, 15:45

Re: Scoped styling being resurrected (but not in HTML)

Unread post by moonbat » 2024-03-01, 08:20

athenian200 wrote:
2024-03-01, 07:43
they used to complain about IE in the same way,
Those were the older generation of Firefox power users, many of whom have found a home here with Pale Moon :)
I can't imagine a self described power user in good faith sticking to Firefox post version 4, let alone today. The Mozilla that originally was and the Firefox that originally was were both completely different beasts than the abominations we have today, it was how they unseated IE's monopoly.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Piotr Kostrzewski
Lunatic
Lunatic
Posts: 280
Joined: 2018-08-14, 15:08

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Piotr Kostrzewski » 2024-03-01, 08:35

athenian200 wrote:
2024-03-01, 07:43

they used to complain about IE in the same way, and some of them still complain about Chrome as if Mozilla is making a difference.
I remember that Internet Explorer rejected me both as a user and as a webmaster.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Scoped styling being resurrected (but not in HTML)

Unread post by athenian200 » 2024-03-01, 08:54

Piotr Kostrzewski wrote:
2024-03-01, 08:13
I was also interested in Windows for smartphones. #Nokia Lumia.
Off-topic:
Yep! How did you guess? My first smartphone was a Nokia Lumia 920, before that I'd only had TracFones. Got it and a 1st gen Surface Pro around the same time, so my experience with Windows 8 was radically different from that of most people... probably why I was blindsided by it failing and got ganged up on by so many angry PC gamers for liking it. LOL.
Do you think that if Windows for smartphones survived, what would the proportions be between it, Android and IOS?
It's a pity that no one decided to re-release Pale Moon for Android.
Off-topic:
I think if Windows Phone had survived, it would have taken Android's place in the ecosystem. Android mostly attracted the "nerdy" crowd that didn't like iOS initially and wanted something a little more hackable, the same people that mostly use Windows on their PCs rather than running Mac. Windows Phone was clearly intended to compete with iOS rather than Android, they didn't take Android seriously enough and thought it would meet the same fate as desktop Linux.

I swear, we live in the strangest timeline... a poorly-made Google project that uses JVM-like technology running on top of a Linux kernel is the only viable alternative to iOS. Windows Phone vs. iOS just would have made a lot more sense, and even Symbian OS vs iOS would have been more logical. Instead, Windows Phone became OS/2... the perfect solution that came too late, from an established vendor, while more nimble companies moved first and rolled out garbage that became too entrenched to be dislodged. Though as part of the anlogy, I guess I could say Android is like DOS... something poorly designed we'll be stuck with for years, because of it being in the right place at the right time.

Also, it would be a lot easier, hypothetically, to properly port Pale Moon to Windows Phone than to port it to Android. Because the full XUL stack could be made to work there in a way it couldn't on Android. Also, the Visual Studio developer tools are a lot nicer than Android's SDK. Granted, you'd probably want a custom UI that fits better on a smartphone, but the point is it would have been doable. There was a Pale Moon for Android, but it was basically just using the Firefox for Android code, which I don't think included any support for XUL extensions.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Piotr Kostrzewski
Lunatic
Lunatic
Posts: 280
Joined: 2018-08-14, 15:08

Re: Scoped styling being resurrected (but not in HTML)

Unread post by Piotr Kostrzewski » 2024-03-01, 13:18

athenian200 wrote:
2024-03-01, 08:54
I was also interested in Windows for smartphones. #Nokia Lumia.
Off-topic:
Yep! How did you guess? My first smartphone was a Nokia Lumia 920, before that I'd only had TracFones. Got it and a 1st gen Surface Pro around the same time, so my experience with Windows 8 was radically different from that of most people... probably why I was blindsided by it failing and got ganged up on by so many angry PC gamers for liking it. LOL.
My cousin had this Nokia.
Off-topic:
I think if Windows Phone had survived, it would have taken Android's place in the ecosystem. Android mostly attracted the "nerdy" crowd that didn't like iOS initially and wanted something a little more hackable, the same people that mostly use Windows on their PCs rather than running Mac. Windows Phone was clearly intended to compete with iOS rather than Android, they didn't take Android seriously enough and thought it would meet the same fate as desktop Linux.

I swear, we live in the strangest timeline... a poorly-made Google project that uses JVM-like technology running on top of a Linux kernel is the only viable alternative to iOS. Windows Phone vs. iOS just would have made a lot more sense, and even Symbian OS vs iOS would have been more logical. Instead, Windows Phone became OS/2... the perfect solution that came too late, from an established vendor, while more nimble companies moved first and rolled out garbage that became too entrenched to be dislodged. Though as part of the anlogy, I guess I could say Android is like DOS... something poorly designed we'll be stuck with for years, because of it being in the right place at the right time.

Also, it would be a lot easier, hypothetically, to properly port Pale Moon to Windows Phone than to port it to Android. Because the full XUL stack could be made to work there in a way it couldn't on Android. Also, the Visual Studio developer tools are a lot nicer than Android's SDK. Granted, you'd probably want a custom UI that fits better on a smartphone, but the point is it would have been doable. There was a Pale Moon for Android, but it was basically just using the Firefox for Android code, which I don't think included any support for XUL extensions.
What you say makes sense.
I think that extensions in the Android version would not be necessary.