From 40bed0f50c1c30dba982ad430f93b8a665a980da Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Thu, 23 Apr 2020 13:40:34 -0700 Subject: [PATCH] docs: fix typos (#1947) --- docs/README.md | 2 +- docs/core-concepts.md | 2 +- docs/extensibility.md | 2 +- docs/input.md | 2 +- docs/{browsers.md => installation.md} | 2 +- docs/intro.md | 2 +- docs/selectors.md | 6 +++--- 7 files changed, 9 insertions(+), 9 deletions(-) rename docs/{browsers.md => installation.md} (99%) diff --git a/docs/README.md b/docs/README.md index 2e7dc4b7c3668..70c6b53d1f02b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -58,5 +58,5 @@ - Storybooks 1. [Extensibility](./extensibility.md) - [Custom selector engines](./extensibility.md#custom-selector-engines) -1. [Managing browser binaries](./browsers.md) +1. [Installation](./installation.md) 1. [API Reference](./api.md) diff --git a/docs/core-concepts.md b/docs/core-concepts.md index 064ff95cb77e2..6c5fbd527f595 100644 --- a/docs/core-concepts.md +++ b/docs/core-concepts.md @@ -266,7 +266,7 @@ Playwright's [`ElementHandle`](./api.md#class-elementhandle) extends Handles Lifetime: - Handles can we be acquired using the page methods [`page.evaluteHandle`](./api.md#pageevaluatehandlepagefunction-arg), [`page.$`](./api.md#pageselector) or [`page.$$`](./api.md#pageselector-1) or their frame counterparts [`frame.evaluateHandle`](./api.md#frameevaluatehandlepagefunction-arg), [`frame.$`](./api.md#frameselector) or [`frame.$$`](./api.md#frameselector-1). -- Once created, handles will retain object from [grabage collection](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management) +- Once created, handles will retain object from [garbage collection](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management) - Handles will be **automatically disposed** once the page or frame they belong to navigates or closes. - Handles can be **manually disposed** using [`jsHandle.dispose`](./api.md#jshandledispose) method. diff --git a/docs/extensibility.md b/docs/extensibility.md index 771a636e31b1f..5cd1c4f067049 100644 --- a/docs/extensibility.md +++ b/docs/extensibility.md @@ -14,7 +14,7 @@ Selector engine should have the following properties: - `query` function to query first element matching `selector` relative to the `root`. - `queryAll` function to query all elements matching `selector` relative to the `root`. -By default the engine is run directly in the frame's JavaScript context and, for example, can call an application-defined function. To isolate the engine from any JavaScript in the frame, but leave access to the DOM, resgister the engine with `{contentScript: true}` option. Content script engine is safer because it is protected from any tampering with the global objects, for example altering `Node.prototype` methods. All built-in selector engines run as content scripts. Note that running as a content script is not guaranteed when the engine is used together with other custom engines. +By default the engine is run directly in the frame's JavaScript context and, for example, can call an application-defined function. To isolate the engine from any JavaScript in the frame, but leave access to the DOM, register the engine with `{contentScript: true}` option. Content script engine is safer because it is protected from any tampering with the global objects, for example altering `Node.prototype` methods. All built-in selector engines run as content scripts. Note that running as a content script is not guaranteed when the engine is used together with other custom engines. An example of registering selector engine that queries elements based on a tag name: ```js diff --git a/docs/input.md b/docs/input.md index 2a97fd9573b4f..75776a9e3ae4d 100644 --- a/docs/input.md +++ b/docs/input.md @@ -197,7 +197,7 @@ ArrowUp, F1 - F12, Digit0 - Digit9, KeyA - KeyZ, etc. - You can alternatively specify a single character you'd like to produce such as `"a"` or `"#"`. -- Following modification shortcuts are also suported: `Shift, Control, Alt, Meta`. +- Following modification shortcuts are also supported: `Shift, Control, Alt, Meta`. #### Variations diff --git a/docs/browsers.md b/docs/installation.md similarity index 99% rename from docs/browsers.md rename to docs/installation.md index aab0c5894e333..ac5b70180131a 100644 --- a/docs/browsers.md +++ b/docs/installation.md @@ -82,7 +82,7 @@ Using these packages is as easy as using a regular Playwright: $ npm i playwright-webkit ``` -2. Requre package +2. Require package ```js // Notice a proper package name in require diff --git a/docs/intro.md b/docs/intro.md index 946c76e81efa6..ffeaac09e3271 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -6,7 +6,7 @@ Playwright is a cross-browser automation driver for end-to-end testing. Playwrig The Playwright API is cross-browser: it works across **Chromium** (used in Chrome, Edge, and many other browsers), **Firefox** and **WebKit** (used in Safari) engines. -Playwright is free and open source. Playwright is also modular, and work with any JavaScript test runner framework. +Playwright is free and open source. Playwright is also modular, and works with any JavaScript test runner framework. ### Capabilities diff --git a/docs/selectors.md b/docs/selectors.md index eb1291eb67afa..746b155bb1e92 100644 --- a/docs/selectors.md +++ b/docs/selectors.md @@ -8,7 +8,7 @@ Selector can be used to obtain `ElementHandle` (see [page.$()](api.md#pageselect Selector is a string that consists of one or more clauses separated by `>>` token, e.g. `clause1 >> clause2 >> clause3`. When multiple clauses are present, next one is queried relative to the previous one's result. -Each clause contains a selector engine name and selector body, e.g. `engine=body`. Here `engine` is one of the supported engines (e.g. `css` or a custom one). Selector `body` follows the format of the particular engine, e.g. for `css` engine it should be a [css selector](https://developer.mozilla.org/en/docs/Web/CSS/CSS_Selectors). Body format is assumed to ignore leading and trailing whitespaces, so that extra whitespace can be added for readability. If selector engine needs to include `>>` in the body, it should be escaped inside a string to not be confused with clause separator, e.g. `text="some >> text"`. +Each clause contains a selector engine name and selector body, e.g. `engine=body`. Here `engine` is one of the supported engines (e.g. `css` or a custom one). Selector `body` follows the format of the particular engine, e.g. for `css` engine it should be a [css selector](https://developer.mozilla.org/en/docs/Web/CSS/CSS_Selectors). Body format is assumed to ignore leading and trailing white spaces, so that extra whitespace can be added for readability. If selector engine needs to include `>>` in the body, it should be escaped inside a string to not be confused with clause separator, e.g. `text="some >> text"`. For example, ``` @@ -61,7 +61,7 @@ const handle = await divHandle.$('css=span'); `css` is a default engine - any malformed selector not starting with `//` nor with `"` is assumed to be a css selector. For example, Playwright converts `page.$('span > button')` to `page.$('css=span > button')`. -`css:light` engine is equivalent to [`Document.querySelector`](https://developer.mozilla.org/en/docs/Web/API/Document/querySelector) and behaves according to the CSS spec. However, it does not pierce shadow roots, which may be incovenient when working with [Shadow DOM and Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM). For that reason, `css` engine pierces shadow roots. More specifically, every [Descendant combinator](https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_combinator) pierces an arbitrary number of open shadow roots, including the implicit descendant combinator at the start of the selector. +`css:light` engine is equivalent to [`Document.querySelector`](https://developer.mozilla.org/en/docs/Web/API/Document/querySelector) and behaves according to the CSS spec. However, it does not pierce shadow roots, which may be inconvenient when working with [Shadow DOM and Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM). For that reason, `css` engine pierces shadow roots. More specifically, every [Descendant combinator](https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_combinator) pierces an arbitrary number of open shadow roots, including the implicit descendant combinator at the start of the selector. `css` engine first searches for elements in the light dom in the iteration order, and then recursively inside open shadow roots in the iteration order. It does not search inside closed shadow roots or iframes. @@ -119,4 +119,4 @@ Malformed selector starting with `"` is assumed to be a text selector. For examp ### id, data-testid, data-test-id, data-test and their :light counterparts -Attribute engines are selecting based on the corresponding atrribute value. For example: `data-test-id=foo` is equivalent to `css=[data-test-id="foo"]`, and `id:light=foo` is equivalent to `css:light=[id="foo"]`. +Attribute engines are selecting based on the corresponding attribute value. For example: `data-test-id=foo` is equivalent to `css=[data-test-id="foo"]`, and `id:light=foo` is equivalent to `css:light=[id="foo"]`.