Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: make inline refs use parameter name instead of its alias #5219

Merged
merged 1 commit into from
Jan 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/src/api/class-elementhandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ Optional event-specific initialization properties.
- alias-js: $eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Returns the return value of [`param: expression`]

The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first
argument to [`param: pageFunction`]. See [Working with selectors](./selectors.md) for more
argument to [`param: expression`]. See [Working with selectors](./selectors.md) for more
details. If no elements match the selector, the method throws an error.

If [`param: pageFunction`] returns a [Promise], then [`method: ElementHandle.evalOnSelector`] would wait for the promise to resolve and return its
If [`param: expression`] returns a [Promise], then [`method: ElementHandle.evalOnSelector`] would wait for the promise to resolve and return its
value.

Examples:
Expand Down Expand Up @@ -283,21 +283,21 @@ assert tweet_handle.eval_on_selector(".retweets", "node => node.innerText") = "1
### param: ElementHandle.evalOnSelector.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: ElementHandle.evalOnSelectorAll
* langs:
- alias-python: eval_on_selector_all
- alias-js: $$eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Returns the return value of [`param: expression`]

The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of
matched elements as a first argument to [`param: pageFunction`]. See
matched elements as a first argument to [`param: expression`]. See
[Working with selectors](./selectors.md) for more details.

If [`param: pageFunction`] returns a [Promise], then [`method: ElementHandle.evalOnSelectorAll`] would wait for the promise to resolve and return its
If [`param: expression`] returns a [Promise], then [`method: ElementHandle.evalOnSelectorAll`] would wait for the promise to resolve and return its
value.

