Skip to content

DomNode.querySelector(String) -> DomNode.querySelector(String, DomNode) in 5.7.0 is a breaking change for Jenkins core #1193

Open

Description

@MarkEWaite

HTMLUnit 5.7.0 added support for CSS pseudo class :scope in commit b24d35b . That change included a signature change from DomNode.querySelector(String) -> DomNode.querySelector(String, DomNode). Jenkins core has over 30 calls to DomNode.querySelector(String) in its automated tests.

Is there a way that the previous signature can be retained while still allowing JUnit to add support for CSS pseudo class :scope?

If there is not, then we will adapt the Jenkins tests to use the new signature.

Activity

  1. changed the title [-]`DomNode.querySelector(String)` -> `DomNode.querySelector(String, DomNode)` is a breaking change for Jenkins core[/-] [+]`DomNode.querySelector(String)` -> `DomNode.querySelector(String, DomNode)` in 5.7.0 is a breaking change for Jenkins core[/+] on Nov 13, 2026
  2. rbri commented on Nov 13, 2026

    @rbri
    Member

    @MarkEWaite thanks for the report, will have a look
    5.8.0 is plannend for the beginning of next week, maybe i can bring it back

  3. rbri commented on Nov 13, 2026

    @rbri
    Member
    • for HtmlPage it is still there (inherited form SgmlPage)
    • the other group of the calls are from js like page.executeJavaScript("document.querySelector('." + customizableTLID.customId + "

    will check what a useful backward compatible version for dom node might be

  4. rbri commented on Nov 13, 2026

    @rbri
    Member

    ok had a look...

    Removing the one-argument variants was not really intended. HtmlUnit 5.8.0 restores DomNode.querySelector(String) and DomNode.querySelectorAll(String) with the same (binary compatible) signatures as 5.6.0; :scope then refers to the node the method is called on, like element.querySelector() in the browsers. No changes to the Jenkins tests are needed.

    Thanks for reaching out, hope all the improvements of the last releases helping to make your work simpler :-)

    At least 5.8 will bring a major update to csp support.

  5. MarkEWaite commented on Nov 13, 2026

    @MarkEWaite
    Author

    Removing the one-argument variants was not really intended. HtmlUnit 5.8.0 restores DomNode.querySelector(String) and DomNode.querySelectorAll(String) with the same (binary compatible) signatures as 5.6.0; :scope then refers to the node the method is called on, like element.querySelector() in the browsers

    That is great news! I was making exactly that change in the callers to adapt to the new API. It will be much nicer that the called method assumes the scope if a scope is not provided.

    Thanks for reaching out, hope all the improvements of the last releases helping to make your work simpler :-)

    Thanks so much for your responsiveness and for all the work that you do in HTMLUnit. It is much appreciated!

  6. rbri commented on Nov 13, 2026

    @rbri
    Member

    will ping you when the new release is out...

  7. rbri commented on Nov 17, 2026

    @rbri
    Member

    @MarkEWaite 5.8.0 is out - its a huge one, hope it works for jenkins

  8. MarkEWaite commented on Nov 19, 2026

    @MarkEWaite
    Author

    @MarkEWaite 5.8.0 is out - its a huge one, hope it works for jenkins

    It fails several Jenkins tests that pass with a Jenkins test harness development copy that includes HTMLUnit 5.8.0. The tests pass with HTMLUnit 5.5.0.

    I'll explore further to see if I can identify a reasonable way to report the failures.

  9. rbri commented on Nov 19, 2026

    @rbri
    Member

    @MarkEWaite sorry for that, have so many tests here and still some regressions sometimes. If i can help i will try my best

  10. reopened this on Nov 19, 2026
  11. rbri commented on Nov 19, 2026

    @rbri
    Member

    @MarkEWaite one last minute change is comming to my mind - see the description here

    #1202

    just an idea

  12. rbri commented on Nov 20, 2026

    @rbri
    Member

    another cause might be the new csp stuff, maybe there are some errors or missing things...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions