15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/*
25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2012 Google Inc. All rights reserved.
3926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * Copyright (C) 2013 Apple Inc. All rights reserved.
45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * are met:
85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 1.  Redistributions of source code must retain the above copyright
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *     notice, this list of conditions and the following disclaimer.
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 2.  Redistributions in binary form must reproduce the above copyright
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *     notice, this list of conditions and the following disclaimer in the
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *     documentation and/or other materials provided with the distribution.
145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */
265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef Internals_h
285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define Internals_h
295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
30df95704c49daea886ddad70775bda23618d6274dBen Murdoch#include "bindings/v8/ExceptionStatePlaceholder.h"
3109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "bindings/v8/ScriptPromise.h"
32f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)#include "bindings/v8/ScriptValue.h"
3353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/css/CSSComputedStyleDeclaration.h"
34591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch#include "core/dom/ContextLifecycleObserver.h"
357757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "core/page/scrolling/ScrollingCoordinator.h"
36a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch#include "platform/heap/Handle.h"
37e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)#include "wtf/ArrayBuffer.h"
38e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)#include "wtf/PassRefPtr.h"
39e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)#include "wtf/RefCounted.h"
40e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)#include "wtf/text/WTFString.h"
415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
425c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)namespace WebCore {
435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class ClientRect;
455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class ClientRectList;
4653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class DOMPoint;
475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class DOMStringList;
4876c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)class LocalDOMWindow;
495c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Document;
505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class DocumentMarker;
515c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Element;
52df95704c49daea886ddad70775bda23618d6274dBen Murdochclass ExceptionState;
5307a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdochclass ExecutionContext;
54f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)class GCObservation;
5507a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdochclass HTMLMediaElement;
56e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdochclass InternalProfilers;
57df95704c49daea886ddad70775bda23618d6274dBen Murdochclass InternalRuntimeFlags;
585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class InternalSettings;
597757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdochclass LayerRectList;
6007a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdochclass LocalFrame;
61df95704c49daea886ddad70775bda23618d6274dBen Murdochclass MallocStatistics;
625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Node;
635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Page;
645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class PagePopupController;
655c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Range;
66926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)class SerializedScriptValue;
6776c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)class StaticNodeList;
68df95704c49daea886ddad70775bda23618d6274dBen Murdochclass ShadowRoot;
69926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)class TypeConversions;
705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
71d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class Internals FINAL : public RefCountedWillBeGarbageCollectedFinalized<Internals>, public ContextLifecycleObserver {
725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public:
73d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    static PassRefPtrWillBeRawPtr<Internals> create(Document*);
745c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    virtual ~Internals();
755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
765c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    static void resetToConsistentState(Page*);
775c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
78df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String elementRenderTreeAsText(Element*, ExceptionState&);
795c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
805c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    String address(Node*);
815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
82d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    PassRefPtrWillBeRawPtr<GCObservation> observeGC(ScriptValue);
83f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)
84926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    bool isPreloaded(const String& url);
85926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    bool isLoadingFromMemoryCache(const String& url);
865c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
8753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void crash();
8853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8951b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    void setStyleResolverStatsEnabled(bool);
9051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    String styleResolverStatsReport(ExceptionState&) const;
9151b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    String styleResolverStatsTotalsReport(ExceptionState&) const;
9251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
9309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    bool isSharingStyle(Element*, Element*, ExceptionState&) const;
9409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
95323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)    PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Node*, ExceptionState&) const;
96df95704c49daea886ddad70775bda23618d6274dBen Murdoch
97df95704c49daea886ddad70775bda23618d6274dBen Murdoch    ShadowRoot* shadowRoot(Element* host, ExceptionState&);
98df95704c49daea886ddad70775bda23618d6274dBen Murdoch    ShadowRoot* youngestShadowRoot(Element* host, ExceptionState&);
99df95704c49daea886ddad70775bda23618d6274dBen Murdoch    ShadowRoot* oldestShadowRoot(Element* host, ExceptionState&);
100df95704c49daea886ddad70775bda23618d6274dBen Murdoch    ShadowRoot* youngerShadowRoot(Node* shadow, ExceptionState&);
101df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String shadowRootType(const Node*, ExceptionState&) const;
102df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool hasShadowInsertionPoint(const Node*, ExceptionState&) const;
103df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool hasContentElement(const Node*, ExceptionState&) const;
104df95704c49daea886ddad70775bda23618d6274dBen Murdoch    size_t countElementShadow(const Node*, ExceptionState&) const;
10509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    const AtomicString& shadowPseudoId(Element*, ExceptionState&);
10609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    void setShadowPseudoId(Element*, const AtomicString&, ExceptionState&);
1075c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
10881a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles)    // CSS Animation / Transition testing.
109926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    unsigned numberOfActiveAnimations() const;
110df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void pauseAnimations(double pauseTime, ExceptionState&);
111df95704c49daea886ddad70775bda23618d6274dBen Murdoch
112df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool isValidContentSelect(Element* insertionPoint, ExceptionState&);
113df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* treeScopeRootNode(Node*, ExceptionState&);
114df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* parentTreeScope(Node*, ExceptionState&);
11509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    bool hasSelectorForIdInShadow(Element* host, const AtomicString& idValue, ExceptionState&);
11609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    bool hasSelectorForClassInShadow(Element* host, const AtomicString& className, ExceptionState&);
11709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    bool hasSelectorForAttributeInShadow(Element* host, const AtomicString& attributeName, ExceptionState&);
118df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool hasSelectorForPseudoClassInShadow(Element* host, const String& pseudoClass, ExceptionState&);
119df95704c49daea886ddad70775bda23618d6274dBen Murdoch    unsigned short compareTreeScopePosition(const Node*, const Node*, ExceptionState&) const;
120df95704c49daea886ddad70775bda23618d6274dBen Murdoch
1215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    // FIXME: Rename these functions if walker is prefered.
122df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* nextSiblingByWalker(Node*, ExceptionState&);
123df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* firstChildByWalker(Node*, ExceptionState&);
124df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* lastChildByWalker(Node*, ExceptionState&);
125df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* nextNodeByWalker(Node*, ExceptionState&);
126df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* previousNodeByWalker(Node*, ExceptionState&);
1275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
12851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    unsigned updateStyleAndReturnAffectedElementCount(ExceptionState&) const;
12909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    unsigned needsLayoutCount(ExceptionState&) const;
13051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
1315c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    String visiblePlaceholder(Element*);
1325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void selectColorInColorChooser(Element*, const String& colorValue);
13309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    bool hasAutofocusRequest(Document*);
13409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    bool hasAutofocusRequest();
13551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    Vector<String> formControlStateOfHistoryItem(ExceptionState&);
13651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    void setFormControlStateOfHistoryItem(const Vector<String>&, ExceptionState&);
137df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setEnableMockPagePopup(bool, ExceptionState&);
138d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    PassRefPtrWillBeRawPtr<PagePopupController> pagePopupController();
1395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
140a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRect> unscaledViewportRect(ExceptionState&);
141591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch
142a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRect> absoluteCaretBounds(ExceptionState&);
1435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
144a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRect> boundingBox(Element*, ExceptionState&);
1455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
146df95704c49daea886ddad70775bda23618d6274dBen Murdoch    unsigned markerCountForNode(Node*, const String&, ExceptionState&);
147e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    unsigned activeMarkerCountForNode(Node*, ExceptionState&);
148a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<Range> markerRangeForNode(Node*, const String& markerType, unsigned index, ExceptionState&);
149df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String markerDescriptionForNode(Node*, const String& markerType, unsigned index, ExceptionState&);
1505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void addTextMatchMarker(const Range*, bool isActive);
151e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    void setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool, ExceptionState&);
15209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    void setMarkedTextMatchesAreHighlighted(Document*, bool, ExceptionState&);
1535c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
154df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setScrollViewPosition(Document*, long x, long y, ExceptionState&);
155e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    String viewportAsText(Document*, float devicePixelRatio, int availableWidth, int availableHeight, ExceptionState&);
1565c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
157df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool wasLastChangeUserEdit(Element* textField, ExceptionState&);
158df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool elementShouldAutoComplete(Element* inputElement, ExceptionState&);
15909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    String suggestedValue(Element*, ExceptionState&);
16009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    void setSuggestedValue(Element*, const String&, ExceptionState&);
161df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setEditingValue(Element* inputElement, const String&, ExceptionState&);
162df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setAutofilled(Element*, bool enabled, ExceptionState&);
163df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void scrollElementToRect(Element*, long x, long y, long w, long h, ExceptionState&);
1645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
165a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<Range> rangeFromLocationAndLength(Element* scope, int rangeLocation, int rangeLength, ExceptionState&);
166df95704c49daea886ddad70775bda23618d6274dBen Murdoch    unsigned locationFromRange(Element* scope, const Range*, ExceptionState&);
167df95704c49daea886ddad70775bda23618d6274dBen Murdoch    unsigned lengthFromRange(Element* scope, const Range*, ExceptionState&);
168df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String rangeAsText(const Range*, ExceptionState&);
1695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
17007a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch    PassRefPtrWillBeRawPtr<DOMPoint> touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document*, ExceptionState&);
171df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document*, ExceptionState&);
17207a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch    PassRefPtrWillBeRawPtr<DOMPoint> touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document*, ExceptionState&);
173df95704c49daea886ddad70775bda23618d6274dBen Murdoch    Node* touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document*, ExceptionState&);
174a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRect> bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document*, ExceptionState&);
1755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
176df95704c49daea886ddad70775bda23618d6274dBen Murdoch    int lastSpellCheckRequestSequence(Document*, ExceptionState&);
177df95704c49daea886ddad70775bda23618d6274dBen Murdoch    int lastSpellCheckProcessedSequence(Document*, ExceptionState&);
1785c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
17909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    Vector<AtomicString> userPreferredLanguages() const;
1805c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void setUserPreferredLanguages(const Vector<String>&);
1815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
182d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    unsigned activeDOMObjectCount(Document*, ExceptionState&);
183df95704c49daea886ddad70775bda23618d6274dBen Murdoch    unsigned wheelEventHandlerCount(Document*, ExceptionState&);
18410f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch    unsigned scrollEventHandlerCount(Document*, ExceptionState&);
185df95704c49daea886ddad70775bda23618d6274dBen Murdoch    unsigned touchEventHandlerCount(Document*, ExceptionState&);
186d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    PassRefPtrWillBeRawPtr<LayerRectList> touchEventTargetLayerRects(Document*, ExceptionState&);
1875c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
18853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    // This is used to test rect based hit testing like what's done on touch screens.
18976c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    PassRefPtrWillBeRawPtr<StaticNodeList> nodesFromRect(Document*, int x, int y, unsigned topPadding, unsigned rightPadding,
190df95704c49daea886ddad70775bda23618d6274dBen Murdoch        unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionState&) const;
1915c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
19219cde67944066db31e633d9e386f2aa9bf9fadb3Torne (Richard Coles)    void emitInspectorDidBeginFrame(int frameId = 0);
1935c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void emitInspectorDidCancelFrame();
1945c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
195df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool hasSpellingMarker(Document*, int from, int length, ExceptionState&);
196df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool hasGrammarMarker(Document*, int from, int length, ExceptionState&);
197df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setContinuousSpellCheckingEnabled(bool enabled, ExceptionState&);
1985c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
199df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool isOverwriteModeEnabled(Document*, ExceptionState&);
200df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void toggleOverwriteModeEnabled(Document*, ExceptionState&);
20153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
202df95704c49daea886ddad70775bda23618d6274dBen Murdoch    unsigned numberOfScrollableAreas(Document*, ExceptionState&);
2035c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
204df95704c49daea886ddad70775bda23618d6274dBen Murdoch    bool isPageBoxVisible(Document*, int pageNumber, ExceptionState&);
2055c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2065c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    static const char* internalsId;
2075c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2085c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    InternalSettings* settings() const;
20981a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles)    InternalRuntimeFlags* runtimeFlags() const;
210e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch    InternalProfilers* profilers();
211926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    unsigned workerThreadCount() const;
2125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
213df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setDeviceProximity(Document*, const String& eventType, double value, double min, double max, ExceptionState&);
2145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
215df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String layerTreeAsText(Document*, unsigned flags, ExceptionState&) const;
216df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String layerTreeAsText(Document*, ExceptionState&) const;
217df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String elementLayerTreeAsText(Element*, unsigned flags, ExceptionState&) const;
218df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String elementLayerTreeAsText(Element*, ExceptionState&) const;
21953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
220c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)    bool scrollsWithRespectTo(Element*, Element*, ExceptionState&);
2219bbd2f5e390b01907d97ecffde80aa1b06113aacTorne (Richard Coles)    bool isUnclippedDescendant(Element*, ExceptionState&);
222c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)
223df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String repaintRectsAsText(Document*, ExceptionState&) const;
224a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRectList> repaintRects(Element*, ExceptionState&) const;
225f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
226df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String scrollingStateTreeAsText(Document*, ExceptionState&) const;
227df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String mainThreadScrollingReasons(Document*, ExceptionState&) const;
228a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRectList> nonFastScrollableRects(Document*, ExceptionState&) const;
2295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
230df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void garbageCollectDocumentResources(Document*, ExceptionState&) const;
231fff8884795cb540f87cf6e6d67b629519b00eb8bBen Murdoch    void evictAllResources() const;
2325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void allowRoundingHacks() const;
2345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    unsigned numberOfLiveNodes() const;
2365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    unsigned numberOfLiveDocuments() const;
237a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles)    String dumpRefCountedInstanceCounts() const;
2385c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    Vector<String> consoleMessageArgumentCounts(Document*) const;
23976c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    PassRefPtrWillBeRawPtr<LocalDOMWindow> openDummyInspectorFrontend(const String& url);
2405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void closeDummyInspectorFrontend();
241e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch    Vector<unsigned long> setMemoryCacheCapacities(unsigned long minDeadBytes, unsigned long maxDeadBytes, unsigned long totalBytes);
242df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setInspectorResourcesDataSizeLimits(int maximumResourcesContentSize, int maximumSingleResourceContentSize, ExceptionState&);
2435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    String counterValue(Element*);
2455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    int pageNumber(Element*, float pageWidth = 800, float pageHeight = 600);
247926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    Vector<String> shortcutIconURLs(Document*) const;
248926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    Vector<String> allIconURLs(Document*) const;
2495c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    int numberOfPages(float pageWidthInPixels = 800, float pageHeightInPixels = 600);
2511fad5ca6c42d689812b66fc493992aa6d747a6fbBen Murdoch    String pageProperty(String, int, ExceptionState& = ASSERT_NO_EXCEPTION) const;
2521fad5ca6c42d689812b66fc493992aa6d747a6fbBen Murdoch    String pageSizeAndMarginsInPixels(int, int, int, int, int, int, int, ExceptionState& = ASSERT_NO_EXCEPTION) const;
2535c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
254df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setDeviceScaleFactor(float scaleFactor, ExceptionState&);
255926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
256df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void setIsCursorVisible(Document*, bool, ExceptionState&);
25753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
2585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void webkitWillEnterFullScreenForElement(Document*, Element*);
2595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void webkitDidEnterFullScreenForElement(Document*, Element*);
2605c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void webkitWillExitFullScreenForElement(Document*, Element*);
2615c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void webkitDidExitFullScreenForElement(Document*, Element*);
2625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
26307a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch    void mediaPlayerRequestFullscreen(HTMLMediaElement*);
26407a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch
2655c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme);
2665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme);
2675c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
268d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    PassRefPtrWillBeRawPtr<MallocStatistics> mallocStatistics() const;
269d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    PassRefPtrWillBeRawPtr<TypeConversions> typeConversions() const;
2705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
271926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    Vector<String> getReferencedFilePaths() const;
2725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
273df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void startTrackingRepaints(Document*, ExceptionState&);
274df95704c49daea886ddad70775bda23618d6274dBen Murdoch    void stopTrackingRepaints(Document*, ExceptionState&);
27551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionState&);
27651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*, ExceptionState&);
2775d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    void forceFullRepaint(Document*, ExceptionState&);
2785c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
279a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRectList> draggableRegions(Document*, ExceptionState&);
280a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRectList> nonDraggableRegions(Document*, ExceptionState&);
2811e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)
282926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    PassRefPtr<ArrayBuffer> serializeObject(PassRefPtr<SerializedScriptValue>) const;
283926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    PassRefPtr<SerializedScriptValue> deserializeBuffer(PassRefPtr<ArrayBuffer>) const;
284926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
285df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String getCurrentCursorInfo(Document*, ExceptionState&);
286926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
287df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String markerTextForListItem(Element*, ExceptionState&);
288926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
289926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    void forceReload(bool endToEnd);
290926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
291df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String getImageSourceURL(Element*, ExceptionState&);
292926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
29353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool isSelectPopupVisible(Node*);
294926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
295a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRect> selectionBounds(ExceptionState&);
296df95704c49daea886ddad70775bda23618d6274dBen Murdoch    String baseURL(Document*, ExceptionState&);
297591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch
298fff8884795cb540f87cf6e6d67b629519b00eb8bBen Murdoch    bool loseSharedGraphicsContext3D();
299fff8884795cb540f87cf6e6d67b629519b00eb8bBen Murdoch
30019cde67944066db31e633d9e386f2aa9bf9fadb3Torne (Richard Coles)    void forceCompositingUpdate(Document*, ExceptionState&);
30119cde67944066db31e633d9e386f2aa9bf9fadb3Torne (Richard Coles)
30209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    void setZoomFactor(float);
30309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
30409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    void setShouldRevealPassword(Element*, bool, ExceptionState&);
30509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
306323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)    ScriptPromise createPromise(ScriptState*);
307323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)    ScriptPromise createResolvedPromise(ScriptState*, ScriptValue);
308323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)    ScriptPromise createRejectedPromise(ScriptState*, ScriptValue);
30909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    ScriptPromise addOneToPromise(ExecutionContext*, ScriptPromise);
31009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
311d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    void trace(Visitor*);
312d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
313d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    void setValueForUser(Element*, const String&);
314d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
315d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    String textSurroundingNode(Node*, int x, int y, unsigned long maxLength);
316d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
317d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)    void setFocused(bool);
318d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)
3195d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    bool ignoreLayoutWithPendingStylesheets(Document*, ExceptionState&);
3205d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)
321d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)    void setNetworkStateNotifierTestOnly(bool);
322d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)    // Test must call setNetworkStateNotifierTestOnly(true) before calling setNetworkConnectionInfo.
323d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)    void setNetworkConnectionInfo(const String&, ExceptionState&);
324d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)
3255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)private:
3265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    explicit Internals(Document*);
3275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    Document* contextDocument() const;
328d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    LocalFrame* frame() const;
329926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    Vector<String> iconURLs(Document*, int iconTypesMask) const;
330a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRectList> annotatedRegions(Document*, bool draggable, ExceptionState&);
3315c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
332df95704c49daea886ddad70775bda23618d6274dBen Murdoch    DocumentMarker* markerAt(Node*, const String& markerType, unsigned index, ExceptionState&);
333d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    RefPtrWillBeMember<InternalRuntimeFlags> m_runtimeFlags;
334d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    RefPtrWillBeMember<InternalProfilers> m_profilers;
3355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)};
3365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)} // namespace WebCore
3385c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#endif
340