Changeset 269784 in webkit


Ignore:
Timestamp:
Nov 13, 2020 9:46:58 AM (3 years ago)
Author:
weinig@apple.com
Message:

Cleanup InternalSettings
https://bugs.webkit.org/show_bug.cgi?id=218881

Reviewed by Darin Adler.

Source/WebCore:

Cleanup InternalSettings by removing all the functions that duplicated functionality
already implemented by InternalSettingsGenerated, sorting the remaining functions by
setting class, and replacing string parameters with proper IDL enums.

  • testing/InternalSettings.cpp:
  • testing/InternalSettings.h:
  • testing/InternalSettings.idl:

Remove duplicate functions and add enums for EditingBehavior, PDFImageCachingPolicy,
StorageBlockingPolicy, SystemLayoutDirection, TrackKind, and UserInterfaceDirectionPolicy.
Most of these map directly to existing WebCore enums (and FontLoadTimingOverride was easily
updated to match the WebCore enum), but new enums were needed for EditingBehavior, PDFImageCachingPolicy
and StorageBlockingPolicy to keep existing tests working. The UserInterfaceDirectionPolicy enum
is different than what the tests expect (tests used "View" rather then "System") but were updated
to match.

  • testing/Internals.cpp:

(WebCore::Internals::Internals):
(WebCore::Internals::setMediaCaptureRequiresSecureConnection): Deleted.

  • testing/Internals.h:

Remove now unused function setMediaCaptureRequiresSecureConnection. This should
be done by the test runner or individual tests as needed.

  • testing/js/WebCoreTestSupport.cpp:

(WebCoreTestSupport::setAllowsAnySSLCertificate):
Switch to calling DeprecatedGlobalSettings directly rather than hopping
through InternalSettings. This allows us to remove the InternalSettings
function.

LayoutTests:

Update tests to work with update InternalSettings related enum values.

  • Platforms passed to internals.settings.setEditingBehavior now must be all lowercase.
  • The value "View" has been renamed to "System" for internals.settings.setUserInterfaceDirectionPolicy
  • editing/mac/selection/double-click-and-drag-over-anchor-to-select.html:
  • editing/selection/shift-click-includes-existing-selection.html:
  • editing/selection/user-select-all-with-shift-expected.txt:
  • editing/selection/user-select-all-with-shift.html:
  • fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2-expected.html:
  • fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement-expected.html:
  • fast/scrolling/rtl-scrollbars-animation-property.html:
  • fast/scrolling/rtl-scrollbars-elementFromPoint-static.html:
  • fast/scrolling/rtl-scrollbars-elementFromPoint.html:
  • fast/scrolling/rtl-scrollbars-expected.html:
  • fast/scrolling/rtl-scrollbars-iframe-offset-expected.html:
  • fast/scrolling/rtl-scrollbars-iframe-offset.html:
  • fast/scrolling/rtl-scrollbars-iframe-position-absolute.html:
  • fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html:
  • fast/scrolling/rtl-scrollbars-iframe-scrolled.html:
  • fast/scrolling/rtl-scrollbars-iframe.html:
  • fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html:
  • fast/scrolling/rtl-scrollbars-listbox-scroll.html:
  • fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html:
  • fast/scrolling/rtl-scrollbars-listbox-select-left.html:
  • fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html:
  • fast/scrolling/rtl-scrollbars-listbox-select-right.html:
  • fast/scrolling/rtl-scrollbars-listbox-simple.html:
  • fast/scrolling/rtl-scrollbars-listbox.html:
  • fast/scrolling/rtl-scrollbars-overflow-contents.html:
  • fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html:
  • fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html:
  • fast/scrolling/rtl-scrollbars-overflow-expected.html:
  • fast/scrolling/rtl-scrollbars-overflow-padding.html:
  • fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html:
  • fast/scrolling/rtl-scrollbars-overflow-position-absolute.html:
  • fast/scrolling/rtl-scrollbars-overflow-simple.html:
  • fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html:
  • fast/scrolling/rtl-scrollbars-overflow.html:
  • fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html:
  • fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html:
  • fast/scrolling/rtl-scrollbars-position-absolute-expected.html:
  • fast/scrolling/rtl-scrollbars-position-absolute.html:
  • fast/scrolling/rtl-scrollbars-position-fixed-expected.html:
  • fast/scrolling/rtl-scrollbars-position-fixed.html:
  • fast/scrolling/rtl-scrollbars-positioning-expected.html:
  • fast/scrolling/rtl-scrollbars-positioning.html:
  • fast/scrolling/rtl-scrollbars-simple.html:
  • fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html:
  • fast/scrolling/rtl-scrollbars-sticky-document-2.html:
  • fast/scrolling/rtl-scrollbars-sticky-document-expected.html:
  • fast/scrolling/rtl-scrollbars-sticky-document.html:
  • fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html:
  • fast/scrolling/rtl-scrollbars-sticky-iframe-2.html:
  • fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html:
  • fast/scrolling/rtl-scrollbars-sticky-iframe.html:
  • fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html:
  • fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html:
  • fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html:
  • fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html:
  • fast/scrolling/rtl-scrollbars-text-selection-expected.html:
  • fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html:
  • fast/scrolling/rtl-scrollbars-text-selection-scrolled.html:
  • fast/scrolling/rtl-scrollbars-text-selection.html:
  • fast/scrolling/rtl-scrollbars.html:
