Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / testing / Internals.idl
1 /*
2  * Copyright (C) 2012 Google Inc. All rights reserved.
3  * Copyright (C) 2013 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 [
28     DoNotCheckConstants,
29     GarbageCollected,
30     Iterable,
31 ] interface Internals {
32     DOMString address(Node node);
33
34     GCObservation observeGC(any observed);
35
36     [RaisesException, TypeChecking=Interface] DOMString elementRenderTreeAsText(Element element);
37     boolean isPreloaded(DOMString url);
38     boolean isLoadingFromMemoryCache(DOMString url);
39
40     [TypeChecking=Interface] boolean isSharingStyle(Element element1, Element element2);
41
42     [TypeChecking=Interface] CSSStyleDeclaration computedStyleIncludingVisitedInfo(Node node);
43
44     [TypeChecking=Interface] ShadowRoot createUserAgentShadowRoot(Element host);
45
46     [TypeChecking=Interface] ShadowRoot shadowRoot(Element host);
47     [TypeChecking=Interface] ShadowRoot youngestShadowRoot(Element host);
48     [TypeChecking=Interface] ShadowRoot oldestShadowRoot(Element host);
49     [RaisesException, TypeChecking=Interface] ShadowRoot youngerShadowRoot(Node root);
50
51     [RaisesException, TypeChecking=Interface] DOMString shadowRootType(Node root);
52     [RaisesException] boolean hasShadowInsertionPoint(Node root);
53     [RaisesException] boolean hasContentElement(Node root);
54     [RaisesException, TypeChecking=Interface] unsigned long countElementShadow(Node Root);
55     [TypeChecking=Interface] DOMString shadowPseudoId(Element element);
56     [RaisesException, TypeChecking=Interface] boolean isValidContentSelect(Element contentElement);
57     [TypeChecking=Interface] Node treeScopeRootNode(Node node);
58     [TypeChecking=Interface] Node parentTreeScope(Node node);
59     [RaisesException, TypeChecking=Interface] boolean hasSelectorForIdInShadow(Element host, DOMString id);
60     [RaisesException, TypeChecking=Interface] boolean hasSelectorForClassInShadow(Element host, DOMString className);
61     [RaisesException, TypeChecking=Interface] boolean hasSelectorForAttributeInShadow(Element host, DOMString attributeName);
62     [RaisesException, TypeChecking=Interface] boolean hasSelectorForPseudoClassInShadow(Element host, DOMString pseudoClass);
63     [RaisesException, TypeChecking=Interface] unsigned short compareTreeScopePosition(Node treeScope1, Node treeScope2);
64     [RaisesException] unsigned long updateStyleAndReturnAffectedElementCount();
65     [RaisesException] unsigned long needsLayoutCount();
66     [RaisesException] unsigned long hitTestCount(Document document);
67
68     // CSS Animation and Transition testing.
69     [RaisesException] void pauseAnimations(double pauseTime);
70
71     [TypeChecking=Interface] Node nextSiblingByWalker(Node node);
72     [TypeChecking=Interface] Node firstChildByWalker(Node node);
73     [TypeChecking=Interface] Node lastChildByWalker(Node node);
74     [TypeChecking=Interface] Node nextNodeByWalker(Node node);
75     [TypeChecking=Interface] Node previousNodeByWalker(Node node);
76
77     DOMString visiblePlaceholder(Element element);
78
79     [TypeChecking=Interface] void selectColorInColorChooser(Element element, DOMString colorValue);
80     [TypeChecking=Interface] void endColorChooser(Element element);
81
82     // If the argument is omitted, the top-level document is used.
83     boolean hasAutofocusRequest(optional Document document);
84     [RaisesException] DOMString[] formControlStateOfHistoryItem();
85     [RaisesException] void setFormControlStateOfHistoryItem(sequence<DOMString> values);
86     [RaisesException] void setEnableMockPagePopup(boolean enabled);
87     readonly attribute PagePopupController pagePopupController;
88     readonly attribute Window pagePopupWindow;
89
90     [RaisesException] ClientRect absoluteCaretBounds();
91
92     [TypeChecking=Interface] ClientRect boundingBox(Element element);
93
94     [RaisesException, TypeChecking=Interface] unsigned long markerCountForNode(Node node, DOMString markerType);
95     [TypeChecking=Interface] unsigned long activeMarkerCountForNode(Node node);
96     [RaisesException, TypeChecking=Interface] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index);
97     [RaisesException, TypeChecking=Interface] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
98     [TypeChecking=Interface] void addTextMatchMarker(Range range, boolean isActive);
99     [TypeChecking=Interface] void setMarkersActive(Node node, unsigned long startOffset, unsigned long endOffset, boolean active);
100     void setMarkedTextMatchesAreHighlighted(Document document, boolean highlight);
101
102     [RaisesException, TypeChecking=Interface] void setFrameViewPosition(Document document, long x, long y);
103
104     [RaisesException, TypeChecking=Interface] DOMString viewportAsText(Document document,
105                                                                        float devicePixelRatio,
106                                                                        long availableWidth,
107                                                                        long availableHeight);
108
109     [RaisesException, TypeChecking=Interface] boolean wasLastChangeUserEdit(Element textField);
110     [RaisesException, TypeChecking=Interface] boolean elementShouldAutoComplete(Element inputElement);
111     [RaisesException, TypeChecking=Interface] DOMString suggestedValue(Element inputElement);
112     [RaisesException, TypeChecking=Interface] void setSuggestedValue(Element inputElement, DOMString value);
113     [RaisesException, TypeChecking=Interface] void setEditingValue(Element inputElement, DOMString value);
114     [RaisesException, TypeChecking=Interface] void setAutofilled(Element inputElement, boolean enabled);
115
116     [RaisesException, TypeChecking=Interface] void scrollElementToRect(Element element, long x, long y, long w, long h);
117
118     [TypeChecking=Interface] Range rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
119     [TypeChecking=Interface] unsigned long locationFromRange(Element scope, Range range);
120     [TypeChecking=Interface] unsigned long lengthFromRange(Element scope, Range range);
121     [TypeChecking=Interface] DOMString rangeAsText(Range range);
122
123     [RaisesException, TypeChecking=Interface] DOMPoint touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
124     [RaisesException, TypeChecking=Interface] Node touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
125     [RaisesException, TypeChecking=Interface] DOMPoint touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
126     [RaisesException, TypeChecking=Interface] Node touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
127     [RaisesException, TypeChecking=Interface] ClientRect bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document document);
128
129     [RaisesException] long lastSpellCheckRequestSequence(Document document);
130     [RaisesException] long lastSpellCheckProcessedSequence(Document document);
131
132     sequence<DOMString> userPreferredLanguages();
133     void setUserPreferredLanguages(sequence<DOMString> languages);
134
135     [TypeChecking=Interface] unsigned long activeDOMObjectCount(Document document);
136     [TypeChecking=Interface] unsigned long wheelEventHandlerCount(Document document);
137     [TypeChecking=Interface] unsigned long scrollEventHandlerCount(Document document);
138     [TypeChecking=Interface] unsigned long touchEventHandlerCount(Document document);
139     [RaisesException, TypeChecking=Interface] LayerRectList touchEventTargetLayerRects(Document document);
140
141
142     [RaisesException, TypeChecking=Interface] NodeList nodesFromRect(Document document, long x, long y,
143         unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
144         boolean ignoreClipping, boolean allowChildFrameContent);
145
146     [TypeChecking=Interface] boolean hasSpellingMarker(Document document, long from, long length);
147     [TypeChecking=Interface] boolean hasGrammarMarker(Document document, long from, long length);
148     void setContinuousSpellCheckingEnabled(boolean enabled);
149
150     [TypeChecking=Interface] boolean isOverwriteModeEnabled(Document document);
151     [TypeChecking=Interface] void toggleOverwriteModeEnabled(Document document);
152
153     [TypeChecking=Interface] unsigned long numberOfScrollableAreas(Document document);
154
155     [TypeChecking=Interface] boolean isPageBoxVisible(Document document, long pageNumber);
156
157     readonly attribute InternalSettings settings;
158     readonly attribute InternalProfilers profilers;
159     readonly attribute InternalRuntimeFlags runtimeFlags;
160     readonly attribute unsigned long workerThreadCount;
161
162     // Flags for layerTreeAsText.
163     // The values of these constants must be kept in sync with the values of LayerTreeAsTextBehaviorFlags in GraphicsLayerClient.h.
164     const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 2;
165     const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 4;
166     const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER = 8;
167     const unsigned short LAYER_TREE_INCLUDES_CLIP_AND_SCROLL_PARENTS = 16;
168     [RaisesException, TypeChecking=Interface] DOMString layerTreeAsText(Document document, optional unsigned short flags);
169     [RaisesException, TypeChecking=Interface] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);
170
171     [RaisesException, TypeChecking=Interface] boolean scrollsWithRespectTo(Element element1, Element element2);
172
173     [TypeChecking=Interface] DOMString scrollingStateTreeAsText(Document document);
174     [RaisesException, TypeChecking=Interface] DOMString mainThreadScrollingReasons(Document document);
175     [RaisesException, TypeChecking=Interface] ClientRectList nonFastScrollableRects(Document document);
176
177     [TypeChecking=Interface] void garbageCollectDocumentResources(Document document);
178     void evictAllResources();
179
180     unsigned long numberOfLiveNodes();
181     unsigned long numberOfLiveDocuments();
182     DOMString dumpRefCountedInstanceCounts();
183     sequence<DOMString> consoleMessageArgumentCounts(Document document);
184     unsigned long[] setMemoryCacheCapacities(unsigned long minDeadBytes, unsigned long maxDeadBytes, unsigned long totalBytes);
185     [RaisesException] void setInspectorResourcesDataSizeLimits(long maximumResourcesContentSize, long maximumSingleResourceContentSize);
186     [RaisesException] DOMString inspectorHighlightJSON(Node node);
187
188     DOMString counterValue(Element element);
189     long pageNumber(Element element, optional float pageWidth, optional float pageHeight);
190     DOMString[] shortcutIconURLs(Document document);
191     DOMString[] allIconURLs(Document document);
192     long numberOfPages(optional double pageWidthInPixels, optional double pageHeightInPixels);
193     [RaisesException] DOMString pageProperty(DOMString propertyName, long pageNumber);
194     [RaisesException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
195
196     [RaisesException] void setDeviceScaleFactor(float scaleFactor);
197
198     [RaisesException, TypeChecking=Interface] void setIsCursorVisible(Document document, boolean isVisible);
199
200     void mediaPlayerRequestFullscreen(HTMLMediaElement mediaElement);
201     double effectiveMediaVolume(HTMLMediaElement mediaElement);
202     void mediaPlayerRemoteRouteAvailabilityChanged(HTMLMediaElement mediaElement, boolean available);
203     void mediaPlayerPlayingRemotelyChanged(HTMLMediaElement mediaElement, boolean remote);
204
205     void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
206     void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
207
208     TypeConversions typeConversions();
209
210     // This is enabled only in Debug builds.
211     // This is because we want to avoid putting the byte stream of testing private scripts
212     // into the binary of Release builds.
213     PrivateScriptTest privateScriptTest();
214
215     DOMString[] getReferencedFilePaths();
216
217     // These functions both reset the tracked repaint rects. They are inteded to be used in the following order:
218     //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
219     [RaisesException, TypeChecking=Interface] void startTrackingRepaints(Document document);
220     [RaisesException, TypeChecking=Interface] void stopTrackingRepaints(Document document);
221
222     // |node| should be Document, HTMLIFrameElement, or unspecified.
223     // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
224     // specified without security checks. Unspecified means this document.
225     [RaisesException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node node);
226
227     [RaisesException, TypeChecking=Interface] void forceFullRepaint(Document document);
228
229     // Returns a list of draggable/non-draggable regions in the document.
230     [RaisesException, TypeChecking=Interface] ClientRectList draggableRegions(Document document);
231     [RaisesException, TypeChecking=Interface] ClientRectList nonDraggableRegions(Document document);
232
233     // Returns a string with information about the mouse cursor used at the specified client location.
234     [RaisesException, TypeChecking=Interface] DOMString getCurrentCursorInfo(Document document);
235
236     [TypeChecking=Interface] DOMString markerTextForListItem(Element element);
237
238     SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
239     ArrayBuffer serializeObject(SerializedScriptValue obj);
240
241     void forceReload(boolean endToEnd);
242
243     [TypeChecking=Interface] DOMString getImageSourceURL(Element element);
244
245     [TypeChecking=Interface] boolean isSelectPopupVisible(Node node);
246     boolean selectPopupItemStyleIsRtl(Node select, long itemIndex);
247     long selectPopupItemStyleFontHeight(Node select, long itemIndex);
248
249     [RaisesException] ClientRect selectionBounds();
250
251     boolean loseSharedGraphicsContext3D();
252
253     [RaisesException, TypeChecking=Interface] void forceCompositingUpdate(Document document);
254
255     void setZoomFactor(float factor);
256
257     [RaisesException, TypeChecking=Interface] void setShouldRevealPassword(Element element, boolean reveal);
258
259     [CallWith=ScriptState] Promise createResolvedPromise(any value);
260     [CallWith=ScriptState] Promise createRejectedPromise(any reason);
261     [CallWith=ScriptState] Promise addOneToPromise(Promise promise);
262     [CallWith=ScriptState, RaisesException] Promise promiseCheck(long arg1, boolean arg2, Dictionary arg3, DOMString arg4, DOMString[] arg5);
263     [CallWith=ScriptState] Promise promiseCheckWithoutExceptionState(Dictionary arg1, DOMString arg2, DOMString... variadic);
264     [CallWith=ScriptState] Promise promiseCheckRange([EnforceRange] octet arg1);
265     [CallWith=ScriptState] Promise promiseCheckOverload(Location arg1);
266     [CallWith=ScriptState] Promise promiseCheckOverload(Document arg1);
267     [CallWith=ScriptState] Promise promiseCheckOverload(Location arg1, long arg2, long arg3);
268
269     void setValueForUser(Element element, DOMString value);
270
271     DOMString textSurroundingNode(Node node, long x, long y, unsigned long maxLength);
272
273     void setFocused(boolean focused);
274
275     [TypeChecking=Interface] boolean ignoreLayoutWithPendingStylesheets(Document document);
276
277     // These functions are for testing NetInfo. You must call setNetworkStateNotifierTestOnly(true)
278     // before calling setNetworkConnectionInfo.
279     void setNetworkStateNotifierTestOnly(boolean testOnly);
280     [RaisesException] void setNetworkConnectionInfo(DOMString type);
281
282     // This function is for testing HitRegions on Canvas2D.
283     unsigned long countHitRegions(CanvasRenderingContext2D context);
284
285     DOMString serializeNavigationMarkup();
286     void hideAllTransitionElements();
287
288     [RaisesException, TypeChecking=Interface] void forcePluginPlaceholder(HTMLElement plugin, DocumentFragment fragment);
289     [RaisesException, TypeChecking=Interface] void forcePluginPlaceholder(HTMLElement plugin, Dictionary options);
290
291     DictionaryTest dictionaryTest();
292     UnionTypesTest unionTypesTest();
293 };