/* * Copyright (C) 2012 Google Inc. All rights reserved. * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ [ NoInterfaceObject, ] interface Internals { DOMString address(Node node); [RaisesException] DOMString elementRenderTreeAsText(Element element); boolean isPreloaded(DOMString url); boolean isLoadingFromMemoryCache(DOMString url); [RaisesException] CSSStyleDeclaration computedStyleIncludingVisitedInfo(Node node); [RaisesException] Node ensureShadowRoot(Element host); [RaisesException] Node createShadowRoot(Element host); [RaisesException] Node shadowRoot(Element host); [RaisesException] DOMString shadowRootType(Node root); [RaisesException] Element includerFor(Node node); [RaisesException] DOMString shadowPseudoId(Element element); [RaisesException] void setShadowPseudoId(Element element, DOMString id); [RaisesException] Node treeScopeRootNode(Node node); [RaisesException] Node parentTreeScope(Node node); // Spatial Navigation testing [RaisesException] unsigned long lastSpatialNavigationCandidateCount(); // CSS Animation testing. unsigned long numberOfActiveAnimations(); [RaisesException] void suspendAnimations(); [RaisesException] void resumeAnimations(); [RaisesException] boolean animationsAreSuspended(); [RaisesException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element); [RaisesException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId); // CSS Transition testing. [RaisesException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element); [RaisesException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId); [RaisesException] boolean attached(Node node); DOMString visiblePlaceholder(Element element); #if defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR void selectColorInColorChooser(Element element, DOMString colorValue); #endif [RaisesException] DOMString[] formControlStateOfPreviousHistoryItem(); [RaisesException] void setFormControlStateOfPreviousHistoryItem(sequence values); [RaisesException] ClientRect absoluteCaretBounds(); [RaisesException] ClientRect boundingBox(Element element); [RaisesException] ClientRectList inspectorHighlightRects(); [RaisesException] DOMString inspectorHighlightObject(); [RaisesException] unsigned long markerCountForNode(Node node, DOMString markerType); [RaisesException] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index); [RaisesException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index); void addTextMatchMarker(Range range, boolean isActive); [RaisesException] void setScrollViewPosition(long x, long y); [RaisesException] void setPagination(DOMString mode, long gap, optional long pageLength); [RaisesException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight); [RaisesException] boolean wasLastChangeUserEdit(Element textField); [RaisesException] boolean elementShouldAutoComplete(Element inputElement); [RaisesException] DOMString suggestedValue(Element inputElement); [RaisesException] void setSuggestedValue(Element inputElement, DOMString value); [RaisesException] void setEditingValue(Element inputElement, DOMString value); [RaisesException] void setAutofilled(Element inputElement, boolean enabled); [RaisesException] unsigned long countMatchesForText(DOMString text, unsigned long findOptions, DOMString markMatches); [RaisesException] void paintControlTints(); [RaisesException] void scrollElementToRect(Element element, long x, long y, long w, long h); [RaisesException] Range rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength); [RaisesException] unsigned long locationFromRange(Element scope, Range range); [RaisesException] unsigned long lengthFromRange(Element scope, Range range); [RaisesException] DOMString rangeAsText(Range range); [RaisesException] void setDelegatesScrolling(boolean enabled); [RaisesException] long lastSpellCheckRequestSequence(); [RaisesException] long lastSpellCheckProcessedSequence(); sequence userPreferredLanguages(); void setUserPreferredLanguages(sequence languages); [RaisesException] unsigned long wheelEventHandlerCount(); [RaisesException] unsigned long touchEventHandlerCount(); [RaisesException] NodeList nodesFromRect(Document document, long x, long y, unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding, boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent); // Calling parserMetaData() with no arguments gets the metadata for the script of the current scope. DOMString parserMetaData(optional any func); void updateEditorUINowIfScheduled(); Node findEditingDeleteButton(); [RaisesException] boolean hasSpellingMarker(long from, long length); [RaisesException] boolean hasGrammarMarker(long from, long length); [RaisesException] boolean hasAutocorrectedMarker(long from, long length); [RaisesException] void setContinuousSpellCheckingEnabled(boolean enabled); [RaisesException] void setAutomaticQuoteSubstitutionEnabled(boolean enabled); [RaisesException] void setAutomaticLinkDetectionEnabled(boolean enabled); [RaisesException] void setAutomaticDashSubstitutionEnabled(boolean enabled); [RaisesException] void setAutomaticTextReplacementEnabled(boolean enabled); [RaisesException] void setAutomaticSpellingCorrectionEnabled(boolean enabled); [RaisesException] boolean isOverwriteModeEnabled(); [RaisesException] void toggleOverwriteModeEnabled(); [RaisesException] unsigned long numberOfScrollableAreas(); [RaisesException] boolean isPageBoxVisible(long pageNumber); readonly attribute InternalSettings settings; readonly attribute unsigned long workerThreadCount; // Flags for layerTreeAsText. const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1; const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2; const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4; const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8; const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16; [RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags); [RaisesException] DOMString scrollingStateTreeAsText(); [RaisesException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons(). [RaisesException] ClientRectList nonFastScrollableRects(); [RaisesException] DOMString repaintRectsAsText(); [RaisesException] void garbageCollectDocumentResources(); void allowRoundingHacks(); [RaisesException] void insertAuthorCSS(DOMString css); [RaisesException] void insertUserCSS(DOMString css); #if defined(ENABLE_BATTERY_STATUS) && ENABLE_BATTERY_STATUS [RaisesException] void setBatteryStatus(DOMString eventType, boolean charging, unrestricted double chargingTime, unrestricted double dischargingTime, unrestricted double level); #endif #if defined(ENABLE_PROXIMITY_EVENTS) && ENABLE_PROXIMITY_EVENTS [RaisesException] void setDeviceProximity(DOMString eventType, unrestricted double value, unrestricted double min, unrestricted double max); #endif // As per spec: http://www.w3.org/TR/WebIDL/#idl-sequence // "Sequences must not be used as the type of an attribute, constant or exception field." // FIXME: this will lead to BUG interals.consoleProfiles !== interals.consoleProfiles as profile will always returns new array. readonly attribute ScriptProfile[] consoleProfiles; unsigned long numberOfLiveNodes(); unsigned long numberOfLiveDocuments(); [Conditional=INSPECTOR] sequence consoleMessageArgumentCounts(); [Conditional=INSPECTOR] DOMWindow openDummyInspectorFrontend(DOMString url); [Conditional=INSPECTOR] void closeDummyInspectorFrontend(); [Conditional=INSPECTOR, RaisesException] void setJavaScriptProfilingEnabled(boolean creates); [Conditional=INSPECTOR, RaisesException] void setInspectorIsUnderTest(boolean isUnderTest); DOMString counterValue(Element element); long pageNumber(Element element, optional unrestricted float pageWidth, optional unrestricted float pageHeight); DOMString[] shortcutIconURLs(); DOMString[] allIconURLs(); long numberOfPages(optional unrestricted double pageWidthInPixels, optional unrestricted double pageHeightInPixels); [RaisesException] DOMString pageProperty(DOMString propertyName, long pageNumber); [RaisesException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft); [RaisesException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y); void setHeaderHeight(unrestricted float height); void setFooterHeight(unrestricted float height); void setTopContentInset(unrestricted float contentInset); #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API void webkitWillEnterFullScreenForElement(Element element); void webkitDidEnterFullScreenForElement(Element element); void webkitWillExitFullScreenForElement(Element element); void webkitDidExitFullScreenForElement(Element element); #endif void setApplicationCacheOriginQuota(unsigned long long quota); void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme); void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme); MallocStatistics mallocStatistics(); TypeConversions typeConversions(); MemoryInfo memoryInfo(); DOMString[] getReferencedFilePaths(); // These functions both reset the tracked repaint rects. They are inteded to be used in the following order: // startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints. [RaisesException] void startTrackingRepaints(); [RaisesException] void stopTrackingRepaints(); // Returns a string with information about the mouse cursor used at the specified client location. [RaisesException] DOMString getCurrentCursorInfo(); [RaisesException] DOMString markerTextForListItem(Element element); SerializedScriptValue deserializeBuffer(ArrayBuffer buffer); ArrayBuffer serializeObject(SerializedScriptValue obj); void setUsesOverlayScrollbars(boolean enabled); void forceReload(boolean endToEnd); [Conditional=VIDEO] void simulateAudioInterruption(Node node); [Conditional=ENCRYPTED_MEDIA_V2] void initializeMockCDM(); [Conditional=SPEECH_SYNTHESIS] void enableMockSpeechSynthesizer(); [RaisesException] DOMString getImageSourceURL(Element element); [Conditional=VIDEO_TRACK, RaisesException] DOMString captionsStyleSheetOverride(); [Conditional=VIDEO_TRACK, RaisesException] void setCaptionsStyleSheetOverride(DOMString override); [Conditional=VIDEO_TRACK, RaisesException] void setPrimaryAudioTrackLanguageOverride(DOMString language); [Conditional=VIDEO_TRACK, RaisesException] void setCaptionDisplayMode(DOMString mode); [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array endTimes); [Conditional=VIDEO] unrestricted double closestTimeToTimeRanges(unrestricted double time, TimeRanges ranges); boolean isSelectPopupVisible(Node node); #if defined(ENABLE_VIBRATION) && ENABLE_VIBRATION boolean isVibrating(); #endif [RaisesException] boolean isPluginUnavailabilityIndicatorObscured(Element element); [RaisesException] boolean isPluginSnapshotted(Element element); [RaisesException] ClientRect selectionBounds(); [Conditional=MEDIA_SOURCE] void initializeMockMediaSource(); [Conditional=VIDEO] void beginMediaSessionInterruption(); [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags); [Conditional=VIDEO] void applicationWillEnterForeground(); [Conditional=VIDEO] void applicationWillEnterBackground(); [Conditional=VIDEO, RaisesException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions); [Conditional=VIDEO, RaisesException] void postRemoteControlCommand(DOMString command); [Conditional=VIDEO] void simulateSystemSleep(); [Conditional=VIDEO] void simulateSystemWake(); };