Location:
trunk
Files:
68 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r269780 r269784  
     12020-11-13  Sam Weinig  <weinig@apple.com>
     2
     3        Cleanup InternalSettings
     4        https://bugs.webkit.org/show_bug.cgi?id=218881
     5
     6        Reviewed by Darin Adler.
     7
     8        Update tests to work with update InternalSettings related enum values.
     9        - Platforms passed to internals.settings.setEditingBehavior now must be all lowercase.
     10        - The value "View" has been renamed to "System" for internals.settings.setUserInterfaceDirectionPolicy
     11
     12        * editing/mac/selection/double-click-and-drag-over-anchor-to-select.html:
     13        * editing/selection/shift-click-includes-existing-selection.html:
     14        * editing/selection/user-select-all-with-shift-expected.txt:
     15        * editing/selection/user-select-all-with-shift.html:
     16        * fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2-expected.html:
     17        * fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement-expected.html:
     18        * fast/scrolling/rtl-scrollbars-animation-property.html:
     19        * fast/scrolling/rtl-scrollbars-elementFromPoint-static.html:
     20        * fast/scrolling/rtl-scrollbars-elementFromPoint.html:
     21        * fast/scrolling/rtl-scrollbars-expected.html:
     22        * fast/scrolling/rtl-scrollbars-iframe-offset-expected.html:
     23        * fast/scrolling/rtl-scrollbars-iframe-offset.html:
     24        * fast/scrolling/rtl-scrollbars-iframe-position-absolute.html:
     25        * fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html:
     26        * fast/scrolling/rtl-scrollbars-iframe-scrolled.html:
     27        * fast/scrolling/rtl-scrollbars-iframe.html:
     28        * fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html:
     29        * fast/scrolling/rtl-scrollbars-listbox-scroll.html:
     30        * fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html:
     31        * fast/scrolling/rtl-scrollbars-listbox-select-left.html:
     32        * fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html:
     33        * fast/scrolling/rtl-scrollbars-listbox-select-right.html:
     34        * fast/scrolling/rtl-scrollbars-listbox-simple.html:
     35        * fast/scrolling/rtl-scrollbars-listbox.html:
     36        * fast/scrolling/rtl-scrollbars-overflow-contents.html:
     37        * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html:
     38        * fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html:
     39        * fast/scrolling/rtl-scrollbars-overflow-expected.html:
     40        * fast/scrolling/rtl-scrollbars-overflow-padding.html:
     41        * fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html:
     42        * fast/scrolling/rtl-scrollbars-overflow-position-absolute.html:
     43        * fast/scrolling/rtl-scrollbars-overflow-simple.html:
     44        * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html:
     45        * fast/scrolling/rtl-scrollbars-overflow.html:
     46        * fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html:
     47        * fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html:
     48        * fast/scrolling/rtl-scrollbars-position-absolute-expected.html:
     49        * fast/scrolling/rtl-scrollbars-position-absolute.html:
     50        * fast/scrolling/rtl-scrollbars-position-fixed-expected.html:
     51        * fast/scrolling/rtl-scrollbars-position-fixed.html:
     52        * fast/scrolling/rtl-scrollbars-positioning-expected.html:
     53        * fast/scrolling/rtl-scrollbars-positioning.html:
     54        * fast/scrolling/rtl-scrollbars-simple.html:
     55        * fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html:
     56        * fast/scrolling/rtl-scrollbars-sticky-document-2.html:
     57        * fast/scrolling/rtl-scrollbars-sticky-document-expected.html:
     58        * fast/scrolling/rtl-scrollbars-sticky-document.html:
     59        * fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html:
     60        * fast/scrolling/rtl-scrollbars-sticky-iframe-2.html:
     61        * fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html:
     62        * fast/scrolling/rtl-scrollbars-sticky-iframe.html:
     63        * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html:
     64        * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html:
     65        * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html:
     66        * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html:
     67        * fast/scrolling/rtl-scrollbars-text-selection-expected.html:
     68        * fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html:
     69        * fast/scrolling/rtl-scrollbars-text-selection-scrolled.html:
     70        * fast/scrolling/rtl-scrollbars-text-selection.html:
     71        * fast/scrolling/rtl-scrollbars.html:
     72
    1732020-11-12  Simon Fraser  <simon.fraser@apple.com>
    274
  • trunk/LayoutTests/editing/mac/selection/double-click-and-drag-over-anchor-to-select.html

    r268847 r269784  
    3535        return;
    3636
    37     internals.settings.setEditingBehavior("Mac");
     37    internals.settings.setEditingBehavior("mac");
    3838    Markup.dump(document.getElementById("container"), "Before extending the selection");
    3939
  • trunk/LayoutTests/editing/selection/shift-click-includes-existing-selection.html

    r264868 r269784  
    3838        return;
    3939
    40     internals.settings.setEditingBehavior("Mac");
     40    internals.settings.setEditingBehavior("mac");
    4141    Markup.dump(document.getElementById("container"), "Before extending the selection");
    4242
  • trunk/LayoutTests/editing/selection/user-select-all-with-shift-expected.txt

    r147022 r269784  
    22To manually test, click to select the first element and shift-click the second element. WebKit should select both elements.
    33
    4 After clicking on the first element (Mac):
     4After clicking on the first element (mac):
    55| "
    66"
     
    1919"
    2020
    21 After shift clicking on the second element (Mac):
     21After shift clicking on the second element (mac):
    2222| "
    2323"
     
    3636"
    3737
    38 After clicking on the second element (Mac):
    39 | "
    40 "
    41 | <div>
    42 |   class="select-all"
    43 |   id="first"
    44 |   "First element"
    45 | "
    46 Some other text.
    47 "
    48 | <div>
    49 |   class="select-all"
    50 |   id="second"
    51 |   "<#selection-anchor>Second element<#selection-focus>"
    52 | "
    53 "
    54 
    55 After shift clicking on the first element (Mac):
     38After clicking on the second element (mac):
     39| "
     40"
     41| <div>
     42|   class="select-all"
     43|   id="first"
     44|   "First element"
     45| "
     46Some other text.
     47"
     48| <div>
     49|   class="select-all"
     50|   id="second"
     51|   "<#selection-anchor>Second element<#selection-focus>"
     52| "
     53"
     54
     55After shift clicking on the first element (mac):
    5656| "
    5757"
     
    7070"
    7171
    72 After clicking on the first element (Win):
     72After clicking on the first element (win):
    7373| "
    7474"
     
    8787"
    8888
    89 After shift clicking on the second element (Win):
     89After shift clicking on the second element (win):
    9090| "
    9191"
     
    104104"
    105105
    106 After clicking on the second element (Win):
    107 | "
    108 "
    109 | <div>
    110 |   class="select-all"
    111 |   id="first"
    112 |   "First element"
    113 | "
    114 Some other text.
    115 "
    116 | <div>
    117 |   class="select-all"
    118 |   id="second"
    119 |   "<#selection-anchor>Second element<#selection-focus>"
    120 | "
    121 "
    122 
    123 After shift clicking on the first element (Win):
     106After clicking on the second element (win):
     107| "
     108"
     109| <div>
     110|   class="select-all"
     111|   id="first"
     112|   "First element"
     113| "
     114Some other text.
     115"
     116| <div>
     117|   class="select-all"
     118|   id="second"
     119|   "<#selection-anchor>Second element<#selection-focus>"
     120| "
     121"
     122
     123After shift clicking on the first element (win):
    124124| "
    125125"
     
    138138"
    139139
    140 After clicking on the first element (Unix):
     140After clicking on the first element (unix):
    141141| "
    142142"
     
    155155"
    156156
    157 After shift clicking on the second element (Unix):
    158 | "
    159 "
    160 | <div>
    161 |   class="select-all"
    162 |   id="first"
    163 |   "First element"
    164 | "
    165 Some other text.
    166 "
    167 | <div>
    168 |   class="select-all"
    169 |   id="second"
    170 |   "<#selection-anchor>Second element<#selection-focus>"
    171 | "
    172 "
    173 
    174 After clicking on the second element (Unix):
    175 | "
    176 "
    177 | <div>
    178 |   class="select-all"
    179 |   id="first"
    180 |   "First element"
    181 | "
    182 Some other text.
    183 "
    184 | <div>
    185 |   class="select-all"
    186 |   id="second"
    187 |   "<#selection-anchor>Second element<#selection-focus>"
    188 | "
    189 "
    190 
    191 After shift clicking on the first element (Unix):
     157After shift clicking on the second element (unix):
     158| "
     159"
     160| <div>
     161|   class="select-all"
     162|   id="first"
     163|   "First element"
     164| "
     165Some other text.
     166"
     167| <div>
     168|   class="select-all"
     169|   id="second"
     170|   "<#selection-anchor>Second element<#selection-focus>"
     171| "
     172"
     173
     174After clicking on the second element (unix):
     175| "
     176"
     177| <div>
     178|   class="select-all"
     179|   id="first"
     180|   "First element"
     181| "
     182Some other text.
     183"
     184| <div>
     185|   class="select-all"
     186|   id="second"
     187|   "<#selection-anchor>Second element<#selection-focus>"
     188| "
     189"
     190
     191After shift clicking on the first element (unix):
    192192| "
    193193"
  • trunk/LayoutTests/editing/selection/user-select-all-with-shift.html

    r147022 r269784  
    5050
    5151if (window.eventSender) {
    52     runTest('Mac');
    53     runTest('Win');
    54     runTest('Unix');
     52    runTest('mac');
     53    runTest('win');
     54    runTest('unix');
    5555
    5656} else
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2-expected.html

    r203267 r269784  
    88    <script>
    99        if (window.internals) {
    10             internals.settings.setUserInterfaceDirectionPolicy("View");
     10            internals.settings.setUserInterfaceDirectionPolicy("System");
    1111            internals.settings.setSystemLayoutDirection("RTL");
    1212        }
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement-expected.html

    r203267 r269784  
    22    <script>
    33        if (window.internals) {
    4             internals.settings.setUserInterfaceDirectionPolicy("View");
     4            internals.settings.setUserInterfaceDirectionPolicy("System");
    55            internals.settings.setSystemLayoutDirection("RTL");
    66        }
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html

    r268400 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-elementFromPoint-static.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-elementFromPoint.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-iframe-offset-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-iframe-offset.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-iframe-position-absolute.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-iframe-scrolled.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-iframe.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll.html

    r256577 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-contents.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-padding.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-position-absolute.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-simple.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overflow.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-position-absolute-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-position-absolute.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-position-fixed-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-position-fixed.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioning-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioning.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-document-2.html

    r244353 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-document-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-document.html

    r244353 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-iframe-2.html

    r244353 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-iframe.html

    r244353 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html

    r244353 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html

    r244353 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-text-selection-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-text-selection-scrolled.html

    r200116 r269784  
    33<script>
    44if (window.internals) {
    5     internals.settings.setUserInterfaceDirectionPolicy("View");
     5    internals.settings.setUserInterfaceDirectionPolicy("System");
    66    internals.settings.setSystemLayoutDirection("RTL");
    77}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars-text-selection.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/LayoutTests/fast/scrolling/rtl-scrollbars.html

    r200116 r269784  
    44<script>
    55if (window.internals) {
    6     internals.settings.setUserInterfaceDirectionPolicy("View");
     6    internals.settings.setUserInterfaceDirectionPolicy("System");
    77    internals.settings.setSystemLayoutDirection("RTL");
    88}
  • trunk/Source/WebCore/ChangeLog

    r269780 r269784  
     12020-11-13  Sam Weinig  <weinig@apple.com>
     2
     3        Cleanup InternalSettings
     4        https://bugs.webkit.org/show_bug.cgi?id=218881
     5
     6        Reviewed by Darin Adler.
     7
     8        Cleanup InternalSettings by removing all the functions that duplicated functionality
     9        already implemented by InternalSettingsGenerated, sorting the remaining functions by
     10        setting class, and replacing string parameters with proper IDL enums.
     11
     12        * testing/InternalSettings.cpp:
     13        * testing/InternalSettings.h:
     14        * testing/InternalSettings.idl:
     15        Remove duplicate functions and add enums for EditingBehavior, PDFImageCachingPolicy,
     16        StorageBlockingPolicy, SystemLayoutDirection, TrackKind, and UserInterfaceDirectionPolicy.
     17        Most of these map directly to existing WebCore enums (and FontLoadTimingOverride was easily
     18        updated to match the WebCore enum), but new enums were needed for EditingBehavior, PDFImageCachingPolicy
     19        and StorageBlockingPolicy to keep existing tests working. The UserInterfaceDirectionPolicy enum
     20        is different than what the tests expect (tests used "View" rather then "System") but were updated
     21        to match.
     22
     23        * testing/Internals.cpp:
     24        (WebCore::Internals::Internals):
     25        (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Deleted.
     26        * testing/Internals.h:
     27        Remove now unused function setMediaCaptureRequiresSecureConnection. This should
     28        be done by the test runner or individual tests as needed.
     29
     30        * testing/js/WebCoreTestSupport.cpp:
     31        (WebCoreTestSupport::setAllowsAnySSLCertificate):
     32        Switch to calling DeprecatedGlobalSettings directly rather than hopping
     33        through InternalSettings. This allows us to remove the InternalSettings
     34        function.
     35
    1362020-11-12  Simon Fraser  <simon.fraser@apple.com>
    237
  • trunk/Source/WebCore/testing/InternalSettings.cpp

    r269308 r269784  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
    3  * Copyright (C) 2013 Apple Inc. All rights reserved.
     3 * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    4444#include <wtf/Language.h>
    4545
    46 #if ENABLE(INPUT_TYPE_COLOR)
    47 #include "ColorChooser.h"
    48 #endif
    49 
    5046#if ENABLE(WEB_AUDIO)
    5147#include "AudioContext.h"
     
    5652InternalSettings::Backup::Backup(Settings& settings)
    5753    : m_originalEditingBehavior(settings.editingBehaviorType())
    58 #if ENABLE(TEXT_AUTOSIZING)
    59     , m_originalTextAutosizingEnabled(settings.textAutosizingEnabled())
    60     , m_originalTextAutosizingWindowSizeOverride(IntSize { static_cast<int>(settings.textAutosizingWindowSizeOverrideWidth()), static_cast<int>(settings.textAutosizingWindowSizeOverrideHeight()) })
    61     , m_originalTextAutosizingUsesIdempotentMode(settings.textAutosizingUsesIdempotentMode())
    62 #endif
    63     , m_originalMediaTypeOverride(settings.mediaTypeOverride())
    64     , m_originalCanvasUsesAcceleratedDrawing(settings.canvasUsesAcceleratedDrawing())
    65     , m_originalMockScrollbarsEnabled(DeprecatedGlobalSettings::mockScrollbarsEnabled())
    66     , m_imagesEnabled(settings.areImagesEnabled())
    67     , m_preferMIMETypeForImages(settings.preferMIMETypeForImages())
    6854    , m_minimumDOMTimerInterval(settings.minimumDOMTimerInterval())
    69 #if ENABLE(VIDEO)
    70     , m_shouldDisplaySubtitles(settings.shouldDisplaySubtitles())
    71     , m_shouldDisplayCaptions(settings.shouldDisplayCaptions())
    72     , m_shouldDisplayTextDescriptions(settings.shouldDisplayTextDescriptions())
    73 #endif
    74     , m_defaultVideoPosterURL(settings.defaultVideoPosterURL())
    75     , m_forcePendingWebGLPolicy(settings.isForcePendingWebGLPolicy())
    7655    , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings.timeWithoutMouseMovementBeforeHidingControls())
    77     , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
    78     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
    79     , m_quickTimePluginReplacementEnabled(settings.quickTimePluginReplacementEnabled())
    80     , m_youTubeFlashPluginReplacementEnabled(settings.youTubeFlashPluginReplacementEnabled())
    81     , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy())
    82     , m_fontFallbackPrefersPictographs(settings.fontFallbackPrefersPictographs())
    83     , m_shouldIgnoreFontLoadCompletions(settings.shouldIgnoreFontLoadCompletions())
    84     , m_backgroundShouldExtendBeyondPage(settings.backgroundShouldExtendBeyondPage())
    8556    , m_storageBlockingPolicy(settings.storageBlockingPolicy())
    86     , m_scrollingTreeIncludesFrames(settings.scrollingTreeIncludesFrames())
    87 #if ENABLE(TOUCH_EVENTS)
    88     , m_touchEventEmulationEnabled(settings.isTouchEventEmulationEnabled())
    89 #endif
    90 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    91     , m_allowsAirPlayForMediaPlayback(settings.allowsAirPlayForMediaPlayback())
    92 #endif
    93     , m_allowsInlineMediaPlayback(settings.allowsInlineMediaPlayback())
    94     , m_allowsInlineMediaPlaybackAfterFullscreen(settings.allowsInlineMediaPlaybackAfterFullscreen())
    95     , m_inlineMediaPlaybackRequiresPlaysInlineAttribute(settings.inlineMediaPlaybackRequiresPlaysInlineAttribute())
    96     , m_deferredCSSParserEnabled(settings.deferredCSSParserEnabled())
    97     , m_inputEventsEnabled(settings.inputEventsEnabled())
    98     , m_incompleteImageBorderEnabled(settings.incompleteImageBorderEnabled())
    99     , m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection(settings.shouldDispatchSyntheticMouseEventsWhenModifyingSelection())
    100     , m_shouldDispatchSyntheticMouseOutAfterSyntheticClick(settings.shouldDispatchSyntheticMouseOutAfterSyntheticClick())
    101 #if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
    102     , m_shouldDeactivateAudioSession(PlatformMediaSessionManager::shouldDeactivateAudioSession())
    103 #endif
    104     , m_animatedImageDebugCanvasDrawingEnabled(settings.animatedImageDebugCanvasDrawingEnabled())
    10557    , m_userInterfaceDirectionPolicy(settings.userInterfaceDirectionPolicy())
    10658    , m_systemLayoutDirection(settings.systemLayoutDirection())
     
    11567#endif
    11668    , m_fetchAPIKeepAliveAPIEnabled(RuntimeEnabledFeatures::sharedFeatures().fetchAPIKeepAliveEnabled())
    117     , m_shouldMockBoldSystemFontForAccessibility(RenderTheme::singleton().shouldMockBoldSystemFontForAccessibility())
     69    , m_customPasteboardDataEnabled(RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
     70    , m_originalMockScrollbarsEnabled(DeprecatedGlobalSettings::mockScrollbarsEnabled())
    11871#if USE(AUDIO_SESSION)
    11972    , m_shouldManageAudioSessionCategory(DeprecatedGlobalSettings::shouldManageAudioSessionCategory())
    12073#endif
    121     , m_customPasteboardDataEnabled(RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
     74#if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
     75    , m_shouldDeactivateAudioSession(PlatformMediaSessionManager::shouldDeactivateAudioSession())
     76#endif
     77    , m_shouldMockBoldSystemFontForAccessibility(RenderTheme::singleton().shouldMockBoldSystemFontForAccessibility())
    12278{
    12379}
     
    12581void InternalSettings::Backup::restoreTo(Settings& settings)
    12682{
    127     settings.setEditingBehaviorType(m_originalEditingBehavior);
    128 
    12983    for (const auto& standardFont : m_standardFontFamilies)
    13084        settings.setStandardFontFamily(standardFont.value, static_cast<UScriptCode>(standardFont.key));
     
    155109    m_pictographFontFamilies.clear();
    156110
    157 #if ENABLE(TEXT_AUTOSIZING)
    158     settings.setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
    159     settings.setTextAutosizingWindowSizeOverrideWidth(m_originalTextAutosizingWindowSizeOverride.width());
    160     settings.setTextAutosizingWindowSizeOverrideHeight(m_originalTextAutosizingWindowSizeOverride.height());
    161     settings.setTextAutosizingUsesIdempotentMode(m_originalTextAutosizingUsesIdempotentMode);
    162 #endif
    163     settings.setMediaTypeOverride(m_originalMediaTypeOverride);
    164     settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
    165     settings.setImagesEnabled(m_imagesEnabled);
    166     settings.setPreferMIMETypeForImages(m_preferMIMETypeForImages);
     111    settings.setEditingBehaviorType(m_originalEditingBehavior);
    167112    settings.setMinimumDOMTimerInterval(m_minimumDOMTimerInterval);
    168 #if ENABLE(VIDEO)
    169     settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
    170     settings.setShouldDisplayCaptions(m_shouldDisplayCaptions);
    171     settings.setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions);
    172 #endif
    173 #if ENABLE(WEB_AUDIO)
    174     AudioContext::setDefaultSampleRateForTesting(WTF::nullopt);
    175 #endif
    176     settings.setDefaultVideoPosterURL(m_defaultVideoPosterURL);
    177     settings.setForcePendingWebGLPolicy(m_forcePendingWebGLPolicy);
    178113    settings.setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls);
    179     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
    180     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
    181     settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy);
    182     settings.setFontFallbackPrefersPictographs(m_fontFallbackPrefersPictographs);
    183     settings.setShouldIgnoreFontLoadCompletions(m_shouldIgnoreFontLoadCompletions);
    184     settings.setBackgroundShouldExtendBeyondPage(m_backgroundShouldExtendBeyondPage);
    185114    settings.setStorageBlockingPolicy(m_storageBlockingPolicy);
    186     settings.setScrollingTreeIncludesFrames(m_scrollingTreeIncludesFrames);
    187 #if ENABLE(TOUCH_EVENTS)
    188     settings.setTouchEventEmulationEnabled(m_touchEventEmulationEnabled);
    189 #endif
    190     settings.setAllowsInlineMediaPlayback(m_allowsInlineMediaPlayback);
    191     settings.setAllowsInlineMediaPlaybackAfterFullscreen(m_allowsInlineMediaPlaybackAfterFullscreen);
    192     settings.setInlineMediaPlaybackRequiresPlaysInlineAttribute(m_inlineMediaPlaybackRequiresPlaysInlineAttribute);
    193     settings.setQuickTimePluginReplacementEnabled(m_quickTimePluginReplacementEnabled);
    194     settings.setYouTubeFlashPluginReplacementEnabled(m_youTubeFlashPluginReplacementEnabled);
    195     settings.setDeferredCSSParserEnabled(m_deferredCSSParserEnabled);
    196     settings.setInputEventsEnabled(m_inputEventsEnabled);
    197115    settings.setUserInterfaceDirectionPolicy(m_userInterfaceDirectionPolicy);
    198116    settings.setSystemLayoutDirection(m_systemLayoutDirection);
     
    202120    settings.setForcedPrefersReducedMotionAccessibilityValue(m_forcedPrefersReducedMotionAccessibilityValue);
    203121    settings.setFontLoadTimingOverride(m_fontLoadTimingOverride);
     122    settings.setFrameFlattening(m_frameFlattening);
     123
     124#if ENABLE(WEBGL2)
     125    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(m_webGL2Enabled);
     126#endif
     127    RuntimeEnabledFeatures::sharedFeatures().setFetchAPIKeepAliveEnabled(m_fetchAPIKeepAliveAPIEnabled);
     128    RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(m_customPasteboardDataEnabled);
     129
     130#if USE(AUDIO_SESSION)
     131    DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
     132#endif
     133
     134#if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
     135    PlatformMediaSessionManager::setShouldDeactivateAudioSession(m_shouldDeactivateAudioSession);
     136#endif
     137
    204138    RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(m_shouldMockBoldSystemFontForAccessibility);
    205139    FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(m_shouldMockBoldSystemFontForAccessibility);
    206     settings.setFrameFlattening(m_frameFlattening);
    207     settings.setIncompleteImageBorderEnabled(m_incompleteImageBorderEnabled);
    208     settings.setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection);
    209     settings.setShouldDispatchSyntheticMouseOutAfterSyntheticClick(m_shouldDispatchSyntheticMouseOutAfterSyntheticClick);
    210 #if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
    211     PlatformMediaSessionManager::setShouldDeactivateAudioSession(m_shouldDeactivateAudioSession);
    212 #endif
    213     settings.setAnimatedImageDebugCanvasDrawingEnabled(m_animatedImageDebugCanvasDrawingEnabled);
    214 
    215 #if ENABLE(WEBGL2)
    216     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(m_webGL2Enabled);
    217 #endif
    218     RuntimeEnabledFeatures::sharedFeatures().setFetchAPIKeepAliveEnabled(m_fetchAPIKeepAliveAPIEnabled);
    219     RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(m_customPasteboardDataEnabled);
    220 
    221 #if USE(AUDIO_SESSION)
    222     DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
     140
     141#if ENABLE(WEB_AUDIO)
     142    AudioContext::setDefaultSampleRateForTesting(WTF::nullopt);
    223143#endif
    224144}
     
    261181    , m_backup(page->settings())
    262182{
    263 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    264     setAllowsAirPlayForMediaPlayback(false);
    265 #endif
    266 #if ENABLE(MEDIA_STREAM)
    267     setMediaCaptureRequiresSecureConnection(false);
    268 #endif
    269183}
    270184
     
    281195    setUseDarkAppearanceInternal(false);
    282196
    283     settings().setForcePendingWebGLPolicy(false);
    284 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    285     settings().setAllowsAirPlayForMediaPlayback(false);
    286 #endif
    287 #if ENABLE(MEDIA_STREAM)
    288     setMediaCaptureRequiresSecureConnection(false);
    289 #endif
    290 
    291197    m_backup.restoreTo(settings());
    292198    m_backup = Backup { settings() };
     
    299205    ASSERT(m_page);
    300206    return m_page->settings();
    301 }
    302 
    303 ExceptionOr<void> InternalSettings::setTouchEventEmulationEnabled(bool enabled)
    304 {
    305     if (!m_page)
    306         return Exception { InvalidAccessError };
    307 #if ENABLE(TOUCH_EVENTS)
    308     settings().setTouchEventEmulationEnabled(enabled);
    309 #else
    310     UNUSED_PARAM(enabled);
    311 #endif
    312     return { };
    313207}
    314208
     
    397291}
    398292
    399 ExceptionOr<void> InternalSettings::setTextAutosizingEnabled(bool enabled)
    400 {
    401     if (!m_page)
    402         return Exception { InvalidAccessError };
    403 #if ENABLE(TEXT_AUTOSIZING)
    404     settings().setTextAutosizingEnabled(enabled);
    405 #else
    406     UNUSED_PARAM(enabled);
    407 #endif
    408     return { };
    409 }
    410 
    411293ExceptionOr<void> InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height)
    412294{
     
    423305}
    424306
    425 ExceptionOr<void> InternalSettings::setTextAutosizingUsesIdempotentMode(bool enabled)
    426 {
    427     if (!m_page)
    428         return Exception { InvalidAccessError };
    429 #if ENABLE(TEXT_AUTOSIZING)
    430     settings().setTextAutosizingUsesIdempotentMode(enabled);
     307ExceptionOr<void> InternalSettings::setEditingBehavior(EditingBehavior editingBehavior)
     308{
     309    if (!m_page)
     310        return Exception { InvalidAccessError };
     311    switch (editingBehavior) {
     312    case EditingBehavior::Win:
     313        settings().setEditingBehaviorType(EditingWindowsBehavior);
     314        break;
     315    case EditingBehavior::Mac:
     316        settings().setEditingBehaviorType(EditingMacBehavior);
     317        break;
     318    case EditingBehavior::Unix:
     319        settings().setEditingBehaviorType(EditingUnixBehavior);
     320        break;
     321    case EditingBehavior::Ios:
     322        settings().setEditingBehaviorType(EditingIOSBehavior);
     323        break;
     324    }
     325    return { };
     326}
     327
     328ExceptionOr<void> InternalSettings::setStorageBlockingPolicy(StorageBlockingPolicy policy)
     329{
     330    if (!m_page)
     331        return Exception { InvalidAccessError };
     332    switch (policy) {
     333    case StorageBlockingPolicy::AllowAll:
     334        settings().setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
     335        break;
     336    case StorageBlockingPolicy::BlockThirdParty:
     337        settings().setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
     338        break;
     339    case StorageBlockingPolicy::BlockAll:
     340        settings().setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
     341        break;
     342    }
     343    return { };
     344}
     345
     346ExceptionOr<void> InternalSettings::setPDFImageCachingPolicy(PDFImageCachingPolicy policy)
     347{
     348    if (!m_page)
     349        return Exception { InvalidAccessError };
     350    switch (policy) {
     351    case PDFImageCachingPolicy::Enabled:
     352        settings().setPdfImageCachingPolicy(PDFImageCachingDisabled);
     353        break;
     354    case PDFImageCachingPolicy::BelowMemoryLimit:
     355        settings().setPdfImageCachingPolicy(PDFImageCachingBelowMemoryLimit);
     356        break;
     357    case PDFImageCachingPolicy::Disabled:
     358        settings().setPdfImageCachingPolicy(PDFImageCachingDisabled);
     359        break;
     360    case PDFImageCachingPolicy::ClipBoundsOnly:
     361        settings().setPdfImageCachingPolicy(PDFImageCachingClipBoundsOnly);
     362        break;
     363    }
     364    return { };
     365}
     366
     367ExceptionOr<void> InternalSettings::setMinimumTimerInterval(double intervalInSeconds)
     368{
     369    if (!m_page)
     370        return Exception { InvalidAccessError };
     371    settings().setMinimumDOMTimerInterval(Seconds { intervalInSeconds });
     372    return { };
     373}
     374
     375ExceptionOr<void> InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time)
     376{
     377    if (!m_page)
     378        return Exception { InvalidAccessError };
     379    settings().setTimeWithoutMouseMovementBeforeHidingControls(Seconds { time });
     380    return { };
     381}
     382
     383ExceptionOr<void> InternalSettings::setFontLoadTimingOverride(FontLoadTimingOverride fontLoadTimingOverride)
     384{
     385    if (!m_page)
     386        return Exception { InvalidAccessError };
     387    settings().setFontLoadTimingOverride(fontLoadTimingOverride);
     388    return { };
     389}
     390
     391ExceptionOr<void> InternalSettings::setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy policy)
     392{
     393    if (!m_page)
     394        return Exception { InvalidAccessError };
     395    settings().setUserInterfaceDirectionPolicy(policy);
     396    return { };
     397}
     398
     399ExceptionOr<void> InternalSettings::setSystemLayoutDirection(SystemLayoutDirection direction)
     400{
     401    if (!m_page)
     402        return Exception { InvalidAccessError };
     403    settings().setSystemLayoutDirection(direction);
     404    return { };
     405}
     406
     407ExceptionOr<void> InternalSettings::setFrameFlattening(FrameFlatteningValue frameFlattening)
     408{
     409    if (!m_page)
     410        return Exception { InvalidAccessError };
     411    settings().setFrameFlattening(frameFlattening);
     412    return { };
     413}
     414
     415InternalSettings::ForcedAccessibilityValue InternalSettings::forcedColorsAreInvertedAccessibilityValue() const
     416{
     417    return settings().forcedColorsAreInvertedAccessibilityValue();
     418}
     419
     420void InternalSettings::setForcedColorsAreInvertedAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
     421{
     422    settings().setForcedColorsAreInvertedAccessibilityValue(value);
     423}
     424
     425InternalSettings::ForcedAccessibilityValue InternalSettings::forcedDisplayIsMonochromeAccessibilityValue() const
     426{
     427    return settings().forcedDisplayIsMonochromeAccessibilityValue();
     428}
     429
     430void InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
     431{
     432    settings().setForcedDisplayIsMonochromeAccessibilityValue(value);
     433}
     434
     435InternalSettings::ForcedAccessibilityValue InternalSettings::forcedPrefersReducedMotionAccessibilityValue() const
     436{
     437    return settings().forcedPrefersReducedMotionAccessibilityValue();
     438}
     439
     440void InternalSettings::setForcedPrefersReducedMotionAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
     441{
     442    settings().setForcedPrefersReducedMotionAccessibilityValue(value);
     443}
     444
     445InternalSettings::ForcedAccessibilityValue InternalSettings::forcedSupportsHighDynamicRangeValue() const
     446{
     447    return settings().forcedSupportsHighDynamicRangeValue();
     448}
     449
     450void InternalSettings::setForcedSupportsHighDynamicRangeValue(InternalSettings::ForcedAccessibilityValue value)
     451{
     452    settings().setForcedSupportsHighDynamicRangeValue(value);
     453}
     454
     455ExceptionOr<void> InternalSettings::setWebGL2Enabled(bool enabled)
     456{
     457    if (!m_page)
     458        return Exception { InvalidAccessError };
     459#if ENABLE(WEBGL2)
     460    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(enabled);
    431461#else
    432462    UNUSED_PARAM(enabled);
    433463#endif
    434464    return { };
     465}
     466
     467ExceptionOr<void> InternalSettings::setWebGPUEnabled(bool enabled)
     468{
     469    if (!m_page)
     470        return Exception { InvalidAccessError };
     471#if ENABLE(WEBGPU)
     472    RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(enabled);
     473#else
     474    UNUSED_PARAM(enabled);
     475#endif
     476    return { };
     477}
     478
     479ExceptionOr<void> InternalSettings::setFetchAPIKeepAliveEnabled(bool enabled)
     480{
     481    if (!m_page)
     482        return Exception { InvalidAccessError };
     483    RuntimeEnabledFeatures::sharedFeatures().setFetchAPIKeepAliveEnabled(enabled);
     484    return { };
     485}
     486
     487ExceptionOr<void> InternalSettings::setCustomPasteboardDataEnabled(bool enabled)
     488{
     489    if (!m_page)
     490        return Exception { InvalidAccessError };
     491    RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(enabled);
     492    return { };
     493}
     494
     495ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool should)
     496{
     497#if USE(AUDIO_SESSION)
     498    DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(should);
     499    return { };
     500#else
     501    UNUSED_PARAM(should);
     502    return Exception { InvalidAccessError };
     503#endif
     504}
     505
     506ExceptionOr<void> InternalSettings::setShouldDisplayTrackKind(TrackKind kind, bool enabled)
     507{
     508    if (!m_page)
     509        return Exception { InvalidAccessError };
     510#if ENABLE(VIDEO)
     511    auto& captionPreferences = m_page->group().captionPreferences();
     512    switch (kind) {
     513    case TrackKind::Subtitles:
     514        captionPreferences.setUserPrefersSubtitles(enabled);
     515        break;
     516    case TrackKind::Captions:
     517        captionPreferences.setUserPrefersCaptions(enabled);
     518        break;
     519    case TrackKind::TextDescriptions:
     520        captionPreferences.setUserPrefersTextDescriptions(enabled);
     521        break;
     522    }
     523#else
     524    UNUSED_PARAM(kind);
     525    UNUSED_PARAM(enabled);
     526#endif
     527    return { };
     528}
     529
     530ExceptionOr<bool> InternalSettings::shouldDisplayTrackKind(TrackKind kind)
     531{
     532    if (!m_page)
     533        return Exception { InvalidAccessError };
     534#if ENABLE(VIDEO)
     535    auto& captionPreferences = m_page->group().captionPreferences();
     536    switch (kind) {
     537    case TrackKind::Subtitles:
     538        return captionPreferences.userPrefersSubtitles();
     539    case TrackKind::Captions:
     540        return captionPreferences.userPrefersCaptions();
     541    case TrackKind::TextDescriptions:
     542        return captionPreferences.userPrefersTextDescriptions();
     543    }
     544#else
     545    UNUSED_PARAM(kind);
     546#endif
     547    return false;
    435548}
    436549
     
    447560}
    448561
    449 ExceptionOr<void> InternalSettings::setMediaTypeOverride(const String& mediaType)
    450 {
    451     if (!m_page)
    452         return Exception { InvalidAccessError };
    453     settings().setMediaTypeOverride(mediaType);
    454     return { };
    455 }
    456 
    457562ExceptionOr<void> InternalSettings::setCanStartMedia(bool enabled)
    458563{
     
    463568}
    464569
    465 ExceptionOr<void> InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows)
    466 {
    467     if (!m_page)
    468         return Exception { InvalidAccessError };
    469 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    470     settings().setAllowsAirPlayForMediaPlayback(allows);
    471 #else
    472     UNUSED_PARAM(allows);
    473 #endif
    474     return { };
    475 }
    476 
    477 ExceptionOr<void> InternalSettings::setMediaCaptureRequiresSecureConnection(bool requires)
    478 {
    479     if (!m_page)
    480         return Exception { InvalidAccessError };
    481 #if ENABLE(MEDIA_STREAM)
    482     m_page->settings().setMediaCaptureRequiresSecureConnection(requires);
    483 #else
    484     UNUSED_PARAM(requires);
    485 #endif
    486     return { };
    487 }
    488 
    489 void InternalSettings::setDefaultAudioContextSampleRate(float sampleRate)
    490 {
     570void InternalSettings::setUseDarkAppearanceInternal(bool useDarkAppearance)
     571{
     572    ASSERT(m_page);
     573    m_page->effectiveAppearanceDidChange(useDarkAppearance, m_page->useElevatedUserInterfaceLevel());
     574}
     575
     576ExceptionOr<void> InternalSettings::setUseDarkAppearance(bool useDarkAppearance)
     577{
     578    if (!m_page)
     579        return Exception { InvalidAccessError };
     580    setUseDarkAppearanceInternal(useDarkAppearance);
     581    return { };
     582}
     583
     584ExceptionOr<void> InternalSettings::setAllowUnclampedScrollPosition(bool allowUnclamped)
     585{
     586    if (!m_page || !m_page->mainFrame().view())
     587        return Exception { InvalidAccessError };
     588
     589    m_page->mainFrame().view()->setAllowsUnclampedScrollPositionForTesting(allowUnclamped);
     590    return { };
     591}
     592
     593ExceptionOr<void>  InternalSettings::setShouldDeactivateAudioSession(bool should)
     594{
     595    if (!m_page)
     596        return Exception { InvalidAccessError };
     597#if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
     598    PlatformMediaSessionManager::setShouldDeactivateAudioSession(should);
     599#endif
     600    return { };
     601}
     602
     603ExceptionOr<void> InternalSettings::setShouldMockBoldSystemFontForAccessibility(bool requires)
     604{
     605    if (!m_page)
     606        return Exception { InvalidAccessError };
     607    RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
     608    FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
     609    return { };
     610}
     611
     612ExceptionOr<void> InternalSettings::setDefaultAudioContextSampleRate(float sampleRate)
     613{
     614    if (!m_page)
     615        return Exception { InvalidAccessError };
    491616#if ENABLE(WEB_AUDIO)
    492617    AudioContext::setDefaultSampleRateForTesting(sampleRate);
     
    494619    UNUSED_PARAM(sampleRate);
    495620#endif
    496 }
    497 
    498 ExceptionOr<void> InternalSettings::setEditingBehavior(const String& editingBehavior)
    499 {
    500     if (!m_page)
    501         return Exception { InvalidAccessError };
    502     if (equalLettersIgnoringASCIICase(editingBehavior, "win"))
    503         settings().setEditingBehaviorType(EditingWindowsBehavior);
    504     else if (equalLettersIgnoringASCIICase(editingBehavior, "mac"))
    505         settings().setEditingBehaviorType(EditingMacBehavior);
    506     else if (equalLettersIgnoringASCIICase(editingBehavior, "unix"))
    507         settings().setEditingBehaviorType(EditingUnixBehavior);
    508     else if (equalLettersIgnoringASCIICase(editingBehavior, "ios"))
    509         settings().setEditingBehaviorType(EditingIOSBehavior);
    510     else
    511         return Exception { SyntaxError };
    512     return { };
    513 }
    514 
    515 ExceptionOr<void> InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled)
    516 {
    517     if (!m_page)
    518         return Exception { InvalidAccessError };
    519 #if ENABLE(VIDEO)
    520     auto& captionPreferences = m_page->group().captionPreferences();
    521     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
    522         captionPreferences.setUserPrefersSubtitles(enabled);
    523     else if (equalLettersIgnoringASCIICase(kind, "captions"))
    524         captionPreferences.setUserPrefersCaptions(enabled);
    525     else if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
    526         captionPreferences.setUserPrefersTextDescriptions(enabled);
    527     else
    528         return Exception { SyntaxError };
    529 #else
    530     UNUSED_PARAM(kind);
    531     UNUSED_PARAM(enabled);
    532 #endif
    533     return { };
    534 }
    535 
    536 ExceptionOr<bool> InternalSettings::shouldDisplayTrackKind(const String& kind)
    537 {
    538     if (!m_page)
    539         return Exception { InvalidAccessError };
    540 #if ENABLE(VIDEO)
    541     auto& captionPreferences = m_page->group().captionPreferences();
    542     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
    543         return captionPreferences.userPrefersSubtitles();
    544     if (equalLettersIgnoringASCIICase(kind, "captions"))
    545         return captionPreferences.userPrefersCaptions();
    546     if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
    547         return captionPreferences.userPrefersTextDescriptions();
    548 
    549     return Exception { SyntaxError };
    550 #else
    551     UNUSED_PARAM(kind);
    552     return false;
    553 #endif
    554 }
    555 
    556 void InternalSettings::setUseDarkAppearanceInternal(bool useDarkAppearance)
    557 {
    558     ASSERT(m_page);
    559     m_page->effectiveAppearanceDidChange(useDarkAppearance, m_page->useElevatedUserInterfaceLevel());
    560 }
    561 
    562 ExceptionOr<void> InternalSettings::setUseDarkAppearance(bool useDarkAppearance)
    563 {
    564     if (!m_page)
    565         return Exception { InvalidAccessError };
    566     setUseDarkAppearanceInternal(useDarkAppearance);
    567     return { };
    568 }
    569 
    570 ExceptionOr<void> InternalSettings::setStorageBlockingPolicy(const String& mode)
    571 {
    572     if (!m_page)
    573         return Exception { InvalidAccessError };
    574     if (mode == "AllowAll")
    575         settings().setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
    576     else if (mode == "BlockThirdParty")
    577         settings().setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
    578     else if (mode == "BlockAll")
    579         settings().setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
    580     else
    581         return Exception { SyntaxError };
    582     return { };
    583 }
    584 
    585 ExceptionOr<void> InternalSettings::setPreferMIMETypeForImages(bool preferMIMETypeForImages)
    586 {
    587     if (!m_page)
    588         return Exception { InvalidAccessError };
    589     settings().setPreferMIMETypeForImages(preferMIMETypeForImages);
    590     return { };
    591 }
    592 
    593 ExceptionOr<void> InternalSettings::setImagesEnabled(bool enabled)
    594 {
    595     if (!m_page)
    596         return Exception { InvalidAccessError };
    597     settings().setImagesEnabled(enabled);
    598     return { };
    599 }
    600 
    601 ExceptionOr<void> InternalSettings::setPDFImageCachingPolicy(const String& policy)
    602 {
    603     if (!m_page)
    604         return Exception { InvalidAccessError };
    605     if (equalLettersIgnoringASCIICase(policy, "disabled"))
    606         settings().setPdfImageCachingPolicy(PDFImageCachingDisabled);
    607     else if (equalLettersIgnoringASCIICase(policy, "belowmemorylimit"))
    608         settings().setPdfImageCachingPolicy(PDFImageCachingBelowMemoryLimit);
    609     else if (equalLettersIgnoringASCIICase(policy, "clipboundsonly"))
    610         settings().setPdfImageCachingPolicy(PDFImageCachingClipBoundsOnly);
    611     else if (equalLettersIgnoringASCIICase(policy, "enabled"))
    612         settings().setPdfImageCachingPolicy(PDFImageCachingEnabled);
    613     else
    614         return Exception { SyntaxError };
    615     return { };
    616 }
    617 
    618 ExceptionOr<void> InternalSettings::setMinimumTimerInterval(double intervalInSeconds)
    619 {
    620     if (!m_page)
    621         return Exception { InvalidAccessError };
    622     settings().setMinimumDOMTimerInterval(Seconds { intervalInSeconds });
    623     return { };
    624 }
    625 
    626 ExceptionOr<void> InternalSettings::setDefaultVideoPosterURL(const String& url)
    627 {
    628     if (!m_page)
    629         return Exception { InvalidAccessError };
    630     settings().setDefaultVideoPosterURL(url);
    631     return { };
    632 }
    633 
    634 ExceptionOr<void> InternalSettings::setForcePendingWebGLPolicy(bool forced)
    635 {
    636     if (!m_page)
    637         return Exception { InvalidAccessError };
    638     settings().setForcePendingWebGLPolicy(forced);
    639     return { };
    640 }
    641 
    642 ExceptionOr<void> InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time)
    643 {
    644     if (!m_page)
    645         return Exception { InvalidAccessError };
    646     settings().setTimeWithoutMouseMovementBeforeHidingControls(Seconds { time });
    647     return { };
    648 }
    649 
    650 ExceptionOr<void> InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled)
    651 {
    652     if (!m_page)
    653         return Exception { InvalidAccessError };
    654     settings().setUseLegacyBackgroundSizeShorthandBehavior(enabled);
    655     return { };
    656 }
    657 
    658 ExceptionOr<void> InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled)
    659 {
    660     if (!m_page)
    661         return Exception { InvalidAccessError };
    662     settings().setAutoscrollForDragAndDropEnabled(enabled);
    663     return { };
    664 }
    665 
    666 ExceptionOr<void> InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs)
    667 {
    668     if (!m_page)
    669         return Exception { InvalidAccessError };
    670     settings().setFontFallbackPrefersPictographs(preferPictographs);
    671     return { };
    672 }
    673 
    674 ExceptionOr<void> InternalSettings::setFontLoadTimingOverride(const FontLoadTimingOverride& fontLoadTimingOverride)
    675 {
    676     if (!m_page)
    677         return Exception { InvalidAccessError };
    678     auto policy = Settings::FontLoadTimingOverride::None;
    679     switch (fontLoadTimingOverride) {
    680     case FontLoadTimingOverride::Block:
    681         policy = Settings::FontLoadTimingOverride::Block;
    682         break;
    683     case FontLoadTimingOverride::Swap:
    684         policy = Settings::FontLoadTimingOverride::Swap;
    685         break;
    686     case FontLoadTimingOverride::Failure:
    687         policy = Settings::FontLoadTimingOverride::Failure;
    688         break;
    689     }
    690     settings().setFontLoadTimingOverride(policy);
    691     return { };
    692 }
    693 
    694 ExceptionOr<void> InternalSettings::setShouldIgnoreFontLoadCompletions(bool ignore)
    695 {
    696     if (!m_page)
    697         return Exception { InvalidAccessError };
    698     settings().setShouldIgnoreFontLoadCompletions(ignore);
    699     return { };
    700 }
    701 
    702 ExceptionOr<void> InternalSettings::setQuickTimePluginReplacementEnabled(bool enabled)
    703 {
    704     if (!m_page)
    705         return Exception { InvalidAccessError };
    706     settings().setQuickTimePluginReplacementEnabled(enabled);
    707     return { };
    708 }
    709 
    710 ExceptionOr<void> InternalSettings::setYouTubeFlashPluginReplacementEnabled(bool enabled)
    711 {
    712     if (!m_page)
    713         return Exception { InvalidAccessError };
    714     settings().setYouTubeFlashPluginReplacementEnabled(enabled);
    715     return { };
    716 }
    717 
    718 ExceptionOr<void> InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground)
    719 {
    720     if (!m_page)
    721         return Exception { InvalidAccessError };
    722     settings().setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
    723     return { };
    724 }
    725 
    726 ExceptionOr<void> InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert)
    727 {
    728     if (!m_page)
    729         return Exception { InvalidAccessError };
    730     settings().setShouldConvertPositionStyleOnCopy(convert);
    731     return { };
    732 }
    733 
    734 ExceptionOr<void> InternalSettings::setScrollingTreeIncludesFrames(bool enabled)
    735 {
    736     if (!m_page)
    737         return Exception { InvalidAccessError };
    738     settings().setScrollingTreeIncludesFrames(enabled);
    739     return { };
    740 }
    741 
    742 ExceptionOr<void> InternalSettings::setAllowUnclampedScrollPosition(bool allowUnclamped)
    743 {
    744     if (!m_page || !m_page->mainFrame().view())
    745         return Exception { InvalidAccessError };
    746 
    747     m_page->mainFrame().view()->setAllowsUnclampedScrollPositionForTesting(allowUnclamped);
    748     return { };
    749 }
    750 
    751 ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlayback(bool allows)
    752 {
    753     if (!m_page)
    754         return Exception { InvalidAccessError };
    755     settings().setAllowsInlineMediaPlayback(allows);
    756     return { };
    757 }
    758 
    759 ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen(bool allows)
    760 {
    761     if (!m_page)
    762         return Exception { InvalidAccessError };
    763     settings().setAllowsInlineMediaPlaybackAfterFullscreen(allows);
    764     return { };
    765 }
    766 
    767 ExceptionOr<void> InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires)
    768 {
    769     if (!m_page)
    770         return Exception { InvalidAccessError };
    771     settings().setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
    772     return { };
    773 }
    774 
    775 ExceptionOr<void> InternalSettings::setShouldMockBoldSystemFontForAccessibility(bool requires)
    776 {
    777     if (!m_page)
    778         return Exception { InvalidAccessError };
    779     RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
    780     FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
    781     return { };
    782 }
    783 
    784 ExceptionOr<void> InternalSettings::setAnimatedImageDebugCanvasDrawingEnabled(bool ignore)
    785 {
    786     if (!m_page)
    787         return Exception { InvalidAccessError };
    788     settings().setAnimatedImageDebugCanvasDrawingEnabled(ignore);
    789     return { };
    790 }
    791 
    792 void InternalSettings::setWebGL2Enabled(bool enabled)
    793 {
    794 #if ENABLE(WEBGL2)
    795     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(enabled);
    796 #else
    797     UNUSED_PARAM(enabled);
    798 #endif
    799 }
    800 
    801 void InternalSettings::setWebGPUEnabled(bool enabled)
    802 {
    803 #if ENABLE(WEBGPU)
    804     RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(enabled);
    805 #else
    806     UNUSED_PARAM(enabled);
    807 #endif
    808 }
    809 
    810 void InternalSettings::setFetchAPIKeepAliveEnabled(bool enabled)
    811 {
    812     RuntimeEnabledFeatures::sharedFeatures().setFetchAPIKeepAliveEnabled(enabled);
    813 }
    814 
    815 ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy()
    816 {
    817     if (!m_page)
    818         return Exception { InvalidAccessError };
    819     switch (settings().userInterfaceDirectionPolicy()) {
    820     case UserInterfaceDirectionPolicy::Content:
    821         return "Content"_str;
    822     case UserInterfaceDirectionPolicy::System:
    823         return "View"_str;
    824     }
    825     ASSERT_NOT_REACHED();
    826     return Exception { InvalidAccessError };
    827 }
    828 
    829 ExceptionOr<void> InternalSettings::setUserInterfaceDirectionPolicy(const String& policy)
    830 {
    831     if (!m_page)
    832         return Exception { InvalidAccessError };
    833     if (equalLettersIgnoringASCIICase(policy, "content")) {
    834         settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::Content);
    835         return { };
    836     }
    837     if (equalLettersIgnoringASCIICase(policy, "view")) {
    838         settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::System);
    839         return { };
    840     }
    841     return Exception { InvalidAccessError };
    842 }
    843 
    844 ExceptionOr<String> InternalSettings::systemLayoutDirection()
    845 {
    846     if (!m_page)
    847         return Exception { InvalidAccessError };
    848     switch (settings().systemLayoutDirection()) {
    849     case TextDirection::LTR:
    850         return "LTR"_str;
    851     case TextDirection::RTL:
    852         return "RTL"_str;
    853     }
    854     ASSERT_NOT_REACHED();
    855     return Exception { InvalidAccessError };
    856 }
    857 
    858 ExceptionOr<void> InternalSettings::setSystemLayoutDirection(const String& direction)
    859 {
    860     if (!m_page)
    861         return Exception { InvalidAccessError };
    862     if (equalLettersIgnoringASCIICase(direction, "ltr")) {
    863         settings().setSystemLayoutDirection(TextDirection::LTR);
    864         return { };
    865     }
    866     if (equalLettersIgnoringASCIICase(direction, "rtl")) {
    867         settings().setSystemLayoutDirection(TextDirection::RTL);
    868         return { };
    869     }
    870     return Exception { InvalidAccessError };
    871 }
    872 
    873 ExceptionOr<void> InternalSettings::setFrameFlattening(FrameFlatteningValue frameFlattening)
    874 {
    875     if (!m_page)
    876         return Exception { InvalidAccessError };
    877     settings().setFrameFlattening(frameFlattening);
    878     return { };
    879 }
    880 
    881 void InternalSettings::setAllowsAnySSLCertificate(bool allowsAnyCertificate)
    882 {
    883     DeprecatedGlobalSettings::setAllowsAnySSLCertificate(allowsAnyCertificate);
    884 }
    885 
    886 ExceptionOr<bool> InternalSettings::deferredCSSParserEnabled()
    887 {
    888     if (!m_page)
    889         return Exception { InvalidAccessError };
    890     return settings().deferredCSSParserEnabled();
    891 }
    892 
    893 ExceptionOr<void> InternalSettings::setDeferredCSSParserEnabled(bool enabled)
    894 {
    895     if (!m_page)
    896         return Exception { InvalidAccessError };
    897     settings().setDeferredCSSParserEnabled(enabled);
    898     return { };
    899 }
    900 
    901 ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool should)
    902 {
    903 #if USE(AUDIO_SESSION)
    904     DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(should);
    905     return { };
    906 #else
    907     UNUSED_PARAM(should);
    908     return Exception { InvalidAccessError };
    909 #endif
    910 }
    911 
    912 ExceptionOr<void> InternalSettings::setCustomPasteboardDataEnabled(bool enabled)
    913 {
    914     RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(enabled);
    915     return { };
    916 }
    917 
    918 ExceptionOr<void> InternalSettings::setIncompleteImageBorderEnabled(bool enabled)
    919 {
    920     if (!m_page)
    921         return Exception { InvalidAccessError };
    922     settings().setIncompleteImageBorderEnabled(enabled);
    923     return { };
    924 }
    925 
    926 ExceptionOr<void> InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(bool shouldDispatch)
    927 {
    928     if (!m_page)
    929         return Exception { InvalidAccessError };
    930     settings().setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(shouldDispatch);
    931     return { };
    932 }
    933 
    934 ExceptionOr<void> InternalSettings::setShouldDispatchSyntheticMouseOutAfterSyntheticClick(bool shouldDispatch)
    935 {
    936     if (!m_page)
    937         return Exception { InvalidAccessError };
    938     settings().setShouldDispatchSyntheticMouseOutAfterSyntheticClick(shouldDispatch);
    939     return { };
    940 }
    941 
    942 static InternalSettings::ForcedAccessibilityValue settingsToInternalSettingsValue(Settings::ForcedAccessibilityValue value)
    943 {
    944     switch (value) {
    945     case Settings::ForcedAccessibilityValue::System:
    946         return InternalSettings::ForcedAccessibilityValue::System;
    947     case Settings::ForcedAccessibilityValue::On:
    948         return InternalSettings::ForcedAccessibilityValue::On;
    949     case Settings::ForcedAccessibilityValue::Off:
    950         return InternalSettings::ForcedAccessibilityValue::Off;
    951     }
    952 
    953     ASSERT_NOT_REACHED();
    954     return InternalSettings::ForcedAccessibilityValue::Off;
    955 }
    956 
    957 static Settings::ForcedAccessibilityValue internalSettingsToSettingsValue(InternalSettings::ForcedAccessibilityValue value)
    958 {
    959     switch (value) {
    960     case InternalSettings::ForcedAccessibilityValue::System:
    961         return Settings::ForcedAccessibilityValue::System;
    962     case InternalSettings::ForcedAccessibilityValue::On:
    963         return Settings::ForcedAccessibilityValue::On;
    964     case InternalSettings::ForcedAccessibilityValue::Off:
    965         return Settings::ForcedAccessibilityValue::Off;
    966     }
    967 
    968     ASSERT_NOT_REACHED();
    969     return Settings::ForcedAccessibilityValue::Off;
    970 }
    971 
    972 InternalSettings::ForcedAccessibilityValue InternalSettings::forcedColorsAreInvertedAccessibilityValue() const
    973 {
    974     return settingsToInternalSettingsValue(settings().forcedColorsAreInvertedAccessibilityValue());
    975 }
    976 
    977 void InternalSettings::setForcedColorsAreInvertedAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
    978 {
    979     settings().setForcedColorsAreInvertedAccessibilityValue(internalSettingsToSettingsValue(value));
    980 }
    981 
    982 InternalSettings::ForcedAccessibilityValue InternalSettings::forcedDisplayIsMonochromeAccessibilityValue() const
    983 {
    984     return settingsToInternalSettingsValue(settings().forcedDisplayIsMonochromeAccessibilityValue());
    985 }
    986 
    987 void InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
    988 {
    989     settings().setForcedDisplayIsMonochromeAccessibilityValue(internalSettingsToSettingsValue(value));
    990 }
    991 
    992 InternalSettings::ForcedAccessibilityValue InternalSettings::forcedPrefersReducedMotionAccessibilityValue() const
    993 {
    994     return settingsToInternalSettingsValue(settings().forcedPrefersReducedMotionAccessibilityValue());
    995 }
    996 
    997 void InternalSettings::setForcedPrefersReducedMotionAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
    998 {
    999     settings().setForcedPrefersReducedMotionAccessibilityValue(internalSettingsToSettingsValue(value));
    1000 }
    1001 
    1002 InternalSettings::ForcedAccessibilityValue InternalSettings::forcedSupportsHighDynamicRangeValue() const
    1003 {
    1004     return settingsToInternalSettingsValue(settings().forcedSupportsHighDynamicRangeValue());
    1005 }
    1006 
    1007 void InternalSettings::setForcedSupportsHighDynamicRangeValue(InternalSettings::ForcedAccessibilityValue value)
    1008 {
    1009     settings().setForcedSupportsHighDynamicRangeValue(internalSettingsToSettingsValue(value));
    1010 }
    1011 
    1012 void InternalSettings::setShouldDeactivateAudioSession(bool should)
    1013 {
    1014 #if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
    1015     PlatformMediaSessionManager::setShouldDeactivateAudioSession(should);
    1016 #endif
    1017 }
    1018 
    1019 void InternalSettings::setStorageAccessAPIPerPageScopeEnabled(bool enabled)
    1020 {
    1021     settings().setStorageAccessAPIPerPageScopeEnabled(enabled);
    1022 }
    1023 // If you add to this class, make sure that you update the Backup class for test reproducability!
    1024 
    1025 }
     621    return { };
     622}
     623
     624// If you add to this class, make sure you are not duplicating functionality in the generated
     625// base class InternalSettingsGenerated and that you update the Backup class for test reproducability.
     626
     627}
  • trunk/Source/WebCore/testing/InternalSettings.h

    r267758 r269784  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
    3  * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
     3 * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    5151    void resetToConsistentState();
    5252
    53     ExceptionOr<void> setUsesOverlayScrollbars(bool);
    54     ExceptionOr<void> setTouchEventEmulationEnabled(bool);
     53    // Settings
    5554    ExceptionOr<void> setStandardFontFamily(const String& family, const String& script);
    5655    ExceptionOr<void> setSerifFontFamily(const String& family, const String& script);
     
    6059    ExceptionOr<void> setFantasyFontFamily(const String& family, const String& script);
    6160    ExceptionOr<void> setPictographFontFamily(const String& family, const String& script);
    62     ExceptionOr<void> setTextAutosizingEnabled(bool);
     61
    6362    ExceptionOr<void> setTextAutosizingWindowSizeOverride(int width, int height);
    64     ExceptionOr<void> setTextAutosizingUsesIdempotentMode(bool);
    65     ExceptionOr<void> setTextAutosizingFontScaleFactor(float);
    66     ExceptionOr<void> setMediaTypeOverride(const String&);
    67     ExceptionOr<void> setCanStartMedia(bool);
    68     ExceptionOr<void> setAllowsAirPlayForMediaPlayback(bool);
    69     ExceptionOr<void> setMediaCaptureRequiresSecureConnection(bool);
    70     void setDefaultAudioContextSampleRate(float);
    7163
    72     ExceptionOr<void> setEditingBehavior(const String&);
    73     ExceptionOr<void> setPreferMIMETypeForImages(bool);
    74     ExceptionOr<void> setPDFImageCachingPolicy(const String&);
    75     ExceptionOr<void> setShouldDisplayTrackKind(const String& kind, bool enabled);
    76     ExceptionOr<bool> shouldDisplayTrackKind(const String& kind);
    77     ExceptionOr<void> setUseDarkAppearance(bool);
    78     ExceptionOr<void> setStorageBlockingPolicy(const String&);
    79     ExceptionOr<void> setImagesEnabled(bool);
    8064    ExceptionOr<void> setMinimumTimerInterval(double intervalInSeconds);
    81     ExceptionOr<void> setDefaultVideoPosterURL(const String&);
    82     ExceptionOr<void> setForcePendingWebGLPolicy(bool);
    83     ExceptionOr<void> setTimeWithoutMouseMovementBeforeHidingControls(double);
    84     ExceptionOr<void> setUseLegacyBackgroundSizeShorthandBehavior(bool);
    85     ExceptionOr<void> setAutoscrollForDragAndDropEnabled(bool);
    86     ExceptionOr<void> setFontFallbackPrefersPictographs(bool);
    87     enum class FontLoadTimingOverride { Block, Swap, Failure };
    88     ExceptionOr<void> setFontLoadTimingOverride(const FontLoadTimingOverride&);
    89     ExceptionOr<void> setShouldIgnoreFontLoadCompletions(bool);
    90     ExceptionOr<void> setQuickTimePluginReplacementEnabled(bool);
    91     ExceptionOr<void> setYouTubeFlashPluginReplacementEnabled(bool);
    92     ExceptionOr<void> setBackgroundShouldExtendBeyondPage(bool);
    93     ExceptionOr<void> setShouldConvertPositionStyleOnCopy(bool);
    94     ExceptionOr<void> setScrollingTreeIncludesFrames(bool);
    95     ExceptionOr<void> setAllowUnclampedScrollPosition(bool);
    96     ExceptionOr<void> setAllowsInlineMediaPlayback(bool);
    97     ExceptionOr<void> setAllowsInlineMediaPlaybackAfterFullscreen(bool);
    98     ExceptionOr<void> setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool);
    99     ExceptionOr<String> userInterfaceDirectionPolicy();
    100     ExceptionOr<void> setUserInterfaceDirectionPolicy(const String&);
    101     ExceptionOr<String> systemLayoutDirection();
    102     ExceptionOr<void> setSystemLayoutDirection(const String&);
    103     ExceptionOr<void> setShouldMockBoldSystemFontForAccessibility(bool);
    104     ExceptionOr<void> setShouldManageAudioSessionCategory(bool);
    105     ExceptionOr<void> setCustomPasteboardDataEnabled(bool);
    106     ExceptionOr<void> setIncompleteImageBorderEnabled(bool);
    107     ExceptionOr<void> setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(bool);
    108     ExceptionOr<void> setShouldDispatchSyntheticMouseOutAfterSyntheticClick(bool);
    109     ExceptionOr<void> setAnimatedImageDebugCanvasDrawingEnabled(bool);
     65    ExceptionOr<void> setTimeWithoutMouseMovementBeforeHidingControls(double intervalInSeconds);
     66
     67    enum class EditingBehavior : uint8_t { Mac, Win, Unix, Ios };
     68    ExceptionOr<void> setEditingBehavior(EditingBehavior);
     69   
     70    enum class PDFImageCachingPolicy : uint8_t { Enabled, BelowMemoryLimit, Disabled, ClipBoundsOnly };
     71    ExceptionOr<void> setPDFImageCachingPolicy(PDFImageCachingPolicy);
     72
     73    enum class StorageBlockingPolicy : uint8_t { AllowAll, BlockThirdParty, BlockAll };
     74    ExceptionOr<void> setStorageBlockingPolicy(StorageBlockingPolicy);
     75   
     76    using UserInterfaceDirectionPolicy = WebCore::UserInterfaceDirectionPolicy;
     77    ExceptionOr<void> setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy);
     78
     79    using SystemLayoutDirection = TextDirection;
     80    ExceptionOr<void> setSystemLayoutDirection(SystemLayoutDirection);
     81
     82    using FontLoadTimingOverride = Settings::FontLoadTimingOverride;
     83    ExceptionOr<void> setFontLoadTimingOverride(FontLoadTimingOverride);
    11084
    11185    using FrameFlatteningValue = FrameFlattening;
    11286    ExceptionOr<void> setFrameFlattening(FrameFlatteningValue);
    11387
    114     ExceptionOr<void> setEditableRegionEnabled(bool);
    115    
    116     static void setAllowsAnySSLCertificate(bool);
    117 
    118     ExceptionOr<bool> deferredCSSParserEnabled();
    119     ExceptionOr<void> setDeferredCSSParserEnabled(bool);
    120 
    121     enum class ForcedAccessibilityValue { System, On, Off };
     88    using ForcedAccessibilityValue = Settings::ForcedAccessibilityValue;
    12289    ForcedAccessibilityValue forcedColorsAreInvertedAccessibilityValue() const;
    12390    void setForcedColorsAreInvertedAccessibilityValue(ForcedAccessibilityValue);
     
    13097
    13198    // RuntimeEnabledFeatures.
    132     static void setWebGL2Enabled(bool);
    133     static void setWebGPUEnabled(bool);
    134     static void setPictureInPictureAPIEnabled(bool);
    135     static void setFetchAPIKeepAliveEnabled(bool);
     99    ExceptionOr<void> setWebGL2Enabled(bool);
     100    ExceptionOr<void> setWebGPUEnabled(bool);
     101    ExceptionOr<void> setFetchAPIKeepAliveEnabled(bool);
     102    ExceptionOr<void> setCustomPasteboardDataEnabled(bool);
    136103
    137     void setShouldDeactivateAudioSession(bool);
    138    
    139     void setStorageAccessAPIPerPageScopeEnabled(bool);
     104    // DeprecatedGlobalSettings.
     105    ExceptionOr<void> setShouldManageAudioSessionCategory(bool);
     106
     107    // CaptionUserPreferences.
     108    enum class TrackKind : uint8_t { Subtitles, Captions, TextDescriptions };
     109    ExceptionOr<void> setShouldDisplayTrackKind(TrackKind, bool enabled);
     110    ExceptionOr<bool> shouldDisplayTrackKind(TrackKind);
     111
     112    // Page
     113    ExceptionOr<void> setEditableRegionEnabled(bool);
     114    ExceptionOr<void> setCanStartMedia(bool);
     115    ExceptionOr<void> setUseDarkAppearance(bool);
     116
     117    // ScrollView
     118    ExceptionOr<void> setAllowUnclampedScrollPosition(bool);
     119
     120    // PlatformMediaSessionManager.
     121    ExceptionOr<void> setShouldDeactivateAudioSession(bool);
     122
     123    // RenderTheme/FontCache
     124    ExceptionOr<void> setShouldMockBoldSystemFontForAccessibility(bool);
     125
     126    // AudioContext
     127    ExceptionOr<void> setDefaultAudioContextSampleRate(float);
    140128
    141129private:
     
    152140        void restoreTo(Settings&);
    153141
    154         EditingBehaviorType m_originalEditingBehavior;
    155 
    156         // Initially empty, only used if changed by a test.
     142        // Settings
     143        // ScriptFontFamilyMaps are initially empty, only used if changed by a test.
    157144        ScriptFontFamilyMap m_standardFontFamilies;
    158145        ScriptFontFamilyMap m_fixedFontFamilies;
     
    162149        ScriptFontFamilyMap m_fantasyFontFamilies;
    163150        ScriptFontFamilyMap m_pictographFontFamilies;
    164 
    165 #if ENABLE(TEXT_AUTOSIZING)
    166         bool m_originalTextAutosizingEnabled;
    167         IntSize m_originalTextAutosizingWindowSizeOverride;
    168         bool m_originalTextAutosizingUsesIdempotentMode;
    169 #endif
    170 
    171         String m_originalMediaTypeOverride;
    172         bool m_originalCanvasUsesAcceleratedDrawing;
    173         bool m_originalMockScrollbarsEnabled;
    174         bool m_originalUsesOverlayScrollbars;
    175         bool m_imagesEnabled;
    176         bool m_preferMIMETypeForImages;
     151        EditingBehaviorType m_originalEditingBehavior;
    177152        Seconds m_minimumDOMTimerInterval;
    178 #if ENABLE(VIDEO)
    179         bool m_shouldDisplaySubtitles;
    180         bool m_shouldDisplayCaptions;
    181         bool m_shouldDisplayTextDescriptions;
    182 #endif
    183         String m_defaultVideoPosterURL;
    184         bool m_forcePendingWebGLPolicy;
    185153        Seconds m_originalTimeWithoutMouseMovementBeforeHidingControls;
    186         bool m_useLegacyBackgroundSizeShorthandBehavior;
    187         bool m_autoscrollForDragAndDropEnabled;
    188         bool m_quickTimePluginReplacementEnabled;
    189         bool m_youTubeFlashPluginReplacementEnabled;
    190         bool m_shouldConvertPositionStyleOnCopy;
    191         bool m_fontFallbackPrefersPictographs;
    192         bool m_shouldIgnoreFontLoadCompletions;
    193         bool m_backgroundShouldExtendBeyondPage;
    194154        SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy;
    195         bool m_scrollingTreeIncludesFrames;
    196 #if ENABLE(TOUCH_EVENTS)
    197         bool m_touchEventEmulationEnabled;
    198 #endif
    199 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    200         bool m_allowsAirPlayForMediaPlayback;
    201 #endif
    202         bool m_allowsInlineMediaPlayback;
    203         bool m_allowsInlineMediaPlaybackAfterFullscreen;
    204         bool m_inlineMediaPlaybackRequiresPlaysInlineAttribute;
    205         bool m_deferredCSSParserEnabled;
    206         bool m_inputEventsEnabled;
    207         bool m_incompleteImageBorderEnabled;
    208         bool m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection;
    209         bool m_shouldDispatchSyntheticMouseOutAfterSyntheticClick { false };
    210         bool m_shouldDeactivateAudioSession;
    211         bool m_animatedImageDebugCanvasDrawingEnabled;
    212155        UserInterfaceDirectionPolicy m_userInterfaceDirectionPolicy;
    213156        TextDirection m_systemLayoutDirection;
    214         PDFImageCachingPolicy m_pdfImageCachingPolicy;
     157        WebCore::PDFImageCachingPolicy m_pdfImageCachingPolicy;
    215158        Settings::ForcedAccessibilityValue m_forcedColorsAreInvertedAccessibilityValue;
    216159        Settings::ForcedAccessibilityValue m_forcedDisplayIsMonochromeAccessibilityValue;
     
    219162        FrameFlattening m_frameFlattening;
    220163
    221         // Runtime enabled settings.
     164        // RuntimeEnabledFeatures
    222165        bool m_webGL2Enabled;
    223166        bool m_fetchAPIKeepAliveAPIEnabled;
    224        
    225         bool m_shouldMockBoldSystemFontForAccessibility;
     167        bool m_customPasteboardDataEnabled;
     168
     169        // DeprecatedGlobalSettings
     170        bool m_originalMockScrollbarsEnabled;
    226171#if USE(AUDIO_SESSION)
    227172        bool m_shouldManageAudioSessionCategory;
    228173#endif
    229         bool m_customPasteboardDataEnabled;
     174
     175        // PlatformMediaSessionManager
     176        bool m_shouldDeactivateAudioSession;
     177
     178        // RenderTheme/FontCache
     179        bool m_shouldMockBoldSystemFontForAccessibility;
    230180    };
    231181
  • trunk/Source/WebCore/testing/InternalSettings.idl

    r267758 r269784  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
    3  * Copyright (C) 2015 Apple Inc. All rights reserved.
     3 * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    2525 */
    2626
     27enum EditingBehavior { "mac", "win", "unix", "ios" };
     28enum FontLoadTimingOverride { "None", "Block", "Swap", "Failure" };
    2729enum ForcedAccessibilityValue { "system", "on", "off" };
    2830enum FrameFlatteningValue { "Disabled", "EnabledForNonFullScreenIFrames", "FullyEnabled" };
    29 enum FontLoadTimingOverride { "Block", "Swap", "Failure" };
     31enum PDFImageCachingPolicy { "enabled", "belowMemoryLimit", "disabled", "clipBoundsOnly" };
     32enum StorageBlockingPolicy { "AllowAll", "BlockThirdParty", "BlockAll" };
     33enum SystemLayoutDirection { "LTR", "RTL" };
     34enum TrackKind { "Subtitles", "Captions", "TextDescriptions" };
     35enum UserInterfaceDirectionPolicy { "Content", "System" };
    3036
    3137[
     
    3440    ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
    3541] interface InternalSettings : InternalSettingsGenerated {
    36     [MayThrowException] undefined setTouchEventEmulationEnabled(boolean enabled);
    37 
    38     // Fonts, text
     42    // Settings
    3943    [MayThrowException] undefined setStandardFontFamily(DOMString family, DOMString script);
    4044    [MayThrowException] undefined setSerifFontFamily(DOMString family, DOMString script);
     
    4448    [MayThrowException] undefined setFantasyFontFamily(DOMString family, DOMString script);
    4549    [MayThrowException] undefined setPictographFontFamily(DOMString family, DOMString script);
    46     [MayThrowException] undefined setFontFallbackPrefersPictographs(boolean preferPictographs);
    4750    [MayThrowException] undefined setFontLoadTimingOverride(FontLoadTimingOverride override);
    48     [MayThrowException] undefined setShouldIgnoreFontLoadCompletions(boolean ignore);
    49 
    50     [MayThrowException] undefined setTextAutosizingEnabled(boolean enabled);
     51    // Forwards to TextAutosizingWindowSizeOverrideHeight and TextAutosizingWindowSizeOverrideWidth.
    5152    [MayThrowException] undefined setTextAutosizingWindowSizeOverride(long width, long height);
    52     [MayThrowException] undefined setTextAutosizingUsesIdempotentMode(boolean enabled);
    53 
    54     // Media
    55     [MayThrowException] undefined setCanStartMedia(boolean enabled);
    56     [MayThrowException] undefined setShouldDisplayTrackKind(DOMString kind, boolean enabled);
    57     [MayThrowException] boolean shouldDisplayTrackKind(DOMString trackKind);
    58     [MayThrowException] undefined setDefaultVideoPosterURL(DOMString poster);
    59     [MayThrowException] undefined setTimeWithoutMouseMovementBeforeHidingControls(unrestricted double time);
    60     [MayThrowException] undefined setMediaTypeOverride(DOMString mediaTypeOverride);
    61     undefined setAllowsAirPlayForMediaPlayback(boolean available);
    62     [Conditional=MEDIA_STREAM, MayThrowException] undefined setMediaCaptureRequiresSecureConnection(boolean enable);
    63     undefined setDefaultAudioContextSampleRate(float sampleRate);
    64 
    65     [MayThrowException] undefined setForcePendingWebGLPolicy(boolean forced);
    66 
    67     [MayThrowException] undefined setQuickTimePluginReplacementEnabled(boolean enabled);
    68     [MayThrowException] undefined setYouTubeFlashPluginReplacementEnabled(boolean enabled);
    69 
    70     // Editing, forms
    71     [MayThrowException] undefined setEditingBehavior(DOMString behavior);
    72     [MayThrowException] undefined setShouldConvertPositionStyleOnCopy(boolean convertPosition);
    73     [MayThrowException] undefined setPreferMIMETypeForImages(boolean preferMimeTypeForImage);
    74 
    75     // Other switches
    76     [MayThrowException] undefined setUseDarkAppearance(boolean enabled);
    77     [MayThrowException] undefined setStorageBlockingPolicy(DOMString policy);
    78     [MayThrowException] undefined setImagesEnabled(boolean enabled);
    79     [MayThrowException] undefined setPDFImageCachingPolicy(DOMString policy);
    80     [MayThrowException] undefined setUseLegacyBackgroundSizeShorthandBehavior(boolean enabled);
    81     [MayThrowException] undefined setAutoscrollForDragAndDropEnabled(boolean enabled);
    82     [MayThrowException] undefined setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
    83     [MayThrowException] undefined setScrollingTreeIncludesFrames(boolean enabled);
    84     [MayThrowException] undefined setAllowUnclampedScrollPosition(boolean allowUnclamped);
    85     [MayThrowException] undefined setAnimatedImageDebugCanvasDrawingEnabled(boolean enable);
    86 
     53    [MayThrowException] undefined setTimeWithoutMouseMovementBeforeHidingControls(unrestricted double intervalInSeconds);
    8754    [MayThrowException] undefined setMinimumTimerInterval(unrestricted double intervalInSeconds);
    88     [MayThrowException] undefined setAllowsInlineMediaPlayback(boolean allows);
    89     [MayThrowException] undefined setAllowsInlineMediaPlaybackAfterFullscreen(boolean allows);
    90     [MayThrowException] undefined setInlineMediaPlaybackRequiresPlaysInlineAttribute(boolean requires);
     55    [MayThrowException] undefined setEditingBehavior(EditingBehavior behavior);
     56    [MayThrowException] undefined setStorageBlockingPolicy(StorageBlockingPolicy policy);
     57    [MayThrowException] undefined setPDFImageCachingPolicy(PDFImageCachingPolicy policy);
    9158    [MayThrowException] undefined setFrameFlattening(FrameFlatteningValue frameFlattening);
    92     [MayThrowException] undefined setIncompleteImageBorderEnabled(boolean enabled);
    93     [MayThrowException] undefined setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(boolean shouldDispatch);
    94     [MayThrowException] undefined setShouldDispatchSyntheticMouseOutAfterSyntheticClick(boolean shouldDispatch);
    95 
    96     // RuntimeEnabledFeatures.
    97     undefined setWebGL2Enabled(boolean enabled);
    98     undefined setWebGPUEnabled(boolean enabled);
    99     undefined setFetchAPIKeepAliveEnabled(boolean enabled);
    100 
    101     [MayThrowException] DOMString userInterfaceDirectionPolicy();
    102     [MayThrowException] undefined setUserInterfaceDirectionPolicy(DOMString policy);
    103     [MayThrowException] DOMString systemLayoutDirection();
    104     [MayThrowException] undefined setSystemLayoutDirection(DOMString direction);
    105 
    106     [MayThrowException] boolean deferredCSSParserEnabled();
    107     [MayThrowException] undefined setDeferredCSSParserEnabled(boolean enabled);
    108 
    109     [MayThrowException] undefined setShouldMockBoldSystemFontForAccessibility(boolean shouldMock);
    110 
     59    [MayThrowException] undefined setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy policy);
     60    [MayThrowException] undefined setSystemLayoutDirection(SystemLayoutDirection direction);
    11161    attribute ForcedAccessibilityValue forcedColorsAreInvertedAccessibilityValue;
    11262    attribute ForcedAccessibilityValue forcedDisplayIsMonochromeAccessibilityValue;
     
    11464    attribute ForcedAccessibilityValue forcedSupportsHighDynamicRangeValue;
    11565
    116     [MayThrowException] undefined setShouldManageAudioSessionCategory(boolean should);
     66    // RuntimeEnabledFeatures.
     67    [MayThrowException] undefined setWebGL2Enabled(boolean enabled);
     68    [MayThrowException] undefined setWebGPUEnabled(boolean enabled);
     69    [MayThrowException] undefined setFetchAPIKeepAliveEnabled(boolean enabled);
    11770    [MayThrowException] undefined setCustomPasteboardDataEnabled(boolean enabled);
    11871
    119     undefined setShouldDeactivateAudioSession(boolean shouldDeactivate);
    120    
    121     undefined setStorageAccessAPIPerPageScopeEnabled(boolean enabled);
     72    // DeprecatedGlobalSettings.
     73    [MayThrowException] undefined setShouldManageAudioSessionCategory(boolean should);
    12274
     75    // CaptionUserPreferences
     76    [MayThrowException] undefined setShouldDisplayTrackKind(TrackKind kind, boolean enabled);
     77    [MayThrowException] boolean shouldDisplayTrackKind(TrackKind kind);
     78
     79    // Page
     80    [MayThrowException] undefined setCanStartMedia(boolean enabled);
    12381    [MayThrowException] undefined setEditableRegionEnabled(boolean enabled);
     82    [MayThrowException] undefined setUseDarkAppearance(boolean enabled);
     83
     84    // ScrollView
     85    [MayThrowException] undefined setAllowUnclampedScrollPosition(boolean allowUnclamped);
     86
     87    // PlatformMediaSessionManager.
     88    [MayThrowException] undefined setShouldDeactivateAudioSession(boolean shouldDeactivate);
     89
     90    // RenderTheme/FontCache
     91    [MayThrowException] undefined setShouldMockBoldSystemFontForAccessibility(boolean shouldMock);
     92
     93    // AudioContext
     94    [MayThrowException] undefined setDefaultAudioContextSampleRate(float sampleRate);
    12495};
    125 
  • trunk/Source/WebCore/testing/Internals.cpp

    r269764 r269784  
    598598#endif
    599599
    600 #if ENABLE(MEDIA_STREAM)
    601     setMediaCaptureRequiresSecureConnection(false);
    602 #endif
    603 
    604600#if ENABLE(WIRELESS_PLAYBACK_TARGET)
    605601    if (document.page())
     
    16221618    if (auto* page = document->page())
    16231619        page->settings().setInterruptAudioOnPageVisibilityChangeEnabled(shouldInterrupt);
    1624 }
    1625 
    1626 void Internals::setMediaCaptureRequiresSecureConnection(bool enabled)
    1627 {
    1628     Document* document = contextDocument();
    1629     if (auto* page = document->page())
    1630         page->settings().setMediaCaptureRequiresSecureConnection(enabled);
    16311620}
    16321621
  • trunk/Source/WebCore/testing/Internals.h

    r269764 r269784  
    593593#if ENABLE(MEDIA_STREAM)
    594594    void setShouldInterruptAudioOnPageVisibilityChange(bool);
    595     void setMediaCaptureRequiresSecureConnection(bool);
    596595    void setCustomPrivateRecorderCreator();
    597596#endif
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp

    r268775 r269784  
    2828#include "WebCoreTestSupport.h"
    2929
     30#include "DeprecatedGlobalSettings.h"
    3031#include "Frame.h"
    3132#include "InternalSettings.h"
     
    144145void setAllowsAnySSLCertificate(bool allowAnySSLCertificate)
    145146{
    146     InternalSettings::setAllowsAnySSLCertificate(allowAnySSLCertificate);
     147    DeprecatedGlobalSettings::setAllowsAnySSLCertificate(allowAnySSLCertificate);
    147148}
    148149
Note: See TracChangeset for help on using the changeset viewer.