selectorText reports `**` when it should be `* + *` in Stylo

RESOLVED DUPLICATE of bug 1391169

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 1391169
9 months ago
9 months ago

People

(Reporter: Martin Trigaux, Unassigned)

Tracking

56 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 months ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20170808170225

Steps to reproduce:

In my CSS selector rules, having the "* + *" CSS selector behaves differently in FF56

To reproduce, take the simple CSS and JS files
https://pastebin.com/uNiJURfM index.html
https://pastebin.com/Qs7QLjCs test.css
https://pastebin.com/QDu9dmdS test.js




Actual results:

In Firefox 56, the console contains

.foo > **
.foo



Expected results:

In Firefox 55 (or Chrome), the console contains

.foo > * + * 
.foo

The rule ** is not a valid selector.

Updated

9 months ago
Component: Untriaged → Developer Tools: Console
I don't see `.foo > **` in the console on 56 or 57 using this page (the test case from the STR in a data URI):

data:text/html,<html><style>.foo {margin: 42px;}.foo > * + * {margin-left: 4px;}</style><script>window.onload = function() { var sheets = document.styleSheets;for(var i = sheets.length-1; i >= 0 ; i--) {var rules = sheets[i].cssRules;for(var r = rules.length-1; r >= 0; r--) {console.log(rules[r].selectorText);}} }</script></html>

I see `.foo > * + *` as expected, am I missing something?
Flags: needinfo?(me)
(Reporter)

Comment 2

9 months ago
You are right, I just tried with a fresh profile and did not get the issue either.
Sorry, I guess it is one of my extension, I will investigate.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 months ago
Flags: needinfo?(me)
Resolution: --- → INVALID
(In reply to Martin Trigaux from comment #2)
> You are right, I just tried with a fresh profile and did not get the issue
> either.
> Sorry, I guess it is one of my extension, I will investigate.

Actually, I just figured it out - this happens with Stylo enabled (layout.css.servo.enabled).  Ryan, it looks like the selectorText is wrong in this case with stylo (see Comment 1).
Flags: needinfo?(jryans)
Status: RESOLVED → UNCONFIRMED
Component: Developer Tools: Console → CSS Parsing and Computation
Product: Firefox → Core
Resolution: INVALID → ---
Summary: cssRules call concatenate * selectors → cssRules call concatenate * selectors in Stylo
Summary: cssRules call concatenate * selectors in Stylo → selectorText reports `**` when it should be `* + *` in Stylo
(In reply to Brian Grinstead [:bgrins] from comment #3)
> (In reply to Martin Trigaux from comment #2)
> > You are right, I just tried with a fresh profile and did not get the issue
> > either.
> > Sorry, I guess it is one of my extension, I will investigate.
> 
> Actually, I just figured it out - this happens with Stylo enabled
> (layout.css.servo.enabled).  Ryan, it looks like the selectorText is wrong
> in this case with stylo (see Comment 1).

Yes, this sounds like Stylo bug 1391169.  It should be fixed in 57, but it wasn't uplifted to 56.

The test case from comment 1 appears to work in 57 with Stylo.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 months ago9 months ago
Flags: needinfo?(jryans)
Resolution: --- → DUPLICATE
Duplicate of bug: 1391169
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #4)
> (In reply to Brian Grinstead [:bgrins] from comment #3)
> > (In reply to Martin Trigaux from comment #2)
> > > You are right, I just tried with a fresh profile and did not get the issue
> > > either.
> > > Sorry, I guess it is one of my extension, I will investigate.
> > 
> > Actually, I just figured it out - this happens with Stylo enabled
> > (layout.css.servo.enabled).  Ryan, it looks like the selectorText is wrong
> > in this case with stylo (see Comment 1).
> 
> Yes, this sounds like Stylo bug 1391169.  It should be fixed in 57, but it
> wasn't uplifted to 56.
> 
> The test case from comment 1 appears to work in 57 with Stylo.

Yes you are right, I confirmed the test case works in 57. Thanks for filing the bug anyway, Martin!
(Reporter)

Comment 7

9 months ago
Thank you for the quick investigation.
Will this be backported to 56 or should I disable servo until upgrading to 57?
(In reply to Martin Trigaux from comment #7)
> Thank you for the quick investigation.
> Will this be backported to 56 or should I disable servo until upgrading to
> 57?

There are no plans to enable Stylo by default in 56, so it's effectively an "early version" that may have quirks like this.  I would suggest either (a) switching to Nightly if you'd like to keep using Stylo with fixes for bugs like this or (b) disabling Stylo for now if you'd like to stay on Beta (currently 56).
You need to log in before you can comment on or make changes to this bug.