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