"Basic Page Style" sheet would not load by default. Only alternate stylesheet seems to be applied

NEW
Unassigned

Status

defect
P3
normal
10 months ago
2 months ago

People

(Reporter: alice0775, Unassigned)

Tracking

({regression, webcompat:contact-ready})

Dependency tree / graph

Firefox Tracking Flags

(firefox-esr60 unaffected, firefox62 wontfix, firefox63 wontfix, firefox64 fix-optional)

Details

(Whiteboard: [contactready] [js] , )

Attachments

(2 attachments)

Reporter

Description

10 months ago
Reproducible: always

Steps To Reproduce:
1. Open URL

Actual Results:
Only alternate CSS seems to be applied.  (See Alt > View > Page Style.)

Expected Results:
Basic Page Style should be applied by default.


Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=04c09eeff73853398a997fba5c1f4c62f3d0efae&tochange=2dca44947bff13747fb708a9ce4adc675afd2d03

Regressed by: Bug 1447009
Reporter

Comment 1

10 months ago
Reporter

Comment 2

10 months ago
Reporter

Comment 3

10 months ago
After selecting "Basic Page Style" in View > Page Style menu, then the page is displayed correctly even if select alternate stylesheet. But after reloading page(F5), page broken again.

:emilio
Your bunch of patch seems to cause the problem, can you please look into this?
Flags: needinfo?(emilio)
Reporter

Updated

10 months ago
Summary: "Basic Page Style" sheet would not load by default. Only alternate CSS seems to be applied → "Basic Page Style" sheet would not load by default. Only alternate stylesheet seems to be applied
Assignee: nobody → emilio
Thanks for reporting this Alice, as usual you're amazing.

So, this page is relying on the title getter returning the empty string. Their style switcher looks like:

	Styleswitcher.switchStyle = function(name) {
		if (isWebKit) {
			$("link[media='screen']").each(function() {
				var el = $(this);
				if (el.attr("title") != "") {
					if (el.attr("title") == name) {
						el.attr("rel", "stylesheet");
						el.removeAttr("disabled");
					} else {
						el.attr("rel", "alternate stylesheet");
						el.attr("disabled", "disabled");
					}
				}
			});
		} else {
			var sheets = document.styleSheets;
			for (var i = 0; i < sheets.length; i++) {
				if (sheets[i].title != "") {
					if (sheets[i].title == name) {
						sheets[i].disabled = false;
					} else {
						sheets[i].disabled = true;
					}
				}
			}
		}

		// Cookie をセット
		$.cookie(Styleswitcher.cookieName, name, {path:"/"});
	};

Fix on their side would be to change:

        if (sheets[i].title != "") {

for:

        if (!sheets[i].title) {

So that both null and the empty string are handled. I think I can't fix it here unless we decide to revert my change and raise an issue in the spec.

Given we've shipped the change already I think it might be really confusing though, unless there are more broken pages.

Moving to tech evangelism for now.
Component: CSS Parsing and Computation → Desktop
Flags: needinfo?(emilio)
Product: Core → Tech Evangelism
Version: 62 Branch → Firefox 62
Assignee: emilio → nobody
@Karl could you help us find a contact?
Flags: needinfo?(kdubost)
Priority: -- → P3
The form for contacting them by email is at 
https://www.orange-book.com/other/obwfk58020/index

Note that they require a lot of information including phone number.

There is also this email which seems to be about contacting people with English overseas@trusco.co.jp
Flags: needinfo?(kdubost)
Whiteboard: [contactready] [js]
Too late to fix in 63. We could still take a patch for 65 and potentially for 64.
Product: Tech Evangelism → Web Compatibility

See bug 1547409. Moving webcompat whiteboard tags to keywords.

You need to log in before you can comment on or make changes to this bug.