Changeset 207521 in webkit


Ignore:
Timestamp:
Oct 18, 2016 10:25:06 PM (8 years ago)
Author:
Darin Adler
Message:

Move internal testing classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163553

Reviewed by Ryosuke Niwa.

  • bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that

is now needed in the testing library.

  • bindings/scripts/CodeGeneratorJS.pm:

(NativeToJSValue): Added code to handle the jsArray case with an exception.

  • css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when

CSS_SCROLL_SNAP is not enabled.

  • dom/Element.cpp:

(WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
There is no reason it needs to be a RefPtr.

  • dom/Element.h: Updated for above change.
  • svg/SVGPathStringBuilder.h: Exported class and made more public so it can

be used in test code.

  • svg/SVGPathUtilities.cpp:

(WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
so moved into there.
(WebCore::buildStringFromPath): Deleted. Ditto.

  • svg/SVGPathUtilities.h: Removed buildStringFromPath.
  • testing/InternalSettings.cpp: Simplified the guard macro and used the all

capitals style that our style guide prescribes for non-function-like macros.
(WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
(WebCore::InternalSettings::resetToConsistentState): Updated since settings
returns a reference.
(WebCore::InternalSettings::settings): Changed to return a reference and
assert that m_page is not null; functions all check m_page for null first.
(WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
ExceptionOr, do an m_page check, and use settings that returns a reference.
(WebCore::InternalSettings::setStandardFontFamily): Ditto.
(WebCore::InternalSettings::setSerifFontFamily): Ditto.
(WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
(WebCore::InternalSettings::setFixedFontFamily): Ditto.
(WebCore::InternalSettings::setCursiveFontFamily): Ditto.
(WebCore::InternalSettings::setFantasyFontFamily): Ditto.
(WebCore::InternalSettings::setPictographFontFamily): Ditto.
(WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
(WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
(WebCore::InternalSettings::setMediaTypeOverride): Ditto.
(WebCore::InternalSettings::setCanStartMedia): Ditto.
(WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
(WebCore::InternalSettings::setEditingBehavior): Ditto.
(WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
(WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
(WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
(WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
(WebCore::InternalSettings::setImagesEnabled): Ditto.
(WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
(WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
(WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
(WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
(WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
(WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
(WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
(WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
(WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
(WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
(WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
(WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
(WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
(WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
(WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
(WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
(WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
(WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
(WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
(WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
(WebCore::InternalSettings::systemLayoutDirection): Ditto.
(WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
(WebCore::InternalSettings::variationFontsEnabled): Ditto.
(WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
(WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.

  • testing/InternalSettings.h: Updated for above changes. Also moved Backup to make

it private instead of public.

  • testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded

exception for setIndexedDBWorkersEnabled.

  • testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.

(WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
(WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
(WebCore::Internals::animationsAreSuspended): Ditto.
(WebCore::Internals::suspendAnimations): Ditto.
(WebCore::Internals::resumeAnimations): Ditto.
(WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
(WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
(WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
(WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
(WebCore::Internals::elementRenderTreeAsText): Ditto.
(WebCore::Internals::ensureShadowRoot): Ditto.
(WebCore::Internals::createShadowRoot): Ditto.
(WebCore::Internals::shadowRootType): Ditto.
(WebCore::Internals::isTimerThrottled): Ditto.
(WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
(WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
(WebCore::Internals::absoluteCaretBounds): Ditto.
(WebCore::Internals::inspectorHighlightRects): Ditto.
(WebCore::Internals::inspectorHighlightObject): Ditto.
(WebCore::Internals::markerCountForNode): Ditto.
(WebCore::Internals::markerAt): Ditto.
(WebCore::Internals::markerRangeForNode): Ditto.
(WebCore::Internals::markerDescriptionForNode): Ditto.
(WebCore::Internals::dumpMarkerRects): Ditto.
(WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
(WebCore::Internals::setScrollViewPosition): Ditto.
(WebCore::Internals::setViewBaseBackgroundColor): Ditto.
(WebCore::Internals::setPagination): Ditto.
(WebCore::Internals::setPaginationLineGridEnabled): Ditto.
(WebCore::Internals::configurationForViewport): Ditto.
(WebCore::Internals::wasLastChangeUserEdit): Ditto.
(WebCore::Internals::scrollElementToRect): Ditto.
(WebCore::Internals::autofillFieldName): Ditto.
(WebCore::Internals::paintControlTints): Ditto.
(WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
(WebCore::Internals::setDelegatesScrolling): Ditto.
(WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
(WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
(WebCore::Internals::wheelEventHandlerCount): Ditto.
(WebCore::Internals::touchEventHandlerCount): Ditto.
(WebCore::Internals::nodesFromRect): Ditto.
(WebCore::Internals::setBatteryStatus): Ditto.
(WebCore::Internals::setDeviceProximity): Ditto.
(WebCore::Internals::hasSpellingMarker): Ditto.
(WebCore::Internals::hasAutocorrectedMarker): Ditto.
(WebCore::Internals::handleAcceptedCandidate): Ditto.
(WebCore::Internals::isOverwriteModeEnabled): Ditto.
(WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
(WebCore::Internals::countMatchesForText): Ditto.
(WebCore::Internals::countFindMatches): Ditto.
(WebCore::Internals::setInspectorIsUnderTest): Ditto.
(WebCore::Internals::hasGrammarMarker): Ditto.
(WebCore::Internals::numberOfScrollableAreas): Ditto.
(WebCore::Internals::isPageBoxVisible): Ditto.
(WebCore::Internals::layerTreeAsText): Ditto.
(WebCore::Internals::repaintRectsAsText): Ditto.
(WebCore::Internals::scrollingStateTreeAsText): Ditto.
(WebCore::Internals::mainThreadScrollingReasons): Ditto.
(WebCore::Internals::nonFastScrollableRects): Ditto.
(WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
(WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
(WebCore::Internals::displayListForElement): Ditto.
(WebCore::Internals::replayDisplayListForElement): Ditto.
(WebCore::Internals::garbageCollectDocumentResources): Ditto.
(WebCore::Internals::insertAuthorCSS): Ditto.
(WebCore::Internals::insertUserCSS): Ditto.
(WebCore::Internals::pageProperty): Ditto.
(WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
(WebCore::Internals::setPageScaleFactor): Ditto.
(WebCore::Internals::setPageZoomFactor): Ditto.
(WebCore::Internals::setTextZoomFactor): Ditto.
(WebCore::Internals::setUseFixedLayout): Ditto.
(WebCore::Internals::setFixedLayoutSize): Ditto.
(WebCore::Internals::setViewExposedRect): Ditto.
(WebCore::Internals::setHeaderHeight): Ditto.
(WebCore::Internals::setFooterHeight): Ditto.
(WebCore::Internals::setTopContentInset): Ditto.
(WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
(WebCore::Internals::startTrackingRepaints): Ditto.
(WebCore::Internals::stopTrackingRepaints): Ditto.
(WebCore::Internals::startTrackingLayerFlushes): Ditto.
(WebCore::Internals::layerFlushCount): Ditto.
(WebCore::Internals::startTrackingStyleRecalcs): Ditto.
(WebCore::Internals::styleRecalcCount): Ditto.
(WebCore::Internals::startTrackingCompositingUpdates): Ditto.
(WebCore::Internals::compositingUpdateCount): Ditto.
(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
(WebCore::Internals::getCurrentCursorInfo): Ditto.
(WebCore::Internals::mediaElementHasCharacteristic): Ditto.
(WebCore::Internals::captionsStyleSheetOverride): Ditto.
(WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
(WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
(WebCore::Internals::setCaptionDisplayMode): Ditto.
(WebCore::Internals::selectionBounds): Ditto.
(WebCore::Internals::isVibrating): Ditto.
(WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
(WebCore::Internals::beginMediaSessionInterruption): Ditto.
(WebCore::Internals::setMediaSessionRestrictions): Ditto.
(WebCore::Internals::postRemoteControlCommand): Ditto.
(WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
(WebCore::Internals::installMockPageOverlay): Ditto.
(WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
(WebCore::Internals::scrollSnapOffsets): Ditto.
(WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
the path string in here for now since it's only used for this testing.
(WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.

  • testing/Internals.h: Updated for above changes.
  • testing/Internals.idl: Use non-legacy exceptions.
Location:
trunk/Source/WebCore
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207519 r207521  
     12016-10-18  Darin Adler  <darin@apple.com>
     2
     3        Move internal testing classes from ExceptionCode to Exception
     4        https://bugs.webkit.org/show_bug.cgi?id=163553
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
     9        is now needed in the testing library.
     10        * bindings/scripts/CodeGeneratorJS.pm:
     11        (NativeToJSValue): Added code to handle the jsArray case with an exception.
     12
     13        * css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
     14        CSS_SCROLL_SNAP is not enabled.
     15
     16        * dom/Element.cpp:
     17        (WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
     18        There is no reason it needs to be a RefPtr.
     19        * dom/Element.h: Updated for above change.
     20
     21        * svg/SVGPathStringBuilder.h: Exported class and made more public so it can
     22        be used in test code.
     23
     24        * svg/SVGPathUtilities.cpp:
     25        (WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
     26        so moved into there.
     27        (WebCore::buildStringFromPath): Deleted. Ditto.
     28        * svg/SVGPathUtilities.h: Removed buildStringFromPath.
     29
     30        * testing/InternalSettings.cpp: Simplified the guard macro and used the all
     31        capitals style that our style guide prescribes for non-function-like macros.
     32        (WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
     33        (WebCore::InternalSettings::resetToConsistentState): Updated since settings
     34        returns a reference.
     35        (WebCore::InternalSettings::settings): Changed to return a reference and
     36        assert that m_page is not null; functions all check m_page for null first.
     37        (WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
     38        ExceptionOr, do an m_page check, and use settings that returns a reference.
     39        (WebCore::InternalSettings::setStandardFontFamily): Ditto.
     40        (WebCore::InternalSettings::setSerifFontFamily): Ditto.
     41        (WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
     42        (WebCore::InternalSettings::setFixedFontFamily): Ditto.
     43        (WebCore::InternalSettings::setCursiveFontFamily): Ditto.
     44        (WebCore::InternalSettings::setFantasyFontFamily): Ditto.
     45        (WebCore::InternalSettings::setPictographFontFamily): Ditto.
     46        (WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
     47        (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
     48        (WebCore::InternalSettings::setMediaTypeOverride): Ditto.
     49        (WebCore::InternalSettings::setCanStartMedia): Ditto.
     50        (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
     51        (WebCore::InternalSettings::setEditingBehavior): Ditto.
     52        (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
     53        (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
     54        (WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
     55        (WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
     56        (WebCore::InternalSettings::setImagesEnabled): Ditto.
     57        (WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
     58        (WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
     59        (WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
     60        (WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
     61        (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
     62        (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
     63        (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
     64        (WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
     65        (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
     66        (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
     67        (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
     68        (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
     69        (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
     70        (WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
     71        (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
     72        (WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
     73        (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
     74        (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
     75        (WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
     76        (WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
     77        (WebCore::InternalSettings::systemLayoutDirection): Ditto.
     78        (WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
     79        (WebCore::InternalSettings::variationFontsEnabled): Ditto.
     80        (WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
     81        (WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
     82        (WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
     83        * testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
     84        it private instead of public.
     85        * testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
     86        exception for setIndexedDBWorkersEnabled.
     87
     88        * testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
     89        (WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
     90        (WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
     91        (WebCore::Internals::animationsAreSuspended): Ditto.
     92        (WebCore::Internals::suspendAnimations): Ditto.
     93        (WebCore::Internals::resumeAnimations): Ditto.
     94        (WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
     95        (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
     96        (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
     97        (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
     98        (WebCore::Internals::elementRenderTreeAsText): Ditto.
     99        (WebCore::Internals::ensureShadowRoot): Ditto.
     100        (WebCore::Internals::createShadowRoot): Ditto.
     101        (WebCore::Internals::shadowRootType): Ditto.
     102        (WebCore::Internals::isTimerThrottled): Ditto.
     103        (WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
     104        (WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
     105        (WebCore::Internals::absoluteCaretBounds): Ditto.
     106        (WebCore::Internals::inspectorHighlightRects): Ditto.
     107        (WebCore::Internals::inspectorHighlightObject): Ditto.
     108        (WebCore::Internals::markerCountForNode): Ditto.
     109        (WebCore::Internals::markerAt): Ditto.
     110        (WebCore::Internals::markerRangeForNode): Ditto.
     111        (WebCore::Internals::markerDescriptionForNode): Ditto.
     112        (WebCore::Internals::dumpMarkerRects): Ditto.
     113        (WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
     114        (WebCore::Internals::setScrollViewPosition): Ditto.
     115        (WebCore::Internals::setViewBaseBackgroundColor): Ditto.
     116        (WebCore::Internals::setPagination): Ditto.
     117        (WebCore::Internals::setPaginationLineGridEnabled): Ditto.
     118        (WebCore::Internals::configurationForViewport): Ditto.
     119        (WebCore::Internals::wasLastChangeUserEdit): Ditto.
     120        (WebCore::Internals::scrollElementToRect): Ditto.
     121        (WebCore::Internals::autofillFieldName): Ditto.
     122        (WebCore::Internals::paintControlTints): Ditto.
     123        (WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
     124        (WebCore::Internals::setDelegatesScrolling): Ditto.
     125        (WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
     126        (WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
     127        (WebCore::Internals::wheelEventHandlerCount): Ditto.
     128        (WebCore::Internals::touchEventHandlerCount): Ditto.
     129        (WebCore::Internals::nodesFromRect): Ditto.
     130        (WebCore::Internals::setBatteryStatus): Ditto.
     131        (WebCore::Internals::setDeviceProximity): Ditto.
     132        (WebCore::Internals::hasSpellingMarker): Ditto.
     133        (WebCore::Internals::hasAutocorrectedMarker): Ditto.
     134        (WebCore::Internals::handleAcceptedCandidate): Ditto.
     135        (WebCore::Internals::isOverwriteModeEnabled): Ditto.
     136        (WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
     137        (WebCore::Internals::countMatchesForText): Ditto.
     138        (WebCore::Internals::countFindMatches): Ditto.
     139        (WebCore::Internals::setInspectorIsUnderTest): Ditto.
     140        (WebCore::Internals::hasGrammarMarker): Ditto.
     141        (WebCore::Internals::numberOfScrollableAreas): Ditto.
     142        (WebCore::Internals::isPageBoxVisible): Ditto.
     143        (WebCore::Internals::layerTreeAsText): Ditto.
     144        (WebCore::Internals::repaintRectsAsText): Ditto.
     145        (WebCore::Internals::scrollingStateTreeAsText): Ditto.
     146        (WebCore::Internals::mainThreadScrollingReasons): Ditto.
     147        (WebCore::Internals::nonFastScrollableRects): Ditto.
     148        (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
     149        (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
     150        (WebCore::Internals::displayListForElement): Ditto.
     151        (WebCore::Internals::replayDisplayListForElement): Ditto.
     152        (WebCore::Internals::garbageCollectDocumentResources): Ditto.
     153        (WebCore::Internals::insertAuthorCSS): Ditto.
     154        (WebCore::Internals::insertUserCSS): Ditto.
     155        (WebCore::Internals::pageProperty): Ditto.
     156        (WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
     157        (WebCore::Internals::setPageScaleFactor): Ditto.
     158        (WebCore::Internals::setPageZoomFactor): Ditto.
     159        (WebCore::Internals::setTextZoomFactor): Ditto.
     160        (WebCore::Internals::setUseFixedLayout): Ditto.
     161        (WebCore::Internals::setFixedLayoutSize): Ditto.
     162        (WebCore::Internals::setViewExposedRect): Ditto.
     163        (WebCore::Internals::setHeaderHeight): Ditto.
     164        (WebCore::Internals::setFooterHeight): Ditto.
     165        (WebCore::Internals::setTopContentInset): Ditto.
     166        (WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
     167        (WebCore::Internals::startTrackingRepaints): Ditto.
     168        (WebCore::Internals::stopTrackingRepaints): Ditto.
     169        (WebCore::Internals::startTrackingLayerFlushes): Ditto.
     170        (WebCore::Internals::layerFlushCount): Ditto.
     171        (WebCore::Internals::startTrackingStyleRecalcs): Ditto.
     172        (WebCore::Internals::styleRecalcCount): Ditto.
     173        (WebCore::Internals::startTrackingCompositingUpdates): Ditto.
     174        (WebCore::Internals::compositingUpdateCount): Ditto.
     175        (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
     176        (WebCore::Internals::getCurrentCursorInfo): Ditto.
     177        (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
     178        (WebCore::Internals::captionsStyleSheetOverride): Ditto.
     179        (WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
     180        (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
     181        (WebCore::Internals::setCaptionDisplayMode): Ditto.
     182        (WebCore::Internals::selectionBounds): Ditto.
     183        (WebCore::Internals::isVibrating): Ditto.
     184        (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
     185        (WebCore::Internals::beginMediaSessionInterruption): Ditto.
     186        (WebCore::Internals::setMediaSessionRestrictions): Ditto.
     187        (WebCore::Internals::postRemoteControlCommand): Ditto.
     188        (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
     189        (WebCore::Internals::installMockPageOverlay): Ditto.
     190        (WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
     191        (WebCore::Internals::scrollSnapOffsets): Ditto.
     192        (WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
     193        the path string in here for now since it's only used for this testing.
     194        (WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
     195
     196        * testing/Internals.h: Updated for above changes.
     197        * testing/Internals.idl: Use non-legacy exceptions.
     198
    11992016-10-18  Chris Dumez  <cdumez@apple.com>
    2200
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r207396 r207521  
    197197
    198198// Implementation details of the above.
    199 void propagateExceptionSlowPath(JSC::ExecState&, JSC::ThrowScope&, Exception&&);
     199WEBCORE_EXPORT void propagateExceptionSlowPath(JSC::ExecState&, JSC::ThrowScope&, Exception&&);
    200200WEBCORE_EXPORT void setDOMExceptionSlow(JSC::ExecState*, JSC::ThrowScope&, ExceptionCode);
    201201
     
    413413void propagateException(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<void>&&);
    414414template<typename T> JSC::JSValue toJS(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<T>&&);
     415template<typename T> JSC::JSValue toJSArray(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<T>&&);
    415416JSC::JSValue toJSBoolean(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<bool>&&);
    416417JSC::JSValue toJSDate(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<double>&&);
     
    930931}
    931932
    932 inline JSC::JSValue toJSBoolean(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<bool>&& value)
     933template<typename T> inline JSC::JSValue toJSArray(JSC::ExecState& state, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, ExceptionOr<T>&& value)
    933934{
    934935    if (UNLIKELY(value.hasException())) {
     
    936937        return { };
    937938    }
    938     return JSC::jsBoolean(value.releaseReturnValue());
    939 }
    940 
    941 template<typename T> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, ExceptionOr<T>&& value)
     939    return jsArray(&state, &globalObject, value.releaseReturnValue());
     940}
     941
     942inline JSC::JSValue toJSBoolean(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<bool>&& value)
    942943{
    943944    if (UNLIKELY(value.hasException())) {
     
    945946        return { };
    946947    }
    947     return toJSNewlyCreated(&state, &globalObject, value.releaseReturnValue());
    948 }
    949 
    950 inline JSC::JSValue toJSNullableString(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<String>&& value)
     948    return JSC::jsBoolean(value.releaseReturnValue());
     949}
     950
     951template<typename T> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, ExceptionOr<T>&& value)
    951952{
    952953    if (UNLIKELY(value.hasException())) {
     
    954955        return { };
    955956    }
    956     return jsStringOrNull(&state, value.releaseReturnValue());
    957 }
    958 
    959 template<typename T> inline JSC::JSValue toJSNumber(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<T>&& value)
     957    return toJSNewlyCreated(&state, &globalObject, value.releaseReturnValue());
     958}
     959
     960inline JSC::JSValue toJSNullableString(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<String>&& value)
    960961{
    961962    if (UNLIKELY(value.hasException())) {
     
    963964        return { };
    964965    }
    965     return JSC::jsNumber(value.releaseReturnValue());
    966 }
    967 
    968 inline JSC::JSValue toJSString(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<String>&& value)
     966    return jsStringOrNull(&state, value.releaseReturnValue());
     967}
     968
     969template<typename T> inline JSC::JSValue toJSNumber(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<T>&& value)
    969970{
    970971    if (UNLIKELY(value.hasException())) {
     
    972973        return { };
    973974    }
     975    return JSC::jsNumber(value.releaseReturnValue());
     976}
     977
     978inline JSC::JSValue toJSString(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<String>&& value)
     979{
     980    if (UNLIKELY(value.hasException())) {
     981        propagateException(state, throwScope, value.releaseException());
     982        return { };
     983    }
    974984    return JSC::jsStringWithCache(&state, value.releaseReturnValue());
    975985}
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r207519 r207521  
    52545254        my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
    52555255        AddToImplIncludes("JS${innerType}.h", $conditional) if $codeGenerator->IsRefPtrType($innerType);
    5256         return "jsArray($statePointer, $globalObject, $value)" if $codeGenerator->IsSequenceType($type);
    5257         return "jsFrozenArray($statePointer, $globalObject, $value)" if $codeGenerator->IsFrozenArrayType($type);
     5256        my $isSequence = $codeGenerator->IsSequenceType($type);
     5257        return "toJSArray($stateReference, *$globalObject, throwScope, $value)" if $isSequence && $mayThrowException;
     5258        return "jsArray($statePointer, $globalObject, $value)" if $isSequence;
     5259        return "jsFrozenArray($statePointer, $globalObject, $value)";;
    52585260    }
    52595261
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r207513 r207521  
    18921892}
    18931893
     1894#if ENABLE(CSS_SCROLL_SNAP)
     1895
    18941896static RefPtr<CSSValueList> consumePositionList(CSSParserTokenRange& range, CSSParserMode cssParserMode)
    18951897{
     
    19041906}
    19051907
    1906 #if ENABLE(CSS_SCROLL_SNAP)
    19071908static RefPtr<CSSValue> consumeScrollSnapCoordinate(CSSParserTokenRange& range, CSSParserMode cssParserMode)
    19081909{
     
    19271928    return nullptr;
    19281929}
     1930
    19291931#endif
    19301932
  • trunk/Source/WebCore/dom/Element.cpp

    r207458 r207521  
    18011801}
    18021802
    1803 RefPtr<ShadowRoot> Element::createShadowRoot(ExceptionCode& ec)
     1803ShadowRoot* Element::createShadowRoot(ExceptionCode& ec)
    18041804{
    18051805    if (alwaysCreateUserAgentShadowRoot())
    1806         ensureUserAgentShadowRoot();
     1806        return &ensureUserAgentShadowRoot();
    18071807
    18081808    ec = HIERARCHY_REQUEST_ERR;
  • trunk/Source/WebCore/dom/Element.h

    r207458 r207521  
    268268
    269269    WEBCORE_EXPORT ShadowRoot* shadowRoot() const;
    270     WEBCORE_EXPORT RefPtr<ShadowRoot> createShadowRoot(ExceptionCode&);
     270    WEBCORE_EXPORT ShadowRoot* createShadowRoot(ExceptionCode&);
    271271
    272272    enum class ShadowRootMode { Open, Closed };
  • trunk/Source/WebCore/svg/SVGPathStringBuilder.h

    r197563 r207521  
    1919 */
    2020
    21 #ifndef SVGPathStringBuilder_h
    22 #define SVGPathStringBuilder_h
     21#pragma once
    2322
    2423#include "SVGPathConsumer.h"
     
    2928class SVGPathStringBuilder final : public SVGPathConsumer {
    3029public:
    31     SVGPathStringBuilder();
    32     ~SVGPathStringBuilder();
     30    WEBCORE_EXPORT SVGPathStringBuilder();
     31    WEBCORE_EXPORT virtual ~SVGPathStringBuilder();
    3332
    34     String result();
     33    WEBCORE_EXPORT String result();
     34
     35    void incrementPathSegmentCount() final;
     36    bool continueConsuming() final;
     37
     38    // Used in UnalteredParsing/NormalizedParsing modes.
     39    WEBCORE_EXPORT void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) final;
     40    WEBCORE_EXPORT void lineTo(const FloatPoint&, PathCoordinateMode) final;
     41    WEBCORE_EXPORT void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) final;
     42    WEBCORE_EXPORT void closePath() final;
     43
     44    // Only used in UnalteredParsing mode.
     45    void lineToHorizontal(float, PathCoordinateMode) final;
     46    void lineToVertical(float, PathCoordinateMode) final;
     47    void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final;
     48    WEBCORE_EXPORT void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final;
     49    void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) final;
     50    void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) final;
    3551
    3652private:
    37     void incrementPathSegmentCount() override;
    38     bool continueConsuming() override;
    39 
    40     // Used in UnalteredParsing/NormalizedParsing modes.
    41     void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) override;
    42     void lineTo(const FloatPoint&, PathCoordinateMode) override;
    43     void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) override;
    44     void closePath() override;
    45 
    46     // Only used in UnalteredParsing mode.
    47     void lineToHorizontal(float, PathCoordinateMode) override;
    48     void lineToVertical(float, PathCoordinateMode) override;
    49     void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) override;
    50     void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) override;
    51     void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) override;
    52     void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) override;
    53 
    5453    StringBuilder m_stringBuilder;
    5554};
    5655
    5756} // namespace WebCore
    58 
    59 #endif // SVGPathStringBuilder_h
  • trunk/Source/WebCore/svg/SVGPathUtilities.cpp

    r194496 r207521  
    208208}
    209209
    210 static void pathIteratorForBuildingString(SVGPathConsumer& consumer, const PathElement& pathElement)
    211 {
    212     switch (pathElement.type) {
    213     case PathElementMoveToPoint:
    214         consumer.moveTo(pathElement.points[0], false, AbsoluteCoordinates);
    215         break;
    216     case PathElementAddLineToPoint:
    217         consumer.lineTo(pathElement.points[0], AbsoluteCoordinates);
    218         break;
    219     case PathElementAddQuadCurveToPoint:
    220         consumer.curveToQuadratic(pathElement.points[0], pathElement.points[1], AbsoluteCoordinates);
    221         break;
    222     case PathElementAddCurveToPoint:
    223         consumer.curveToCubic(pathElement.points[0], pathElement.points[1], pathElement.points[2], AbsoluteCoordinates);
    224         break;
    225     case PathElementCloseSubpath:
    226         consumer.closePath();
    227         break;
    228 
    229     default:
    230         ASSERT_NOT_REACHED();
    231         break;
    232     }
    233 }
    234 
    235 bool buildStringFromPath(const Path& path, String& string)
    236 {
    237     // Ideally we would have a SVGPathPlatformPathSource, but it's not possible to manually iterate
    238     // a path, only apply a function to all path elements at once.
    239 
    240     SVGPathStringBuilder builder;
    241     path.apply([&builder](const PathElement& pathElement) {
    242         pathIteratorForBuildingString(builder, pathElement);
    243     });
    244     string = builder.result();
    245 
    246     return true;
    247 }
    248 
    249 }
     210}
  • trunk/Source/WebCore/svg/SVGPathUtilities.h

    r191551 r207521  
    1919 */
    2020
    21 #ifndef SVGPathUtilities_h
    22 #define SVGPathUtilities_h
     21#pragma once
    2322
    2423#include "SVGPathConsumer.h"
     
    5958bool getPointAtLengthOfSVGPathByteStream(const SVGPathByteStream&, float length, SVGPoint&);
    6059
    61 // Path -> String
    62 WEBCORE_EXPORT bool buildStringFromPath(const Path&, String&);
    63 
    6460} // namespace WebCore
    65 
    66 #endif // SVGPathUtilities_h
  • trunk/Source/WebCore/testing/InternalSettings.cpp

    r207183 r207521  
    4646#endif
    4747
    48 #define InternalSettingsGuardForSettingsReturn(returnValue) \
    49     if (!settings()) { \
    50         ec = INVALID_ACCESS_ERR; \
    51         return returnValue; \
    52     }
    53 
    54 #define InternalSettingsGuardForSettings()  \
    55     if (!settings()) { \
    56         ec = INVALID_ACCESS_ERR; \
    57         return; \
    58     }
    59 
    60 #define InternalSettingsGuardForPage() \
    61     if (!page()) { \
    62         ec = INVALID_ACCESS_ERR; \
    63         return; \
    64     }
    65 
    6648namespace WebCore {
    6749
     
    226208}
    227209
    228 InternalSettings::~InternalSettings()
    229 {
     210void InternalSettings::hostDestroyed()
     211{
     212    m_page = nullptr;
    230213}
    231214
     
    240223}
    241224
     225Ref<InternalSettings> InternalSettings::create(Page* page)
     226{
     227    return adoptRef(*new InternalSettings(page));
     228}
     229
    242230void InternalSettings::resetToConsistentState()
    243231{
    244     page()->setPageScaleFactor(1, { 0, 0 });
    245     page()->mainFrame().setPageAndTextZoomFactors(1, 1);
    246     page()->setCanStartMedia(true);
    247     page()->settings().setForcePendingWebGLPolicy(false);
     232    m_page->setPageScaleFactor(1, { 0, 0 });
     233    m_page->mainFrame().setPageAndTextZoomFactors(1, 1);
     234    m_page->setCanStartMedia(true);
     235
     236    settings().setForcePendingWebGLPolicy(false);
    248237#if ENABLE(WIRELESS_PLAYBACK_TARGET)
    249     setAllowsAirPlayForMediaPlayback(false);
    250 #endif
    251 
    252     m_backup.restoreTo(*settings());
    253     m_backup = Backup(*settings());
     238    settings().setAllowsAirPlayForMediaPlayback(false);
     239#endif
     240
     241    m_backup.restoreTo(settings());
     242    m_backup = Backup { settings() };
    254243
    255244    InternalSettingsGenerated::resetToConsistentState();
    256245}
    257246
    258 Settings* InternalSettings::settings() const
    259 {
    260     if (!page())
    261         return 0;
    262     return &page()->settings();
    263 }
    264 
    265 void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode& ec)
    266 {
     247Settings& InternalSettings::settings() const
     248{
     249    ASSERT(m_page);
     250    return m_page->settings();
     251}
     252
     253ExceptionOr<void> InternalSettings::setTouchEventEmulationEnabled(bool enabled)
     254{
     255    if (!m_page)
     256        return Exception { INVALID_ACCESS_ERR };
    267257#if ENABLE(TOUCH_EVENTS)
    268     InternalSettingsGuardForSettings();
    269     settings()->setTouchEventEmulationEnabled(enabled);
     258    settings().setTouchEventEmulationEnabled(enabled);
    270259#else
    271260    UNUSED_PARAM(enabled);
    272     UNUSED_PARAM(ec);
    273 #endif
    274 }
    275 
    276 void InternalSettings::setStandardFontFamily(const String& family, const String& script, ExceptionCode& ec)
    277 {
    278     InternalSettingsGuardForSettings();
     261#endif
     262    return { };
     263}
     264
     265ExceptionOr<void> InternalSettings::setStandardFontFamily(const String& family, const String& script)
     266{
     267    if (!m_page)
     268        return Exception { INVALID_ACCESS_ERR };
    279269    UScriptCode code = scriptNameToCode(script);
    280270    if (code == USCRIPT_INVALID_CODE)
    281         return;
    282     m_backup.m_standardFontFamilies.add(code, settings()->standardFontFamily(code));
    283     settings()->setStandardFontFamily(family, code);
    284 }
    285 
    286 void InternalSettings::setSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
    287 {
    288     InternalSettingsGuardForSettings();
     271        return { };
     272    m_backup.m_standardFontFamilies.add(code, settings().standardFontFamily(code));
     273    settings().setStandardFontFamily(family, code);
     274    return { };
     275}
     276
     277ExceptionOr<void> InternalSettings::setSerifFontFamily(const String& family, const String& script)
     278{
     279    if (!m_page)
     280        return Exception { INVALID_ACCESS_ERR };
    289281    UScriptCode code = scriptNameToCode(script);
    290282    if (code == USCRIPT_INVALID_CODE)
    291         return;
    292     m_backup.m_serifFontFamilies.add(code, settings()->serifFontFamily(code));
    293     settings()->setSerifFontFamily(family, code);
    294 }
    295 
    296 void InternalSettings::setSansSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
    297 {
    298     InternalSettingsGuardForSettings();
     283        return { };
     284    m_backup.m_serifFontFamilies.add(code, settings().serifFontFamily(code));
     285    settings().setSerifFontFamily(family, code);
     286    return { };
     287}
     288
     289ExceptionOr<void> InternalSettings::setSansSerifFontFamily(const String& family, const String& script)
     290{
     291    if (!m_page)
     292        return Exception { INVALID_ACCESS_ERR };
    299293    UScriptCode code = scriptNameToCode(script);
    300294    if (code == USCRIPT_INVALID_CODE)
    301         return;
    302     m_backup.m_sansSerifFontFamilies.add(code, settings()->sansSerifFontFamily(code));
    303     settings()->setSansSerifFontFamily(family, code);
    304 }
    305 
    306 void InternalSettings::setFixedFontFamily(const String& family, const String& script, ExceptionCode& ec)
    307 {
    308     InternalSettingsGuardForSettings();
     295        return { };
     296    m_backup.m_sansSerifFontFamilies.add(code, settings().sansSerifFontFamily(code));
     297    settings().setSansSerifFontFamily(family, code);
     298    return { };
     299}
     300
     301ExceptionOr<void> InternalSettings::setFixedFontFamily(const String& family, const String& script)
     302{
     303    if (!m_page)
     304        return Exception { INVALID_ACCESS_ERR };
    309305    UScriptCode code = scriptNameToCode(script);
    310306    if (code == USCRIPT_INVALID_CODE)
    311         return;
    312     m_backup.m_fixedFontFamilies.add(code, settings()->fixedFontFamily(code));
    313     settings()->setFixedFontFamily(family, code);
    314 }
    315 
    316 void InternalSettings::setCursiveFontFamily(const String& family, const String& script, ExceptionCode& ec)
    317 {
    318     InternalSettingsGuardForSettings();
     307        return { };
     308    m_backup.m_fixedFontFamilies.add(code, settings().fixedFontFamily(code));
     309    settings().setFixedFontFamily(family, code);
     310    return { };
     311}
     312
     313ExceptionOr<void> InternalSettings::setCursiveFontFamily(const String& family, const String& script)
     314{
     315    if (!m_page)
     316        return Exception { INVALID_ACCESS_ERR };
    319317    UScriptCode code = scriptNameToCode(script);
    320318    if (code == USCRIPT_INVALID_CODE)
    321         return;
    322     m_backup.m_cursiveFontFamilies.add(code, settings()->cursiveFontFamily(code));
    323     settings()->setCursiveFontFamily(family, code);
    324 }
    325 
    326 void InternalSettings::setFantasyFontFamily(const String& family, const String& script, ExceptionCode& ec)
    327 {
    328     InternalSettingsGuardForSettings();
     319        return { };
     320    m_backup.m_cursiveFontFamilies.add(code, settings().cursiveFontFamily(code));
     321    settings().setCursiveFontFamily(family, code);
     322    return { };
     323}
     324
     325ExceptionOr<void> InternalSettings::setFantasyFontFamily(const String& family, const String& script)
     326{
     327    if (!m_page)
     328        return Exception { INVALID_ACCESS_ERR };
    329329    UScriptCode code = scriptNameToCode(script);
    330330    if (code == USCRIPT_INVALID_CODE)
    331         return;
    332     m_backup.m_fantasyFontFamilies.add(code, settings()->fantasyFontFamily(code));
    333     settings()->setFantasyFontFamily(family, code);
    334 }
    335 
    336 void InternalSettings::setPictographFontFamily(const String& family, const String& script, ExceptionCode& ec)
    337 {
    338     InternalSettingsGuardForSettings();
     331        return { };
     332    m_backup.m_fantasyFontFamilies.add(code, settings().fantasyFontFamily(code));
     333    settings().setFantasyFontFamily(family, code);
     334    return { };
     335}
     336
     337ExceptionOr<void> InternalSettings::setPictographFontFamily(const String& family, const String& script)
     338{
     339    if (!m_page)
     340        return Exception { INVALID_ACCESS_ERR };
    339341    UScriptCode code = scriptNameToCode(script);
    340342    if (code == USCRIPT_INVALID_CODE)
    341         return;
    342     m_backup.m_pictographFontFamilies.add(code, settings()->pictographFontFamily(code));
    343     settings()->setPictographFontFamily(family, code);
    344 }
    345 
    346 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec)
    347 {
     343        return { };
     344    m_backup.m_pictographFontFamilies.add(code, settings().pictographFontFamily(code));
     345    settings().setPictographFontFamily(family, code);
     346    return { };
     347}
     348
     349ExceptionOr<void> InternalSettings::setTextAutosizingEnabled(bool enabled)
     350{
     351    if (!m_page)
     352        return Exception { INVALID_ACCESS_ERR };
    348353#if ENABLE(TEXT_AUTOSIZING)
    349     InternalSettingsGuardForSettings();
    350     settings()->setTextAutosizingEnabled(enabled);
     354    settings().setTextAutosizingEnabled(enabled);
    351355#else
    352356    UNUSED_PARAM(enabled);
    353     UNUSED_PARAM(ec);
    354 #endif
    355 }
    356 
    357 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode& ec)
    358 {
     357#endif
     358    return { };
     359}
     360
     361ExceptionOr<void> InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height)
     362{
     363    if (!m_page)
     364        return Exception { INVALID_ACCESS_ERR };
    359365#if ENABLE(TEXT_AUTOSIZING)
    360     InternalSettingsGuardForSettings();
    361     settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
     366    settings().setTextAutosizingWindowSizeOverride(IntSize(width, height));
    362367#else
    363368    UNUSED_PARAM(width);
    364369    UNUSED_PARAM(height);
    365     UNUSED_PARAM(ec);
    366 #endif
    367 }
    368 
    369 void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCode& ec)
    370 {
    371     InternalSettingsGuardForSettings();
    372     settings()->setMediaTypeOverride(mediaType);
    373 }
    374 
    375 void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
    376 {
    377     InternalSettingsGuardForSettings();
     370#endif
     371    return { };
     372}
     373
     374ExceptionOr<void> InternalSettings::setMediaTypeOverride(const String& mediaType)
     375{
     376    if (!m_page)
     377        return Exception { INVALID_ACCESS_ERR };
     378    settings().setMediaTypeOverride(mediaType);
     379    return { };
     380}
     381
     382ExceptionOr<void> InternalSettings::setCanStartMedia(bool enabled)
     383{
     384    if (!m_page)
     385        return Exception { INVALID_ACCESS_ERR };
    378386    m_page->setCanStartMedia(enabled);
    379 }
    380 
    381 void InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows)
    382 {
     387    return { };
     388}
     389
     390ExceptionOr<void> InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows)
     391{
     392    if (!m_page)
     393        return Exception { INVALID_ACCESS_ERR };
    383394#if ENABLE(WIRELESS_PLAYBACK_TARGET)
    384     m_page->settings().setAllowsAirPlayForMediaPlayback(allows);
     395    settings().setAllowsAirPlayForMediaPlayback(allows);
    385396#else
    386397    UNUSED_PARAM(allows);
    387398#endif
    388 }
    389 
    390 void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionCode& ec)
    391 {
    392     InternalSettingsGuardForSettings();
     399    return { };
     400}
     401
     402ExceptionOr<void> InternalSettings::setEditingBehavior(const String& editingBehavior)
     403{
     404    if (!m_page)
     405        return Exception { INVALID_ACCESS_ERR };
    393406    if (equalLettersIgnoringASCIICase(editingBehavior, "win"))
    394         settings()->setEditingBehaviorType(EditingWindowsBehavior);
     407        settings().setEditingBehaviorType(EditingWindowsBehavior);
    395408    else if (equalLettersIgnoringASCIICase(editingBehavior, "mac"))
    396         settings()->setEditingBehaviorType(EditingMacBehavior);
     409        settings().setEditingBehaviorType(EditingMacBehavior);
    397410    else if (equalLettersIgnoringASCIICase(editingBehavior, "unix"))
    398         settings()->setEditingBehaviorType(EditingUnixBehavior);
     411        settings().setEditingBehaviorType(EditingUnixBehavior);
    399412    else if (equalLettersIgnoringASCIICase(editingBehavior, "ios"))
    400         settings()->setEditingBehaviorType(EditingIOSBehavior);
     413        settings().setEditingBehaviorType(EditingIOSBehavior);
    401414    else
    402         ec = SYNTAX_ERR;
    403 }
    404 
    405 void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec)
    406 {
    407     InternalSettingsGuardForSettings();
    408 
     415        return Exception { SYNTAX_ERR };
     416    return { };
     417}
     418
     419ExceptionOr<void> InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled)
     420{
     421    if (!m_page)
     422        return Exception { INVALID_ACCESS_ERR };
    409423#if ENABLE(VIDEO_TRACK)
    410     if (!page())
    411         return;
    412 
    413     auto& captionPreferences = page()->group().captionPreferences();
     424    auto& captionPreferences = m_page->group().captionPreferences();
    414425    if (equalLettersIgnoringASCIICase(kind, "subtitles"))
    415426        captionPreferences.setUserPrefersSubtitles(enabled);
     
    419430        captionPreferences.setUserPrefersTextDescriptions(enabled);
    420431    else
    421         ec = SYNTAX_ERR;
     432        return Exception { SYNTAX_ERR };
    422433#else
    423434    UNUSED_PARAM(kind);
    424435    UNUSED_PARAM(enabled);
    425436#endif
    426 }
    427 
    428 bool InternalSettings::shouldDisplayTrackKind(const String& kind, ExceptionCode& ec)
    429 {
    430     InternalSettingsGuardForSettingsReturn(false);
    431 
     437    return { };
     438}
     439
     440ExceptionOr<bool> InternalSettings::shouldDisplayTrackKind(const String& kind)
     441{
     442    if (!m_page)
     443        return Exception { INVALID_ACCESS_ERR };
    432444#if ENABLE(VIDEO_TRACK)
    433     if (!page())
    434         return false;
    435 
    436     auto& captionPreferences = page()->group().captionPreferences();
     445    auto& captionPreferences = m_page->group().captionPreferences();
    437446    if (equalLettersIgnoringASCIICase(kind, "subtitles"))
    438447        return captionPreferences.userPrefersSubtitles();
     
    442451        return captionPreferences.userPrefersTextDescriptions();
    443452
    444     ec = SYNTAX_ERR;
    445     return false;
     453    return Exception { SYNTAX_ERR };
    446454#else
    447455    UNUSED_PARAM(kind);
     
    450458}
    451459
    452 void InternalSettings::setStorageBlockingPolicy(const String& mode, ExceptionCode& ec)
    453 {
    454     InternalSettingsGuardForSettings();
    455 
     460ExceptionOr<void> InternalSettings::setStorageBlockingPolicy(const String& mode)
     461{
     462    if (!m_page)
     463        return Exception { INVALID_ACCESS_ERR };
    456464    if (mode == "AllowAll")
    457         settings()->setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
     465        settings().setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
    458466    else if (mode == "BlockThirdParty")
    459         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
     467        settings().setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
    460468    else if (mode == "BlockAll")
    461         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
     469        settings().setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
    462470    else
    463         ec = SYNTAX_ERR;
     471        return Exception { SYNTAX_ERR };
     472    return { };
    464473}
    465474
     
    469478}
    470479
    471 void InternalSettings::setPreferMIMETypeForImages(bool preferMIMETypeForImages, ExceptionCode &ec)
    472 {
    473     InternalSettingsGuardForSettings();
    474     settings()->setPreferMIMETypeForImages(preferMIMETypeForImages);
    475 }
    476 
    477 void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
    478 {
    479     InternalSettingsGuardForSettings();
    480     settings()->setImagesEnabled(enabled);
    481 }
    482 
    483 void InternalSettings::setPDFImageCachingPolicy(const String& policy, ExceptionCode& ec)
    484 {
    485     InternalSettingsGuardForSettings();
     480ExceptionOr<void> InternalSettings::setPreferMIMETypeForImages(bool preferMIMETypeForImages)
     481{
     482    if (!m_page)
     483        return Exception { INVALID_ACCESS_ERR };
     484    settings().setPreferMIMETypeForImages(preferMIMETypeForImages);
     485    return { };
     486}
     487
     488ExceptionOr<void> InternalSettings::setImagesEnabled(bool enabled)
     489{
     490    if (!m_page)
     491        return Exception { INVALID_ACCESS_ERR };
     492    settings().setImagesEnabled(enabled);
     493    return { };
     494}
     495
     496ExceptionOr<void> InternalSettings::setPDFImageCachingPolicy(const String& policy)
     497{
     498    if (!m_page)
     499        return Exception { INVALID_ACCESS_ERR };
    486500    if (equalLettersIgnoringASCIICase(policy, "disabled"))
    487         settings()->setPdfImageCachingPolicy(PDFImageCachingDisabled);
     501        settings().setPdfImageCachingPolicy(PDFImageCachingDisabled);
    488502    else if (equalLettersIgnoringASCIICase(policy, "belowmemorylimit"))
    489         settings()->setPdfImageCachingPolicy(PDFImageCachingBelowMemoryLimit);
     503        settings().setPdfImageCachingPolicy(PDFImageCachingBelowMemoryLimit);
    490504    else if (equalLettersIgnoringASCIICase(policy, "clipboundsonly"))
    491         settings()->setPdfImageCachingPolicy(PDFImageCachingClipBoundsOnly);
     505        settings().setPdfImageCachingPolicy(PDFImageCachingClipBoundsOnly);
    492506    else if (equalLettersIgnoringASCIICase(policy, "enabled"))
    493         settings()->setPdfImageCachingPolicy(PDFImageCachingEnabled);
     507        settings().setPdfImageCachingPolicy(PDFImageCachingEnabled);
    494508    else
    495         ec = SYNTAX_ERR;
    496 }
    497 
    498 void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec)
    499 {
    500     InternalSettingsGuardForSettings();
    501     settings()->setMinimumDOMTimerInterval(std::chrono::milliseconds((std::chrono::milliseconds::rep)(intervalInSeconds * 1000)));
    502 }
    503 
    504 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode& ec)
    505 {
    506     InternalSettingsGuardForSettings();
    507     settings()->setDefaultVideoPosterURL(url);
    508 }
    509 
    510 void InternalSettings::setForcePendingWebGLPolicy(bool forced, ExceptionCode& ec)
    511 {
    512     InternalSettingsGuardForSettings();
    513     settings()->setForcePendingWebGLPolicy(forced);
    514 }
    515 
    516 void InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode& ec)
    517 {
    518     InternalSettingsGuardForSettings();
    519     settings()->setTimeWithoutMouseMovementBeforeHidingControls(time);
    520 }
    521 
    522 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec)
    523 {
    524     InternalSettingsGuardForSettings();
    525     settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
    526 }
    527 
    528 void InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode& ec)
    529 {
    530     InternalSettingsGuardForSettings();
    531     settings()->setAutoscrollForDragAndDropEnabled(enabled);
    532 }
    533 
    534 void InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode& ec)
    535 {
    536     InternalSettingsGuardForSettings();
    537     settings()->setFontFallbackPrefersPictographs(preferPictographs);
    538 }
    539 
    540 void InternalSettings::setWebFontsAlwaysFallBack(bool enable, ExceptionCode& ec)
    541 {
    542     InternalSettingsGuardForSettings();
    543     settings()->setWebFontsAlwaysFallBack(enable);
    544 }
    545 
    546 void InternalSettings::setQuickTimePluginReplacementEnabled(bool enabled, ExceptionCode& ec)
    547 {
    548     InternalSettingsGuardForSettings();
    549     settings()->setQuickTimePluginReplacementEnabled(enabled);
    550 }
    551 
    552 void InternalSettings::setYouTubeFlashPluginReplacementEnabled(bool enabled, ExceptionCode& ec)
    553 {
    554     InternalSettingsGuardForSettings();
    555     settings()->setYouTubeFlashPluginReplacementEnabled(enabled);
    556 }
    557 
    558 void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec)
    559 {
    560     InternalSettingsGuardForSettings();
    561     settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
    562 }
    563 
    564 void InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode& ec)
    565 {
    566     InternalSettingsGuardForSettings();
    567     settings()->setShouldConvertPositionStyleOnCopy(convert);
    568 }
    569 
    570 void InternalSettings::setScrollingTreeIncludesFrames(bool enabled, ExceptionCode& ec)
    571 {
    572     InternalSettingsGuardForSettings();
    573     settings()->setScrollingTreeIncludesFrames(enabled);
    574 }
    575 
    576 void InternalSettings::setAllowsInlineMediaPlayback(bool allows, ExceptionCode& ec)
    577 {
    578     InternalSettingsGuardForSettings();
    579     settings()->setAllowsInlineMediaPlayback(allows);
    580 }
    581 
    582 void InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen(bool allows, ExceptionCode& ec)
    583 {
    584     InternalSettingsGuardForSettings();
    585     settings()->setAllowsInlineMediaPlaybackAfterFullscreen(allows);
    586 }
    587 
    588 void InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires, ExceptionCode& ec)
    589 {
    590     InternalSettingsGuardForSettings();
    591     settings()->setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
    592 }
    593 
    594 void InternalSettings::setIndexedDBWorkersEnabled(bool enabled, ExceptionCode&)
     509        return Exception { SYNTAX_ERR };
     510    return { };
     511}
     512
     513ExceptionOr<void> InternalSettings::setMinimumTimerInterval(double intervalInSeconds)
     514{
     515    if (!m_page)
     516        return Exception { INVALID_ACCESS_ERR };
     517    settings().setMinimumDOMTimerInterval(std::chrono::milliseconds((std::chrono::milliseconds::rep)(intervalInSeconds * 1000)));
     518    return { };
     519}
     520
     521ExceptionOr<void> InternalSettings::setDefaultVideoPosterURL(const String& url)
     522{
     523    if (!m_page)
     524        return Exception { INVALID_ACCESS_ERR };
     525    settings().setDefaultVideoPosterURL(url);
     526    return { };
     527}
     528
     529ExceptionOr<void> InternalSettings::setForcePendingWebGLPolicy(bool forced)
     530{
     531    if (!m_page)
     532        return Exception { INVALID_ACCESS_ERR };
     533    settings().setForcePendingWebGLPolicy(forced);
     534    return { };
     535}
     536
     537ExceptionOr<void> InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time)
     538{
     539    if (!m_page)
     540        return Exception { INVALID_ACCESS_ERR };
     541    settings().setTimeWithoutMouseMovementBeforeHidingControls(time);
     542    return { };
     543}
     544
     545ExceptionOr<void> InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled)
     546{
     547    if (!m_page)
     548        return Exception { INVALID_ACCESS_ERR };
     549    settings().setUseLegacyBackgroundSizeShorthandBehavior(enabled);
     550    return { };
     551}
     552
     553ExceptionOr<void> InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled)
     554{
     555    if (!m_page)
     556        return Exception { INVALID_ACCESS_ERR };
     557    settings().setAutoscrollForDragAndDropEnabled(enabled);
     558    return { };
     559}
     560
     561ExceptionOr<void> InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs)
     562{
     563    if (!m_page)
     564        return Exception { INVALID_ACCESS_ERR };
     565    settings().setFontFallbackPrefersPictographs(preferPictographs);
     566    return { };
     567}
     568
     569ExceptionOr<void> InternalSettings::setWebFontsAlwaysFallBack(bool enable)
     570{
     571    if (!m_page)
     572        return Exception { INVALID_ACCESS_ERR };
     573    settings().setWebFontsAlwaysFallBack(enable);
     574    return { };
     575}
     576
     577ExceptionOr<void> InternalSettings::setQuickTimePluginReplacementEnabled(bool enabled)
     578{
     579    if (!m_page)
     580        return Exception { INVALID_ACCESS_ERR };
     581    settings().setQuickTimePluginReplacementEnabled(enabled);
     582    return { };
     583}
     584
     585ExceptionOr<void> InternalSettings::setYouTubeFlashPluginReplacementEnabled(bool enabled)
     586{
     587    if (!m_page)
     588        return Exception { INVALID_ACCESS_ERR };
     589    settings().setYouTubeFlashPluginReplacementEnabled(enabled);
     590    return { };
     591}
     592
     593ExceptionOr<void> InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground)
     594{
     595    if (!m_page)
     596        return Exception { INVALID_ACCESS_ERR };
     597    settings().setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
     598    return { };
     599}
     600
     601ExceptionOr<void> InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert)
     602{
     603    if (!m_page)
     604        return Exception { INVALID_ACCESS_ERR };
     605    settings().setShouldConvertPositionStyleOnCopy(convert);
     606    return { };
     607}
     608
     609ExceptionOr<void> InternalSettings::setScrollingTreeIncludesFrames(bool enabled)
     610{
     611    if (!m_page)
     612        return Exception { INVALID_ACCESS_ERR };
     613    settings().setScrollingTreeIncludesFrames(enabled);
     614    return { };
     615}
     616
     617ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlayback(bool allows)
     618{
     619    if (!m_page)
     620        return Exception { INVALID_ACCESS_ERR };
     621    settings().setAllowsInlineMediaPlayback(allows);
     622    return { };
     623}
     624
     625ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen(bool allows)
     626{
     627    if (!m_page)
     628        return Exception { INVALID_ACCESS_ERR };
     629    settings().setAllowsInlineMediaPlaybackAfterFullscreen(allows);
     630    return { };
     631}
     632
     633ExceptionOr<void> InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires)
     634{
     635    if (!m_page)
     636        return Exception { INVALID_ACCESS_ERR };
     637    settings().setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
     638    return { };
     639}
     640
     641void InternalSettings::setIndexedDBWorkersEnabled(bool enabled)
    595642{
    596643#if ENABLE(INDEXED_DATABASE_IN_WORKERS)
     
    601648}
    602649
    603 String InternalSettings::userInterfaceDirectionPolicy(ExceptionCode& ec)
    604 {
    605     InternalSettingsGuardForSettingsReturn("");
    606     switch (settings()->userInterfaceDirectionPolicy()) {
     650ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy()
     651{
     652    if (!m_page)
     653        return Exception { INVALID_ACCESS_ERR };
     654    switch (settings().userInterfaceDirectionPolicy()) {
    607655    case UserInterfaceDirectionPolicy::Content:
    608         return ASCIILiteral("Content");
     656        return String { ASCIILiteral { "Content" } };
    609657    case UserInterfaceDirectionPolicy::System:
    610         return ASCIILiteral("View");
     658        return String { ASCIILiteral { "View" } };
    611659    }
    612660    ASSERT_NOT_REACHED();
    613     return String();
    614 }
    615 
    616 void InternalSettings::setUserInterfaceDirectionPolicy(const String& policy, ExceptionCode& ec)
    617 {
    618     InternalSettingsGuardForSettings();
     661    return Exception { INVALID_ACCESS_ERR };
     662}
     663
     664ExceptionOr<void> InternalSettings::setUserInterfaceDirectionPolicy(const String& policy)
     665{
     666    if (!m_page)
     667        return Exception { INVALID_ACCESS_ERR };
    619668    if (equalLettersIgnoringASCIICase(policy, "content")) {
    620         settings()->setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::Content);
    621         return;
     669        settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::Content);
     670        return { };
    622671    }
    623672    if (equalLettersIgnoringASCIICase(policy, "view")) {
    624         settings()->setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::System);
    625         return;
     673        settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::System);
     674        return { };
    626675    }
    627     ec = INVALID_ACCESS_ERR;
    628 }
    629 
    630 String InternalSettings::systemLayoutDirection(ExceptionCode& ec)
    631 {
    632     InternalSettingsGuardForSettingsReturn("");
    633     switch (settings()->systemLayoutDirection()) {
     676    return Exception { INVALID_ACCESS_ERR };
     677}
     678
     679ExceptionOr<String> InternalSettings::systemLayoutDirection()
     680{
     681    if (!m_page)
     682        return Exception { INVALID_ACCESS_ERR };
     683    switch (settings().systemLayoutDirection()) {
    634684    case LTR:
    635         return ASCIILiteral("LTR");
     685        return String { ASCIILiteral { "LTR" } };
    636686    case RTL:
    637         return ASCIILiteral("RTL");
     687        return String { ASCIILiteral { "RTL" } };
    638688    }
    639689    ASSERT_NOT_REACHED();
    640     return String();
    641 }
    642 
    643 void InternalSettings::setSystemLayoutDirection(const String& direction, ExceptionCode& ec)
    644 {
    645     InternalSettingsGuardForSettings();
     690    return Exception { INVALID_ACCESS_ERR };
     691}
     692
     693ExceptionOr<void> InternalSettings::setSystemLayoutDirection(const String& direction)
     694{
     695    if (!m_page)
     696        return Exception { INVALID_ACCESS_ERR };
    646697    if (equalLettersIgnoringASCIICase(direction, "ltr")) {
    647         settings()->setSystemLayoutDirection(LTR);
    648         return;
     698        settings().setSystemLayoutDirection(LTR);
     699        return { };
    649700    }
    650701    if (equalLettersIgnoringASCIICase(direction, "rtl")) {
    651         settings()->setSystemLayoutDirection(RTL);
    652         return;
     702        settings().setSystemLayoutDirection(RTL);
     703        return { };
    653704    }
    654     ec = INVALID_ACCESS_ERR;
     705    return Exception { INVALID_ACCESS_ERR };
    655706}
    656707
     
    660711}
    661712
    662 bool InternalSettings::variationFontsEnabled(ExceptionCode& ec)
    663 {
     713ExceptionOr<bool> InternalSettings::variationFontsEnabled()
     714{
     715    if (!m_page)
     716        return Exception { INVALID_ACCESS_ERR };
    664717#if ENABLE(VARIATION_FONTS)
    665     InternalSettingsGuardForSettingsReturn(true);
    666     return settings()->variationFontsEnabled();
    667 #else
    668     UNUSED_PARAM(ec);
     718    return settings().variationFontsEnabled();
     719#else
    669720    return false;
    670721#endif
    671722}
    672723
    673 void InternalSettings::setVariationFontsEnabled(bool enabled, ExceptionCode& ec)
    674 {
     724ExceptionOr<void> InternalSettings::setVariationFontsEnabled(bool enabled)
     725{
     726    if (!m_page)
     727        return Exception { INVALID_ACCESS_ERR };
    675728#if ENABLE(VARIATION_FONTS)
    676     InternalSettingsGuardForSettings();
    677     settings()->setVariationFontsEnabled(enabled);
     729    settings().setVariationFontsEnabled(enabled);
    678730#else
    679731    UNUSED_PARAM(enabled);
    680     UNUSED_PARAM(ec);
    681 #endif
     732#endif
     733    return { };
    682734}
    683735
    684736InternalSettings::ForcedPrefersReducedMotionValue InternalSettings::forcedPrefersReducedMotionValue() const
    685737{
    686     switch (settings()->forcedPrefersReducedMotionValue()) {
     738    switch (settings().forcedPrefersReducedMotionValue()) {
    687739    case Settings::ForcedPrefersReducedMotionValue::System:
    688740        return InternalSettings::ForcedPrefersReducedMotionValue::System;
     
    701753    switch (value) {
    702754    case InternalSettings::ForcedPrefersReducedMotionValue::System:
    703         settings()->setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::System);
    704         break;
     755        settings().setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::System);
     756        return;
    705757    case InternalSettings::ForcedPrefersReducedMotionValue::On:
    706         settings()->setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::On);
    707         break;
     758        settings().setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::On);
     759        return;
    708760    case InternalSettings::ForcedPrefersReducedMotionValue::Off:
    709         settings()->setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::Off);
    710         break;
     761        settings().setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::Off);
     762        return;
    711763    }
    712 }
    713 
    714 // If you add to this list, make sure that you update the Backup class for test reproducability!
    715 
    716 }
     764
     765    ASSERT_NOT_REACHED();
     766}
     767
     768// If you add to this class, make sure that you update the Backup class for test reproducability!
     769
     770}
  • trunk/Source/WebCore/testing/InternalSettings.h

    r207173 r207521  
    3131
    3232#include "EditingBehaviorTypes.h"
     33#include "ExceptionOr.h"
    3334#include "FontGenericFamilies.h"
    3435#include "IntSize.h"
     
    4041namespace WebCore {
    4142
    42 typedef int ExceptionCode;
    43 
    44 class Frame;
    45 class Document;
    4643class Page;
    4744class Settings;
     
    4946class InternalSettings : public InternalSettingsGenerated {
    5047public:
     48    static Ref<InternalSettings> create(Page*);
     49    static InternalSettings* from(Page*);
     50    void hostDestroyed();
     51    void resetToConsistentState();
     52
     53    ExceptionOr<void> setUsesOverlayScrollbars(bool);
     54    ExceptionOr<void> setTouchEventEmulationEnabled(bool);
     55    ExceptionOr<void> setStandardFontFamily(const String& family, const String& script);
     56    ExceptionOr<void> setSerifFontFamily(const String& family, const String& script);
     57    ExceptionOr<void> setSansSerifFontFamily(const String& family, const String& script);
     58    ExceptionOr<void> setFixedFontFamily(const String& family, const String& script);
     59    ExceptionOr<void> setCursiveFontFamily(const String& family, const String& script);
     60    ExceptionOr<void> setFantasyFontFamily(const String& family, const String& script);
     61    ExceptionOr<void> setPictographFontFamily(const String& family, const String& script);
     62    ExceptionOr<void> setTextAutosizingEnabled(bool);
     63    ExceptionOr<void> setTextAutosizingWindowSizeOverride(int width, int height);
     64    ExceptionOr<void> setTextAutosizingFontScaleFactor(float);
     65    ExceptionOr<void> setMediaTypeOverride(const String&);
     66    ExceptionOr<void> setCanStartMedia(bool);
     67    ExceptionOr<void> setAllowsAirPlayForMediaPlayback(bool);
     68    ExceptionOr<void> setEditingBehavior(const String&);
     69    ExceptionOr<void> setPreferMIMETypeForImages(bool);
     70    ExceptionOr<void> setPDFImageCachingPolicy(const String&);
     71    ExceptionOr<void> setShouldDisplayTrackKind(const String& kind, bool enabled);
     72    ExceptionOr<bool> shouldDisplayTrackKind(const String& kind);
     73    ExceptionOr<void> setStorageBlockingPolicy(const String&);
     74    static void setLangAttributeAwareFormControlUIEnabled(bool);
     75    ExceptionOr<void> setImagesEnabled(bool);
     76    ExceptionOr<void> setMinimumTimerInterval(double intervalInSeconds);
     77    ExceptionOr<void> setDefaultVideoPosterURL(const String&);
     78    ExceptionOr<void> setForcePendingWebGLPolicy(bool);
     79    ExceptionOr<void> setTimeWithoutMouseMovementBeforeHidingControls(double);
     80    ExceptionOr<void> setUseLegacyBackgroundSizeShorthandBehavior(bool);
     81    ExceptionOr<void> setAutoscrollForDragAndDropEnabled(bool);
     82    ExceptionOr<void> setFontFallbackPrefersPictographs(bool);
     83    ExceptionOr<void> setWebFontsAlwaysFallBack(bool);
     84    ExceptionOr<void> setQuickTimePluginReplacementEnabled(bool);
     85    ExceptionOr<void> setYouTubeFlashPluginReplacementEnabled(bool);
     86    ExceptionOr<void> setBackgroundShouldExtendBeyondPage(bool);
     87    ExceptionOr<void> setShouldConvertPositionStyleOnCopy(bool);
     88    ExceptionOr<void> setScrollingTreeIncludesFrames(bool);
     89    ExceptionOr<void> setAllowsInlineMediaPlayback(bool);
     90    ExceptionOr<void> setAllowsInlineMediaPlaybackAfterFullscreen(bool);
     91    ExceptionOr<void> setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool);
     92    static void setIndexedDBWorkersEnabled(bool);
     93    ExceptionOr<String> userInterfaceDirectionPolicy();
     94    ExceptionOr<void> setUserInterfaceDirectionPolicy(const String&);
     95    ExceptionOr<String> systemLayoutDirection();
     96    ExceptionOr<void> setSystemLayoutDirection(const String&);
     97    ExceptionOr<bool> variationFontsEnabled();
     98    ExceptionOr<void> setVariationFontsEnabled(bool);
     99
     100    enum class ForcedPrefersReducedMotionValue { System, On, Off };
     101    ForcedPrefersReducedMotionValue forcedPrefersReducedMotionValue() const;
     102    void setForcedPrefersReducedMotionValue(ForcedPrefersReducedMotionValue);
     103
     104    static void setAllowsAnySSLCertificate(bool);
     105
     106private:
     107    explicit InternalSettings(Page*);
     108
     109    Settings& settings() const;
     110    static const char* supplementName();
     111
    51112    class Backup {
    52113    public:
     
    119180    };
    120181
    121     static Ref<InternalSettings> create(Page* page)
    122     {
    123         return adoptRef(*new InternalSettings(page));
    124     }
    125     static InternalSettings* from(Page*);
    126     void hostDestroyed() { m_page = 0; }
    127 
    128     virtual ~InternalSettings();
    129     void resetToConsistentState();
    130 
    131     void setUsesOverlayScrollbars(bool, ExceptionCode&);
    132     void setTouchEventEmulationEnabled(bool, ExceptionCode&);
    133     void setStandardFontFamily(const String& family, const String& script, ExceptionCode&);
    134     void setSerifFontFamily(const String& family, const String& script, ExceptionCode&);
    135     void setSansSerifFontFamily(const String& family, const String& script, ExceptionCode&);
    136     void setFixedFontFamily(const String& family, const String& script, ExceptionCode&);
    137     void setCursiveFontFamily(const String& family, const String& script, ExceptionCode&);
    138     void setFantasyFontFamily(const String& family, const String& script, ExceptionCode&);
    139     void setPictographFontFamily(const String& family, const String& script, ExceptionCode&);
    140     void setTextAutosizingEnabled(bool enabled, ExceptionCode&);
    141     void setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode&);
    142     void setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode&);
    143     void setMediaTypeOverride(const String& mediaType, ExceptionCode&);
    144     void setCanStartMedia(bool, ExceptionCode&);
    145     void setAllowsAirPlayForMediaPlayback(bool);
    146     void setEditingBehavior(const String&, ExceptionCode&);
    147     void setPreferMIMETypeForImages(bool, ExceptionCode&);
    148     void setPDFImageCachingPolicy(const String&, ExceptionCode&);
    149     void setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode&);
    150     bool shouldDisplayTrackKind(const String& kind, ExceptionCode&);
    151     void setStorageBlockingPolicy(const String&, ExceptionCode&);
    152     void setLangAttributeAwareFormControlUIEnabled(bool);
    153     void setImagesEnabled(bool, ExceptionCode&);
    154     void setMinimumTimerInterval(double intervalInSeconds, ExceptionCode&);
    155     void setDefaultVideoPosterURL(const String& url, ExceptionCode&);
    156     void setForcePendingWebGLPolicy(bool, ExceptionCode&);
    157     void setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode&);
    158     void setUseLegacyBackgroundSizeShorthandBehavior(bool, ExceptionCode&);
    159     void setAutoscrollForDragAndDropEnabled(bool, ExceptionCode&);
    160     void setFontFallbackPrefersPictographs(bool, ExceptionCode&);
    161     void setWebFontsAlwaysFallBack(bool, ExceptionCode&);
    162     void setQuickTimePluginReplacementEnabled(bool, ExceptionCode&);
    163     void setYouTubeFlashPluginReplacementEnabled(bool, ExceptionCode&);
    164     void setBackgroundShouldExtendBeyondPage(bool, ExceptionCode&);
    165     void setShouldConvertPositionStyleOnCopy(bool, ExceptionCode&);
    166     void setScrollingTreeIncludesFrames(bool, ExceptionCode&);
    167     void setAllowsInlineMediaPlayback(bool, ExceptionCode&);
    168     void setAllowsInlineMediaPlaybackAfterFullscreen(bool, ExceptionCode&);
    169     void setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool, ExceptionCode&);
    170     void setIndexedDBWorkersEnabled(bool, ExceptionCode&);
    171     String userInterfaceDirectionPolicy(ExceptionCode&);
    172     void setUserInterfaceDirectionPolicy(const String& policy, ExceptionCode&);
    173     String systemLayoutDirection(ExceptionCode&);
    174     void setSystemLayoutDirection(const String& direction, ExceptionCode&);
    175     bool variationFontsEnabled(ExceptionCode&);
    176     void setVariationFontsEnabled(bool, ExceptionCode&);
    177 
    178     enum class ForcedPrefersReducedMotionValue { System, On, Off };
    179     ForcedPrefersReducedMotionValue forcedPrefersReducedMotionValue() const;
    180     void setForcedPrefersReducedMotionValue(ForcedPrefersReducedMotionValue);
    181 
    182     static void setAllowsAnySSLCertificate(bool);
    183 
    184 private:
    185     explicit InternalSettings(Page*);
    186 
    187     Settings* settings() const;
    188     Page* page() const { return m_page; }
    189     static const char* supplementName();
    190 
    191182    Page* m_page;
    192183    Backup m_backup;
  • trunk/Source/WebCore/testing/InternalSettings.idl

    r207173 r207521  
    3232    ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
    3333] interface InternalSettings : InternalSettingsGenerated {
    34     [MayThrowLegacyException] void setTouchEventEmulationEnabled(boolean enabled);
     34    [MayThrowException] void setTouchEventEmulationEnabled(boolean enabled);
    3535
    3636    // Fonts, text
    37     [MayThrowLegacyException] void setStandardFontFamily(DOMString family, DOMString script);
    38     [MayThrowLegacyException] void setSerifFontFamily(DOMString family, DOMString script);
    39     [MayThrowLegacyException] void setSansSerifFontFamily(DOMString family, DOMString script);
    40     [MayThrowLegacyException] void setFixedFontFamily(DOMString family, DOMString script);
    41     [MayThrowLegacyException] void setCursiveFontFamily(DOMString family, DOMString script);
    42     [MayThrowLegacyException] void setFantasyFontFamily(DOMString family, DOMString script);
    43     [MayThrowLegacyException] void setPictographFontFamily(DOMString family, DOMString script);
    44     [MayThrowLegacyException] void setFontFallbackPrefersPictographs(boolean preferPictographs);
    45     [MayThrowLegacyException] void setWebFontsAlwaysFallBack(boolean enable);
     37    [MayThrowException] void setStandardFontFamily(DOMString family, DOMString script);
     38    [MayThrowException] void setSerifFontFamily(DOMString family, DOMString script);
     39    [MayThrowException] void setSansSerifFontFamily(DOMString family, DOMString script);
     40    [MayThrowException] void setFixedFontFamily(DOMString family, DOMString script);
     41    [MayThrowException] void setCursiveFontFamily(DOMString family, DOMString script);
     42    [MayThrowException] void setFantasyFontFamily(DOMString family, DOMString script);
     43    [MayThrowException] void setPictographFontFamily(DOMString family, DOMString script);
     44    [MayThrowException] void setFontFallbackPrefersPictographs(boolean preferPictographs);
     45    [MayThrowException] void setWebFontsAlwaysFallBack(boolean enable);
    4646
    47     [MayThrowLegacyException] void setTextAutosizingEnabled(boolean enabled);
    48     [MayThrowLegacyException] void setTextAutosizingWindowSizeOverride(long width, long height);
     47    [MayThrowException] void setTextAutosizingEnabled(boolean enabled);
     48    [MayThrowException] void setTextAutosizingWindowSizeOverride(long width, long height);
    4949
    5050    // Media
    51     [MayThrowLegacyException] void setCanStartMedia(boolean enabled);
    52     [Conditional=VIDEO_TRACK, MayThrowLegacyException] void setShouldDisplayTrackKind(DOMString kind, boolean enabled);
    53     [Conditional=VIDEO_TRACK, MayThrowLegacyException] boolean shouldDisplayTrackKind(DOMString trackKind);
    54     [MayThrowLegacyException] void setDefaultVideoPosterURL(DOMString poster);
    55     [MayThrowLegacyException] void setTimeWithoutMouseMovementBeforeHidingControls(unrestricted double time);
    56     [MayThrowLegacyException] void setMediaTypeOverride(DOMString mediaTypeOverride);
     51    [MayThrowException] void setCanStartMedia(boolean enabled);
     52    [Conditional=VIDEO_TRACK, MayThrowException] void setShouldDisplayTrackKind(DOMString kind, boolean enabled);
     53    [Conditional=VIDEO_TRACK, MayThrowException] boolean shouldDisplayTrackKind(DOMString trackKind);
     54    [MayThrowException] void setDefaultVideoPosterURL(DOMString poster);
     55    [MayThrowException] void setTimeWithoutMouseMovementBeforeHidingControls(unrestricted double time);
     56    [MayThrowException] void setMediaTypeOverride(DOMString mediaTypeOverride);
    5757    void setAllowsAirPlayForMediaPlayback(boolean available);
    5858
    59     [MayThrowLegacyException] void setForcePendingWebGLPolicy(boolean forced);
     59    [MayThrowException] void setForcePendingWebGLPolicy(boolean forced);
    6060
    61     [MayThrowLegacyException] void setQuickTimePluginReplacementEnabled(boolean enabled);
    62     [MayThrowLegacyException] void setYouTubeFlashPluginReplacementEnabled(boolean enabled);
     61    [MayThrowException] void setQuickTimePluginReplacementEnabled(boolean enabled);
     62    [MayThrowException] void setYouTubeFlashPluginReplacementEnabled(boolean enabled);
    6363
    6464    // Editing, forms
    65     [MayThrowLegacyException] void setEditingBehavior(DOMString behavior);
    66     [MayThrowLegacyException] void setShouldConvertPositionStyleOnCopy(boolean convertPosition);
     65    [MayThrowException] void setEditingBehavior(DOMString behavior);
     66    [MayThrowException] void setShouldConvertPositionStyleOnCopy(boolean convertPosition);
    6767    void setLangAttributeAwareFormControlUIEnabled(boolean enabled);
    68     [MayThrowLegacyException] void setPreferMIMETypeForImages(boolean preferMimeTypeForImage);
     68    [MayThrowException] void setPreferMIMETypeForImages(boolean preferMimeTypeForImage);
    6969
    7070    // Other switches
    71     [MayThrowLegacyException] void setStorageBlockingPolicy(DOMString policy);
    72     [MayThrowLegacyException] void setImagesEnabled(boolean enabled);
    73     [MayThrowLegacyException] void setPDFImageCachingPolicy(DOMString policy);
    74     [MayThrowLegacyException] void setUseLegacyBackgroundSizeShorthandBehavior(boolean enabled);
    75     [MayThrowLegacyException] void setAutoscrollForDragAndDropEnabled(boolean enabled);
    76     [MayThrowLegacyException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
    77     [MayThrowLegacyException] void setScrollingTreeIncludesFrames(boolean enabled);
     71    [MayThrowException] void setStorageBlockingPolicy(DOMString policy);
     72    [MayThrowException] void setImagesEnabled(boolean enabled);
     73    [MayThrowException] void setPDFImageCachingPolicy(DOMString policy);
     74    [MayThrowException] void setUseLegacyBackgroundSizeShorthandBehavior(boolean enabled);
     75    [MayThrowException] void setAutoscrollForDragAndDropEnabled(boolean enabled);
     76    [MayThrowException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
     77    [MayThrowException] void setScrollingTreeIncludesFrames(boolean enabled);
    7878
    79     [MayThrowLegacyException] void setMinimumTimerInterval(unrestricted double intervalInSeconds);
    80     [MayThrowLegacyException] void setAllowsInlineMediaPlayback(boolean allows);
    81     [MayThrowLegacyException] void setAllowsInlineMediaPlaybackAfterFullscreen(boolean allows);
    82     [MayThrowLegacyException] void setInlineMediaPlaybackRequiresPlaysInlineAttribute(boolean requires);
     79    [MayThrowException] void setMinimumTimerInterval(unrestricted double intervalInSeconds);
     80    [MayThrowException] void setAllowsInlineMediaPlayback(boolean allows);
     81    [MayThrowException] void setAllowsInlineMediaPlaybackAfterFullscreen(boolean allows);
     82    [MayThrowException] void setInlineMediaPlaybackRequiresPlaysInlineAttribute(boolean requires);
    8383
    84     [MayThrowLegacyException] void setIndexedDBWorkersEnabled(boolean requires);
     84    void setIndexedDBWorkersEnabled(boolean requires);
    8585
    86     [MayThrowLegacyException] DOMString userInterfaceDirectionPolicy();
    87     [MayThrowLegacyException] void setUserInterfaceDirectionPolicy(DOMString policy);
    88     [MayThrowLegacyException] DOMString systemLayoutDirection();
    89     [MayThrowLegacyException] void setSystemLayoutDirection(DOMString direction);
     86    [MayThrowException] DOMString userInterfaceDirectionPolicy();
     87    [MayThrowException] void setUserInterfaceDirectionPolicy(DOMString policy);
     88    [MayThrowException] DOMString systemLayoutDirection();
     89    [MayThrowException] void setSystemLayoutDirection(DOMString direction);
    9090
    91     [MayThrowLegacyException] boolean variationFontsEnabled();
    92     [MayThrowLegacyException] void setVariationFontsEnabled(boolean enabled);
     91    [MayThrowException] boolean variationFontsEnabled();
     92    [MayThrowException] void setVariationFontsEnabled(boolean enabled);
    9393
    9494    attribute ForcedPrefersReducedMotionValue forcedPrefersReducedMotionValue;
  • trunk/Source/WebCore/testing/Internals.cpp

    r207458 r207521  
    109109#include "ResourceLoadObserver.h"
    110110#include "RuntimeEnabledFeatures.h"
     111#include "SVGPathStringBuilder.h"
    111112#include "SchemeRegistry.h"
    112113#include "ScriptedAnimationController.h"
     
    233234using namespace HTMLNames;
    234235
    235 class InspectorStubFrontend : public InspectorFrontendClientLocal, public FrontendChannel {
     236class InspectorStubFrontend final : public InspectorFrontendClientLocal, public FrontendChannel {
    236237public:
    237238    InspectorStubFrontend(Page& inspectedPage, RefPtr<DOMWindow>&& frontendWindow);
    238239    virtual ~InspectorStubFrontend();
    239240
    240     // InspectorFrontendClient API
    241     void attachWindow(DockSide) override { }
    242     void detachWindow() override { }
    243     void closeWindow() override;
    244     void bringToFront() override { }
    245     String localizedStringsURL() override { return String(); }
    246     void inspectedURLChanged(const String&) override { }
    247 protected:
    248     void setAttachedWindowHeight(unsigned) override { }
    249     void setAttachedWindowWidth(unsigned) override { }
    250 
    251 public:
    252     // Inspector::FrontendChannel API
    253     bool sendMessageToFrontend(const String& message) override;
    254     ConnectionType connectionType() const override { return ConnectionType::Local; }
    255 
    256241private:
     242    void attachWindow(DockSide) final { }
     243    void detachWindow() final { }
     244    void closeWindow() final;
     245    void bringToFront() final { }
     246    String localizedStringsURL() final { return String(); }
     247    void inspectedURLChanged(const String&) final { }
     248    void setAttachedWindowHeight(unsigned) final { }
     249    void setAttachedWindowWidth(unsigned) final { }
     250
     251    bool sendMessageToFrontend(const String& message) final;
     252    ConnectionType connectionType() const final { return ConnectionType::Local; }
     253
    257254    Page* frontendPage() const
    258255    {
     
    587584}
    588585
    589 void Internals::setCanShowModalDialogOverride(bool allow, ExceptionCode& ec)
    590 {
    591     if (!contextDocument() || !contextDocument()->domWindow()) {
    592         ec = INVALID_ACCESS_ERR;
    593         return;
    594     }
     586ExceptionOr<void> Internals::setCanShowModalDialogOverride(bool allow)
     587{
     588    if (!contextDocument() || !contextDocument()->domWindow())
     589        return Exception { INVALID_ACCESS_ERR };
    595590
    596591    contextDocument()->domWindow()->setCanShowModalDialogOverride(allow);
     592    return { };
    597593}
    598594
     
    672668}
    673669
    674 unsigned Internals::lastSpatialNavigationCandidateCount(ExceptionCode& ec) const
    675 {
    676     if (!contextDocument() || !contextDocument()->page()) {
    677         ec = INVALID_ACCESS_ERR;
    678         return 0;
    679     }
     670ExceptionOr<unsigned> Internals::lastSpatialNavigationCandidateCount() const
     671{
     672    if (!contextDocument() || !contextDocument()->page())
     673        return Exception { INVALID_ACCESS_ERR };
    680674
    681675    return contextDocument()->page()->lastSpatialNavigationCandidateCount();
     
    687681}
    688682
    689 bool Internals::animationsAreSuspended(ExceptionCode& ec) const
    690 {
    691     Document* document = contextDocument();
    692     if (!document || !document->frame()) {
    693         ec = INVALID_ACCESS_ERR;
    694         return false;
    695     }
     683ExceptionOr<bool> Internals::animationsAreSuspended() const
     684{
     685    Document* document = contextDocument();
     686    if (!document || !document->frame())
     687        return Exception { INVALID_ACCESS_ERR };
    696688
    697689    return document->frame()->animation().isSuspended();
    698690}
    699691
    700 void Internals::suspendAnimations(ExceptionCode& ec) const
    701 {
    702     Document* document = contextDocument();
    703     if (!document || !document->frame()) {
    704         ec = INVALID_ACCESS_ERR;
    705         return;
    706     }
     692ExceptionOr<void> Internals::suspendAnimations() const
     693{
     694    Document* document = contextDocument();
     695    if (!document || !document->frame())
     696        return Exception { INVALID_ACCESS_ERR };
    707697
    708698    document->frame()->animation().suspendAnimations();
    709 }
    710 
    711 void Internals::resumeAnimations(ExceptionCode& ec) const
    712 {
    713     Document* document = contextDocument();
    714     if (!document || !document->frame()) {
    715         ec = INVALID_ACCESS_ERR;
    716         return;
    717     }
     699    return { };
     700}
     701
     702ExceptionOr<void> Internals::resumeAnimations() const
     703{
     704    Document* document = contextDocument();
     705    if (!document || !document->frame())
     706        return Exception { INVALID_ACCESS_ERR };
    718707
    719708    document->frame()->animation().resumeAnimations();
    720 }
    721 
    722 bool Internals::pauseAnimationAtTimeOnElement(const String& animationName, double pauseTime, Element& element, ExceptionCode& ec)
    723 {
    724     if (pauseTime < 0) {
    725         ec = INVALID_ACCESS_ERR;
    726         return false;
    727     }
     709    return { };
     710}
     711
     712ExceptionOr<bool> Internals::pauseAnimationAtTimeOnElement(const String& animationName, double pauseTime, Element& element)
     713{
     714    if (pauseTime < 0)
     715        return Exception { INVALID_ACCESS_ERR };
    728716    return frame()->animation().pauseAnimationAtTime(element.renderer(), AtomicString(animationName), pauseTime);
    729717}
    730718
    731 bool Internals::pauseAnimationAtTimeOnPseudoElement(const String& animationName, double pauseTime, Element& element, const String& pseudoId, ExceptionCode& ec)
    732 {
    733     if (pauseTime < 0) {
    734         ec = INVALID_ACCESS_ERR;
    735         return false;
    736     }
    737 
    738     if (pseudoId != "before" && pseudoId != "after") {
    739         ec = INVALID_ACCESS_ERR;
    740         return false;
    741     }
     719ExceptionOr<bool> Internals::pauseAnimationAtTimeOnPseudoElement(const String& animationName, double pauseTime, Element& element, const String& pseudoId)
     720{
     721    if (pauseTime < 0)
     722        return Exception { INVALID_ACCESS_ERR };
     723
     724    if (pseudoId != "before" && pseudoId != "after")
     725        return Exception { INVALID_ACCESS_ERR };
    742726
    743727    PseudoElement* pseudoElement = pseudoId == "before" ? element.beforePseudoElement() : element.afterPseudoElement();
    744     if (!pseudoElement) {
    745         ec = INVALID_ACCESS_ERR;
    746         return false;
    747     }
     728    if (!pseudoElement)
     729        return Exception { INVALID_ACCESS_ERR };
    748730
    749731    return frame()->animation().pauseAnimationAtTime(pseudoElement->renderer(), AtomicString(animationName), pauseTime);
    750732}
    751733
    752 bool Internals::pauseTransitionAtTimeOnElement(const String& propertyName, double pauseTime, Element& element, ExceptionCode& ec)
    753 {
    754     if (pauseTime < 0) {
    755         ec = INVALID_ACCESS_ERR;
    756         return false;
    757     }
     734ExceptionOr<bool> Internals::pauseTransitionAtTimeOnElement(const String& propertyName, double pauseTime, Element& element)
     735{
     736    if (pauseTime < 0)
     737        return Exception { INVALID_ACCESS_ERR };
    758738    return frame()->animation().pauseTransitionAtTime(element.renderer(), propertyName, pauseTime);
    759739}
    760740
    761 bool Internals::pauseTransitionAtTimeOnPseudoElement(const String& property, double pauseTime, Element& element, const String& pseudoId, ExceptionCode& ec)
    762 {
    763     if (pauseTime < 0) {
    764         ec = INVALID_ACCESS_ERR;
    765         return false;
    766     }
    767 
    768     if (pseudoId != "before" && pseudoId != "after") {
    769         ec = INVALID_ACCESS_ERR;
    770         return false;
    771     }
     741ExceptionOr<bool> Internals::pauseTransitionAtTimeOnPseudoElement(const String& property, double pauseTime, Element& element, const String& pseudoId)
     742{
     743    if (pauseTime < 0)
     744        return Exception { INVALID_ACCESS_ERR };
     745
     746    if (pseudoId != "before" && pseudoId != "after")
     747        return Exception { INVALID_ACCESS_ERR };
    772748
    773749    PseudoElement* pseudoElement = pseudoId == "before" ? element.beforePseudoElement() : element.afterPseudoElement();
    774     if (!pseudoElement) {
    775         ec = INVALID_ACCESS_ERR;
    776         return false;
    777     }
     750    if (!pseudoElement)
     751        return Exception { INVALID_ACCESS_ERR };
    778752
    779753    return frame()->animation().pauseTransitionAtTime(pseudoElement->renderer(), property, pauseTime);
    780754}
    781755
    782 String Internals::elementRenderTreeAsText(Element& element, ExceptionCode& ec)
     756ExceptionOr<String> Internals::elementRenderTreeAsText(Element& element)
    783757{
    784758    element.document().updateStyleIfNeeded();
    785759
    786760    String representation = externalRepresentation(&element);
    787     if (representation.isEmpty()) {
    788         ec = INVALID_ACCESS_ERR;
    789         return String();
    790     }
    791 
    792     return representation;
     761    if (representation.isEmpty())
     762        return Exception { INVALID_ACCESS_ERR };
     763
     764    return WTFMove(representation);
    793765}
    794766
     
    804776}
    805777
    806 Node* Internals::ensureShadowRoot(Element& host, ExceptionCode& ec)
     778ExceptionOr<Node*> Internals::ensureShadowRoot(Element& host)
    807779{
    808780    if (ShadowRoot* shadowRoot = host.shadowRoot())
    809781        return shadowRoot;
    810782
    811     return host.createShadowRoot(ec).get();
     783    ExceptionCode ec = 0;
     784    auto result = host.createShadowRoot(ec);
     785    if (ec)
     786        return Exception { ec };
     787    return result;
    812788}
    813789
     
    817793}
    818794
    819 Node* Internals::createShadowRoot(Element& host, ExceptionCode& ec)
    820 {
    821     return host.createShadowRoot(ec).get();
     795ExceptionOr<Node*> Internals::createShadowRoot(Element& host)
     796{
     797    ExceptionCode ec = 0;
     798    auto result = host.createShadowRoot(ec);
     799    if (ec)
     800        return Exception { ec };
     801    return result;
    822802}
    823803
     
    827807}
    828808
    829 String Internals::shadowRootType(const Node& root, ExceptionCode& ec) const
    830 {
    831     if (!is<ShadowRoot>(root)) {
    832         ec = INVALID_ACCESS_ERR;
    833         return String();
    834     }
     809ExceptionOr<String> Internals::shadowRootType(const Node& root) const
     810{
     811    if (!is<ShadowRoot>(root))
     812        return Exception { INVALID_ACCESS_ERR };
    835813
    836814    switch (downcast<ShadowRoot>(root).mode()) {
     
    857835}
    858836
    859 bool Internals::isTimerThrottled(int timeoutId, ExceptionCode& ec)
     837ExceptionOr<bool> Internals::isTimerThrottled(int timeoutId)
    860838{
    861839    DOMTimer* timer = scriptExecutionContext()->findTimeout(timeoutId);
    862     if (!timer) {
    863         ec = NOT_FOUND_ERR;
    864         return false;
    865     }
     840    if (!timer)
     841        return Exception { NOT_FOUND_ERR };
    866842    return timer->m_throttleState == DOMTimer::ShouldThrottle;
    867843}
     
    902878}
    903879
    904 Vector<String> Internals::formControlStateOfPreviousHistoryItem(ExceptionCode& ec)
     880ExceptionOr<Vector<String>> Internals::formControlStateOfPreviousHistoryItem()
    905881{
    906882    HistoryItem* mainItem = frame()->loader().history().previousItem();
    907     if (!mainItem) {
    908         ec = INVALID_ACCESS_ERR;
    909         return Vector<String>();
    910     }
     883    if (!mainItem)
     884        return Exception { INVALID_ACCESS_ERR };
    911885    String uniqueName = frame()->tree().uniqueName();
    912     if (mainItem->target() != uniqueName && !mainItem->childItemWithTarget(uniqueName)) {
    913         ec = INVALID_ACCESS_ERR;
    914         return Vector<String>();
    915     }
    916     return mainItem->target() == uniqueName ? mainItem->documentState() : mainItem->childItemWithTarget(uniqueName)->documentState();
    917 }
    918 
    919 void Internals::setFormControlStateOfPreviousHistoryItem(const Vector<String>& state, ExceptionCode& ec)
     886    if (mainItem->target() != uniqueName && !mainItem->childItemWithTarget(uniqueName))
     887        return Exception { INVALID_ACCESS_ERR };
     888    return Vector<String> { mainItem->target() == uniqueName ? mainItem->documentState() : mainItem->childItemWithTarget(uniqueName)->documentState() };
     889}
     890
     891ExceptionOr<void> Internals::setFormControlStateOfPreviousHistoryItem(const Vector<String>& state)
    920892{
    921893    HistoryItem* mainItem = frame()->loader().history().previousItem();
    922     if (!mainItem) {
    923         ec = INVALID_ACCESS_ERR;
    924         return;
    925     }
     894    if (!mainItem)
     895        return Exception { INVALID_ACCESS_ERR };
    926896    String uniqueName = frame()->tree().uniqueName();
    927897    if (mainItem->target() == uniqueName)
     
    930900        subItem->setDocumentState(state);
    931901    else
    932         ec = INVALID_ACCESS_ERR;
     902        return Exception { INVALID_ACCESS_ERR };
     903    return { };
    933904}
    934905
    935906#if ENABLE(SPEECH_SYNTHESIS)
     907
    936908void Internals::enableMockSpeechSynthesizer()
    937909{
     
    945917    synthesis->setPlatformSynthesizer(std::make_unique<PlatformSpeechSynthesizerMock>(synthesis));
    946918}
     919
    947920#endif
    948921
    949922#if ENABLE(WEB_RTC)
     923
    950924void Internals::enableMockMediaEndpoint()
    951925{
     
    962936    connection.emulatePlatformEvent(action);
    963937}
     938
    964939#endif
    965940
    966941#if ENABLE(MEDIA_STREAM)
     942
    967943void Internals::setMockMediaCaptureDevicesEnabled(bool enabled)
    968944{
    969945    WebCore::Settings::setMockCaptureDevicesEnabled(enabled);
    970946}
    971 #endif
    972 
    973 Ref<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec)
    974 {
    975     Document* document = contextDocument();
    976     if (!document || !document->frame()) {
    977         ec = INVALID_ACCESS_ERR;
    978         return ClientRect::create();
    979     }
     947
     948#endif
     949
     950ExceptionOr<Ref<ClientRect>> Internals::absoluteCaretBounds()
     951{
     952    Document* document = contextDocument();
     953    if (!document || !document->frame())
     954        return Exception { INVALID_ACCESS_ERR };
    980955
    981956    return ClientRect::create(document->frame()->selection().absoluteCaretBounds());
     
    991966}
    992967
    993 Ref<ClientRectList> Internals::inspectorHighlightRects(ExceptionCode& ec)
    994 {
    995     Document* document = contextDocument();
    996     if (!document || !document->page()) {
    997         ec = INVALID_ACCESS_ERR;
    998         return ClientRectList::create();
    999     }
     968ExceptionOr<Ref<ClientRectList>> Internals::inspectorHighlightRects()
     969{
     970    Document* document = contextDocument();
     971    if (!document || !document->page())
     972        return Exception { INVALID_ACCESS_ERR };
    1000973
    1001974    Highlight highlight;
     
    1004977}
    1005978
    1006 String Internals::inspectorHighlightObject(ExceptionCode& ec)
    1007 {
    1008     Document* document = contextDocument();
    1009     if (!document || !document->page()) {
    1010         ec = INVALID_ACCESS_ERR;
    1011         return String();
    1012     }
     979ExceptionOr<String> Internals::inspectorHighlightObject()
     980{
     981    Document* document = contextDocument();
     982    if (!document || !document->page())
     983        return Exception { INVALID_ACCESS_ERR };
    1013984
    1014985    return document->page()->inspectorController().buildObjectForHighlightedNodes()->toJSONString();
    1015986}
    1016987
    1017 unsigned Internals::markerCountForNode(Node& node, const String& markerType, ExceptionCode& ec)
     988ExceptionOr<unsigned> Internals::markerCountForNode(Node& node, const String& markerType)
    1018989{
    1019990    DocumentMarker::MarkerTypes markerTypes = 0;
    1020     if (!markerTypesFrom(markerType, markerTypes)) {
    1021         ec = SYNTAX_ERR;
    1022         return 0;
    1023     }
     991    if (!markerTypesFrom(markerType, markerTypes))
     992        return Exception { SYNTAX_ERR };
    1024993
    1025994    node.document().frame()->editor().updateEditorUINowIfScheduled();
     
    1027996}
    1028997
    1029 RenderedDocumentMarker* Internals::markerAt(Node& node, const String& markerType, unsigned index, ExceptionCode& ec)
     998ExceptionOr<RenderedDocumentMarker*> Internals::markerAt(Node& node, const String& markerType, unsigned index)
    1030999{
    10311000    node.document().updateLayoutIgnorePendingStylesheets();
    10321001
    10331002    DocumentMarker::MarkerTypes markerTypes = 0;
    1034     if (!markerTypesFrom(markerType, markerTypes)) {
    1035         ec = SYNTAX_ERR;
    1036         return nullptr;
    1037     }
     1003    if (!markerTypesFrom(markerType, markerTypes))
     1004        return Exception { SYNTAX_ERR };
    10381005
    10391006    node.document().frame()->editor().updateEditorUINowIfScheduled();
     
    10451012}
    10461013
    1047 RefPtr<Range> Internals::markerRangeForNode(Node& node, const String& markerType, unsigned index, ExceptionCode& ec)
    1048 {
    1049     RenderedDocumentMarker* marker = markerAt(node, markerType, index, ec);
     1014ExceptionOr<RefPtr<Range>> Internals::markerRangeForNode(Node& node, const String& markerType, unsigned index)
     1015{
     1016    auto result = markerAt(node, markerType, index);
     1017    if (result.hasException())
     1018        return result.releaseException();
     1019    auto marker = result.releaseReturnValue();
    10501020    if (!marker)
    10511021        return nullptr;
    1052     return Range::create(node.document(), &node, marker->startOffset(), &node, marker->endOffset());
    1053 }
    1054 
    1055 String Internals::markerDescriptionForNode(Node& node, const String& markerType, unsigned index, ExceptionCode& ec)
    1056 {
    1057     RenderedDocumentMarker* marker = markerAt(node, markerType, index, ec);
     1022    return RefPtr<Range> { Range::create(node.document(), &node, marker->startOffset(), &node, marker->endOffset()) };
     1023}
     1024
     1025ExceptionOr<String> Internals::markerDescriptionForNode(Node& node, const String& markerType, unsigned index)
     1026{
     1027    auto result = markerAt(node, markerType, index);
     1028    if (result.hasException())
     1029        return result.releaseException();
     1030    auto marker = result.releaseReturnValue();
    10581031    if (!marker)
    10591032        return String();
    1060     return marker->description();
    1061 }
    1062 
    1063 String Internals::dumpMarkerRects(const String& markerTypeString, ExceptionCode& ec)
     1033    return String { marker->description() };
     1034}
     1035
     1036ExceptionOr<String> Internals::dumpMarkerRects(const String& markerTypeString)
    10641037{
    10651038    DocumentMarker::MarkerType markerType;
    1066     if (!markerTypeFrom(markerTypeString, markerType)) {
    1067         ec = SYNTAX_ERR;
    1068         return String();
    1069     }
     1039    if (!markerTypeFrom(markerTypeString, markerType))
     1040        return Exception { SYNTAX_ERR };
    10701041
    10711042    contextDocument()->markers().updateRectsForInvalidatedMarkersOfType(markerType);
     
    10941065}
    10951066
    1096 void Internals::setMarkedTextMatchesAreHighlighted(bool flag, ExceptionCode& ec)
    1097 {
    1098     Document* document = contextDocument();
    1099     if (!document || !document->frame()) {
    1100         ec = INVALID_ACCESS_ERR;
    1101         return;
    1102     }
     1067ExceptionOr<void> Internals::setMarkedTextMatchesAreHighlighted(bool flag)
     1068{
     1069    Document* document = contextDocument();
     1070    if (!document || !document->frame())
     1071        return Exception { INVALID_ACCESS_ERR };
    11031072    document->frame()->editor().setMarkedTextMatchesAreHighlighted(flag);
     1073    return { };
    11041074}
    11051075
     
    11091079}
    11101080
    1111 void Internals::setScrollViewPosition(int x, int y, ExceptionCode& ec)
    1112 {
    1113     Document* document = contextDocument();
    1114     if (!document || !document->view()) {
    1115         ec = INVALID_ACCESS_ERR;
    1116         return;
    1117     }
    1118 
    1119     FrameView* frameView = document->view();
    1120     bool constrainsScrollingToContentEdgeOldValue = frameView->constrainsScrollingToContentEdge();
    1121     bool scrollbarsSuppressedOldValue = frameView->scrollbarsSuppressed();
    1122 
    1123     frameView->setConstrainsScrollingToContentEdge(false);
    1124     frameView->setScrollbarsSuppressed(false);
    1125     frameView->setScrollOffsetFromInternals({ x, y });
    1126     frameView->setScrollbarsSuppressed(scrollbarsSuppressedOldValue);
    1127     frameView->setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdgeOldValue);
    1128 }
    1129 
    1130 void Internals::setViewBaseBackgroundColor(const String& colorValue, ExceptionCode& ec)
    1131 {
    1132     Document* document = contextDocument();
    1133     if (!document || !document->view()) {
    1134         ec = INVALID_ACCESS_ERR;
    1135         return;
    1136     }
     1081ExceptionOr<void> Internals::setScrollViewPosition(int x, int y)
     1082{
     1083    Document* document = contextDocument();
     1084    if (!document || !document->view())
     1085        return Exception { INVALID_ACCESS_ERR };
     1086
     1087    auto& frameView = *document->view();
     1088    bool constrainsScrollingToContentEdgeOldValue = frameView.constrainsScrollingToContentEdge();
     1089    bool scrollbarsSuppressedOldValue = frameView.scrollbarsSuppressed();
     1090
     1091    frameView.setConstrainsScrollingToContentEdge(false);
     1092    frameView.setScrollbarsSuppressed(false);
     1093    frameView.setScrollOffsetFromInternals({ x, y });
     1094    frameView.setScrollbarsSuppressed(scrollbarsSuppressedOldValue);
     1095    frameView.setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdgeOldValue);
     1096
     1097    return { };
     1098}
     1099
     1100ExceptionOr<void> Internals::setViewBaseBackgroundColor(const String& colorValue)
     1101{
     1102    Document* document = contextDocument();
     1103    if (!document || !document->view())
     1104        return Exception { INVALID_ACCESS_ERR };
    11371105
    11381106    document->view()->setBaseBackgroundColor(Color(colorValue));
    1139 }
    1140 
    1141 void Internals::setPagination(const String& mode, int gap, int pageLength, ExceptionCode& ec)
    1142 {
    1143     Document* document = contextDocument();
    1144     if (!document || !document->page()) {
    1145         ec = INVALID_ACCESS_ERR;
    1146         return;
    1147     }
    1148     Page* page = document->page();
     1107    return { };
     1108}
     1109
     1110ExceptionOr<void> Internals::setPagination(const String& mode, int gap, int pageLength)
     1111{
     1112    Document* document = contextDocument();
     1113    if (!document || !document->page())
     1114        return Exception { INVALID_ACCESS_ERR };
    11491115
    11501116    Pagination pagination;
     
    11591125    else if (mode == "BottomToTopPaginated")
    11601126        pagination.mode = Pagination::BottomToTopPaginated;
    1161     else {
    1162         ec = SYNTAX_ERR;
    1163         return;
    1164     }
     1127    else
     1128        return Exception { SYNTAX_ERR };
    11651129
    11661130    pagination.gap = gap;
    11671131    pagination.pageLength = pageLength;
    1168     page->setPagination(pagination);
    1169 }
    1170 
    1171 void Internals::setPaginationLineGridEnabled(bool enabled, ExceptionCode& ec)
    1172 {
    1173     Document* document = contextDocument();
    1174     if (!document || !document->page()) {
    1175         ec = INVALID_ACCESS_ERR;
    1176         return;
    1177     }
    1178     Page* page = document->page();
    1179     page->setPaginationLineGridEnabled(enabled);
    1180 }
    1181 
    1182 String Internals::configurationForViewport(float devicePixelRatio, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight, ExceptionCode& ec)
    1183 {
    1184     Document* document = contextDocument();
    1185     if (!document || !document->page()) {
    1186         ec = INVALID_ACCESS_ERR;
    1187         return String();
    1188     }
    1189     Page* page = document->page();
     1132    document->page()->setPagination(pagination);
     1133
     1134    return { };
     1135}
     1136
     1137ExceptionOr<void> Internals::setPaginationLineGridEnabled(bool enabled)
     1138{
     1139    Document* document = contextDocument();
     1140    if (!document || !document->page())
     1141        return Exception { INVALID_ACCESS_ERR };
     1142    document->page()->setPaginationLineGridEnabled(enabled);
     1143    return { };
     1144}
     1145
     1146ExceptionOr<String> Internals::configurationForViewport(float devicePixelRatio, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight)
     1147{
     1148    Document* document = contextDocument();
     1149    if (!document || !document->page())
     1150        return Exception { INVALID_ACCESS_ERR };
    11901151
    11911152    const int defaultLayoutWidthForNonMobilePages = 980;
    11921153
    1193     ViewportArguments arguments = page->viewportArguments();
     1154    ViewportArguments arguments = document->page()->viewportArguments();
    11941155    ViewportAttributes attributes = computeViewportAttributes(arguments, defaultLayoutWidthForNonMobilePages, deviceWidth, deviceHeight, devicePixelRatio, IntSize(availableWidth, availableHeight));
    11951156    restrictMinimumScaleFactorToViewportSize(attributes, IntSize(availableWidth, availableHeight), devicePixelRatio);
    11961157    restrictScaleFactorToInitialScaleIfNotUserScalable(attributes);
    11971158
    1198     return "viewport size " + String::number(attributes.layoutSize.width()) + "x" + String::number(attributes.layoutSize.height()) + " scale " + String::number(attributes.initialScale) + " with limits [" + String::number(attributes.minimumScale) + ", " + String::number(attributes.maximumScale) + "] and userScalable " + (attributes.userScalable ? "true" : "false");
    1199 }
    1200 
    1201 bool Internals::wasLastChangeUserEdit(Element& textField, ExceptionCode& ec)
     1159    return String { "viewport size " + String::number(attributes.layoutSize.width()) + "x" + String::number(attributes.layoutSize.height()) + " scale " + String::number(attributes.initialScale) + " with limits [" + String::number(attributes.minimumScale) + ", " + String::number(attributes.maximumScale) + "] and userScalable " + (attributes.userScalable ? "true" : "false") };
     1160}
     1161
     1162ExceptionOr<bool> Internals::wasLastChangeUserEdit(Element& textField)
    12021163{
    12031164    if (is<HTMLInputElement>(textField))
     
    12071168        return downcast<HTMLTextAreaElement>(textField).lastChangeWasUserEdit();
    12081169
    1209     ec = INVALID_NODE_TYPE_ERR;
    1210     return false;
     1170    return Exception { INVALID_NODE_TYPE_ERR };
    12111171}
    12121172
     
    12451205}
    12461206
    1247 void Internals::scrollElementToRect(Element& element, int x, int y, int w, int h, ExceptionCode& ec)
     1207ExceptionOr<void> Internals::scrollElementToRect(Element& element, int x, int y, int w, int h)
    12481208{
    12491209    FrameView* frameView = element.document().view();
    1250     if (!frameView) {
    1251         ec = INVALID_ACCESS_ERR;
    1252         return;
    1253     }
     1210    if (!frameView)
     1211        return Exception { INVALID_ACCESS_ERR };
    12541212    frameView->scrollElementToRect(element, { x, y, w, h });
    1255 }
    1256 
    1257 String Internals::autofillFieldName(Element& element, ExceptionCode& ec)
    1258 {
    1259     if (!is<HTMLFormControlElement>(element)) {
    1260         ec = INVALID_NODE_TYPE_ERR;
    1261         return { };
    1262     }
    1263 
    1264     return downcast<HTMLFormControlElement>(element).autofillData().fieldName;
    1265 }
    1266 
    1267 void Internals::paintControlTints(ExceptionCode& ec)
    1268 {
    1269     Document* document = contextDocument();
    1270     if (!document || !document->view()) {
    1271         ec = INVALID_ACCESS_ERR;
    1272         return;
    1273     }
    1274 
    1275     FrameView* frameView = document->view();
    1276     frameView->paintControlTints();
     1213    return { };
     1214}
     1215
     1216ExceptionOr<String> Internals::autofillFieldName(Element& element)
     1217{
     1218    if (!is<HTMLFormControlElement>(element))
     1219        return Exception { INVALID_NODE_TYPE_ERR };
     1220
     1221    return String { downcast<HTMLFormControlElement>(element).autofillData().fieldName };
     1222}
     1223
     1224ExceptionOr<void> Internals::paintControlTints()
     1225{
     1226    Document* document = contextDocument();
     1227    if (!document || !document->view())
     1228        return Exception { INVALID_ACCESS_ERR };
     1229
     1230    document->view()->paintControlTints();
     1231    return { };
    12771232}
    12781233
     
    13081263}
    13091264
    1310 RefPtr<Range> Internals::rangeForDictionaryLookupAtLocation(int x, int y, ExceptionCode& ec)
     1265ExceptionOr<RefPtr<Range>> Internals::rangeForDictionaryLookupAtLocation(int x, int y)
    13111266{
    13121267#if PLATFORM(MAC)
    13131268    Document* document = contextDocument();
    1314     if (!document || !document->frame()) {
    1315         ec = INVALID_ACCESS_ERR;
    1316         return nullptr;
    1317     }
     1269    if (!document || !document->frame())
     1270        return Exception { INVALID_ACCESS_ERR };
    13181271
    13191272    document->updateLayoutIgnorePendingStylesheets();
     
    13251278    UNUSED_PARAM(x);
    13261279    UNUSED_PARAM(y);
    1327     ec = INVALID_ACCESS_ERR;
    1328     return nullptr;
    1329 #endif
    1330 }
    1331 
    1332 void Internals::setDelegatesScrolling(bool enabled, ExceptionCode& ec)
     1280    return Exception { INVALID_ACCESS_ERR };
     1281#endif
     1282}
     1283
     1284ExceptionOr<void> Internals::setDelegatesScrolling(bool enabled)
    13331285{
    13341286    Document* document = contextDocument();
    13351287    // Delegate scrolling is valid only on mainframe's view.
    1336     if (!document || !document->view() || !document->page() || &document->page()->mainFrame() != document->frame()) {
    1337         ec = INVALID_ACCESS_ERR;
    1338         return;
    1339     }
     1288    if (!document || !document->view() || !document->page() || &document->page()->mainFrame() != document->frame())
     1289        return Exception { INVALID_ACCESS_ERR };
    13401290
    13411291    document->view()->setDelegatesScrolling(enabled);
    1342 }
    1343 
    1344 int Internals::lastSpellCheckRequestSequence(ExceptionCode& ec)
    1345 {
    1346     Document* document = contextDocument();
    1347     if (!document || !document->frame()) {
    1348         ec = INVALID_ACCESS_ERR;
    1349         return -1;
    1350     }
     1292    return { };
     1293}
     1294
     1295ExceptionOr<int> Internals::lastSpellCheckRequestSequence()
     1296{
     1297    Document* document = contextDocument();
     1298    if (!document || !document->frame())
     1299        return Exception { INVALID_ACCESS_ERR };
    13511300
    13521301    return document->frame()->editor().spellChecker().lastRequestSequence();
    13531302}
    13541303
    1355 int Internals::lastSpellCheckProcessedSequence(ExceptionCode& ec)
    1356 {
    1357     Document* document = contextDocument();
    1358     if (!document || !document->frame()) {
    1359         ec = INVALID_ACCESS_ERR;
    1360         return -1;
    1361     }
     1304ExceptionOr<int> Internals::lastSpellCheckProcessedSequence()
     1305{
     1306    Document* document = contextDocument();
     1307    if (!document || !document->frame())
     1308        return Exception { INVALID_ACCESS_ERR };
    13621309
    13631310    return document->frame()->editor().spellChecker().lastProcessedSequence();
     
    13981345}
    13991346
    1400 unsigned Internals::wheelEventHandlerCount(ExceptionCode& ec)
    1401 {
    1402     Document* document = contextDocument();
    1403     if (!document) {
    1404         ec = INVALID_ACCESS_ERR;
    1405         return 0;
    1406     }
     1347ExceptionOr<unsigned> Internals::wheelEventHandlerCount()
     1348{
     1349    Document* document = contextDocument();
     1350    if (!document)
     1351        return Exception { INVALID_ACCESS_ERR };
    14071352
    14081353    return document->wheelEventHandlerCount();
    14091354}
    14101355
    1411 unsigned Internals::touchEventHandlerCount(ExceptionCode& ec)
    1412 {
    1413     Document* document = contextDocument();
    1414     if (!document) {
    1415         ec = INVALID_ACCESS_ERR;
    1416         return 0;
    1417     }
     1356ExceptionOr<unsigned> Internals::touchEventHandlerCount()
     1357{
     1358    Document* document = contextDocument();
     1359    if (!document)
     1360        return Exception { INVALID_ACCESS_ERR };
    14181361
    14191362    return document->touchEventHandlerCount();
     
    14241367// different document, and could just make the call through another Internals
    14251368// instance instead.
    1426 RefPtr<NodeList> Internals::nodesFromRect(Document& document, int centerX, int centerY, unsigned topPadding, unsigned rightPadding,
    1427     unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode& ec) const
    1428 {
    1429     if (!document.frame() || !document.frame()->view()) {
    1430         ec = INVALID_ACCESS_ERR;
    1431         return nullptr;
    1432     }
     1369ExceptionOr<RefPtr<NodeList>> Internals::nodesFromRect(Document& document, int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const
     1370{
     1371    if (!document.frame() || !document.frame()->view())
     1372        return Exception { INVALID_ACCESS_ERR };
    14331373
    14341374    Frame* frame = document.frame();
     
    14761416    }
    14771417
    1478     return StaticNodeList::create(WTFMove(matches));
     1418    return RefPtr<NodeList> { StaticNodeList::create(WTFMove(matches)) };
    14791419}
    14801420
     
    15601500}
    15611501
    1562 void Internals::setBatteryStatus(const String& eventType, bool charging, double chargingTime, double dischargingTime, double level, ExceptionCode& ec)
    1563 {
    1564     Document* document = contextDocument();
    1565     if (!document || !document->page()) {
    1566         ec = INVALID_ACCESS_ERR;
    1567         return;
    1568     }
     1502ExceptionOr<void> Internals::setBatteryStatus(const String& eventType, bool charging, double chargingTime, double dischargingTime, double level)
     1503{
     1504    Document* document = contextDocument();
     1505    if (!document || !document->page())
     1506        return Exception { INVALID_ACCESS_ERR };
    15691507
    15701508#if ENABLE(BATTERY_STATUS)
     
    15771515    UNUSED_PARAM(level);
    15781516#endif
    1579 }
    1580 
    1581 void Internals::setDeviceProximity(const String& eventType, double value, double min, double max, ExceptionCode& ec)
    1582 {
    1583     Document* document = contextDocument();
    1584     if (!document || !document->page()) {
    1585         ec = INVALID_ACCESS_ERR;
    1586         return;
    1587     }
     1517    return { };
     1518}
     1519
     1520ExceptionOr<void> Internals::setDeviceProximity(const String&, double value, double min, double max)
     1521{
     1522    Document* document = contextDocument();
     1523    if (!document || !document->page())
     1524        return Exception { INVALID_ACCESS_ERR };
    15881525
    15891526#if ENABLE(PROXIMITY_EVENTS)
    15901527    DeviceProximityController::from(document->page())->didChangeDeviceProximity(value, min, max);
    15911528#else
    1592     UNUSED_PARAM(eventType);
    15931529    UNUSED_PARAM(value);
    15941530    UNUSED_PARAM(min);
    15951531    UNUSED_PARAM(max);
    15961532#endif
     1533    return { };
    15971534}
    15981535
     
    16051542}
    16061543
    1607 bool Internals::hasSpellingMarker(int from, int length, ExceptionCode&)
     1544bool Internals::hasSpellingMarker(int from, int length)
    16081545{
    16091546    Document* document = contextDocument();
     
    16161553}
    16171554   
    1618 bool Internals::hasAutocorrectedMarker(int from, int length, ExceptionCode&)
     1555bool Internals::hasAutocorrectedMarker(int from, int length)
    16191556{
    16201557    Document* document = contextDocument();
     
    17011638}
    17021639
    1703 void Internals::handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length, ExceptionCode&)
     1640void Internals::handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length)
    17041641{
    17051642    if (!contextDocument() || !contextDocument()->frame())
     
    17141651}
    17151652
    1716 bool Internals::isOverwriteModeEnabled(ExceptionCode&)
     1653bool Internals::isOverwriteModeEnabled()
    17171654{
    17181655    Document* document = contextDocument();
     
    17231660}
    17241661
    1725 void Internals::toggleOverwriteModeEnabled(ExceptionCode&)
     1662void Internals::toggleOverwriteModeEnabled()
    17261663{
    17271664    Document* document = contextDocument();
     
    17321669}
    17331670
    1734 unsigned Internals::countMatchesForText(const String& text, unsigned findOptions, const String& markMatches, ExceptionCode&)
     1671unsigned Internals::countMatchesForText(const String& text, unsigned findOptions, const String& markMatches)
    17351672{
    17361673    Document* document = contextDocument();
     
    17421679}
    17431680
    1744 unsigned Internals::countFindMatches(const String& text, unsigned findOptions, ExceptionCode&)
     1681unsigned Internals::countFindMatches(const String& text, unsigned findOptions)
    17451682{
    17461683    Document* document = contextDocument();
     
    17791716}
    17801717
    1781 void Internals::setInspectorIsUnderTest(bool isUnderTest, ExceptionCode& ec)
     1718ExceptionOr<void> Internals::setInspectorIsUnderTest(bool isUnderTest)
    17821719{
    17831720    Page* page = contextDocument()->frame()->page();
    1784     if (!page) {
    1785         ec = INVALID_ACCESS_ERR;
    1786         return;
    1787     }
     1721    if (!page)
     1722        return Exception { INVALID_ACCESS_ERR };
    17881723
    17891724    page->inspectorController().setIsUnderTest(isUnderTest);
    1790 }
    1791 
    1792 bool Internals::hasGrammarMarker(int from, int length, ExceptionCode&)
     1725    return { };
     1726}
     1727
     1728bool Internals::hasGrammarMarker(int from, int length)
    17931729{
    17941730    Document* document = contextDocument();
     
    17991735}
    18001736
    1801 unsigned Internals::numberOfScrollableAreas(ExceptionCode&)
     1737unsigned Internals::numberOfScrollableAreas()
    18021738{
    18031739    Document* document = contextDocument();
     
    18181754}
    18191755   
    1820 bool Internals::isPageBoxVisible(int pageNumber, ExceptionCode& ec)
    1821 {
    1822     Document* document = contextDocument();
    1823     if (!document) {
    1824         ec = INVALID_ACCESS_ERR;
    1825         return false;
    1826     }
     1756ExceptionOr<bool> Internals::isPageBoxVisible(int pageNumber)
     1757{
     1758    Document* document = contextDocument();
     1759    if (!document)
     1760        return Exception { INVALID_ACCESS_ERR };
    18271761
    18281762    return document->isPageBoxVisible(pageNumber);
     
    18331767// different document, and could just make the call through another Internals
    18341768// instance instead.
    1835 String Internals::layerTreeAsText(Document& document, unsigned short flags, ExceptionCode& ec) const
    1836 {
    1837     if (!document.frame()) {
    1838         ec = INVALID_ACCESS_ERR;
    1839         return String();
    1840     }
     1769ExceptionOr<String> Internals::layerTreeAsText(Document& document, unsigned short flags) const
     1770{
     1771    if (!document.frame())
     1772        return Exception { INVALID_ACCESS_ERR };
    18411773
    18421774    LayerTreeFlags layerTreeFlags = 0;
     
    18551787}
    18561788
    1857 String Internals::repaintRectsAsText(ExceptionCode& ec) const
    1858 {
    1859     Document* document = contextDocument();
    1860     if (!document || !document->frame()) {
    1861         ec = INVALID_ACCESS_ERR;
    1862         return String();
    1863     }
     1789ExceptionOr<String> Internals::repaintRectsAsText() const
     1790{
     1791    Document* document = contextDocument();
     1792    if (!document || !document->frame())
     1793        return Exception { INVALID_ACCESS_ERR };
    18641794
    18651795    return document->frame()->trackedRepaintRectsAsText();
    18661796}
    18671797
    1868 String Internals::scrollingStateTreeAsText(ExceptionCode& ec) const
    1869 {
    1870     Document* document = contextDocument();
    1871     if (!document || !document->frame()) {
    1872         ec = INVALID_ACCESS_ERR;
    1873         return String();
    1874     }
     1798ExceptionOr<String> Internals::scrollingStateTreeAsText() const
     1799{
     1800    Document* document = contextDocument();
     1801    if (!document || !document->frame())
     1802        return Exception { INVALID_ACCESS_ERR };
    18751803
    18761804    Page* page = document->page();
     
    18811809}
    18821810
    1883 String Internals::mainThreadScrollingReasons(ExceptionCode& ec) const
    1884 {
    1885     Document* document = contextDocument();
    1886     if (!document || !document->frame()) {
    1887         ec = INVALID_ACCESS_ERR;
    1888         return String();
    1889     }
     1811ExceptionOr<String> Internals::mainThreadScrollingReasons() const
     1812{
     1813    Document* document = contextDocument();
     1814    if (!document || !document->frame())
     1815        return Exception { INVALID_ACCESS_ERR };
    18901816
    18911817    Page* page = document->page();
     
    18961822}
    18971823
    1898 RefPtr<ClientRectList> Internals::nonFastScrollableRects(ExceptionCode& ec) const
    1899 {
    1900     Document* document = contextDocument();
    1901     if (!document || !document->frame()) {
    1902         ec = INVALID_ACCESS_ERR;
    1903         return nullptr;
    1904     }
     1824ExceptionOr<RefPtr<ClientRectList>> Internals::nonFastScrollableRects() const
     1825{
     1826    Document* document = contextDocument();
     1827    if (!document || !document->frame())
     1828        return Exception { INVALID_ACCESS_ERR };
    19051829
    19061830    Page* page = document->page();
     
    19081832        return nullptr;
    19091833
    1910     return page->nonFastScrollableRects();
    1911 }
    1912 
    1913 void Internals::setElementUsesDisplayListDrawing(Element& element, bool usesDisplayListDrawing, ExceptionCode& ec)
    1914 {
    1915     Document* document = contextDocument();
    1916     if (!document || !document->renderView()) {
    1917         ec = INVALID_ACCESS_ERR;
    1918         return;
    1919     }
    1920 
    1921     if (!element.renderer()) {
    1922         ec = INVALID_ACCESS_ERR;
    1923         return;
    1924     }
     1834    return RefPtr<ClientRectList> { page->nonFastScrollableRects() };
     1835}
     1836
     1837ExceptionOr<void> Internals::setElementUsesDisplayListDrawing(Element& element, bool usesDisplayListDrawing)
     1838{
     1839    Document* document = contextDocument();
     1840    if (!document || !document->renderView())
     1841        return Exception { INVALID_ACCESS_ERR };
     1842
     1843    if (!element.renderer())
     1844        return Exception { INVALID_ACCESS_ERR };
    19251845
    19261846    if (is<HTMLCanvasElement>(element)) {
    19271847        downcast<HTMLCanvasElement>(element).setUsesDisplayListDrawing(usesDisplayListDrawing);
    1928         return;
     1848        return { };
    19291849    }
    19301850
    1931     if (!element.renderer()->hasLayer()) {
    1932         ec = INVALID_ACCESS_ERR;
    1933         return;
    1934     }
     1851    if (!element.renderer()->hasLayer())
     1852        return Exception { INVALID_ACCESS_ERR };
    19351853   
    19361854    RenderLayer* layer = downcast<RenderLayerModelObject>(element.renderer())->layer();
    1937     if (!layer->isComposited()) {
    1938         ec = INVALID_ACCESS_ERR;
    1939         return;
    1940     }
     1855    if (!layer->isComposited())
     1856        return Exception { INVALID_ACCESS_ERR };
    19411857   
    19421858    layer->backing()->setUsesDisplayListDrawing(usesDisplayListDrawing);
    1943 }
    1944 
    1945 void Internals::setElementTracksDisplayListReplay(Element& element, bool isTrackingReplay, ExceptionCode& ec)
    1946 {
    1947     Document* document = contextDocument();
    1948     if (!document || !document->renderView()) {
    1949         ec = INVALID_ACCESS_ERR;
    1950         return;
    1951     }
    1952 
    1953     if (!element.renderer()) {
    1954         ec = INVALID_ACCESS_ERR;
    1955         return;
    1956     }
     1859    return { };
     1860}
     1861
     1862ExceptionOr<void> Internals::setElementTracksDisplayListReplay(Element& element, bool isTrackingReplay)
     1863{
     1864    Document* document = contextDocument();
     1865    if (!document || !document->renderView())
     1866        return Exception { INVALID_ACCESS_ERR };
     1867
     1868    if (!element.renderer())
     1869        return Exception { INVALID_ACCESS_ERR };
    19571870
    19581871    if (is<HTMLCanvasElement>(element)) {
    19591872        downcast<HTMLCanvasElement>(element).setTracksDisplayListReplay(isTrackingReplay);
    1960         return;
     1873        return { };
    19611874    }
    19621875
    1963     if (!element.renderer()->hasLayer()) {
    1964         ec = INVALID_ACCESS_ERR;
    1965         return;
    1966     }
     1876    if (!element.renderer()->hasLayer())
     1877        return Exception { INVALID_ACCESS_ERR };
    19671878
    19681879    RenderLayer* layer = downcast<RenderLayerModelObject>(element.renderer())->layer();
    1969     if (!layer->isComposited()) {
    1970         ec = INVALID_ACCESS_ERR;
    1971         return;
    1972     }
     1880    if (!layer->isComposited())
     1881        return Exception { INVALID_ACCESS_ERR };
    19731882   
    19741883    layer->backing()->setIsTrackingDisplayListReplay(isTrackingReplay);
    1975 }
    1976 
    1977 String Internals::displayListForElement(Element& element, unsigned short flags, ExceptionCode& ec)
    1978 {
    1979     Document* document = contextDocument();
    1980     if (!document || !document->renderView()) {
    1981         ec = INVALID_ACCESS_ERR;
    1982         return String();
    1983     }
    1984 
    1985     if (!element.renderer()) {
    1986         ec = INVALID_ACCESS_ERR;
    1987         return String();
    1988     }
     1884    return { };
     1885}
     1886
     1887ExceptionOr<String> Internals::displayListForElement(Element& element, unsigned short flags)
     1888{
     1889    Document* document = contextDocument();
     1890    if (!document || !document->renderView())
     1891        return Exception { INVALID_ACCESS_ERR };
     1892
     1893    if (!element.renderer())
     1894        return Exception { INVALID_ACCESS_ERR };
    19891895
    19901896    DisplayList::AsTextFlags displayListFlags = 0;
     
    19951901        return downcast<HTMLCanvasElement>(element).displayListAsText(displayListFlags);
    19961902
    1997     if (!element.renderer()->hasLayer()) {
    1998         ec = INVALID_ACCESS_ERR;
    1999         return String();
    2000     }
     1903    if (!element.renderer()->hasLayer())
     1904        return Exception { INVALID_ACCESS_ERR };
    20011905
    20021906    RenderLayer* layer = downcast<RenderLayerModelObject>(element.renderer())->layer();
    2003     if (!layer->isComposited()) {
    2004         ec = INVALID_ACCESS_ERR;
    2005         return String();
    2006     }
     1907    if (!layer->isComposited())
     1908        return Exception { INVALID_ACCESS_ERR };
    20071909
    20081910    return layer->backing()->displayListAsText(displayListFlags);
    20091911}
    20101912
    2011 String Internals::replayDisplayListForElement(Element& element, unsigned short flags, ExceptionCode& ec)
    2012 {
    2013     Document* document = contextDocument();
    2014     if (!document || !document->renderView()) {
    2015         ec = INVALID_ACCESS_ERR;
    2016         return String();
    2017     }
    2018 
    2019     if (!element.renderer()) {
    2020         ec = INVALID_ACCESS_ERR;
    2021         return String();
    2022     }
     1913ExceptionOr<String> Internals::replayDisplayListForElement(Element& element, unsigned short flags)
     1914{
     1915    Document* document = contextDocument();
     1916    if (!document || !document->renderView())
     1917        return Exception { INVALID_ACCESS_ERR };
     1918
     1919    if (!element.renderer())
     1920        return Exception { INVALID_ACCESS_ERR };
    20231921
    20241922    DisplayList::AsTextFlags displayListFlags = 0;
     
    20291927        return downcast<HTMLCanvasElement>(element).replayDisplayListAsText(displayListFlags);
    20301928
    2031     if (!element.renderer()->hasLayer()) {
    2032         ec = INVALID_ACCESS_ERR;
    2033         return String();
    2034     }
     1929    if (!element.renderer()->hasLayer())
     1930        return Exception { INVALID_ACCESS_ERR };
    20351931
    20361932    RenderLayer* layer = downcast<RenderLayerModelObject>(element.renderer())->layer();
    2037     if (!layer->isComposited()) {
    2038         ec = INVALID_ACCESS_ERR;
    2039         return String();
    2040     }
     1933    if (!layer->isComposited())
     1934        return Exception { INVALID_ACCESS_ERR };
    20411935
    20421936    return layer->backing()->replayDisplayListAsText(displayListFlags);
    20431937}
    20441938
    2045 void Internals::garbageCollectDocumentResources(ExceptionCode& ec) const
    2046 {
    2047     Document* document = contextDocument();
    2048     if (!document) {
    2049         ec = INVALID_ACCESS_ERR;
    2050         return;
    2051     }
     1939ExceptionOr<void> Internals::garbageCollectDocumentResources() const
     1940{
     1941    Document* document = contextDocument();
     1942    if (!document)
     1943        return Exception { INVALID_ACCESS_ERR };
    20521944    document->cachedResourceLoader().garbageCollectDocumentResources();
     1945    return { };
    20531946}
    20541947
     
    20681961}
    20691962
    2070 void Internals::insertAuthorCSS(const String& css, ExceptionCode& ec) const
    2071 {
    2072     Document* document = contextDocument();
    2073     if (!document) {
    2074         ec = INVALID_ACCESS_ERR;
    2075         return;
    2076     }
     1963ExceptionOr<void> Internals::insertAuthorCSS(const String& css) const
     1964{
     1965    Document* document = contextDocument();
     1966    if (!document)
     1967        return Exception { INVALID_ACCESS_ERR };
    20771968
    20781969    auto parsedSheet = StyleSheetContents::create(*document);
     
    20801971    parsedSheet.get().parseString(css);
    20811972    document->extensionStyleSheets().addAuthorStyleSheetForTesting(WTFMove(parsedSheet));
    2082 }
    2083 
    2084 void Internals::insertUserCSS(const String& css, ExceptionCode& ec) const
    2085 {
    2086     Document* document = contextDocument();
    2087     if (!document) {
    2088         ec = INVALID_ACCESS_ERR;
    2089         return;
    2090     }
     1973    return { };
     1974}
     1975
     1976ExceptionOr<void> Internals::insertUserCSS(const String& css) const
     1977{
     1978    Document* document = contextDocument();
     1979    if (!document)
     1980        return Exception { INVALID_ACCESS_ERR };
    20911981
    20921982    auto parsedSheet = StyleSheetContents::create(*document);
     
    20941984    parsedSheet.get().parseString(css);
    20951985    document->extensionStyleSheets().addUserStyleSheet(WTFMove(parsedSheet));
     1986    return { };
    20961987}
    20971988
     
    21272018}
    21282019
    2129 String Internals::pageProperty(String propertyName, int pageNumber, ExceptionCode& ec) const
    2130 {
    2131     if (!frame()) {
    2132         ec = INVALID_ACCESS_ERR;
    2133         return String();
    2134     }
     2020ExceptionOr<String> Internals::pageProperty(const String& propertyName, int pageNumber) const
     2021{
     2022    if (!frame())
     2023        return Exception { INVALID_ACCESS_ERR };
    21352024
    21362025    return PrintContext::pageProperty(frame(), propertyName.utf8().data(), pageNumber);
    21372026}
    21382027
    2139 String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionCode& ec) const
    2140 {
    2141     if (!frame()) {
    2142         ec = INVALID_ACCESS_ERR;
    2143         return String();
    2144     }
     2028ExceptionOr<String> Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
     2029{
     2030    if (!frame())
     2031        return Exception { INVALID_ACCESS_ERR };
    21452032
    21462033    return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);
    21472034}
    21482035
    2149 void Internals::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode& ec)
    2150 {
    2151     Document* document = contextDocument();
    2152     if (!document || !document->page()) {
    2153         ec = INVALID_ACCESS_ERR;
    2154         return;
    2155     }
    2156     Page* page = document->page();
    2157     page->setPageScaleFactor(scaleFactor, IntPoint(x, y));
    2158 }
    2159 
    2160 void Internals::setPageZoomFactor(float zoomFactor, ExceptionCode& ec)
    2161 {
    2162     Document* document = contextDocument();
    2163     if (!document || !document->frame()) {
    2164         ec = INVALID_ACCESS_ERR;
    2165         return;
    2166     }
    2167     Frame* frame = document->frame();
    2168     frame->setPageZoomFactor(zoomFactor);
    2169 }
    2170 
    2171 void Internals::setTextZoomFactor(float zoomFactor, ExceptionCode& ec)
    2172 {
    2173     Document* document = contextDocument();
    2174     if (!document || !document->frame()) {
    2175         ec = INVALID_ACCESS_ERR;
    2176         return;
    2177     }
    2178     Frame* frame = document->frame();
    2179     frame->setTextZoomFactor(zoomFactor);
    2180 }
    2181 
    2182 void Internals::setUseFixedLayout(bool useFixedLayout, ExceptionCode& ec)
    2183 {
    2184     Document* document = contextDocument();
    2185     if (!document || !document->view()) {
    2186         ec = INVALID_ACCESS_ERR;
    2187         return;
    2188     }
    2189     FrameView* frameView = document->view();
    2190     frameView->setUseFixedLayout(useFixedLayout);
    2191 }
    2192 
    2193 void Internals::setFixedLayoutSize(int width, int height, ExceptionCode& ec)
    2194 {
    2195     Document* document = contextDocument();
    2196     if (!document || !document->view()) {
    2197         ec = INVALID_ACCESS_ERR;
    2198         return;
    2199     }
    2200     FrameView* frameView = document->view();
    2201     frameView->setFixedLayoutSize(IntSize(width, height));
    2202 }
    2203 
    2204 void Internals::setViewExposedRect(float x, float y, float width, float height, ExceptionCode& ec)
    2205 {
    2206     Document* document = contextDocument();
    2207     if (!document || !document->view()) {
    2208         ec = INVALID_ACCESS_ERR;
    2209         return;
    2210     }
    2211 
    2212     FrameView* frameView = document->view();
    2213     frameView->setViewExposedRect(FloatRect(x, y, width, height));
     2036ExceptionOr<void> Internals::setPageScaleFactor(float scaleFactor, int x, int y)
     2037{
     2038    Document* document = contextDocument();
     2039    if (!document || !document->page())
     2040        return Exception { INVALID_ACCESS_ERR };
     2041
     2042    document->page()->setPageScaleFactor(scaleFactor, IntPoint(x, y));
     2043    return { };
     2044}
     2045
     2046ExceptionOr<void> Internals::setPageZoomFactor(float zoomFactor)
     2047{
     2048    Document* document = contextDocument();
     2049    if (!document || !document->frame())
     2050        return Exception { INVALID_ACCESS_ERR };
     2051
     2052    document->frame()->setPageZoomFactor(zoomFactor);
     2053    return { };
     2054}
     2055
     2056ExceptionOr<void> Internals::setTextZoomFactor(float zoomFactor)
     2057{
     2058    Document* document = contextDocument();
     2059    if (!document || !document->frame())
     2060        return Exception { INVALID_ACCESS_ERR };
     2061
     2062    document->frame()->setTextZoomFactor(zoomFactor);
     2063    return { };
     2064}
     2065
     2066ExceptionOr<void> Internals::setUseFixedLayout(bool useFixedLayout)
     2067{
     2068    Document* document = contextDocument();
     2069    if (!document || !document->view())
     2070        return Exception { INVALID_ACCESS_ERR };
     2071
     2072    document->view()->setUseFixedLayout(useFixedLayout);
     2073    return { };
     2074}
     2075
     2076ExceptionOr<void> Internals::setFixedLayoutSize(int width, int height)
     2077{
     2078    Document* document = contextDocument();
     2079    if (!document || !document->view())
     2080        return Exception { INVALID_ACCESS_ERR };
     2081
     2082    document->view()->setFixedLayoutSize(IntSize(width, height));
     2083    return { };
     2084}
     2085
     2086ExceptionOr<void> Internals::setViewExposedRect(float x, float y, float width, float height)
     2087{
     2088    Document* document = contextDocument();
     2089    if (!document || !document->view())
     2090        return Exception { INVALID_ACCESS_ERR };
     2091
     2092    document->view()->setViewExposedRect(FloatRect(x, y, width, height));
     2093    return { };
    22142094}
    22152095
     
    22202100        return;
    22212101
    2222     FrameView* frameView = document->view();
    2223     frameView->setHeaderHeight(height);
     2102    document->view()->setHeaderHeight(height);
    22242103}
    22252104
     
    22302109        return;
    22312110
    2232     FrameView* frameView = document->view();
    2233     frameView->setFooterHeight(height);
     2111    document->view()->setFooterHeight(height);
    22342112}
    22352113   
     
    22372115{
    22382116    Document* document = contextDocument();
    2239     if (!document)
     2117    if (!document || !document->page())
    22402118        return;
    2241    
    2242     Page* page = document->page();
    2243     page->setTopContentInset(contentInset);
     2119
     2120    document->page()->setTopContentInset(contentInset);
    22442121}
    22452122
    22462123#if ENABLE(FULLSCREEN_API)
     2124
    22472125void Internals::webkitWillEnterFullScreenForElement(Element& element)
    22482126{
     
    22762154    document->webkitDidExitFullScreenForElement(&element);
    22772155}
     2156
    22782157#endif
    22792158
     
    22812160{
    22822161    Document* document = contextDocument();
    2283     if (!document)
     2162    if (!document || !document->page())
    22842163        return;
    22852164    document->page()->applicationCacheStorage().storeUpdatedQuotaForOrigin(document->securityOrigin(), quota);
     
    23172196}
    23182197
    2319 void Internals::startTrackingRepaints(ExceptionCode& ec)
    2320 {
    2321     Document* document = contextDocument();
    2322     if (!document || !document->view()) {
    2323         ec = INVALID_ACCESS_ERR;
    2324         return;
    2325     }
    2326 
    2327     FrameView* frameView = document->view();
    2328     frameView->setTracksRepaints(true);
    2329 }
    2330 
    2331 void Internals::stopTrackingRepaints(ExceptionCode& ec)
    2332 {
    2333     Document* document = contextDocument();
    2334     if (!document || !document->view()) {
    2335         ec = INVALID_ACCESS_ERR;
    2336         return;
    2337     }
    2338 
    2339     FrameView* frameView = document->view();
    2340     frameView->setTracksRepaints(false);
    2341 }
    2342 
    2343 void Internals::startTrackingLayerFlushes(ExceptionCode& ec)
    2344 {
    2345     Document* document = contextDocument();
    2346     if (!document || !document->renderView()) {
    2347         ec = INVALID_ACCESS_ERR;
    2348         return;
    2349     }
     2198ExceptionOr<void> Internals::startTrackingRepaints()
     2199{
     2200    Document* document = contextDocument();
     2201    if (!document || !document->view())
     2202        return Exception { INVALID_ACCESS_ERR };
     2203
     2204    document->view()->setTracksRepaints(true);
     2205    return { };
     2206}
     2207
     2208ExceptionOr<void> Internals::stopTrackingRepaints()
     2209{
     2210    Document* document = contextDocument();
     2211    if (!document || !document->view())
     2212        return Exception { INVALID_ACCESS_ERR };
     2213
     2214    document->view()->setTracksRepaints(false);
     2215    return { };
     2216}
     2217
     2218ExceptionOr<void> Internals::startTrackingLayerFlushes()
     2219{
     2220    Document* document = contextDocument();
     2221    if (!document || !document->renderView())
     2222        return Exception { INVALID_ACCESS_ERR };
    23502223
    23512224    document->renderView()->compositor().startTrackingLayerFlushes();
    2352 }
    2353 
    2354 unsigned Internals::layerFlushCount(ExceptionCode& ec)
    2355 {
    2356     Document* document = contextDocument();
    2357     if (!document || !document->renderView()) {
    2358         ec = INVALID_ACCESS_ERR;
    2359         return 0;
    2360     }
     2225    return { };
     2226}
     2227
     2228ExceptionOr<unsigned> Internals::layerFlushCount()
     2229{
     2230    Document* document = contextDocument();
     2231    if (!document || !document->renderView())
     2232        return Exception { INVALID_ACCESS_ERR };
    23612233
    23622234    return document->renderView()->compositor().layerFlushCount();
    23632235}
    23642236
    2365 void Internals::startTrackingStyleRecalcs(ExceptionCode& ec)
    2366 {
    2367     Document* document = contextDocument();
    2368     if (!document) {
    2369         ec = INVALID_ACCESS_ERR;
    2370         return;
    2371     }
     2237ExceptionOr<void> Internals::startTrackingStyleRecalcs()
     2238{
     2239    Document* document = contextDocument();
     2240    if (!document)
     2241        return Exception { INVALID_ACCESS_ERR };
     2242
    23722243    document->startTrackingStyleRecalcs();
    2373 }
    2374 
    2375 unsigned Internals::styleRecalcCount(ExceptionCode& ec)
    2376 {
    2377     Document* document = contextDocument();
    2378     if (!document) {
    2379         ec = INVALID_ACCESS_ERR;
    2380         return 0;
    2381     }
     2244    return { };
     2245}
     2246
     2247ExceptionOr<unsigned> Internals::styleRecalcCount()
     2248{
     2249    Document* document = contextDocument();
     2250    if (!document)
     2251        return Exception { INVALID_ACCESS_ERR };
    23822252   
    23832253    return document->styleRecalcCount();
     
    23922262}
    23932263
    2394 void Internals::startTrackingCompositingUpdates(ExceptionCode& ec)
    2395 {
    2396     Document* document = contextDocument();
    2397     if (!document || !document->renderView()) {
    2398         ec = INVALID_ACCESS_ERR;
    2399         return;
    2400     }
     2264ExceptionOr<void> Internals::startTrackingCompositingUpdates()
     2265{
     2266    Document* document = contextDocument();
     2267    if (!document || !document->renderView())
     2268        return Exception { INVALID_ACCESS_ERR };
    24012269
    24022270    document->renderView()->compositor().startTrackingCompositingUpdates();
    2403 }
    2404 
    2405 unsigned Internals::compositingUpdateCount(ExceptionCode& ec)
    2406 {
    2407     Document* document = contextDocument();
    2408     if (!document || !document->renderView()) {
    2409         ec = INVALID_ACCESS_ERR;
    2410         return 0;
    2411     }
     2271    return { };
     2272}
     2273
     2274ExceptionOr<unsigned> Internals::compositingUpdateCount()
     2275{
     2276    Document* document = contextDocument();
     2277    if (!document || !document->renderView())
     2278        return Exception { INVALID_ACCESS_ERR };
    24122279   
    24132280    return document->renderView()->compositor().compositingUpdateCount();
    24142281}
    24152282
    2416 void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node* node, ExceptionCode& ec)
     2283ExceptionOr<void> Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node* node)
    24172284{
    24182285    Document* document;
     
    24232290    else if (is<HTMLIFrameElement>(*node))
    24242291        document = downcast<HTMLIFrameElement>(*node).contentDocument();
    2425     else {
    2426         ec = TypeError;
    2427         return;
    2428     }
     2292    else
     2293        return Exception { TypeError };
    24292294
    24302295    document->updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks::Synchronously);
     2296    return { };
    24312297}
    24322298
     
    24942360#endif
    24952361
    2496 String Internals::getCurrentCursorInfo(ExceptionCode& ec)
    2497 {
    2498     Document* document = contextDocument();
    2499     if (!document || !document->frame()) {
    2500         ec = INVALID_ACCESS_ERR;
    2501         return String();
    2502     }
     2362ExceptionOr<String> Internals::getCurrentCursorInfo()
     2363{
     2364    Document* document = contextDocument();
     2365    if (!document || !document->frame())
     2366        return Exception { INVALID_ACCESS_ERR };
    25032367
    25042368#if !PLATFORM(IOS)
     
    25282392    return result.toString();
    25292393#else
    2530     return "FAIL: Cursor details not available on this platform.";
     2394    return String { "FAIL: Cursor details not available on this platform." };
    25312395#endif
    25322396}
     
    26122476}
    26132477
    2614 bool Internals::mediaElementHasCharacteristic(HTMLMediaElement& element, const String& characteristic, ExceptionCode& ec)
     2478ExceptionOr<bool> Internals::mediaElementHasCharacteristic(HTMLMediaElement& element, const String& characteristic)
    26152479{
    26162480    if (equalLettersIgnoringASCIICase(characteristic, "audible"))
     
    26212485        return element.hasClosedCaptions();
    26222486
    2623     ec = SYNTAX_ERR;
    2624     return false;
    2625 }
     2487    return Exception { SYNTAX_ERR };
     2488}
     2489
    26262490#endif
    26272491
     
    26402504}
    26412505
    2642 String Internals::captionsStyleSheetOverride(ExceptionCode& ec)
    2643 {
    2644     Document* document = contextDocument();
    2645     if (!document || !document->page()) {
    2646         ec = INVALID_ACCESS_ERR;
    2647         return emptyString();
    2648     }
     2506ExceptionOr<String> Internals::captionsStyleSheetOverride()
     2507{
     2508    Document* document = contextDocument();
     2509    if (!document || !document->page())
     2510        return Exception { INVALID_ACCESS_ERR };
    26492511
    26502512#if ENABLE(VIDEO_TRACK)
     
    26552517}
    26562518
    2657 void Internals::setCaptionsStyleSheetOverride(const String& override, ExceptionCode& ec)
    2658 {
    2659     Document* document = contextDocument();
    2660     if (!document || !document->page()) {
    2661         ec = INVALID_ACCESS_ERR;
    2662         return;
    2663     }
     2519ExceptionOr<void> Internals::setCaptionsStyleSheetOverride(const String& override)
     2520{
     2521    Document* document = contextDocument();
     2522    if (!document || !document->page())
     2523        return Exception { INVALID_ACCESS_ERR };
    26642524
    26652525#if ENABLE(VIDEO_TRACK)
     
    26682528    UNUSED_PARAM(override);
    26692529#endif
    2670 }
    2671 
    2672 void Internals::setPrimaryAudioTrackLanguageOverride(const String& language, ExceptionCode& ec)
    2673 {
    2674     Document* document = contextDocument();
    2675     if (!document || !document->page()) {
    2676         ec = INVALID_ACCESS_ERR;
    2677         return;
    2678     }
     2530    return { };
     2531}
     2532
     2533ExceptionOr<void> Internals::setPrimaryAudioTrackLanguageOverride(const String& language)
     2534{
     2535    Document* document = contextDocument();
     2536    if (!document || !document->page())
     2537        return Exception { INVALID_ACCESS_ERR };
    26792538
    26802539#if ENABLE(VIDEO_TRACK)
     
    26832542    UNUSED_PARAM(language);
    26842543#endif
    2685 }
    2686 
    2687 void Internals::setCaptionDisplayMode(const String& mode, ExceptionCode& ec)
    2688 {
    2689     Document* document = contextDocument();
    2690     if (!document || !document->page()) {
    2691         ec = INVALID_ACCESS_ERR;
    2692         return;
    2693     }
     2544    return { };
     2545}
     2546
     2547ExceptionOr<void> Internals::setCaptionDisplayMode(const String& mode)
     2548{
     2549    Document* document = contextDocument();
     2550    if (!document || !document->page())
     2551        return Exception { INVALID_ACCESS_ERR };
    26942552   
    26952553#if ENABLE(VIDEO_TRACK)
     
    27052563        captionPreferences.setCaptionDisplayMode(CaptionUserPreferences::Manual);
    27062564    else
    2707         ec = SYNTAX_ERR;
     2565        return Exception { SYNTAX_ERR };
    27082566#else
    27092567    UNUSED_PARAM(mode);
    27102568#endif
     2569    return { };
    27112570}
    27122571
    27132572#if ENABLE(VIDEO)
     2573
    27142574Ref<TimeRanges> Internals::createTimeRanges(Float32Array& startTimes, Float32Array& endTimes)
    27152575{
     
    27272587    return ranges.nearest(time);
    27282588}
    2729 #endif
    2730 
    2731 Ref<ClientRect> Internals::selectionBounds(ExceptionCode& ec)
    2732 {
    2733     Document* document = contextDocument();
    2734     if (!document || !document->frame()) {
    2735         ec = INVALID_ACCESS_ERR;
    2736         return ClientRect::create();
    2737     }
     2589
     2590#endif
     2591
     2592ExceptionOr<Ref<ClientRect>> Internals::selectionBounds()
     2593{
     2594    Document* document = contextDocument();
     2595    if (!document || !document->frame())
     2596        return Exception { INVALID_ACCESS_ERR };
    27382597
    27392598    return ClientRect::create(document->frame()->selection().selectionBounds());
     
    27412600
    27422601#if ENABLE(VIBRATION)
     2602
    27432603bool Internals::isVibrating()
    27442604{
    2745     Page* page = contextDocument()->page();
    2746     ASSERT(page);
    2747 
    2748     return Vibration::from(page)->isVibrating();
    2749 }
    2750 #endif
    2751 
    2752 bool Internals::isPluginUnavailabilityIndicatorObscured(Element& element, ExceptionCode& ec)
     2605    auto* document = contextDocument();
     2606    auto* page = document ? document->page() : nullptr;
     2607    return page && Vibration::from(page)->isVibrating();
     2608}
     2609
     2610#endif
     2611
     2612ExceptionOr<bool> Internals::isPluginUnavailabilityIndicatorObscured(Element& element)
    27532613{
    27542614    auto* renderer = element.renderer();
    2755     if (!is<RenderEmbeddedObject>(renderer)) {
    2756         ec = INVALID_ACCESS_ERR;
    2757         return false;
    2758     }
     2615    if (!is<RenderEmbeddedObject>(renderer))
     2616        return Exception { INVALID_ACCESS_ERR };
    27592617
    27602618    return downcast<RenderEmbeddedObject>(*renderer).isReplacementObscured();
     
    27952653#if ENABLE(VIDEO)
    27962654
    2797 void Internals::beginMediaSessionInterruption(const String& interruptionString, ExceptionCode& ec)
     2655ExceptionOr<void> Internals::beginMediaSessionInterruption(const String& interruptionString)
    27982656{
    27992657    PlatformMediaSession::InterruptionType interruption = PlatformMediaSession::SystemInterruption;
     
    28072665    else if (equalLettersIgnoringASCIICase(interruptionString, "suspendedunderlock"))
    28082666        interruption = PlatformMediaSession::SuspendedUnderLock;
    2809     else {
    2810         ec = INVALID_ACCESS_ERR;
    2811         return;
    2812     }
     2667    else
     2668        return Exception { INVALID_ACCESS_ERR };
    28132669
    28142670    PlatformMediaSessionManager::sharedManager().beginInterruption(interruption);
     2671    return { };
    28152672}
    28162673
     
    28352692}
    28362693
    2837 void Internals::setMediaSessionRestrictions(const String& mediaTypeString, const String& restrictionsString, ExceptionCode& ec)
     2694ExceptionOr<void> Internals::setMediaSessionRestrictions(const String& mediaTypeString, const String& restrictionsString)
    28382695{
    28392696    PlatformMediaSession::MediaType mediaType = PlatformMediaSession::None;
     
    28442701    else if (equalLettersIgnoringASCIICase(mediaTypeString, "webaudio"))
    28452702        mediaType = PlatformMediaSession::WebAudio;
    2846     else {
    2847         ec = INVALID_ACCESS_ERR;
    2848         return;
    2849     }
     2703    else
     2704        return Exception { INVALID_ACCESS_ERR };
    28502705
    28512706    PlatformMediaSessionManager::SessionRestrictions restrictions = PlatformMediaSessionManager::sharedManager().restrictions(mediaType);
     
    28672722    }
    28682723    PlatformMediaSessionManager::sharedManager().addRestriction(mediaType, restrictions);
     2724    return { };
    28692725}
    28702726
     
    29112767}
    29122768
    2913 void Internals::postRemoteControlCommand(const String& commandString, float argument, ExceptionCode& ec)
     2769ExceptionOr<void> Internals::postRemoteControlCommand(const String& commandString, float argument)
    29142770{
    29152771    PlatformMediaSession::RemoteControlCommandType command;
     
    29342790    else if (equalLettersIgnoringASCIICase(commandString, "seektoplaybackposition"))
    29352791        command = PlatformMediaSession::SeekToPlaybackPositionCommand;
    2936     else {
    2937         ec = INVALID_ACCESS_ERR;
    2938         return;
    2939     }
     2792    else
     2793        return Exception { INVALID_ACCESS_ERR };
    29402794   
    29412795    PlatformMediaSessionManager::sharedManager().didReceiveRemoteControlCommand(command, &parameter);
     2796    return { };
    29422797}
    29432798
     
    30452900}
    30462901
    3047 void Internals::setMockMediaPlaybackTargetPickerState(const String& deviceName, const String& deviceState, ExceptionCode& ec)
     2902ExceptionOr<void> Internals::setMockMediaPlaybackTargetPickerState(const String& deviceName, const String& deviceState)
    30482903{
    30492904    Page* page = contextDocument()->frame()->page();
     
    30582913    else if (equalLettersIgnoringASCIICase(deviceState, "unknown"))
    30592914        state = MediaPlaybackTargetContext::Unknown;
    3060     else {
    3061         ec = INVALID_ACCESS_ERR;
    3062         return;
    3063     }
     2915    else
     2916        return Exception { INVALID_ACCESS_ERR };
    30642917
    30652918    page->setMockMediaPlaybackTargetPickerState(deviceName, state);
    3066 }
    3067 
    3068 #endif
    3069 
    3070 RefPtr<MockPageOverlay> Internals::installMockPageOverlay(PageOverlayType type, ExceptionCode& ec)
    3071 {
    3072     Document* document = contextDocument();
    3073     if (!document || !document->frame()) {
    3074         ec = INVALID_ACCESS_ERR;
    3075         return nullptr;
    3076     }
     2919    return { };
     2920}
     2921
     2922#endif
     2923
     2924ExceptionOr<Ref<MockPageOverlay>> Internals::installMockPageOverlay(PageOverlayType type)
     2925{
     2926    Document* document = contextDocument();
     2927    if (!document || !document->frame())
     2928        return Exception { INVALID_ACCESS_ERR };
    30772929
    30782930    return MockPageOverlayClient::singleton().installOverlay(document->frame()->mainFrame(), type == PageOverlayType::View ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
    30792931}
    30802932
    3081 String Internals::pageOverlayLayerTreeAsText(ExceptionCode& ec) const
    3082 {
    3083     Document* document = contextDocument();
    3084     if (!document || !document->frame()) {
    3085         ec = INVALID_ACCESS_ERR;
    3086         return String();
    3087     }
     2933ExceptionOr<String> Internals::pageOverlayLayerTreeAsText() const
     2934{
     2935    Document* document = contextDocument();
     2936    if (!document || !document->frame())
     2937        return Exception { INVALID_ACCESS_ERR };
    30882938
    30892939    document->updateLayout();
     
    31733023}
    31743024   
    3175 String Internals::scrollSnapOffsets(Element& element, ExceptionCode& ec)
     3025ExceptionOr<String> Internals::scrollSnapOffsets(Element& element)
    31763026{
    31773027    if (!element.renderBox())
     
    31833033    if (box.isBody()) {
    31843034        FrameView* frameView = box.frame().mainFrame().view();
    3185         if (!frameView || !frameView->isScrollable()) {
    3186             ec = INVALID_ACCESS_ERR;
    3187             return String();
    3188         }
     3035        if (!frameView || !frameView->isScrollable())
     3036            return Exception { INVALID_ACCESS_ERR };
    31893037        scrollableArea = frameView;
    31903038       
    31913039    } else {
    3192         if (!box.canBeScrolledAndHasScrollableArea()) {
    3193             ec = INVALID_ACCESS_ERR;
    3194             return String();
    3195         }
     3040        if (!box.canBeScrolledAndHasScrollableArea())
     3041            return Exception { INVALID_ACCESS_ERR };
    31963042        scrollableArea = box.layer();
    31973043    }
     
    32253071}
    32263072
    3227 String Internals::pathStringWithShrinkWrappedRects(Vector<double> rectComponents, double radius, ExceptionCode& ec)
    3228 {
    3229     if (rectComponents.size() % 4) {
    3230         ec = INVALID_ACCESS_ERR;
    3231         return String();
    3232     }
     3073ExceptionOr<String> Internals::pathStringWithShrinkWrappedRects(const Vector<double>& rectComponents, double radius)
     3074{
     3075    if (rectComponents.size() % 4)
     3076        return Exception { INVALID_ACCESS_ERR };
    32333077
    32343078    Vector<FloatRect> rects;
    3235     while (!rectComponents.isEmpty()) {
    3236         double height = rectComponents.takeLast();
    3237         double width = rectComponents.takeLast();
    3238         double y = rectComponents.takeLast();
    3239         double x = rectComponents.takeLast();
    3240 
    3241         rects.append(FloatRect(x, y, width, height));
    3242     }
    3243 
    3244     rects.reverse();
    3245 
    3246     Path path = PathUtilities::pathWithShrinkWrappedRects(rects, radius);
    3247 
    3248     String pathString;
    3249     buildStringFromPath(path, pathString);
    3250 
    3251     return pathString;
     3079    for (unsigned i = 0; i < rectComponents.size(); i += 4)
     3080        rects.append(FloatRect(rectComponents[i], rectComponents[i + 1], rectComponents[i + 2], rectComponents[i + 3]));
     3081
     3082    SVGPathStringBuilder builder;
     3083    PathUtilities::pathWithShrinkWrappedRects(rects, radius).apply([&builder](const PathElement& element) {
     3084        switch (element.type) {
     3085        case PathElementMoveToPoint:
     3086            builder.moveTo(element.points[0], false, AbsoluteCoordinates);
     3087            return;
     3088        case PathElementAddLineToPoint:
     3089            builder.lineTo(element.points[0], AbsoluteCoordinates);
     3090            return;
     3091        case PathElementAddQuadCurveToPoint:
     3092            builder.curveToQuadratic(element.points[0], element.points[1], AbsoluteCoordinates);
     3093            return;
     3094        case PathElementAddCurveToPoint:
     3095            builder.curveToCubic(element.points[0], element.points[1], element.points[2], AbsoluteCoordinates);
     3096            return;
     3097        case PathElementCloseSubpath:
     3098            builder.closePath();
     3099            return;
     3100        }
     3101        ASSERT_NOT_REACHED();
     3102    });
     3103    return builder.result();
    32523104}
    32533105
     
    33133165#endif
    33143166
    3315 String Internals::resourceLoadStatisticsForOrigin(String origin)
     3167String Internals::resourceLoadStatisticsForOrigin(const String& origin)
    33163168{
    33173169    return ResourceLoadObserver::sharedObserver().statisticsForOrigin(origin);
     
    33363188
    33373189#if ENABLE(CSS_GRID_LAYOUT)
     3190
    33383191void Internals::setCSSGridLayoutEnabled(bool enable)
    33393192{
    33403193    RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled(enable);
    33413194}
     3195
    33423196#endif
    33433197
    33443198#if ENABLE(WEBGL2)
     3199
    33453200bool Internals::webGL2Enabled() const
    33463201{
     
    33523207    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(enable);
    33533208}
     3209
    33543210#endif
    33553211
     
    33863242
    33873243#if !PLATFORM(COCOA)
     3244
    33883245bool Internals::userPrefersReducedMotion() const
    33893246{
    33903247    return false;
    33913248}
     3249
    33923250#endif
    33933251
  • trunk/Source/WebCore/testing/Internals.h

    r207372 r207521  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
    3  * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
     3 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    2929#include "CSSComputedStyleDeclaration.h"
    3030#include "ContextDestructionObserver.h"
     31#include "ExceptionOr.h"
    3132#include "PageConsoleClient.h"
    3233#include <runtime/Float32Array.h>
     
    7172class XMLHttpRequest;
    7273
    73 typedef int ExceptionCode;
    74 
    7574class Internals final : public RefCounted<Internals>, private ContextDestructionObserver {
    7675public:
     
    8079    static void resetToConsistentState(Page&);
    8180
    82     String elementRenderTreeAsText(Element&, ExceptionCode&);
     81    ExceptionOr<String> elementRenderTreeAsText(Element&);
    8382    bool hasPausedImageAnimations(Element&);
    8483
     
    9594    enum class CachePolicy { UseProtocolCachePolicy, ReloadIgnoringCacheData, ReturnCacheDataElseLoad, ReturnCacheDataDontLoad };
    9695    void setOverrideCachePolicy(CachePolicy);
    97     void setCanShowModalDialogOverride(bool allow, ExceptionCode&);
     96    ExceptionOr<void> setCanShowModalDialogOverride(bool allow);
    9897    enum class ResourceLoadPriority { ResourceLoadPriorityVeryLow, ResourceLoadPriorityLow, ResourceLoadPriorityMedium, ResourceLoadPriorityHigh, ResourceLoadPriorityVeryHigh };
    9998    void setOverrideResourceLoadPriority(ResourceLoadPriority);
     
    111110    RefPtr<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Element&) const;
    112111
    113     Node* ensureShadowRoot(Element& host, ExceptionCode&);
     112    ExceptionOr<Node*> ensureShadowRoot(Element& host);
    114113    Node* ensureUserAgentShadowRoot(Element& host);
    115     Node* createShadowRoot(Element& host, ExceptionCode&);
     114    ExceptionOr<Node*> createShadowRoot(Element& host);
    116115    Node* shadowRoot(Element& host);
    117     String shadowRootType(const Node&, ExceptionCode&) const;
     116    ExceptionOr<String> shadowRootType(const Node&) const;
    118117    String shadowPseudoId(Element&);
    119118    void setShadowPseudoId(Element&, const String&);
    120119
    121120    // DOMTimers throttling testing.
    122     bool isTimerThrottled(int timeoutId, ExceptionCode&);
     121    ExceptionOr<bool> isTimerThrottled(int timeoutId);
    123122    bool isRequestAnimationFrameThrottled() const;
    124123    bool areTimersThrottled() const;
    125124
    126125    // Spatial Navigation testing.
    127     unsigned lastSpatialNavigationCandidateCount(ExceptionCode&) const;
     126    ExceptionOr<unsigned> lastSpatialNavigationCandidateCount() const;
    128127
    129128    // CSS Animation testing.
    130129    unsigned numberOfActiveAnimations() const;
    131     bool animationsAreSuspended(ExceptionCode&) const;
    132     void suspendAnimations(ExceptionCode&) const;
    133     void resumeAnimations(ExceptionCode&) const;
    134     bool pauseAnimationAtTimeOnElement(const String& animationName, double pauseTime, Element&, ExceptionCode&);
    135     bool pauseAnimationAtTimeOnPseudoElement(const String& animationName, double pauseTime, Element&, const String& pseudoId, ExceptionCode&);
     130    ExceptionOr<bool> animationsAreSuspended() const;
     131    ExceptionOr<void> suspendAnimations() const;
     132    ExceptionOr<void> resumeAnimations() const;
     133    ExceptionOr<bool> pauseAnimationAtTimeOnElement(const String& animationName, double pauseTime, Element&);
     134    ExceptionOr<bool> pauseAnimationAtTimeOnPseudoElement(const String& animationName, double pauseTime, Element&, const String& pseudoId);
    136135
    137136    // CSS Transition testing.
    138     bool pauseTransitionAtTimeOnElement(const String& propertyName, double pauseTime, Element&, ExceptionCode&);
    139     bool pauseTransitionAtTimeOnPseudoElement(const String& property, double pauseTime, Element&, const String& pseudoId, ExceptionCode&);
     137    ExceptionOr<bool> pauseTransitionAtTimeOnElement(const String& propertyName, double pauseTime, Element&);
     138    ExceptionOr<bool> pauseTransitionAtTimeOnPseudoElement(const String& property, double pauseTime, Element&, const String& pseudoId);
    140139
    141140    Node* treeScopeRootNode(Node&);
     
    144143    String visiblePlaceholder(Element&);
    145144    void selectColorInColorChooser(HTMLInputElement&, const String& colorValue);
    146     Vector<String> formControlStateOfPreviousHistoryItem(ExceptionCode&);
    147     void setFormControlStateOfPreviousHistoryItem(const Vector<String>&, ExceptionCode&);
    148 
    149     Ref<ClientRect> absoluteCaretBounds(ExceptionCode&);
     145    ExceptionOr<Vector<String>> formControlStateOfPreviousHistoryItem();
     146    ExceptionOr<void> setFormControlStateOfPreviousHistoryItem(const Vector<String>&);
     147
     148    ExceptionOr<Ref<ClientRect>> absoluteCaretBounds();
    150149
    151150    Ref<ClientRect> boundingBox(Element&);
    152151
    153     Ref<ClientRectList> inspectorHighlightRects(ExceptionCode&);
    154     String inspectorHighlightObject(ExceptionCode&);
    155 
    156     unsigned markerCountForNode(Node&, const String&, ExceptionCode&);
    157     RefPtr<Range> markerRangeForNode(Node&, const String& markerType, unsigned index, ExceptionCode&);
    158     String markerDescriptionForNode(Node&, const String& markerType, unsigned index, ExceptionCode&);
    159     String dumpMarkerRects(const String& markerType, ExceptionCode&);
     152    ExceptionOr<Ref<ClientRectList>> inspectorHighlightRects();
     153    ExceptionOr<String> inspectorHighlightObject();
     154
     155    ExceptionOr<unsigned> markerCountForNode(Node&, const String&);
     156    ExceptionOr<RefPtr<Range>> markerRangeForNode(Node&, const String& markerType, unsigned index);
     157    ExceptionOr<String> markerDescriptionForNode(Node&, const String& markerType, unsigned index);
     158    ExceptionOr<String> dumpMarkerRects(const String& markerType);
    160159    void addTextMatchMarker(const Range&, bool isActive);
    161     void setMarkedTextMatchesAreHighlighted(bool, ExceptionCode&);
     160    ExceptionOr<void> setMarkedTextMatchesAreHighlighted(bool);
    162161
    163162    void invalidateFontCache();
    164163
    165     void setScrollViewPosition(int x, int y, ExceptionCode&);
    166     void setViewBaseBackgroundColor(const String& colorValue, ExceptionCode&);
    167 
    168     void setPagination(const String& mode, int gap, int pageLength, ExceptionCode&);
    169     void setPaginationLineGridEnabled(bool, ExceptionCode&);
    170     String configurationForViewport(float devicePixelRatio, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight, ExceptionCode&);
    171 
    172     bool wasLastChangeUserEdit(Element& textField, ExceptionCode&);
     164    ExceptionOr<void> setScrollViewPosition(int x, int y);
     165    ExceptionOr<void> setViewBaseBackgroundColor(const String& colorValue);
     166
     167    ExceptionOr<void> setPagination(const String& mode, int gap, int pageLength);
     168    ExceptionOr<void> setPaginationLineGridEnabled(bool);
     169    ExceptionOr<String> configurationForViewport(float devicePixelRatio, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
     170
     171    ExceptionOr<bool> wasLastChangeUserEdit(Element& textField);
    173172    bool elementShouldAutoComplete(HTMLInputElement&);
    174173    void setEditingValue(HTMLInputElement&, const String&);
     
    176175    enum class AutoFillButtonType { AutoFillButtonTypeNone, AutoFillButtonTypeContacts, AutoFillButtonTypeCredentials };
    177176    void setShowAutoFillButton(HTMLInputElement&, AutoFillButtonType);
    178     void scrollElementToRect(Element&, int x, int y, int w, int h, ExceptionCode&);
    179 
    180     String autofillFieldName(Element&, ExceptionCode&);
    181 
    182     void paintControlTints(ExceptionCode&);
     177    ExceptionOr<void> scrollElementToRect(Element&, int x, int y, int w, int h);
     178
     179    ExceptionOr<String> autofillFieldName(Element&);
     180
     181    ExceptionOr<void> paintControlTints();
    183182
    184183    RefPtr<Range> rangeFromLocationAndLength(Element& scope, int rangeLocation, int rangeLength);
     
    187186    String rangeAsText(const Range&);
    188187    RefPtr<Range> subrange(Range&, int rangeLocation, int rangeLength);
    189     RefPtr<Range> rangeForDictionaryLookupAtLocation(int x, int y, ExceptionCode&);
    190 
    191     void setDelegatesScrolling(bool enabled, ExceptionCode&);
    192 
    193     int lastSpellCheckRequestSequence(ExceptionCode&);
    194     int lastSpellCheckProcessedSequence(ExceptionCode&);
     188    ExceptionOr<RefPtr<Range>> rangeForDictionaryLookupAtLocation(int x, int y);
     189
     190    ExceptionOr<void> setDelegatesScrolling(bool enabled);
     191
     192    ExceptionOr<int> lastSpellCheckRequestSequence();
     193    ExceptionOr<int> lastSpellCheckProcessedSequence();
    195194
    196195    Vector<String> userPreferredLanguages() const;
     
    200199    void setUserPreferredAudioCharacteristic(const String&);
    201200
    202     unsigned wheelEventHandlerCount(ExceptionCode&);
    203     unsigned touchEventHandlerCount(ExceptionCode&);
    204 
    205     RefPtr<NodeList> nodesFromRect(Document&, int x, int y, unsigned topPadding, unsigned rightPadding,
    206         unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode&) const;
     201    ExceptionOr<unsigned> wheelEventHandlerCount();
     202    ExceptionOr<unsigned> touchEventHandlerCount();
     203
     204    ExceptionOr<RefPtr<NodeList>> nodesFromRect(Document&, int x, int y, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const;
    207205
    208206    String parserMetaData(JSC::JSValue = JSC::JSValue::JSUndefined);
     
    210208    void updateEditorUINowIfScheduled();
    211209
    212     bool hasSpellingMarker(int from, int length, ExceptionCode&);
    213     bool hasGrammarMarker(int from, int length, ExceptionCode&);
    214     bool hasAutocorrectedMarker(int from, int length, ExceptionCode&);
     210    bool hasSpellingMarker(int from, int length);
     211    bool hasGrammarMarker(int from, int length);
     212    bool hasAutocorrectedMarker(int from, int length);
    215213    void setContinuousSpellCheckingEnabled(bool);
    216214    void setAutomaticQuoteSubstitutionEnabled(bool);
     
    220218    void setAutomaticSpellingCorrectionEnabled(bool);
    221219
    222     void handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length, ExceptionCode&);
    223 
    224     bool isOverwriteModeEnabled(ExceptionCode&);
    225     void toggleOverwriteModeEnabled(ExceptionCode&);
    226 
    227     unsigned countMatchesForText(const String&, unsigned findOptions, const String& markMatches, ExceptionCode&);
    228     unsigned countFindMatches(const String&, unsigned findOptions, ExceptionCode&);
    229 
    230     unsigned numberOfScrollableAreas(ExceptionCode&);
    231 
    232     bool isPageBoxVisible(int pageNumber, ExceptionCode&);
     220    void handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length);
     221
     222    bool isOverwriteModeEnabled();
     223    void toggleOverwriteModeEnabled();
     224
     225    unsigned countMatchesForText(const String&, unsigned findOptions, const String& markMatches);
     226    unsigned countFindMatches(const String&, unsigned findOptions);
     227
     228    unsigned numberOfScrollableAreas();
     229
     230    ExceptionOr<bool> isPageBoxVisible(int pageNumber);
    233231
    234232    static const char* internalsId;
     
    237235    unsigned workerThreadCount() const;
    238236
    239     void setBatteryStatus(const String& eventType, bool charging, double chargingTime, double dischargingTime, double level, ExceptionCode&);
    240 
    241     void setDeviceProximity(const String& eventType, double value, double min, double max, ExceptionCode&);
     237    ExceptionOr<void> setBatteryStatus(const String& eventType, bool charging, double chargingTime, double dischargingTime, double level);
     238    ExceptionOr<void> setDeviceProximity(const String& eventType, double value, double min, double max);
    242239
    243240    enum {
     
    249246        LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16
    250247    };
    251     String layerTreeAsText(Document&, unsigned short flags, ExceptionCode&) const;
    252     String repaintRectsAsText(ExceptionCode&) const;
    253     String scrollingStateTreeAsText(ExceptionCode&) const;
    254     String mainThreadScrollingReasons(ExceptionCode&) const;
    255     RefPtr<ClientRectList> nonFastScrollableRects(ExceptionCode&) const;
    256 
    257     void setElementUsesDisplayListDrawing(Element&, bool usesDisplayListDrawing, ExceptionCode&);
    258     void setElementTracksDisplayListReplay(Element&, bool isTrackingReplay, ExceptionCode&);
     248    ExceptionOr<String> layerTreeAsText(Document&, unsigned short flags) const;
     249    ExceptionOr<String> repaintRectsAsText() const;
     250    ExceptionOr<String> scrollingStateTreeAsText() const;
     251    ExceptionOr<String> mainThreadScrollingReasons() const;
     252    ExceptionOr<RefPtr<ClientRectList>> nonFastScrollableRects() const;
     253
     254    ExceptionOr<void> setElementUsesDisplayListDrawing(Element&, bool usesDisplayListDrawing);
     255    ExceptionOr<void> setElementTracksDisplayListReplay(Element&, bool isTrackingReplay);
    259256
    260257    enum {
     
    262259        DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1,
    263260    };
    264     String displayListForElement(Element&, unsigned short flags, ExceptionCode&);
    265 
    266     String replayDisplayListForElement(Element&, unsigned short flags, ExceptionCode&);
    267 
    268     void garbageCollectDocumentResources(ExceptionCode&) const;
     261    ExceptionOr<String> displayListForElement(Element&, unsigned short flags);
     262    ExceptionOr<String> replayDisplayListForElement(Element&, unsigned short flags);
     263
     264    ExceptionOr<void> garbageCollectDocumentResources() const;
    269265
    270266    void beginSimulatedMemoryPressure();
     
    272268    bool isUnderMemoryPressure();
    273269
    274     void insertAuthorCSS(const String&, ExceptionCode&) const;
    275     void insertUserCSS(const String&, ExceptionCode&) const;
     270    ExceptionOr<void> insertAuthorCSS(const String&) const;
     271    ExceptionOr<void> insertUserCSS(const String&) const;
    276272
    277273    unsigned numberOfLiveNodes() const;
     
    280276    RefPtr<DOMWindow> openDummyInspectorFrontend(const String& url);
    281277    void closeDummyInspectorFrontend();
    282     void setInspectorIsUnderTest(bool isUnderTest, ExceptionCode&);
     278    ExceptionOr<void> setInspectorIsUnderTest(bool);
    283279
    284280    String counterValue(Element&);
     
    288284
    289285    int numberOfPages(float pageWidthInPixels = 800, float pageHeightInPixels = 600);
    290     String pageProperty(String, int, ExceptionCode&) const;
    291     String pageSizeAndMarginsInPixels(int, int, int, int, int, int, int, ExceptionCode&) const;
    292 
    293     void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&);
    294     void setPageZoomFactor(float zoomFactor, ExceptionCode&);
    295     void setTextZoomFactor(float zoomFactor, ExceptionCode&);
    296 
    297     void setUseFixedLayout(bool useFixedLayout, ExceptionCode&);
    298     void setFixedLayoutSize(int width, int height, ExceptionCode&);
    299     void setViewExposedRect(float left, float top, float width, float height, ExceptionCode&);
     286    ExceptionOr<String> pageProperty(const String& propertyName, int pageNumber) const;
     287    ExceptionOr<String> pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const;
     288
     289    ExceptionOr<void> setPageScaleFactor(float scaleFactor, int x, int y);
     290    ExceptionOr<void> setPageZoomFactor(float);
     291    ExceptionOr<void> setTextZoomFactor(float);
     292
     293    ExceptionOr<void> setUseFixedLayout(bool);
     294    ExceptionOr<void> setFixedLayoutSize(int width, int height);
     295    ExceptionOr<void> setViewExposedRect(float left, float top, float width, float height);
    300296
    301297    void setHeaderHeight(float);
     
    322318    Vector<String> getReferencedFilePaths() const;
    323319
    324     void startTrackingRepaints(ExceptionCode&);
    325     void stopTrackingRepaints(ExceptionCode&);
    326 
    327     void startTrackingLayerFlushes(ExceptionCode&);
    328     unsigned layerFlushCount(ExceptionCode&);
     320    ExceptionOr<void> startTrackingRepaints();
     321    ExceptionOr<void> stopTrackingRepaints();
     322
     323    ExceptionOr<void> startTrackingLayerFlushes();
     324    ExceptionOr<unsigned> layerFlushCount();
    329325   
    330     void startTrackingStyleRecalcs(ExceptionCode&);
    331     unsigned styleRecalcCount(ExceptionCode&);
     326    ExceptionOr<void> startTrackingStyleRecalcs();
     327    ExceptionOr<unsigned> styleRecalcCount();
    332328    unsigned lastStyleUpdateSize() const;
    333329
    334     void startTrackingCompositingUpdates(ExceptionCode&);
    335     unsigned compositingUpdateCount(ExceptionCode&);
    336 
    337     void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*, ExceptionCode&);
     330    ExceptionOr<void> startTrackingCompositingUpdates();
     331    ExceptionOr<unsigned> compositingUpdateCount();
     332
     333    ExceptionOr<void> updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*);
    338334    unsigned layoutCount() const;
    339335
     
    346342    void setUsesMockScrollAnimator(bool);
    347343
    348     String getCurrentCursorInfo(ExceptionCode&);
     344    ExceptionOr<String> getCurrentCursorInfo();
    349345
    350346    String markerTextForListItem(Element&);
     
    378374#if ENABLE(VIDEO)
    379375    void simulateAudioInterruption(HTMLMediaElement&);
    380     bool mediaElementHasCharacteristic(HTMLMediaElement&, const String&, ExceptionCode&);
     376    ExceptionOr<bool> mediaElementHasCharacteristic(HTMLMediaElement&, const String&);
    381377#endif
    382378
    383379    bool isSelectPopupVisible(HTMLSelectElement&);
    384380
    385     String captionsStyleSheetOverride(ExceptionCode&);
    386     void setCaptionsStyleSheetOverride(const String&, ExceptionCode&);
    387     void setPrimaryAudioTrackLanguageOverride(const String&, ExceptionCode&);
    388     void setCaptionDisplayMode(const String&, ExceptionCode&);
     381    ExceptionOr<String> captionsStyleSheetOverride();
     382    ExceptionOr<void> setCaptionsStyleSheetOverride(const String&);
     383    ExceptionOr<void> setPrimaryAudioTrackLanguageOverride(const String&);
     384    ExceptionOr<void> setCaptionDisplayMode(const String&);
    389385
    390386#if ENABLE(VIDEO)
     
    393389#endif
    394390
    395     Ref<ClientRect> selectionBounds(ExceptionCode&);
     391    ExceptionOr<Ref<ClientRect>> selectionBounds();
    396392
    397393#if ENABLE(VIBRATION)
     
    399395#endif
    400396
    401     bool isPluginUnavailabilityIndicatorObscured(Element&, ExceptionCode&);
     397    ExceptionOr<bool> isPluginUnavailabilityIndicatorObscured(Element&);
    402398    bool isPluginSnapshotted(Element&);
    403399
     
    410406
    411407#if ENABLE(VIDEO)
    412     void beginMediaSessionInterruption(const String&, ExceptionCode&);
     408    ExceptionOr<void> beginMediaSessionInterruption(const String&);
    413409    void endMediaSessionInterruption(const String&);
    414410    void applicationDidEnterForeground() const;
    415411    void applicationWillEnterBackground() const;
    416     void setMediaSessionRestrictions(const String& mediaType, const String& restrictions, ExceptionCode&);
     412    ExceptionOr<void> setMediaSessionRestrictions(const String& mediaType, const String& restrictions);
    417413    void setMediaElementRestrictions(HTMLMediaElement&, const String& restrictions);
    418     void postRemoteControlCommand(const String&, float argument, ExceptionCode&);
     414    ExceptionOr<void> postRemoteControlCommand(const String&, float argument);
    419415    bool elementIsBlockingDisplaySleep(HTMLMediaElement&) const;
    420416#endif
     
    431427#if ENABLE(WIRELESS_PLAYBACK_TARGET)
    432428    void setMockMediaPlaybackTargetPickerEnabled(bool);
    433     void setMockMediaPlaybackTargetPickerState(const String& deviceName, const String& deviceState, ExceptionCode&);
     429    ExceptionOr<void> setMockMediaPlaybackTargetPickerState(const String& deviceName, const String& deviceState);
    434430#endif
    435431
     
    442438
    443439    enum class PageOverlayType { View, Document };
    444     RefPtr<MockPageOverlay> installMockPageOverlay(PageOverlayType, ExceptionCode&);
    445     String pageOverlayLayerTreeAsText(ExceptionCode&) const;
     440    ExceptionOr<Ref<MockPageOverlay>> installMockPageOverlay(PageOverlayType);
     441    ExceptionOr<String> pageOverlayLayerTreeAsText() const;
    446442
    447443    void setPageMuted(bool);
     
    459455
    460456#if ENABLE(CSS_SCROLL_SNAP)
    461     String scrollSnapOffsets(Element&, ExceptionCode&);
    462 #endif
    463 
    464     String pathStringWithShrinkWrappedRects(Vector<double> rectComponents, double radius, ExceptionCode&);
     457    ExceptionOr<String> scrollSnapOffsets(Element&);
     458#endif
     459
     460    ExceptionOr<String> pathStringWithShrinkWrappedRects(const Vector<double>& rectComponents, double radius);
    465461
    466462    String getCurrentMediaControlsStatusForElement(HTMLMediaElement&);
     
    469465    void setShowAllPlugins(bool);
    470466
    471     String resourceLoadStatisticsForOrigin(String origin);
     467    String resourceLoadStatisticsForOrigin(const String& origin);
    472468    void setResourceLoadStatisticsEnabled(bool);
    473469
     
    504500    Frame* frame() const;
    505501
    506     RenderedDocumentMarker* markerAt(Node&, const String& markerType, unsigned index, ExceptionCode&);
     502    ExceptionOr<RenderedDocumentMarker*> markerAt(Node&, const String& markerType, unsigned index);
    507503
    508504    std::unique_ptr<InspectorStubFrontend> m_inspectorFrontend;
  • trunk/Source/WebCore/testing/Internals.idl

    r207372 r207521  
    8383    boolean hasPausedImageAnimations(Element element);
    8484
    85     [MayThrowLegacyException] DOMString elementRenderTreeAsText(Element element);
     85    [MayThrowException] DOMString elementRenderTreeAsText(Element element);
    8686    boolean isPreloaded(DOMString url);
    8787    boolean isLoadingFromMemoryCache(DOMString url);
     
    101101    CSSStyleDeclaration computedStyleIncludingVisitedInfo(Element element);
    102102
    103     [MayThrowLegacyException] Node ensureShadowRoot(Element host);
     103    [MayThrowException] Node ensureShadowRoot(Element host);
    104104    Node ensureUserAgentShadowRoot(Element host);
    105     [MayThrowLegacyException] Node createShadowRoot(Element host);
     105    [MayThrowException] Node createShadowRoot(Element host);
    106106    Node shadowRoot(Element host);
    107107
    108     [MayThrowLegacyException] DOMString shadowRootType(Node root);
     108    [MayThrowException] DOMString shadowRootType(Node root);
    109109    DOMString shadowPseudoId(Element element);
    110110    void setShadowPseudoId(Element element, DOMString id);
     
    113113
    114114    // Spatial Navigation testing
    115     [MayThrowLegacyException] unsigned long lastSpatialNavigationCandidateCount();
     115    [MayThrowException] unsigned long lastSpatialNavigationCandidateCount();
    116116
    117117    // CSS Animation testing.
    118118    unsigned long numberOfActiveAnimations();
    119     [MayThrowLegacyException] void suspendAnimations();
    120     [MayThrowLegacyException] void resumeAnimations();
    121     [MayThrowLegacyException] boolean animationsAreSuspended();
    122     [MayThrowLegacyException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
    123     [MayThrowLegacyException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
     119    [MayThrowException] void suspendAnimations();
     120    [MayThrowException] void resumeAnimations();
     121    [MayThrowException] boolean animationsAreSuspended();
     122    [MayThrowException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
     123    [MayThrowException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
    124124
    125125    // CSS Transition testing.
    126     [MayThrowLegacyException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
    127     [MayThrowLegacyException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId);
     126    [MayThrowException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
     127    [MayThrowException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId);
    128128
    129129    DOMString visiblePlaceholder(Element element);
    130130    void selectColorInColorChooser(HTMLInputElement element, DOMString colorValue);
    131     [MayThrowLegacyException] sequence<DOMString> formControlStateOfPreviousHistoryItem();
    132     [MayThrowLegacyException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
    133 
    134     [MayThrowLegacyException] ClientRect absoluteCaretBounds();
     131    [MayThrowException] sequence<DOMString> formControlStateOfPreviousHistoryItem();
     132    [MayThrowException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
     133
     134    [MayThrowException] ClientRect absoluteCaretBounds();
    135135
    136136    ClientRect boundingBox(Element element);
    137137
    138     [MayThrowLegacyException] ClientRectList inspectorHighlightRects();
    139     [MayThrowLegacyException] DOMString inspectorHighlightObject();
    140 
    141     [MayThrowLegacyException] unsigned long markerCountForNode(Node node, DOMString markerType);
    142     [MayThrowLegacyException] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index);
    143     [MayThrowLegacyException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
    144     [MayThrowLegacyException] DOMString dumpMarkerRects(DOMString markerType);
     138    [MayThrowException] ClientRectList inspectorHighlightRects();
     139    [MayThrowException] DOMString inspectorHighlightObject();
     140
     141    [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
     142    [MayThrowException] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index);
     143    [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
     144    [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
    145145    void addTextMatchMarker(Range range, boolean isActive);
    146     [MayThrowLegacyException] void setMarkedTextMatchesAreHighlighted(boolean flag);
     146    [MayThrowException] void setMarkedTextMatchesAreHighlighted(boolean flag);
    147147
    148148    void invalidateFontCache();
    149149
    150     [MayThrowLegacyException] void setScrollViewPosition(long x, long y);
    151 
    152     [MayThrowLegacyException] void setViewBaseBackgroundColor(DOMString colorValue);
    153 
    154     [MayThrowLegacyException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
    155     [MayThrowLegacyException] void setPaginationLineGridEnabled(boolean enabled);
    156 
    157     [MayThrowLegacyException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
    158 
    159     [MayThrowLegacyException] boolean wasLastChangeUserEdit(Element textField);
     150    [MayThrowException] void setScrollViewPosition(long x, long y);
     151
     152    [MayThrowException] void setViewBaseBackgroundColor(DOMString colorValue);
     153
     154    [MayThrowException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
     155    [MayThrowException] void setPaginationLineGridEnabled(boolean enabled);
     156
     157    [MayThrowException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
     158
     159    [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
    160160    boolean elementShouldAutoComplete(HTMLInputElement inputElement);
    161161    void setEditingValue(HTMLInputElement inputElement, DOMString value);
    162162    void setAutofilled(HTMLInputElement inputElement, boolean enabled);
    163163    void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
    164     [MayThrowLegacyException] unsigned long countMatchesForText(DOMString text, unsigned long findOptions, DOMString markMatches);
    165     [MayThrowLegacyException] unsigned long countFindMatches(DOMString text, unsigned long findOptions);
    166 
    167     [MayThrowLegacyException] DOMString autofillFieldName(Element formControlElement);
    168 
    169     [MayThrowLegacyException] void paintControlTints();
    170 
    171     [MayThrowLegacyException] void scrollElementToRect(Element element, long x, long y, long w, long h);
     164    unsigned long countMatchesForText(DOMString text, unsigned long findOptions, DOMString markMatches);
     165    unsigned long countFindMatches(DOMString text, unsigned long findOptions);
     166
     167    [MayThrowException] DOMString autofillFieldName(Element formControlElement);
     168
     169    [MayThrowException] void paintControlTints();
     170
     171    [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
    172172
    173173    Range rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
     
    176176    DOMString rangeAsText(Range range);
    177177    Range subrange(Range range, long rangeLocation, long rangeLength);
    178     [MayThrowLegacyException] Range rangeForDictionaryLookupAtLocation(long x, long y);
    179 
    180     [MayThrowLegacyException] void setDelegatesScrolling(boolean enabled);
    181 
    182     [MayThrowLegacyException] long lastSpellCheckRequestSequence();
    183     [MayThrowLegacyException] long lastSpellCheckProcessedSequence();
     178    [MayThrowException] Range rangeForDictionaryLookupAtLocation(long x, long y);
     179
     180    [MayThrowException] void setDelegatesScrolling(boolean enabled);
     181
     182    [MayThrowException] long lastSpellCheckRequestSequence();
     183    [MayThrowException] long lastSpellCheckProcessedSequence();
    184184
    185185    sequence<DOMString> userPreferredLanguages();
     
    189189    void setUserPreferredAudioCharacteristic(DOMString characteristic);
    190190
    191     [MayThrowLegacyException] unsigned long wheelEventHandlerCount();
    192     [MayThrowLegacyException] unsigned long touchEventHandlerCount();
    193 
    194     [MayThrowLegacyException] NodeList nodesFromRect(Document document, long x, long y,
     191    [MayThrowException] unsigned long wheelEventHandlerCount();
     192    [MayThrowException] unsigned long touchEventHandlerCount();
     193
     194    [MayThrowException] NodeList nodesFromRect(Document document, long x, long y,
    195195        unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
    196196        boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
     
    201201    void updateEditorUINowIfScheduled();
    202202
    203     [MayThrowLegacyException] boolean hasSpellingMarker(long from, long length);
    204     [MayThrowLegacyException] boolean hasGrammarMarker(long from, long length);
    205     [MayThrowLegacyException] boolean hasAutocorrectedMarker(long from, long length);
     203    boolean hasSpellingMarker(long from, long length);
     204    boolean hasGrammarMarker(long from, long length);
     205    boolean hasAutocorrectedMarker(long from, long length);
    206206    void setContinuousSpellCheckingEnabled(boolean enabled);
    207207    void setAutomaticQuoteSubstitutionEnabled(boolean enabled);
     
    211211    void setAutomaticSpellingCorrectionEnabled(boolean enabled);
    212212
    213     [MayThrowLegacyException] void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
    214 
    215     [MayThrowLegacyException] boolean isOverwriteModeEnabled();
    216     [MayThrowLegacyException] void toggleOverwriteModeEnabled();
    217 
    218     [MayThrowLegacyException] unsigned long numberOfScrollableAreas();
    219 
    220     [MayThrowLegacyException] boolean isPageBoxVisible(long pageNumber);
     213    void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
     214
     215    boolean isOverwriteModeEnabled();
     216    void toggleOverwriteModeEnabled();
     217
     218    unsigned long numberOfScrollableAreas();
     219
     220    [MayThrowException] boolean isPageBoxVisible(long pageNumber);
    221221
    222222    unsigned long imageFrameIndex(HTMLImageElement element);
     
    231231    const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
    232232    const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16;
    233     [MayThrowLegacyException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
    234 
    235     [MayThrowLegacyException] DOMString scrollingStateTreeAsText();
    236     [MayThrowLegacyException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
    237     [MayThrowLegacyException] ClientRectList nonFastScrollableRects();
    238 
    239     [MayThrowLegacyException] DOMString repaintRectsAsText();
     233    [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
     234
     235    [MayThrowException] DOMString scrollingStateTreeAsText();
     236    [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
     237    [MayThrowException] ClientRectList nonFastScrollableRects();
     238
     239    [MayThrowException] DOMString repaintRectsAsText();
    240240
    241241    // These throw if the element does not have a compositing layer.
    242     [MayThrowLegacyException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
    243     [MayThrowLegacyException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
     242    [MayThrowException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
     243    [MayThrowException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
    244244
    245245    // Flags for displayListForElement.
    246246    const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
    247247    // Returns the recorded display list.
    248     [MayThrowLegacyException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
     248    [MayThrowException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
    249249    // Returns the display list that was actually painted.
    250     [MayThrowLegacyException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
    251 
    252     [MayThrowLegacyException] void garbageCollectDocumentResources();
    253 
    254     [MayThrowLegacyException] void insertAuthorCSS(DOMString css);
    255     [MayThrowLegacyException] void insertUserCSS(DOMString css);
     250    [MayThrowException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
     251
     252    [MayThrowException] void garbageCollectDocumentResources();
     253
     254    [MayThrowException] void insertAuthorCSS(DOMString css);
     255    [MayThrowException] void insertUserCSS(DOMString css);
    256256
    257257    readonly attribute boolean isUnderMemoryPressure;
     
    260260
    261261#if defined(ENABLE_BATTERY_STATUS) && ENABLE_BATTERY_STATUS
    262     [MayThrowLegacyException] void setBatteryStatus(DOMString eventType, boolean charging, unrestricted double chargingTime, unrestricted double dischargingTime, unrestricted double level);
     262    [MayThrowException] void setBatteryStatus(DOMString eventType, boolean charging, unrestricted double chargingTime, unrestricted double dischargingTime, unrestricted double level);
    263263#endif
    264264
    265265#if defined(ENABLE_PROXIMITY_EVENTS) && ENABLE_PROXIMITY_EVENTS
    266     [MayThrowLegacyException] void setDeviceProximity(DOMString eventType, unrestricted double value, unrestricted double min, unrestricted double max);
     266    [MayThrowException] void setDeviceProximity(DOMString eventType, unrestricted double value, unrestricted double min, unrestricted double max);
    267267#endif
    268268
     
    271271    DOMWindow openDummyInspectorFrontend(DOMString url);
    272272    void closeDummyInspectorFrontend();
    273     [MayThrowLegacyException] void setInspectorIsUnderTest(boolean isUnderTest);
     273    [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
    274274
    275275    DOMString counterValue(Element element);
     
    277277    sequence<DOMString> shortcutIconURLs();
    278278    long numberOfPages(optional unrestricted double pageWidthInPixels = 800, optional unrestricted double pageHeightInPixels = 600);
    279     [MayThrowLegacyException] DOMString pageProperty(DOMString propertyName, long pageNumber);
    280     [MayThrowLegacyException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
    281 
    282     [MayThrowLegacyException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
    283     [MayThrowLegacyException] void setPageZoomFactor(unrestricted float zoomFactor);
    284     [MayThrowLegacyException] void setTextZoomFactor(unrestricted float zoomFactor);
    285 
    286     [MayThrowLegacyException] void setUseFixedLayout(boolean useFixedLayout);
    287     [MayThrowLegacyException] void setFixedLayoutSize(long width, long height);
    288 
    289     [MayThrowLegacyException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
     279    [MayThrowException] DOMString pageProperty(DOMString propertyName, long pageNumber);
     280    [MayThrowException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
     281
     282    [MayThrowException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
     283    [MayThrowException] void setPageZoomFactor(unrestricted float zoomFactor);
     284    [MayThrowException] void setTextZoomFactor(unrestricted float zoomFactor);
     285
     286    [MayThrowException] void setUseFixedLayout(boolean useFixedLayout);
     287    [MayThrowException] void setFixedLayoutSize(long width, long height);
     288
     289    [MayThrowException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
    290290
    291291    void setHeaderHeight(unrestricted float height);
     
    314314    // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
    315315    //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
    316     [MayThrowLegacyException] void startTrackingRepaints();
    317     [MayThrowLegacyException] void stopTrackingRepaints();
    318 
    319     [MayThrowLegacyException] void startTrackingLayerFlushes();
    320     [MayThrowLegacyException] unsigned long layerFlushCount();
     316    [MayThrowException] void startTrackingRepaints();
     317    [MayThrowException] void stopTrackingRepaints();
     318
     319    [MayThrowException] void startTrackingLayerFlushes();
     320    [MayThrowException] unsigned long layerFlushCount();
    321321
    322322    // Query if a timer is currently throttled, to debug timer throttling.
    323     [MayThrowLegacyException] boolean isTimerThrottled(long timerHandle);
     323    [MayThrowException] boolean isTimerThrottled(long timerHandle);
    324324
    325325    boolean isRequestAnimationFrameThrottled();
    326326    boolean areTimersThrottled();
    327327
    328     [MayThrowLegacyException] void startTrackingStyleRecalcs();
    329     [MayThrowLegacyException] unsigned long styleRecalcCount();
     328    [MayThrowException] void startTrackingStyleRecalcs();
     329    [MayThrowException] unsigned long styleRecalcCount();
    330330    readonly attribute unsigned long lastStyleUpdateSize;
    331331
    332     [MayThrowLegacyException] void startTrackingCompositingUpdates();
    333     [MayThrowLegacyException] unsigned long compositingUpdateCount();
     332    [MayThrowException] void startTrackingCompositingUpdates();
     333    [MayThrowException] unsigned long compositingUpdateCount();
    334334
    335335    // |node| should be Document, HTMLIFrameElement, or unspecified.
    336336    // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
    337337    // specified without security checks. Unspecified or null means this document.
    338     [MayThrowLegacyException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
     338    [MayThrowException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
    339339
    340340    readonly attribute unsigned long layoutCount;
    341341
    342342    // Returns a string with information about the mouse cursor used at the specified client location.
    343     [MayThrowLegacyException] DOMString getCurrentCursorInfo();
     343    [MayThrowException] DOMString getCurrentCursorInfo();
    344344
    345345    DOMString markerTextForListItem(Element element);
     
    360360
    361361    [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element);
    362     [Conditional=VIDEO, MayThrowLegacyException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
     362    [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
    363363
    364364    [Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
     
    368368    DOMString getImageSourceURL(Element element);
    369369
    370     [Conditional=VIDEO_TRACK, MayThrowLegacyException] DOMString captionsStyleSheetOverride();
    371     [Conditional=VIDEO_TRACK, MayThrowLegacyException] void setCaptionsStyleSheetOverride(DOMString override);
    372     [Conditional=VIDEO_TRACK, MayThrowLegacyException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
    373     [Conditional=VIDEO_TRACK, MayThrowLegacyException] void setCaptionDisplayMode(DOMString mode);
     370    [Conditional=VIDEO_TRACK, MayThrowException] DOMString captionsStyleSheetOverride();
     371    [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionsStyleSheetOverride(DOMString override);
     372    [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
     373    [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode);
    374374
    375375    [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array
     
    383383#endif
    384384
    385     [MayThrowLegacyException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
     385    [MayThrowException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
    386386    boolean isPluginSnapshotted(Element element);
    387387
    388     [MayThrowLegacyException] ClientRect selectionBounds();
     388    [MayThrowException] ClientRect selectionBounds();
    389389
    390390    [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
     
    393393    [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
    394394
    395     [Conditional=VIDEO, MayThrowLegacyException] void beginMediaSessionInterruption(DOMString interruptionType);
     395    [Conditional=VIDEO, MayThrowException] void beginMediaSessionInterruption(DOMString interruptionType);
    396396    [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
    397397    [Conditional=MEDIA_SESSION] void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory category);
     
    402402    [Conditional=VIDEO] void applicationDidEnterForeground();
    403403    [Conditional=VIDEO] void applicationWillEnterBackground();
    404     [Conditional=VIDEO, MayThrowLegacyException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
     404    [Conditional=VIDEO, MayThrowException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
    405405    [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
    406406    [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
    407     [Conditional=VIDEO, MayThrowLegacyException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
     407    [Conditional=VIDEO, MayThrowException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
    408408    [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
    409     [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowLegacyException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
     409    [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
    410410    [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
    411411    [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
     
    415415    [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(HTMLMediaElement element);
    416416
    417     [MayThrowLegacyException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
    418     [MayThrowLegacyException] DOMString pageOverlayLayerTreeAsText();
     417    [MayThrowException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
     418    [MayThrowException] DOMString pageOverlayLayerTreeAsText();
    419419
    420420    void setPageMuted(boolean muted);
     
    430430
    431431#if defined(ENABLE_CSS_SCROLL_SNAP) && ENABLE_CSS_SCROLL_SNAP
    432     [MayThrowLegacyException] DOMString scrollSnapOffsets(Element element);
    433 #endif
    434 
    435     [MayThrowLegacyException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
     432    [MayThrowException] DOMString scrollSnapOffsets(Element element);
     433#endif
     434
     435    [MayThrowException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
    436436
    437437    [Conditional=VIDEO] DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
     
    446446    void setResourceLoadStatisticsEnabled(boolean enable);
    447447
    448     [MayThrowLegacyException] void setCanShowModalDialogOverride(boolean allow);
     448    [MayThrowException] void setCanShowModalDialogOverride(boolean allow);
    449449
    450450    DOMString composedTreeAsText(Node parent);
Note: See TracChangeset for help on using the changeset viewer.