DisplayFeaturesProvider Class
The display features of the screen of the device (https://drafts.csswg.org/css-viewport/#display-feature-override), of the browsing contexts that share a BrowsingContextOptions (ViewportSegmentsOptions.Provider). Set DisplayFeaturesProvider.DisplayFeatures to simulate a foldable device: the documents evaluate their media queries again and compute their styles again.
public class DisplayFeaturesProviderRemarks
A provider can be shared by several browsing contexts, and used from any thread.
Constructors
| Name | Description |
|---|---|
| DisplayFeaturesProvider() |
DisplayFeaturesProvider()
ViewportSegments.cspublic DisplayFeaturesProvider()No documentation is available.
Properties
| Name | Description |
|---|---|
| DisplayFeatures | Gets or sets the display features of the screen (empty by default: the viewport has a single segment). The offsets are relative to the viewport of the top-level documents. Setting it updates the documents. |
DisplayFeatures
ViewportSegments.csGets or sets the display features of the screen (empty by default: the viewport has a single segment). The offsets are relative to the viewport of the top-level documents. Setting it updates the documents.
public IReadOnlyList<DisplayFeature> DisplayFeatures { get; set; }Methods
| Name | Description |
|---|---|
| GetDisplayFeatures() | Returns the display features of the screen. The default implementation returns DisplayFeaturesProvider.DisplayFeatures. It is called on the thread of an event loop, and must not block it. |
| OnDisplayFeaturesChanged() | Raises DisplayFeaturesProvider.DisplayFeaturesChanged, then updates the documents: their media queries are evaluated again (change events of the MediaQueryList objects) and their styles are computed again. It can be called from any thread. |
GetDisplayFeatures()
ViewportSegments.csReturns the display features of the screen. The default implementation returns DisplayFeaturesProvider.DisplayFeatures. It is called on the thread of an event loop, and must not block it.
public virtual IReadOnlyList<DisplayFeature> GetDisplayFeatures()OnDisplayFeaturesChanged()
ViewportSegments.csRaises DisplayFeaturesProvider.DisplayFeaturesChanged, then updates the documents: their media queries are evaluated again (change events of the MediaQueryList objects) and their styles are computed again. It can be called from any thread.
protected void OnDisplayFeaturesChanged()Events
| Name | Description |
|---|---|
| DisplayFeaturesChanged | Raised when the display features change (DisplayFeaturesProvider.OnDisplayFeaturesChanged). |
DisplayFeaturesChanged
Raised when the display features change (DisplayFeaturesProvider.OnDisplayFeaturesChanged).
public event EventHandler? DisplayFeaturesChanged