Alternate stylesheets seem to be broken in Pale Moon. Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1498
Joined: 2018-10-28, 19:56
Location: Georgia

Alternate stylesheets seem to be broken in Pale Moon.

Unread post by athenian200 » 2020-08-11, 08:54

I found this in the official Windows 28.12.0 binary while testing something on my Windows machine. Anyway...

Example page with alternate stylesheets:

https://www.w3.org/Style/Examples/007/a ... es.en.html

Steps to reproduce:

1. Navigate to the above URL.

2. Go to the View Menu, and then go to Page Style and select any alternate stylesheet.

Expected behavior:

Alternate stylesheets are applied to the page and change its appearance.

Actual behavior:

The only choices that actually apply are "No Style" and "Basic Page Style," and if you select an alternate stylesheet it won't get applied to the page and won't remain selected.

Additional quirk noticed:

Borealis Navigator's alternate stylesheets still appear to work okay when built against the same version of UXP as 28.12.0, which suggests the problem lies in the application code rather than the platform.

Is anyone else having this problem?
"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
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35473
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by Moonchild » 2020-08-11, 10:21

Are you sure it's because of an issue in the FE and not because it uses upgrade-insecure-requests?
"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
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by RealityRipple » 2020-08-11, 10:27

Huh, I hadn't tested it, but yeah, there does seem to be a problem. My site (https://realityripple.com/) has seven different named styles to choose from. The buttons at the bottom of the page and the JS to select between them still works, but the actual menu items under View don't work anymore.

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

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by Moonchild » 2020-08-11, 10:29

TBH, I didn't even know that was a thing, so I'm probably even less suitable to research this than you two are ;)
Wouldn't surprise me if this is some more Janek fallout though. We'll have to see.
"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
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by adesh » 2020-08-11, 11:17

Interestingly, selecting a style using JS button on the bottom of RealityRipple's website updates the selected style in the View menu.
It may be related or not but selecting style from the View menu generates an error:

Code: Select all

TypeError: this.controller is undefined[Learn More]  
browserPlacesViews.js:223:1
Probably sequence does not complete because of this.

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 575
Joined: 2017-01-14, 02:40
Location: Philippines
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by FranklinDM » 2020-08-11, 11:36

I tested around with a few older versions and found that this feature works fine in v28.10.0 and earlier, and might have been broken with v28.11.0.

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

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by Moonchild » 2020-08-11, 12:11

adesh wrote:
2020-08-11, 11:17
Interestingly, selecting a style using JS button on the bottom of RealityRipple's website updates the selected style in the View menu.
It may be related or not but selecting style from the View menu generates an error:

Code: Select all

TypeError: this.controller is undefined[Learn More]  
browserPlacesViews.js:223:1
Probably sequence does not complete because of this.
I didn't get any error. I'll have to try a new session, I guess.

New session in a portable: still no error. Not that I think it'd be related because this wouldn't plug into places. Possibly an extension problem for you, Adesh?
"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: 35473
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by Moonchild » 2020-08-11, 12:16

Definitely working in 28.10.0 and not working in 28.11.0, so... a regression somewhere.
"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
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by adesh » 2020-08-11, 12:38

Off-topic:
Moonchild wrote:
2020-08-11, 12:11
Not that I think it'd be related because this wouldn't plug into places. Possibly an extension problem for you, Adesh?
Probably something is bad in my default profile.

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 575
Joined: 2017-01-14, 02:40
Location: Philippines
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by FranklinDM » 2020-08-11, 12:52

I've found a fix, and PR #1825 should resolve the issue.

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

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by Moonchild » 2020-08-11, 13:05

Yeah I just found out the same, I converted:

Code: Select all

    return Array.some(frame.document.styleSheets,
                      function(stylesheet) stylesheet.title == title);
to

Code: Select all

    return Array.some(frame.document.styleSheets,
                      function(stylesheet) {
                        stylesheet.title == title
                      });
In my tidying up of formatting, but didn't think of the implied return in the expression format declaration.
"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
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by RealityRipple » 2020-08-11, 18:20

Just did a test build, everything looks back to normal. Nice catch!

New Tobin Paradigm

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by New Tobin Paradigm » 2020-08-11, 18:43

So where did these regressions come from?

User avatar
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by RealityRipple » 2020-08-11, 18:55

New Tobin Paradigm wrote:
2020-08-11, 18:43
So where did these regressions come from?
Issue #1737. Might want to make sure no similarly written functions lost their returns.

New Tobin Paradigm

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by New Tobin Paradigm » 2020-08-11, 19:18

I see.

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

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by Moonchild » 2020-08-11, 20:26

New Tobin Paradigm wrote:
2020-08-11, 18:43
So where did these regressions come from?
Because of the weird-ass function-body-as-expression syntax that someone at some point in JS's history thought was such a wonderful idea to save a few keystrokes.
"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
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by RealityRipple » 2020-08-11, 21:53

Moonchild wrote:
2020-08-11, 20:26
New Tobin Paradigm wrote:
2020-08-11, 18:43
So where did these regressions come from?
Because of the weird-ass function-body-as-expression syntax that someone at some point in JS's history thought was such a wonderful idea to save a few keystrokes.
it's part of the crazy arrow function syntax that turns javascript into an unreadable mess

User avatar
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by RealityRipple » 2020-09-12, 05:15

I think something's gone wrong here again. My site only shows the selected page style in the menu. All the alternate styles are missing. If I select a different style manually, the menu item changes to match, but all the others are still hidden.

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by adesh » 2020-09-12, 05:58

I see all the styles listed for a moment when the page is loading but they vanish when I hover the menu item again.

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 575
Joined: 2017-01-14, 02:40
Location: Philippines
Contact:

Re: Alternate stylesheets seem to be broken in Pale Moon.

Unread post by FranklinDM » 2020-09-12, 06:16

The changes in Issue #1629 (UXP) might have been the cause. Try flipping the pref dom.link.disabled_attribute.enabled to false.

EDIT: This was uplifted to release in this commit.
Last edited by FranklinDM on 2020-09-12, 06:45, edited 2 times in total.

Locked