Skip to content

Commit

Permalink
Rename InkPresenter to DelegatedInkTrailPresenter (#36773)
Browse files Browse the repository at this point in the history
* move documentations

* update content

* fix statuses

* Apply suggestions from code review

---------

Co-authored-by: wbamberg <will@bootbonnet.ca>
  • Loading branch information
skyclouds2001 and wbamberg authored Nov 15, 2024
1 parent 632289f commit 57aa261
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 40 deletions.
4 changes: 4 additions & 0 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8799,6 +8799,10 @@
/en-US/docs/Web/API/IndexedDB_API/ObjectStore /en-US/docs/Web/API/IDBObjectStore
/en-US/docs/Web/API/IndexedDB_API/Synchronous_API /en-US/docs/Web/API/IndexedDB_API
/en-US/docs/Web/API/IndexedDB_API/Transaction /en-US/docs/Web/API/IDBTransaction
/en-US/docs/Web/API/InkPresenter /en-US/docs/Web/API/DelegatedInkTrailPresenter
/en-US/docs/Web/API/InkPresenter/expectedImprovement /en-US/docs/Web/API/DelegatedInkTrailPresenter/expectedImprovement
/en-US/docs/Web/API/InkPresenter/presentationArea /en-US/docs/Web/API/DelegatedInkTrailPresenter/presentationArea
/en-US/docs/Web/API/InkPresenter/updateInkTrailStartPoint /en-US/docs/Web/API/DelegatedInkTrailPresenter/updateInkTrailStartPoint
/en-US/docs/Web/API/Input.mozGetFileNameArray /en-US/docs/Web/API/HTMLInputElement
/en-US/docs/Web/API/Input.mozSetFileNameArray /en-US/docs/Web/API/HTMLInputElement
/en-US/docs/Web/API/Input.multiple /en-US/docs/Web/API/HTMLInputElement/multiple
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
title: "InkPresenter: expectedImprovement property"
title: "DelegatedInkTrailPresenter: expectedImprovement property"
short-title: expectedImprovement
slug: Web/API/InkPresenter/expectedImprovement
slug: Web/API/DelegatedInkTrailPresenter/expectedImprovement
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.InkPresenter.expectedImprovement
- deprecated
- non-standard
browser-compat: api.DelegatedInkTrailPresenter.expectedImprovement
---

{{APIRef("Ink API")}}{{SeeCompatTable}}
{{APIRef("Ink API")}}{{Deprecated_header}}{{Non-Standard_Header}}

The **`expectedImprovement`** read-only property of the {{domxref("InkPresenter")}} interface returns a value, in milliseconds, indicating the latency improvement that can be expected using this presenter.
The **`expectedImprovement`** read-only property of the {{domxref("DelegatedInkTrailPresenter")}} interface returns a value, in milliseconds, indicating the latency improvement that can be expected using this presenter.

### Value

Expand All @@ -30,7 +31,7 @@ async function inkInit() {

## Specifications

{{Specifications}}
The feature is no longer a part of the specification.

## Browser compatibility

Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
---
title: InkPresenter
slug: Web/API/InkPresenter
title: DelegatedInkTrailPresenter
slug: Web/API/DelegatedInkTrailPresenter
page-type: web-api-interface
status:
- experimental
browser-compat: api.InkPresenter
browser-compat: api.DelegatedInkTrailPresenter
---

{{APIRef("Ink API")}}{{SeeCompatTable}}

The **`InkPresenter`** interface of the [Ink API](/en-US/docs/Web/API/Ink_API) provides the ability to instruct the OS-level compositor to render ink strokes between pointer event dispatches.
The **`DelegatedInkTrailPresenter`** interface of the [Ink API](/en-US/docs/Web/API/Ink_API) provides the ability to instruct the OS-level compositor to render ink strokes between pointer event dispatches.

{{InheritanceDiagram}}

## Instance properties

- {{domxref("InkPresenter.expectedImprovement", "expectedImprovement")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- {{domxref("DelegatedInkTrailPresenter.expectedImprovement", "expectedImprovement")}} {{Deprecated_Inline}} {{Non-standard_Inline}} {{ReadOnlyInline}}
- : Returns a value, in milliseconds, indicating the latency improvement that can be expected using this presenter.
- {{domxref("InkPresenter.presentationArea", "presentationArea")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- {{domxref("DelegatedInkTrailPresenter.presentationArea", "presentationArea")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : Returns the {{domxref("Element")}} inside which rendering of ink strokes is confined.

## Instance methods

- {{domxref("InkPresenter.updateInkTrailStartPoint", "updateInkTrailStartPoint()")}} {{Experimental_Inline}}
- {{domxref("DelegatedInkTrailPresenter.updateInkTrailStartPoint", "updateInkTrailStartPoint()")}} {{Experimental_Inline}}
- : Passes the {{domxref("PointerEvent")}} that was used as the last rendering point for the current frame, allowing the OS-level compositor to render a delegated ink trail ahead of the next pointer event being dispatched.

## Example

In this example, we draw a trail onto a 2D canvas. Near the start of the code, we call {{domxref("Ink.requestPresenter()")}}, passing it the canvas as the presentation area for it to take care of and storing the promise it returns in the `presenter` variable.

Later on, in the `pointermove` event listener, the new position of the trailhead is drawn onto the canvas each time the event fires. In addition, the `InkPresenter` object returned when the `presenter` promise fulfills has its {{domxref("InkPresenter.updateInkTrailStartPoint", "updateInkTrailStartPoint()")}} method invoked; this is passed:
Later on, in the `pointermove` event listener, the new position of the trailhead is drawn onto the canvas each time the event fires. In addition, the `DelegatedInkTrailPresenter` object returned when the `presenter` promise fulfills has its {{domxref("DelegatedInkTrailPresenter.updateInkTrailStartPoint", "updateInkTrailStartPoint()")}} method invoked; this is passed:

- The last trusted pointer event representing the rendering point for the current frame.
- A `style` object containing color and diameter settings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
---
title: "InkPresenter: presentationArea property"
title: "DelegatedInkTrailPresenter: presentationArea property"
short-title: presentationArea
slug: Web/API/InkPresenter/presentationArea
slug: Web/API/DelegatedInkTrailPresenter/presentationArea
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.InkPresenter.presentationArea
browser-compat: api.DelegatedInkTrailPresenter.presentationArea
---

{{APIRef("Ink API")}}{{SeeCompatTable}}

The **`presentationArea`** read-only property of the {{domxref("InkPresenter")}} interface returns the {{domxref("Element")}} inside which rendering of ink strokes is confined.
The **`presentationArea`** read-only property of the {{domxref("DelegatedInkTrailPresenter")}} interface returns the {{domxref("Element")}} inside which rendering of ink strokes is confined.

If the preceding {{domxref("Ink.requestPresenter", "Ink.requestPresenter()")}} method call included a specific `presentationArea` element definition, then that will be the element returned. Otherwise, the default is returned, which is the containing viewport.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
---
title: "InkPresenter: updateInkTrailStartPoint() method"
title: "DelegatedInkTrailPresenter: updateInkTrailStartPoint() method"
short-title: updateInkTrailStartPoint()
slug: Web/API/InkPresenter/updateInkTrailStartPoint
slug: Web/API/DelegatedInkTrailPresenter/updateInkTrailStartPoint
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.InkPresenter.updateInkTrailStartPoint
browser-compat: api.DelegatedInkTrailPresenter.updateInkTrailStartPoint
---

{{APIRef("Ink API")}}{{SeeCompatTable}}

The **`updateInkTrailStartPoint()`** method of the {{domxref("InkPresenter")}} interface indicates which {{domxref("PointerEvent")}} was used as the last rendering point for the current frame, allowing the OS-level compositor to render a delegated ink trail ahead of the next pointer event being dispatched.
The **`updateInkTrailStartPoint()`** method of the {{domxref("DelegatedInkTrailPresenter")}} interface indicates which {{domxref("PointerEvent")}} was used as the last rendering point for the current frame, allowing the OS-level compositor to render a delegated ink trail ahead of the next pointer event being dispatched.

## Syntax

Expand Down Expand Up @@ -39,15 +37,15 @@ requestPresenter(event, style)
- : An error is thrown and the operation is aborted if the:
- `color` property does not contain a valid CSS color code.
- `diameter` property is not a number or less than 1.
- {{domxref("InkPresenter.presentationArea", "presentationArea")}} element is removed from the document before or during rendering.
- {{domxref("DelegatedInkTrailPresenter.presentationArea", "presentationArea")}} element is removed from the document before or during rendering.

## Examples

### Drawing an ink trail

In this example, we draw a trail onto a 2D canvas. Near the start of the code, we call {{domxref("Ink.requestPresenter()")}}, passing it the canvas as the presentation area for it to take care of and storing the promise it returns in the `presenter` variable.

Later on, in the `pointermove` event listener, the new position of the trailhead is drawn onto the canvas each time the event fires. In addition, the {{domxref("InkPresenter")}} object returned when the `presenter` promise fulfills has its `updateInkTrailStartPoint()` method invoked; this is passed:
Later on, in the `pointermove` event listener, the new position of the trailhead is drawn onto the canvas each time the event fires. In addition, the {{domxref("DelegatedInkTrailPresenter")}} object returned when the `presenter` promise fulfills has its `updateInkTrailStartPoint()` method invoked; this is passed:

- The last trusted pointer event representing the rendering point for the current frame.
- A `style` object containing color and diameter settings.
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/ink/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ browser-compat: api.Ink

{{APIRef("Ink API")}}{{SeeCompatTable}}

The **`Ink`** interface of the [Ink API](/en-US/docs/Web/API/Ink_API) provides access to {{domxref("InkPresenter")}} objects for the application to use to render ink strokes.
The **`Ink`** interface of the [Ink API](/en-US/docs/Web/API/Ink_API) provides access to {{domxref("DelegatedInkTrailPresenter")}} objects for the application to use to render ink strokes.

{{InheritanceDiagram}}

## Instance methods

- {{domxref("Ink.requestPresenter", "requestPresenter()")}} {{Experimental_Inline}}
- : Returns a {{jsxref("Promise")}} that fulfills with an {{domxref("InkPresenter")}} object to handle rendering strokes.
- : Returns a {{jsxref("Promise")}} that fulfills with a {{domxref("DelegatedInkTrailPresenter")}} object to handle rendering strokes.

## Example

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/ink/requestpresenter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ browser-compat: api.Ink.requestPresenter

{{APIRef("Ink API")}}{{SeeCompatTable}}

The **`requestPresenter()`** method of the {{domxref("Ink")}} interface returns a {{jsxref("Promise")}} that fulfills with an {{domxref("InkPresenter")}} object to handle rendering strokes.
The **`requestPresenter()`** method of the {{domxref("Ink")}} interface returns a {{jsxref("Promise")}} that fulfills with a {{domxref("DelegatedInkTrailPresenter")}} object to handle rendering strokes.

## Syntax

Expand All @@ -21,13 +21,13 @@ requestPresenter(param)
### Parameters

- `param` {{optional_inline}}
- : An `InkPresenterParam` object that contains the following property:
- : An object that contains the following property:
- `presentationArea` {{optional_inline}}
- : An {{domxref("Element")}} inside which rendering of ink strokes is confined (the element's border box, to be precise). If `param` is not included, or `presentationArea` is set to `null`, ink rendering is confined to the containing viewport by default.

### Return value

A {{jsxref("Promise")}} that resolves to an {{domxref("InkPresenter")}} object instance.
A {{jsxref("Promise")}} that resolves to a {{domxref("DelegatedInkTrailPresenter")}} object instance.

### Exceptions

Expand Down
10 changes: 5 additions & 5 deletions files/en-us/web/api/ink_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ The Ink API significantly reduces this latency by allowing browsers to bypass th
> [!NOTE]
> Compositors are part of the rendering machinery that draws the UI to the screen in a browser or operating system. See [Inside look at modern web browser (part 3)](https://developer.chrome.com/blog/inside-browser-part3/) for some interesting insights into how a compositor functions inside a web browser.
The entry point is the {{domxref("Navigator.ink")}} property, which returns an {{domxref("Ink")}} object for the current document. The {{domxref("Ink.requestPresenter","Ink.requestPresenter()")}} method returns a {{jsxref("Promise")}} that fulfills with an {{domxref("InkPresenter")}} object instance. This instructs the OS-level compositor to render ink strokes between pointer event dispatches in the next available frame in each case.
The entry point is the {{domxref("Navigator.ink")}} property, which returns an {{domxref("Ink")}} object for the current document. The {{domxref("Ink.requestPresenter","Ink.requestPresenter()")}} method returns a {{jsxref("Promise")}} that fulfills with a {{domxref("DelegatedInkTrailPresenter")}} object instance. This instructs the OS-level compositor to render ink strokes between pointer event dispatches in the next available frame in each case.

## Interfaces

- {{domxref("Ink")}}
- : Provides access to {{domxref("InkPresenter")}} objects for the application to use to render the strokes.
- {{domxref("InkPresenter")}}
- {{domxref("Ink")}} {{Experimental_Inline}}
- : Provides access to {{domxref("DelegatedInkTrailPresenter")}} objects for the application to use to render the strokes.
- {{domxref("DelegatedInkTrailPresenter")}} {{Experimental_Inline}}
- : Instructs the OS-level compositor to render ink strokes between pointer event dispatches.

### Extensions to other interfaces
Expand All @@ -42,7 +42,7 @@ The entry point is the {{domxref("Navigator.ink")}} property, which returns an {

In this example, we draw a trail onto a 2D canvas. Near the start of the code, we call {{domxref("Ink.requestPresenter()")}}, passing it the canvas as the presentation area for it to take care of and storing the promise it returns in the `presenter` variable.

Later on, in the `pointermove` event listener, the new position of the trailhead is drawn onto the canvas each time the event fires. In addition, the {{domxref("InkPresenter")}} object returned when the `presenter` promise fulfills has its {{domxref("InkPresenter.updateInkTrailStartPoint", "updateInkTrailStartPoint()")}} method invoked; this is passed:
Later on, in the `pointermove` event listener, the new position of the trailhead is drawn onto the canvas each time the event fires. In addition, the {{domxref("DelegatedInkTrailPresenter")}} object returned when the `presenter` promise fulfills has its {{domxref("DelegatedInkTrailPresenter.updateInkTrailStartPoint", "updateInkTrailStartPoint()")}} method invoked; this is passed:

- The last trusted pointer event representing the rendering point for the current frame.
- A `style` object containing color and diameter settings.
Expand Down
2 changes: 1 addition & 1 deletion files/jsondata/GroupData.json
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@
},
"Ink API": {
"overview": ["Ink API"],
"interfaces": ["Ink", "InkPresenter"],
"interfaces": ["DelegatedInkTrailPresenter", "Ink"],
"methods": [],
"properties": ["Navigator.ink"],
"events": []
Expand Down

0 comments on commit 57aa261

Please sign in to comment.