Closed Bug 1858649 Opened 1 year ago Closed 1 year ago

please support document.querySelector('form *:has(> textarea)')

Categories

(Core :: CSS Parsing and Computation, enhancement)

Firefox 118
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1858743

People

(Reporter: yjbrowserjyt, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

I have found that some websites use document.querySelector('form *:has(> textarea)'), which results in a SyntaxError in Firefox, stating, "Document.querySelector: 'form *:has(> textarea)' is not a valid selector."

Please assist in enabling this syntax.

Actual results:

SyntaxError: Document.querySelector: 'form *:has(> textarea)' is not a valid selector

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

The :has() pseudo-class is currently only enabled in Nightly build.

Depends on: 1853701

(In reply to jian from comment #0)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

I have found that some websites use document.querySelector('form *:has(> textarea)'), which results in a SyntaxError in Firefox, stating, "Document.querySelector: 'form *:has(> textarea)' is not a valid selector."

Please assist in enabling this syntax.

Actual results:

SyntaxError: Document.querySelector: 'form *:has(> textarea)' is not a valid selector

jian, can you tell us which website it is?

I lost the webpage, but I built a test page. When I click on "loadjs" Chrome can execute it normally, but Firefox cannot run it.

https://yjllq.com/test4.html

(In reply to Nicolas Chevobbe [:nchevobbe] [on PTO, back October 23] from comment #2)

(In reply to jian from comment #0)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

I have found that some websites use document.querySelector('form *:has(> textarea)'), which results in a SyntaxError in Firefox, stating, "Document.querySelector: 'form *:has(> textarea)' is not a valid selector."

Please assist in enabling this syntax.

Actual results:

SyntaxError: Document.querySelector: 'form *:has(> textarea)' is not a valid selector

jian, can you tell us which website it is?

I lost the webpage, but I built a test page. When I click on "loadjs" Chrome can execute it normally, but Firefox cannot run it.

https://yjllq.com/test4.html

Thanks for the testcase!
That page works on Nightly 119 on - On release 119, it's behind the pref layout.css.has-selector.enabled.
Work to enable on default is being tracked in bug 1858743.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1858743
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.