Closed Bug 1353670 Opened 7 years ago Closed 7 years ago

Support /deep/ operator in css selectors in Marionette

Categories

(Remote Protocol :: Marionette, defect)

52 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: moritz.kneilmann, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36

Steps to reproduce:

I tried finding an element with Geckodriver using the css selector locator strategy and a css selector that includes the `/deep/` operator. (Actually I executed `driver.findElement(By.cssSelector("i4-login /deep/ input"))` using the selenium FirefoxDriver (https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver))



Actual results:

I got the error `Given css selector expression "some-element /deep/ input" is invalid: InvalidSelectorError: 'some-element /deep/ input' is not a valid selector: "i4-login /deep/ input"`.


Expected results:

Return the `input` element.

I assume this is not a bug in the Geckodriver, since there it just forwards errors from Marionette.
See: https://github.com/mozilla/geckodriver/blob/master/src/marionette.rs#L519

According to the WebDriver spec (https://www.w3.org/TR/webdriver/#dfn-css-selector) the css selector locator strategy should just use `querySelectorAll` which to my knowledge supports `/deep`.
On the other hand I found that Marionette actually already uses `querySelectorAll`, so I don't know..
See: https://dxr.mozilla.org/mozilla-central/source/testing/marionette/element.js#487
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Summary: Support /deep/ selectors in Marionette → Support /deep/ operator in css selectors in Marionette
Looking around the specs, it appears that /deep/ has been dropped and been replaced with https://drafts.csswg.org/css-scoping/#deep-combinator

Marionette just calls into `querySelector` and `querySelectorAll` for finding CSS selectors. When the `>>>` is implemented and if it doesnt work with Marionette I suggest testing it in devtools and if it doesnt work there raising a specific querySelector issue against DOM
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
> Marionette just calls into `querySelector` and `querySelectorAll` for finding CSS selectors.

And since `querySelector` works with `/deep/` I would expect it to work through Marionette too. But in my case 
it didn't.
Since we're using `querySelector`[1] I can't see how Marionette is doing anything special. We just offload to the browser to do the heavy lifting for us.

[1] https://dxr.mozilla.org/mozilla-central/source/testing/marionette/element.js#487
I can’t find any information on MDN about this, but I don’t think Gecko implements the ‘shadow-piercing descendant combinator’ yet.
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.