473a344683dda0dd3c7bfbcdd82da2e267cb3db1
[WebKit-https.git] / Source / WebCore / testing / Internals.h
1 /*
2  * Copyright (C) 2012 Google Inc. All rights reserved.
3  * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1.  Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer.
11  * 2.  Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
16  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 #pragma once
28
29 #include "CSSComputedStyleDeclaration.h"
30 #include "ContextDestructionObserver.h"
31 #include "ExceptionOr.h"
32 #include "PageConsoleClient.h"
33 #include <runtime/Float32Array.h>
34
35 #if ENABLE(MEDIA_SESSION)
36 #include "MediaSessionInterruptionProvider.h"
37 #endif
38
39 namespace WebCore {
40
41 class AudioContext;
42 class ClientRect;
43 class ClientRectList;
44 class DOMURL;
45 class DOMWindow;
46 class Document;
47 class Element;
48 class File;
49 class Frame;
50 class GCObservation;
51 class HTMLImageElement;
52 class HTMLInputElement;
53 class HTMLLinkElement;
54 class HTMLMediaElement;
55 class HTMLSelectElement;
56 class InspectorStubFrontend;
57 class InternalSettings;
58 class MallocStatistics;
59 class MediaSession;
60 class MemoryInfo;
61 class MockCDMFactory;
62 class MockContentFilterSettings;
63 class MockPageOverlay;
64 class NodeList;
65 class Page;
66 class Range;
67 class RenderedDocumentMarker;
68 class RTCPeerConnection;
69 class SerializedScriptValue;
70 class SourceBuffer;
71 class StyleSheet;
72 class TimeRanges;
73 class TypeConversions;
74 class WebGLRenderingContextBase;
75 class XMLHttpRequest;
76
77 class Internals final : public RefCounted<Internals>, private ContextDestructionObserver {
78 public:
79     static Ref<Internals> create(Document&);
80     virtual ~Internals();
81
82     static void resetToConsistentState(Page&);
83
84     ExceptionOr<String> elementRenderTreeAsText(Element&);
85     bool hasPausedImageAnimations(Element&);
86
87     String address(Node&);
88     bool nodeNeedsStyleRecalc(Node&);
89     String styleChangeType(Node&);
90     String description(JSC::JSValue);
91
92     bool isPreloaded(const String& url);
93     bool isLoadingFromMemoryCache(const String& url);
94     String xhrResponseSource(XMLHttpRequest&);
95     bool isSharingStyleSheetContents(HTMLLinkElement&, HTMLLinkElement&);
96     bool isStyleSheetLoadingSubresources(HTMLLinkElement&);
97     enum class CachePolicy { UseProtocolCachePolicy, ReloadIgnoringCacheData, ReturnCacheDataElseLoad, ReturnCacheDataDontLoad };
98     void setOverrideCachePolicy(CachePolicy);
99     ExceptionOr<void> setCanShowModalDialogOverride(bool allow);
100     enum class ResourceLoadPriority { ResourceLoadPriorityVeryLow, ResourceLoadPriorityLow, ResourceLoadPriorityMedium, ResourceLoadPriorityHigh, ResourceLoadPriorityVeryHigh };
101     void setOverrideResourceLoadPriority(ResourceLoadPriority);
102     void setStrictRawResourceValidationPolicyDisabled(bool);
103
104     void clearMemoryCache();
105     void pruneMemoryCacheToSize(unsigned size);
106     unsigned memoryCacheSize() const;
107
108     unsigned imageFrameIndex(HTMLImageElement&);
109     void setImageFrameDecodingDuration(HTMLImageElement&, float duration);
110     void resetImageAnimation(HTMLImageElement&);
111
112     void clearPageCache();
113     unsigned pageCacheSize() const;
114
115     void disableTileSizeUpdateDelay();
116
117     Ref<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Element&) const;
118
119     Node* ensureUserAgentShadowRoot(Element& host);
120     Node* shadowRoot(Element& host);
121     ExceptionOr<String> shadowRootType(const Node&) const;
122     String shadowPseudoId(Element&);
123     void setShadowPseudoId(Element&, const String&);
124
125     // CSS Deferred Parsing Testing
126     unsigned deferredStyleRulesCount(StyleSheet&);
127     unsigned deferredGroupRulesCount(StyleSheet&);
128     unsigned deferredKeyframesRulesCount(StyleSheet&);
129
130     // DOMTimers throttling testing.
131     ExceptionOr<bool> isTimerThrottled(int timeoutId);
132     bool isRequestAnimationFrameThrottled() const;
133     bool areTimersThrottled() const;
134
135     enum EventThrottlingBehavior { Responsive, Unresponsive };
136     void setEventThrottlingBehaviorOverride(std::optional<EventThrottlingBehavior>);
137     std::optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const;
138
139     // Spatial Navigation testing.
140     ExceptionOr<unsigned> lastSpatialNavigationCandidateCount() const;
141
142     // CSS Animation testing.
143     unsigned numberOfActiveAnimations() const;
144     ExceptionOr<bool> animationsAreSuspended() const;
145     ExceptionOr<void> suspendAnimations() const;
146     ExceptionOr<void> resumeAnimations() const;
147     ExceptionOr<bool> pauseAnimationAtTimeOnElement(const String& animationName, double pauseTime, Element&);
148     ExceptionOr<bool> pauseAnimationAtTimeOnPseudoElement(const String& animationName, double pauseTime, Element&, const String& pseudoId);
149
150     // CSS Transition testing.
151     ExceptionOr<bool> pauseTransitionAtTimeOnElement(const String& propertyName, double pauseTime, Element&);
152     ExceptionOr<bool> pauseTransitionAtTimeOnPseudoElement(const String& property, double pauseTime, Element&, const String& pseudoId);
153
154     Node* treeScopeRootNode(Node&);
155     Node* parentTreeScope(Node&);
156
157     String visiblePlaceholder(Element&);
158     void selectColorInColorChooser(HTMLInputElement&, const String& colorValue);
159     ExceptionOr<Vector<String>> formControlStateOfPreviousHistoryItem();
160     ExceptionOr<void> setFormControlStateOfPreviousHistoryItem(const Vector<String>&);
161
162     ExceptionOr<Ref<ClientRect>> absoluteCaretBounds();
163
164     Ref<ClientRect> boundingBox(Element&);
165
166     ExceptionOr<Ref<ClientRectList>> inspectorHighlightRects();
167     ExceptionOr<String> inspectorHighlightObject();
168
169     ExceptionOr<unsigned> markerCountForNode(Node&, const String&);
170     ExceptionOr<RefPtr<Range>> markerRangeForNode(Node&, const String& markerType, unsigned index);
171     ExceptionOr<String> markerDescriptionForNode(Node&, const String& markerType, unsigned index);
172     ExceptionOr<String> dumpMarkerRects(const String& markerType);
173     void addTextMatchMarker(const Range&, bool isActive);
174     ExceptionOr<void> setMarkedTextMatchesAreHighlighted(bool);
175
176     void invalidateFontCache();
177
178     ExceptionOr<void> setScrollViewPosition(int x, int y);
179     
180     ExceptionOr<Ref<ClientRect>> layoutViewportRect();
181     ExceptionOr<Ref<ClientRect>> visualViewportRect();
182     
183     ExceptionOr<void> setViewBaseBackgroundColor(const String& colorValue);
184
185     ExceptionOr<void> setPagination(const String& mode, int gap, int pageLength);
186     ExceptionOr<void> setPaginationLineGridEnabled(bool);
187     ExceptionOr<String> configurationForViewport(float devicePixelRatio, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
188
189     ExceptionOr<bool> wasLastChangeUserEdit(Element& textField);
190     bool elementShouldAutoComplete(HTMLInputElement&);
191     void setEditingValue(HTMLInputElement&, const String&);
192     void setAutofilled(HTMLInputElement&, bool enabled);
193     enum class AutoFillButtonType { AutoFillButtonTypeNone, AutoFillButtonTypeContacts, AutoFillButtonTypeCredentials };
194     void setShowAutoFillButton(HTMLInputElement&, AutoFillButtonType);
195     ExceptionOr<void> scrollElementToRect(Element&, int x, int y, int w, int h);
196
197     ExceptionOr<String> autofillFieldName(Element&);
198
199     ExceptionOr<void> paintControlTints();
200
201     RefPtr<Range> rangeFromLocationAndLength(Element& scope, int rangeLocation, int rangeLength);
202     unsigned locationFromRange(Element& scope, const Range&);
203     unsigned lengthFromRange(Element& scope, const Range&);
204     String rangeAsText(const Range&);
205     Ref<Range> subrange(Range&, int rangeLocation, int rangeLength);
206     ExceptionOr<RefPtr<Range>> rangeForDictionaryLookupAtLocation(int x, int y);
207     RefPtr<Range> rangeOfStringNearLocation(const Range&, const String&, unsigned);
208
209     ExceptionOr<void> setDelegatesScrolling(bool enabled);
210
211     ExceptionOr<int> lastSpellCheckRequestSequence();
212     ExceptionOr<int> lastSpellCheckProcessedSequence();
213
214     Vector<String> userPreferredLanguages() const;
215     void setUserPreferredLanguages(const Vector<String>&);
216
217     Vector<String> userPreferredAudioCharacteristics() const;
218     void setUserPreferredAudioCharacteristic(const String&);
219
220     ExceptionOr<unsigned> wheelEventHandlerCount();
221     ExceptionOr<unsigned> touchEventHandlerCount();
222
223     ExceptionOr<RefPtr<NodeList>> nodesFromRect(Document&, int x, int y, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const;
224
225     String parserMetaData(JSC::JSValue = JSC::JSValue::JSUndefined);
226
227     void updateEditorUINowIfScheduled();
228
229     bool hasSpellingMarker(int from, int length);
230     bool hasGrammarMarker(int from, int length);
231     bool hasAutocorrectedMarker(int from, int length);
232     void setContinuousSpellCheckingEnabled(bool);
233     void setAutomaticQuoteSubstitutionEnabled(bool);
234     void setAutomaticLinkDetectionEnabled(bool);
235     void setAutomaticDashSubstitutionEnabled(bool);
236     void setAutomaticTextReplacementEnabled(bool);
237     void setAutomaticSpellingCorrectionEnabled(bool);
238
239     void handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length);
240
241     bool isOverwriteModeEnabled();
242     void toggleOverwriteModeEnabled();
243
244     ExceptionOr<RefPtr<Range>> rangeOfString(const String&, RefPtr<Range>&&, const Vector<String>& findOptions);
245     ExceptionOr<unsigned> countMatchesForText(const String&, const Vector<String>& findOptions, const String& markMatches);
246     ExceptionOr<unsigned> countFindMatches(const String&, const Vector<String>& findOptions);
247
248     unsigned numberOfScrollableAreas();
249
250     ExceptionOr<bool> isPageBoxVisible(int pageNumber);
251
252     static const char* internalsId;
253
254     InternalSettings* settings() const;
255     unsigned workerThreadCount() const;
256     bool areSVGAnimationsPaused() const;
257
258     ExceptionOr<void> setDeviceProximity(const String& eventType, double value, double min, double max);
259
260     enum {
261         // Values need to be kept in sync with Internals.idl.
262         LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1,
263         LAYER_TREE_INCLUDES_TILE_CACHES = 2,
264         LAYER_TREE_INCLUDES_REPAINT_RECTS = 4,
265         LAYER_TREE_INCLUDES_PAINTING_PHASES = 8,
266         LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16,
267         LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32,
268     };
269     ExceptionOr<String> layerTreeAsText(Document&, unsigned short flags) const;
270     ExceptionOr<String> repaintRectsAsText() const;
271     ExceptionOr<String> scrollingStateTreeAsText() const;
272     ExceptionOr<String> mainThreadScrollingReasons() const;
273     ExceptionOr<RefPtr<ClientRectList>> nonFastScrollableRects() const;
274
275     ExceptionOr<void> setElementUsesDisplayListDrawing(Element&, bool usesDisplayListDrawing);
276     ExceptionOr<void> setElementTracksDisplayListReplay(Element&, bool isTrackingReplay);
277
278     enum {
279         // Values need to be kept in sync with Internals.idl.
280         DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1,
281     };
282     ExceptionOr<String> displayListForElement(Element&, unsigned short flags);
283     ExceptionOr<String> replayDisplayListForElement(Element&, unsigned short flags);
284
285     ExceptionOr<void> garbageCollectDocumentResources() const;
286
287     void beginSimulatedMemoryPressure();
288     void endSimulatedMemoryPressure();
289     bool isUnderMemoryPressure();
290
291     ExceptionOr<void> insertAuthorCSS(const String&) const;
292     ExceptionOr<void> insertUserCSS(const String&) const;
293
294     unsigned numberOfLiveNodes() const;
295     unsigned numberOfLiveDocuments() const;
296
297     RefPtr<DOMWindow> openDummyInspectorFrontend(const String& url);
298     void closeDummyInspectorFrontend();
299     ExceptionOr<void> setInspectorIsUnderTest(bool);
300
301     String counterValue(Element&);
302
303     int pageNumber(Element&, float pageWidth = 800, float pageHeight = 600);
304     Vector<String> shortcutIconURLs() const;
305
306     int numberOfPages(float pageWidthInPixels = 800, float pageHeightInPixels = 600);
307     ExceptionOr<String> pageProperty(const String& propertyName, int pageNumber) const;
308     ExceptionOr<String> pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const;
309
310     ExceptionOr<float> pageScaleFactor() const;
311
312     ExceptionOr<void> setPageScaleFactor(float scaleFactor, int x, int y);
313     ExceptionOr<void> setPageZoomFactor(float);
314     ExceptionOr<void> setTextZoomFactor(float);
315
316     ExceptionOr<void> setUseFixedLayout(bool);
317     ExceptionOr<void> setFixedLayoutSize(int width, int height);
318     ExceptionOr<void> setViewExposedRect(float left, float top, float width, float height);
319
320     void setHeaderHeight(float);
321     void setFooterHeight(float);
322
323     void setTopContentInset(float);
324
325 #if ENABLE(FULLSCREEN_API)
326     void webkitWillEnterFullScreenForElement(Element&);
327     void webkitDidEnterFullScreenForElement(Element&);
328     void webkitWillExitFullScreenForElement(Element&);
329     void webkitDidExitFullScreenForElement(Element&);
330 #endif
331
332     WEBCORE_TESTSUPPORT_EXPORT void setApplicationCacheOriginQuota(unsigned long long);
333
334     void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme);
335     void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme);
336
337     void registerDefaultPortForProtocol(unsigned short port, const String& protocol);
338
339     Ref<MallocStatistics> mallocStatistics() const;
340     Ref<TypeConversions> typeConversions() const;
341     Ref<MemoryInfo> memoryInfo() const;
342
343     Vector<String> getReferencedFilePaths() const;
344
345     ExceptionOr<void> startTrackingRepaints();
346     ExceptionOr<void> stopTrackingRepaints();
347
348     ExceptionOr<void> startTrackingLayerFlushes();
349     ExceptionOr<unsigned> layerFlushCount();
350     
351     ExceptionOr<void> startTrackingStyleRecalcs();
352     ExceptionOr<unsigned> styleRecalcCount();
353     unsigned lastStyleUpdateSize() const;
354
355     ExceptionOr<void> startTrackingCompositingUpdates();
356     ExceptionOr<unsigned> compositingUpdateCount();
357
358     ExceptionOr<void> updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*);
359     unsigned layoutCount() const;
360
361     Ref<ArrayBuffer> serializeObject(const RefPtr<SerializedScriptValue>&) const;
362     Ref<SerializedScriptValue> deserializeBuffer(ArrayBuffer&) const;
363
364     bool isFromCurrentWorld(JSC::JSValue) const;
365
366     void setUsesOverlayScrollbars(bool);
367     void setUsesMockScrollAnimator(bool);
368
369     ExceptionOr<String> getCurrentCursorInfo();
370
371     String markerTextForListItem(Element&);
372
373     String toolTipFromElement(Element&) const;
374
375     void forceReload(bool endToEnd);
376
377     void enableAutoSizeMode(bool enabled, int minimumWidth, int minimumHeight, int maximumWidth, int maximumHeight);
378
379 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
380     void initializeMockCDM();
381 #endif
382
383 #if ENABLE(ENCRYPTED_MEDIA)
384     Ref<MockCDMFactory> registerMockCDM();
385 #endif
386
387 #if ENABLE(SPEECH_SYNTHESIS)
388     void enableMockSpeechSynthesizer();
389 #endif
390
391 #if ENABLE(MEDIA_STREAM)
392     void setMockMediaCaptureDevicesEnabled(bool);
393 #endif
394
395 #if ENABLE(WEB_RTC)
396     void enableMockMediaEndpoint();
397     void enableMockRTCPeerConnectionHandler();
398     void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection&, const String& action);
399     void useMockRTCPeerConnectionFactory(const String&);
400 #endif
401
402     String getImageSourceURL(Element&);
403
404 #if ENABLE(VIDEO)
405     void simulateAudioInterruption(HTMLMediaElement&);
406     ExceptionOr<bool> mediaElementHasCharacteristic(HTMLMediaElement&, const String&);
407 #endif
408
409     bool isSelectPopupVisible(HTMLSelectElement&);
410
411     ExceptionOr<String> captionsStyleSheetOverride();
412     ExceptionOr<void> setCaptionsStyleSheetOverride(const String&);
413     ExceptionOr<void> setPrimaryAudioTrackLanguageOverride(const String&);
414     ExceptionOr<void> setCaptionDisplayMode(const String&);
415
416 #if ENABLE(VIDEO)
417     Ref<TimeRanges> createTimeRanges(Float32Array& startTimes, Float32Array& endTimes);
418     double closestTimeToTimeRanges(double time, TimeRanges&);
419 #endif
420
421     ExceptionOr<Ref<ClientRect>> selectionBounds();
422
423 #if ENABLE(VIBRATION)
424     bool isVibrating();
425 #endif
426
427     ExceptionOr<bool> isPluginUnavailabilityIndicatorObscured(Element&);
428     bool isPluginSnapshotted(Element&);
429
430 #if ENABLE(MEDIA_SOURCE)
431     WEBCORE_TESTSUPPORT_EXPORT void initializeMockMediaSource();
432     Vector<String> bufferedSamplesForTrackID(SourceBuffer&, const AtomicString&);
433     Vector<String> enqueuedSamplesForTrackID(SourceBuffer&, const AtomicString&);
434     void setShouldGenerateTimestamps(SourceBuffer&, bool);
435 #endif
436
437 #if ENABLE(VIDEO)
438     ExceptionOr<void> beginMediaSessionInterruption(const String&);
439     void endMediaSessionInterruption(const String&);
440     void applicationDidEnterForeground() const;
441     void applicationWillEnterBackground() const;
442     ExceptionOr<void> setMediaSessionRestrictions(const String& mediaType, const String& restrictions);
443     ExceptionOr<String> mediaSessionRestrictions(const String& mediaType) const;
444     void setMediaElementRestrictions(HTMLMediaElement&, const String& restrictions);
445     ExceptionOr<void> postRemoteControlCommand(const String&, float argument);
446     bool elementIsBlockingDisplaySleep(HTMLMediaElement&) const;
447 #endif
448
449 #if ENABLE(MEDIA_SESSION)
450     void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory);
451     void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory);
452     String mediaSessionCurrentState(MediaSession&) const;
453     double mediaElementPlayerVolume(HTMLMediaElement&) const;
454     enum class MediaControlEvent { PlayPause, NextTrack, PreviousTrack };
455     void sendMediaControlEvent(MediaControlEvent);
456 #endif
457
458 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
459     void setMockMediaPlaybackTargetPickerEnabled(bool);
460     ExceptionOr<void> setMockMediaPlaybackTargetPickerState(const String& deviceName, const String& deviceState);
461 #endif
462
463 #if ENABLE(WEB_AUDIO)
464     void setAudioContextRestrictions(AudioContext&, const String& restrictions);
465 #endif
466
467     void simulateSystemSleep() const;
468     void simulateSystemWake() const;
469
470     enum class PageOverlayType { View, Document };
471     ExceptionOr<Ref<MockPageOverlay>> installMockPageOverlay(PageOverlayType);
472     ExceptionOr<String> pageOverlayLayerTreeAsText(unsigned short flags) const;
473
474     void setPageMuted(const String&);
475     String pageMediaState();
476
477     void setPageDefersLoading(bool);
478
479     RefPtr<File> createFile(const String&);
480     void queueMicroTask(int);
481     bool testPreloaderSettingViewport();
482
483 #if ENABLE(CONTENT_FILTERING)
484     MockContentFilterSettings& mockContentFilterSettings();
485 #endif
486
487 #if ENABLE(CSS_SCROLL_SNAP)
488     ExceptionOr<String> scrollSnapOffsets(Element&);
489     void setPlatformMomentumScrollingPredictionEnabled(bool);
490 #endif
491
492     ExceptionOr<String> pathStringWithShrinkWrappedRects(const Vector<double>& rectComponents, double radius);
493
494     String getCurrentMediaControlsStatusForElement(HTMLMediaElement&);
495
496     String userVisibleString(const DOMURL&);
497     void setShowAllPlugins(bool);
498
499     String resourceLoadStatisticsForOrigin(const String& origin);
500     void setResourceLoadStatisticsEnabled(bool);
501
502 #if ENABLE(READABLE_STREAM_API)
503     bool isReadableStreamDisturbed(JSC::ExecState&, JSC::JSValue);
504 #endif
505
506     String composedTreeAsText(Node&);
507     
508     bool isProcessingUserGesture();
509
510     RefPtr<GCObservation> observeGC(JSC::JSValue);
511
512     enum class UserInterfaceLayoutDirection { LTR, RTL };
513     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection);
514
515     bool userPrefersReducedMotion() const;
516     
517     void reportBacktrace();
518
519     enum class BaseWritingDirection { Natural, Ltr, Rtl };
520     void setBaseWritingDirection(BaseWritingDirection);
521
522 #if ENABLE(POINTER_LOCK)
523     bool pageHasPendingPointerLock() const;
524     bool pageHasPointerLock() const;
525 #endif
526
527     Vector<String> accessKeyModifiers() const;
528
529 #if PLATFORM(IOS)
530     void setQuickLookPassword(const String&);
531 #endif
532
533     void setAsRunningUserScripts(Document&);
534
535 #if ENABLE(WEBGL)
536     void simulateWebGLContextChanged(WebGLRenderingContextBase&);
537 #endif
538
539 private:
540     explicit Internals(Document&);
541     Document* contextDocument() const;
542     Frame* frame() const;
543
544     ExceptionOr<RenderedDocumentMarker*> markerAt(Node&, const String& markerType, unsigned index);
545
546     std::unique_ptr<InspectorStubFrontend> m_inspectorFrontend;
547 };
548
549 } // namespace WebCore