Examples:
Expand Down Expand Up @@ -331,7 +331,7 @@ assert feed_handle.eval_on_selector_all(".tweet", "nodes => nodes.map(n => n.inn
### param: ElementHandle.evalOnSelectorAll.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: ElementHandle.fill

Expand Down
30 changes: 15 additions & 15 deletions docs/src/api/class-frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,13 @@ Optional event-specific initialization properties.
- alias-js: $eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Returns the return value of [`param: expression`]

The method finds an element matching the specified selector within the frame and passes it as a first argument to
[`param: pageFunction`]. See [Working with selectors](./selectors.md) for more details. If no
[`param: expression`]. See [Working with selectors](./selectors.md) for more details. If no
elements match the selector, the method throws an error.

If [`param: pageFunction`] returns a [Promise], then [`method: Frame.evalOnSelector`] would wait for the promise to resolve and return its
If [`param: expression`] returns a [Promise], then [`method: Frame.evalOnSelector`] would wait for the promise to resolve and return its
value.

Examples:
Expand Down Expand Up @@ -336,21 +336,21 @@ html = frame.eval_on_selector(".main-container", "(e, suffix) => e.outerHTML + s
### param: Frame.evalOnSelector.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Frame.evalOnSelectorAll
* langs:
- alias-python: eval_on_selector_all
- alias-js: $$eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Returns the return value of [`param: expression`]

The method finds all elements matching the specified selector within the frame and passes an array of matched elements
as a first argument to [`param: pageFunction`]. See [Working with selectors](./selectors.md) for
as a first argument to [`param: expression`]. See [Working with selectors](./selectors.md) for
more details.

If [`param: pageFunction`] returns a [Promise], then [`method: Frame.evalOnSelectorAll`] would wait for the promise to resolve and return its
If [`param: expression`] returns a [Promise], then [`method: Frame.evalOnSelectorAll`] would wait for the promise to resolve and return its
value.

Examples:
Expand All @@ -374,12 +374,12 @@ divs_counts = frame.eval_on_selector_all("div", "(divs, min) => divs.length >= m
### param: Frame.evalOnSelectorAll.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Frame.evaluate
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Returns the return value of [`param: expression`]

If the function passed to the [`method: Frame.evaluate`] returns a [Promise], then [`method: Frame.evaluate`] would wait for the promise to
resolve and return its value.
Expand Down Expand Up @@ -450,12 +450,12 @@ body_handle.dispose()
### param: Frame.evaluate.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Frame.evaluateHandle
- returns: <[JSHandle]>

Returns the return value of [`param: pageFunction`] as in-page object (JSHandle).
Returns the return value of [`param: expression`] as in-page object (JSHandle).

The only difference between [`method: Frame.evaluate`] and [`method: Frame.evaluateHandle`] is that
[method: Frame.evaluateHandle`] returns in-page object (JSHandle).
Expand Down Expand Up @@ -520,7 +520,7 @@ result_handle.dispose()
### param: Frame.evaluateHandle.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Frame.fill

Expand Down Expand Up @@ -1010,7 +1010,7 @@ Returns frame's url.
## async method: Frame.waitForFunction
- returns: <[JSHandle]>

Returns when the [`param: pageFunction`] returns a truthy value, returns that value.
Returns when the [`param: expression`] returns a truthy value, returns that value.

The [`method: Frame.waitForFunction`] can be used to observe viewport size change:

Expand Down Expand Up @@ -1082,12 +1082,12 @@ frame.wait_for_function("selector => !!document.querySelector(selector)", select
### param: Frame.waitForFunction.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

### option: Frame.waitForFunction.polling
- `polling` <[float]|"raf">

If [`option: polling`] is `'raf'`, then [`param: pageFunction`] is constantly executed in `requestAnimationFrame`
If [`option: polling`] is `'raf'`, then [`param: expression`] is constantly executed in `requestAnimationFrame`
callback. If [`option: polling`] is a number, then it is treated as an interval in milliseconds at which the function
would be executed. Defaults to `raf`.

Expand Down
14 changes: 7 additions & 7 deletions docs/src/api/class-jshandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ The `jsHandle.dispose` method stops referencing the element handle.
## async method: JSHandle.evaluate
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Returns the return value of [`param: expression`]

This method passes this handle as the first argument to [`param: pageFunction`].
This method passes this handle as the first argument to [`param: expression`].

If [`param: pageFunction`] returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return
If [`param: expression`] returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return
its value.

Examples:
Expand All @@ -66,14 +66,14 @@ assert tweet_handle.evaluate("node => node.innerText") == "10 retweets"
### param: JSHandle.evaluate.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: JSHandle.evaluateHandle
- returns: <[JSHandle]>

Returns the return value of [`param: pageFunction`] as in-page object (JSHandle).
Returns the return value of [`param: expression`] as in-page object (JSHandle).

This method passes this handle as the first argument to [`param: pageFunction`].
This method passes this handle as the first argument to [`param: expression`].

The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` returns
in-page object (JSHandle).
Expand All @@ -88,7 +88,7 @@ See [`method: Page.evaluateHandle`] for more details.
### param: JSHandle.evaluateHandle.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: JSHandle.getProperties
- returns: <[Map]<[string], [JSHandle]>>
Expand Down
30 changes: 15 additions & 15 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,10 @@ Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`
- returns: <[Serializable]>

The method finds an element matching the specified selector within the page and passes it as a first argument to
[`param: pageFunction`]. If no elements match the selector, the method throws an error. Returns the value of
[`param: pageFunction`].
[`param: expression`]. If no elements match the selector, the method throws an error. Returns the value of
[`param: expression`].

If [`param: pageFunction`] returns a [Promise], then [`method: Page.evalOnSelector`] would wait for the promise to resolve and
If [`param: expression`] returns a [Promise], then [`method: Page.evalOnSelector`] would wait for the promise to resolve and
return its value.

Examples:
Expand Down Expand Up @@ -762,7 +762,7 @@ Shortcut for main frame's [`method: Frame.evalOnSelector`].
### param: Page.evalOnSelector.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Page.evalOnSelectorAll
* langs:
Expand All @@ -771,9 +771,9 @@ Optional argument to pass to [`param: pageFunction`]
- returns: <[Serializable]>

The method finds all elements matching the specified selector within the page and passes an array of matched elements as
a first argument to [`param: pageFunction`]. Returns the result of [`param: pageFunction`] invocation.
a first argument to [`param: expression`]. Returns the result of [`param: expression`] invocation.

If [`param: pageFunction`] returns a [Promise], then [`method: Page.evalOnSelectorAll`] would wait for the promise to resolve and
If [`param: expression`] returns a [Promise], then [`method: Page.evalOnSelectorAll`] would wait for the promise to resolve and
return its value.

Examples:
Expand All @@ -797,12 +797,12 @@ div_counts = page.eval_on_selector_all("div", "(divs, min) => divs.length >= min
### param: Page.evalOnSelectorAll.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Page.evaluate
- returns: <[Serializable]>

Returns the value of the [`param: pageFunction`] invocation.
Returns the value of the [`param: expression`] invocation.

If the function passed to the [`method: Page.evaluate`] returns a [Promise], then [`method: Page.evaluate`] would wait
for the promise to resolve and return its value.
Expand All @@ -811,7 +811,7 @@ If the function passed to the [`method: Page.evaluate`] returns a non-[Serializa
[`method: Page.evaluate`] resolves to `undefined`. DevTools Protocol also supports transferring some additional values
that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`, and bigint literals.

Passing argument to [`param: pageFunction`]:
Passing argument to [`param: expression`]:

```js
const result = await page.evaluate(([x, y]) => {
Expand Down Expand Up @@ -877,12 +877,12 @@ Shortcut for main frame's [`method: Frame.evaluate`].
### param: Page.evaluate.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Page.evaluateHandle
- returns: <[JSHandle]>

Returns the value of the [`param: pageFunction`] invocation as in-page object (JSHandle).
Returns the value of the [`param: expression`] invocation as in-page object (JSHandle).

The only difference between [`method: Page.evaluate`] and [`method: Page.evaluateHandle`] is that [`method: Page.evaluateHandle`] returns in-page
object (JSHandle).
Expand Down Expand Up @@ -947,7 +947,7 @@ result_handle.dispose()
### param: Page.evaluateHandle.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Page.exposeBinding

Expand Down Expand Up @@ -2197,7 +2197,7 @@ Either a predicate that receives an event or an options object. Optional.
## async method: Page.waitForFunction
- returns: <[JSHandle]>

Returns when the [`param: pageFunction`] returns a truthy value. It resolves to a JSHandle of the truthy value.
Returns when the [`param: expression`] returns a truthy value. It resolves to a JSHandle of the truthy value.

The [`method: Page.waitForFunction`] can be used to observe viewport size change:

Expand Down Expand Up @@ -2271,12 +2271,12 @@ Shortcut for main frame's [`method: Frame.waitForFunction`].
### param: Page.waitForFunction.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

### option: Page.waitForFunction.polling
- `polling` <[float]|"raf">

If [`option: polling`] is `'raf'`, then [`param: pageFunction`] is constantly executed in `requestAnimationFrame`
If [`option: polling`] is `'raf'`, then [`param: expression`] is constantly executed in `requestAnimationFrame`
callback. If [`option: polling`] is a number, then it is treated as an interval in milliseconds at which the function
would be executed. Defaults to `raf`.

Expand Down
8 changes: 4 additions & 4 deletions docs/src/api/class-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs
## async method: Worker.evaluate
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Returns the return value of [`param: expression`]

If the function passed to the `worker.evaluate` returns a [Promise], then `worker.evaluate` would wait for the promise
to resolve and return its value.
Expand All @@ -49,12 +49,12 @@ If the function passed to the `worker.evaluate` returns a non-[Serializable] val
### param: Worker.evaluate.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## async method: Worker.evaluateHandle
- returns: <[JSHandle]>

Returns the return value of [`param: pageFunction`] as in-page object (JSHandle).
Returns the return value of [`param: expression`] as in-page object (JSHandle).

The only difference between `worker.evaluate` and `worker.evaluateHandle` is that `worker.evaluateHandle` returns
in-page object (JSHandle).
Expand All @@ -67,7 +67,7 @@ the promise to resolve and return its value.
### param: Worker.evaluateHandle.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Optional argument to pass to [`param: expression`]

## method: Worker.url
- returns: <[string]>