w3c / w3c/webdriver

Consider introducing per-Element script execution.

Open
#1,776 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
718
Forks
228
PR merge metrics
No merged PRs in 30d

Description

13.2 Executing Script

It would be nice if we could have the identical document level script execution, per element, such that this would be set to the element in question.

I emulated this, but I think it's such a useful feature it should be a first class operation.

class Element
  # ...
  def execute(script, *arguments)
    @session.execute("return (function(){#{script}}).call(...arguments)", self, *arguments)
  end

  def execute_async(script, *arguments)
    @session.execute_async("return (function(){#{script}}).call(...arguments)", self, *arguments)
  end
  # ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue points to section 13.2, “Executing Script”; start there and review the document-level script execution model. A complete change would specify first-class per-element synchronous and asynchronous execution with this bound to the target element, including the argument behavior shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.