Skip to content

Commit 027c9df

Browse files
committed
Update IsNonClientRegionSupportEnabled.md
include feature flag in remarks, update interface to match sample code, reformat lines
1 parent 5a18d07 commit 027c9df

1 file changed

Lines changed: 28 additions & 19 deletions

File tree

specs/IsNonClientRegionSupportEnabled.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
# Background
22

3-
To improve the developer experience for customizing non-client regions, WebView2 is working to support using DOM elements as non-client regions. We currently have
4-
limited support for title bar aka draggable regions and are working on building out support for caption controls and resize regions.
5-
6-
For security and flexibility, we want developers to be able to enable or disable all custom non-client functionality per WebView. Non-client functionality will affect
7-
that app window’s size and position so it’s important that developers can definitively toggle access. This can be achieved in a limited way using a feature flag, but
8-
feature flags are applied per WebView2 environment, thus, an API on the WebView2 to enable/disable non-client support via a setting is the better solution.
3+
To improve the developer experience for customizing non-client regions, WebView2 is
4+
working to support using DOM elements as non-client regions. We currently have limited
5+
support for title bar aka draggable regions and are working on building out support
6+
for caption controls and resize regions.
7+
8+
For security and flexibility, we want developers to be able to enable or disable all
9+
custom non-client functionality per WebView. Non-client functionality will affect that
10+
app window’s size and position so it’s important that developers can definitively
11+
toggle access. This can be achieved in a limited way using a feature flag, but feature
12+
flags are applied per WebView2 environment, thus, an API on the WebView2 to enable/disable
13+
non-client support via a setting is the better solution.
914

1015
# Description
11-
`IsNonClientRegionSupportEnabled` defaults to `FALSE`. Disabling/Enabling `IsNonClientRegionSupportEnabled` takes effect after the next navigation. Currently,
12-
draggable regions is the only non-client experience we have implemented. Eventually, this setting will expand to enable other non-client functionality, such as resize
13-
and caption controls.
14-
15-
When the setting is set to `TRUE`, then the following non-client region support for the top level document will be enabled:
16+
`IsNonClientRegionSupportEnabled` defaults to `FALSE`. Disabling/Enabling
17+
`IsNonClientRegionSupportEnabled` takes effect after the next navigation. Currently, draggable
18+
regions is the only non-client experience we have implemented. Eventually, this setting will
19+
expand to enable other non-client functionality, such as resize and caption controls.
1620

21+
When the setting is set to `TRUE`, then the following non-client region support for the top
22+
level document will be enabled:
1723
* Web pages will be able to use the `app-region` CSS style.
18-
19-
* Draggable Regions declared with the CSS style `app-region: drag` will support title bar functionality, for example, the dragging of the app window, the title bar context menu upon right click, and the maximizing/ restoring of the window size upon double click of the html element.
24+
* Draggable Regions declared with the CSS style `app-region: drag` will support title bar
25+
functionality, for example, the dragging of the app window, the title bar context menu upon
26+
right click, and the maximizing/restoring of the window size upon double click of the html
27+
element.
2028

2129
When set to `FALSE`, then all non-client region support will be disabled.
22-
2330
* Web pages will not be able to use the `app-region` CSS style.
2431

2532
# Examples
@@ -89,8 +96,9 @@ private void SetNonClientRegionSupport(CoreWebView2 sender, CoreWebView2Navigati
8996
```
9097

9198
# Remarks
92-
If the feature flag is used to enable draggable regions in additional browser arguments, draggable
93-
region support will remain enabled even if the `IsNonClientRegionSupportEnabled` setting is `FALSE`.
99+
If the feature flag (`msWebView2EnableDraggableRegions`) is used to enable draggable regions in
100+
additional browser arguments, draggable region support will remain enabled even if the
101+
`IsNonClientRegionSupportEnabled` setting is `FALSE`.
94102
* Note: The feature flag is experimental and should not be used in production.
95103

96104
# API Notes
@@ -104,7 +112,7 @@ Non-client regions are HTML elements that are marked with the css style `app-reg
104112
```cpp
105113
/// This is the ICoreWebView2Settings Staging interface.
106114
[uuid(436CA5E2-2D50-43C7-9735-E760F299439E), object, pointer_default(unique)]
107-
interface ICoreWebView2Settings9 : ICoreWebView2Settings8 {
115+
interface ICoreWebView2Settings12 : ICoreWebView2Settings11 {
108116
/// `IsNonClientRegionSupportEnabled` property enables web pages to use the
109117
/// `app-region` CSS style. Disabling/Enabling the `IsNonClientRegionSupportEnabled`
110118
/// takes effect after the next navigation. Defaults to `FALSE`.
@@ -128,5 +136,6 @@ interface ICoreWebView2Settings9 : ICoreWebView2Settings8 {
128136
```
129137

130138
# Appendix
131-
We considered implementing the APIs in the ControllerOptions class, which would establish whether non-client regions would be supported for the life of the webview at
132-
creation. To provide greater flexibility of use, we decided to implement it as a setting.
139+
We considered implementing the APIs in the ControllerOptions class, which would establish
140+
whether non-client regions would be supported for the life of the webview at creation. To
141+
provide greater flexibility of use, we decided to implement it as a setting.

0 commit comments

Comments
 (0)