Closed Bug 1375358 Opened 9 years ago Closed 9 years ago

Userstyle CSS is not inserted correctly if page is loaded as a background tab

Categories

(Firefox :: Untriaged, defect)

56 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: dsmith, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20170621102301 Steps to reproduce: Install Stylus 1.1.0 in a new profile. (Stylus is a WebExtension addon.) Create this user style: .pageWidth { margin: 0px auto; max-width: 1170px; } And have it apply to URLs on domain: forums.sufficientvelocity.com Test URL: https://forums.sufficientvelocity.com/ NB: The CSS of the site includes this rule: .pageWidth { margin: 0px 5%; } Load the page with the Stylus rule active (should be, by default). Click on one of the forums (eg: Forum News) so that you're loading it within the same tab. It will load correctly (correct width, and centered on the screen). Then go back to the main page, and open that same forum in a new tab (middle-clicking or context menu). It will load incorrectly: The max-width will be applied because there are no conflicting rules, but it will use the site's margin setting instead of Stylus's margin setting, leaving the content left-aligned on the screen. If you go to the DOM inspector, you'll see the site's rule that comes from css.php is applied after the Stylus rule that should have overridden it. Instead, the Stylus property is overridden. Actual results: CSS is not applied correctly to the cascade if a page is loaded via a link from another page into a background tab. This bug only appears if new tabs are loaded in the background. If tabs are loaded in the foreground, they work correctly. It does not occur if you load the page in an existing tab via link. It does not occur if you reload a page that loaded incorrectly the first time. It does not occur if you load the page via bookmark. Expected results: This appears to be a regression introduced on March 18. (March 17 version works correctly.) (I'm only finding it now because of an attempt to find a WebExtension capable of replacing Stylish.) There are a number of patches that affected CSS that landed on March 17. I'm not sure how to narrow it down any further.
Please report the issue to the extension author.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
The issue *has* been reported to the extension author. Investigation indicated that it is very likely that this is a Firefox bug (though further investigation is ongoing), primarily supported by the fact that I can give you an exact Firefox build when the behavior changed from correct to broken, and the fact that is only ever broken with one method of opening a new URL, while having a Firefox pref set a certain way. Resolving this as invalid without even attempting to investigate is bad faith behavior of Mozilla's part.
Inserting user stylesheet to specific sites is not a Firefox feature, hence invalid. A bug should be reported by the extension author if, as the result of further investigation, it has turned out to be a bug that should be fixed in Firefox side.
... It *is* a Firefox feature, which Firefox supports in a number of ways, including in the WebExtension API which it is promoting, and the development tools which explicitly allow you to load a custom stylesheet and apply it to the current page. It also doesn't change the fact that this bug is not about a feature, but about *behavior*. It's about the reliability of Firefox's behavior with respect to WebExtensions, which appears to change based on a very narrow set of conditions. In addition, a similar bug was briefly introduced a few weeks ago due to ongoing work in transitioning to Stylo. It helped weight my belief that this has a high likelihood of being a Firefox problem, and thus spend the time finding a regression range for you, so that at least the issue could be tracked in parallel with the work done by the extension author.
You need to log in before you can comment on or make changes to this bug.