Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / frame / UseCounter.h
index bc48f48..2ab44fc 100644 (file)
 #ifndef UseCounter_h
 #define UseCounter_h
 
-#include "CSSPropertyNames.h"
+#include "core/CSSPropertyNames.h"
 #include "wtf/BitVector.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/text/WTFString.h"
 
-namespace WebCore {
+namespace blink {
 
 class CSSStyleSheet;
-class DOMWindow;
+class LocalDOMWindow;
 class Document;
 class ExecutionContext;
 class StyleSheetContents;
@@ -62,15 +62,11 @@ public:
         // Do not change assigned numbers of existing items: add new features
         // to the end of the list.
         PageDestruction = 0,
-        LegacyNotifications = 1,
         PrefixedIndexedDB = 3,
         WorkerStart = 4,
         SharedWorkerStart = 5,
-        LegacyWebAudio = 6,
-        WebAudioStart = 7,
         UnprefixedIndexedDB = 9,
         OpenWebDatabase = 10,
-        LegacyTextNotifications = 12,
         UnprefixedRequestAnimationFrame = 13,
         PrefixedRequestAnimationFrame = 14,
         ContentSecurityPolicy = 15,
@@ -101,9 +97,7 @@ public:
         MinAttribute = 43,
         PatternAttribute = 44,
         PlaceholderAttribute = 45,
-        PrecisionAttribute = 46,
         PrefixedDirectoryAttribute = 47,
-        PrefixedSpeechAttribute = 48,
         RequiredAttribute = 49,
         ResultsAttribute = 50,
         StepAttribute = 51,
@@ -118,7 +112,6 @@ public:
         DeprecatedFlexboxChrome = 62,
         DeprecatedFlexboxChromeExtension = 63,
         UnprefixedPerformanceTimeline = 65,
-        PrefixedPerformanceTimeline = 66,
         UnprefixedUserTiming = 67,
         WindowEvent = 69,
         ContentSecurityPolicyWithBaseElement = 70,
@@ -133,19 +126,14 @@ public:
         DocumentAll = 83,
         FormElement = 84,
         DemotedFormElement = 85,
-        CaptureAttributeAsEnum = 86,
-        ShadowDOMPrefixedCreateShadowRoot = 88,
-        ShadowDOMPrefixedShadowRoot = 89,
         SVGAnimationElement = 90,
         KeyboardEventKeyLocation = 91,
         LineClamp = 96,
         SubFrameBeforeUnloadRegistered = 97,
         SubFrameBeforeUnloadFired = 98,
         TextReplaceWholeText = 100,
-        PrefixedShadowRootConstructor = 101,
         ConsoleMarkTimeline = 102,
         CSSPseudoElementUserAgentCustomPseudo = 103,
-        DocumentTypeInternalSubset = 105, // Removed from DOM4.
         ElementGetAttributeNode = 107, // Removed from DOM4.
         ElementSetAttributeNode = 108, // Removed from DOM4.
         ElementRemoveAttributeNode = 109, // Removed from DOM4.
@@ -176,7 +164,6 @@ public:
         PrefixedAndUnprefixedAnimationIterationEvent = 136,
         EventReturnValue = 137, // Legacy IE extension.
         SVGSVGElement = 138,
-        SVGAnimateColorElement = 139,
         InsertAdjacentText = 140,
         InsertAdjacentElement = 141,
         HasAttributes = 142, // Removed from DOM4.
@@ -219,10 +206,8 @@ public:
         InputTypeTextMaxLength = 191,
         InputTypePassword = 192,
         InputTypePasswordMaxLength = 193,
-        SVGInstanceRoot = 194,
         ShowModalDialog = 195,
         PrefixedPageVisibility = 196,
-        HTMLFrameElementLocation = 197,
         CSSStyleSheetInsertRuleOptionalArg = 198, // Inconsistent with the specification and other browsers.
         DocumentBeforeUnloadRegistered = 200,
         DocumentBeforeUnloadFired = 201,
@@ -233,7 +218,6 @@ public:
         HTMLHeadElementProfile = 207,
         OverflowChangedEvent = 208,
         SVGPointMatrixTransform = 209,
-        HTMLHtmlElementManifest = 210,
         DOMFocusInOutEvent = 211,
         FileGetLastModifiedDate = 212,
         HTMLElementInnerText = 213,
@@ -241,14 +225,12 @@ public:
         ReplaceDocumentViaJavaScriptURL = 215,
         ElementSetAttributeNodeNS = 216, // Removed from DOM4.
         ElementPrefixedMatchesSelector = 217,
-        DOMImplementationCreateCSSStyleSheet = 218,
         CSSStyleSheetRules = 219,
         CSSStyleSheetAddRule = 220,
         CSSStyleSheetRemoveRule = 221,
         // The above items are available in M33 branch.
 
         InitMessageEvent = 222,
-        PrefixedInitMessageEvent = 223,
         ElementSetPrefix = 224, // Element.prefix is readonly in DOM4.
         CSSStyleDeclarationGetPropertyCSSValue = 225,
         PrefixedMediaCancelKeyRequest = 229,
@@ -258,55 +240,39 @@ public:
         PrefixedDevicePixelRatioMediaFeature = 233,
         PrefixedMaxDevicePixelRatioMediaFeature = 234,
         PrefixedMinDevicePixelRatioMediaFeature = 235,
-        PrefixedTransform2dMediaFeature = 236,
         PrefixedTransform3dMediaFeature = 237,
-        PrefixedAnimationMediaFeature = 238,
-        PrefixedViewModeMediaFeature = 239,
         PrefixedStorageQuota = 240,
         ContentSecurityPolicyReportOnlyInMeta = 241,
-        PrefixedMediaSourceOpen = 242,
         ResetReferrerPolicy = 243,
         CaseInsensitiveAttrSelectorMatch = 244, // Case-insensitivity dropped from specification.
-        CaptureAttributeAsBoolean = 245,
         FormNameAccessForImageElement = 246,
         FormNameAccessForPastNamesMap = 247,
         FormAssociationByParser = 248,
-        HTMLSourceElementMedia = 249,
         SVGSVGElementInDocument = 250,
         SVGDocumentRootElement = 251,
-        DocumentCreateEventOptionalArgument = 252,
         MediaErrorEncrypted = 253,
         EventSourceURL = 254,
         WebSocketURL = 255,
         WorkerSubjectToCSP = 257,
         WorkerAllowedByChildBlockedByScript = 258,
-        HTMLMediaElementControllerNotNull = 259,
         DeprecatedWebKitGradient = 260,
         DeprecatedWebKitLinearGradient = 261,
         DeprecatedWebKitRepeatingLinearGradient = 262,
         DeprecatedWebKitRadialGradient = 263,
         DeprecatedWebKitRepeatingRadialGradient = 264,
-        PrefixedGetImageDataHD = 265,
-        PrefixedPutImageDataHD = 266,
         PrefixedImageSmoothingEnabled = 267,
         UnprefixedImageSmoothingEnabled = 268,
-        PromiseConstructor = 270,
-        PromiseCast = 271,
-        PromiseReject = 272,
-        PromiseResolve = 273,
         // The above items are available in M34 branch.
 
         TextAutosizing = 274,
-        TextAutosizingLayout = 275,
         HTMLAnchorElementPingAttribute = 276,
-        JavascriptExhaustedMemory = 277,
         InsertAdjacentHTML = 278,
         SVGClassName = 279,
         HTMLAppletElement = 280,
         HTMLMediaElementSeekToFragmentStart = 281,
         HTMLMediaElementPauseAtFragmentEnd = 282,
         PrefixedWindowURL = 283,
-        PrefixedWorkerURL = 284,
+        PrefixedWorkerURL = 284, // This didn't work because of crbug.com/376039. Available since M37.
         WindowOrientation = 285,
         DOMStringListContains = 286,
         DocumentCaptureEvents = 287,
@@ -335,9 +301,8 @@ public:
         NamedNodeMapGetNamedItemNS = 310,
         NamedNodeMapSetNamedItemNS = 311,
         NamedNodeMapRemoveNamedItemNS = 312,
-        OpenWebDatabaseInWorker = 313,
-        OpenWebDatabaseSyncInWorker = 314,
-        PrefixedAllowFullscreenAttribute = 315,
+        OpenWebDatabaseInWorker = 313, // This didn't work because of crbug.com/376039. Available since M37.
+        OpenWebDatabaseSyncInWorker = 314, // This didn't work because of crbug.com/376039. Available since M37.
         XHRProgressEventPosition = 316,
         XHRProgressEventTotalSize = 317,
         PrefixedDocumentIsFullscreen = 318,
@@ -347,13 +312,193 @@ public:
         PrefixedDocumentFullscreenEnabled = 322,
         PrefixedDocumentFullscreenElement = 323,
         PrefixedDocumentExitFullscreen = 324,
+        // The above items are available in M35 branch.
+
+        SVGForeignObjectElement = 325,
+        SelectionSetPosition = 327,
+        AnimationPlayerFinishEvent = 328,
+        SVGSVGElementInXMLDocument = 329,
+        CanvasRenderingContext2DSetAlpha = 330,
+        CanvasRenderingContext2DSetCompositeOperation = 331,
+        CanvasRenderingContext2DSetLineWidth = 332,
+        CanvasRenderingContext2DSetLineCap = 333,
+        CanvasRenderingContext2DSetLineJoin = 334,
+        CanvasRenderingContext2DSetMiterLimit = 335,
+        CanvasRenderingContext2DClearShadow = 336,
+        CanvasRenderingContext2DSetStrokeColor = 337,
+        CanvasRenderingContext2DSetFillColor = 338,
+        CanvasRenderingContext2DDrawImageFromRect = 339,
+        CanvasRenderingContext2DSetShadow = 340,
+        PrefixedPerformanceClearResourceTimings = 341,
+        PrefixedPerformanceSetResourceTimingBufferSize = 342,
+        EventSrcElement = 343,
+        EventCancelBubble = 344,
+        EventPath = 345,
+        EventClipboardData = 346,
+        NodeIteratorDetach = 347,
+        AttrNodeValue = 348,
+        AttrTextContent = 349,
+        EventGetReturnValueTrue = 350,
+        EventGetReturnValueFalse = 351,
+        EventSetReturnValueTrue = 352,
+        EventSetReturnValueFalse = 353,
+        NodeIteratorExpandEntityReferences = 354,
+        TreeWalkerExpandEntityReferences = 355,
+        WindowOffscreenBuffering = 356,
+        WindowDefaultStatus = 357,
+        WindowDefaultstatus = 358,
+        PrefixedTransitionEventConstructor = 361,
+        PrefixedMutationObserverConstructor = 362,
+        PrefixedIDBCursorConstructor = 363,
+        PrefixedIDBDatabaseConstructor = 364,
+        PrefixedIDBFactoryConstructor = 365,
+        PrefixedIDBIndexConstructor = 366,
+        PrefixedIDBKeyRangeConstructor = 367,
+        PrefixedIDBObjectStoreConstructor = 368,
+        PrefixedIDBRequestConstructor = 369,
+        PrefixedIDBTransactionConstructor = 370,
+        NotificationPermission = 371,
+        RangeDetach = 372,
+        HTMLTableElementVspace = 374,
+        HTMLTableElementHspace = 375,
+        PrefixedTouchRadiusX = 378,
+        PrefixedTouchRadiusY = 379,
+        PrefixedTouchRotationAngle = 380,
+        PrefixedTouchForce = 381,
+        PrefixedMouseEventMovementX = 382,
+        PrefixedMouseEventMovementY = 383,
+        PrefixedFileRelativePath = 386,
+        DocumentCaretRangeFromPoint = 387,
+        DocumentGetCSSCanvasContext = 388,
+        ElementScrollIntoViewIfNeeded = 389,
+        RangeCompareNode = 392,
+        RangeExpand = 393,
+        HTMLImageElementX = 396,
+        HTMLImageElementY = 397,
+        SelectionBaseNode = 400,
+        SelectionBaseOffset = 401,
+        SelectionExtentNode = 402,
+        SelectionExtentOffset = 403,
+        SelectionType = 404,
+        SelectionModify = 405,
+        SelectionSetBaseAndExtent = 406,
+        SelectionEmpty = 407,
+        VTTCue = 409,
+        VTTCueRender = 410,
+        VTTCueRenderVertical = 411,
+        VTTCueRenderSnapToLinesFalse = 412,
+        VTTCueRenderLineNotAuto = 413,
+        VTTCueRenderPositionNot50 = 414,
+        VTTCueRenderSizeNot100 = 415,
+        VTTCueRenderAlignNotMiddle = 416,
+        // The above items are available in M36 branch.
+
+        ElementRequestPointerLock = 417,
+        VTTCueRenderRtl = 418,
+        PostMessageFromSecureToInsecure = 419,
+        PostMessageFromInsecureToSecure = 420,
+        DocumentExitPointerLock = 421,
+        DocumentPointerLockElement = 422,
+        PrefixedCursorZoomIn = 424,
+        PrefixedCursorZoomOut = 425,
+        CSSCharsetRuleEncoding = 426,
+        DocumentSetCharset = 427,
+        DocumentDefaultCharset = 428,
+        TextEncoderConstructor = 429,
+        TextEncoderEncode = 430,
+        TextDecoderConstructor = 431,
+        TextDecoderDecode = 432,
+        FocusInOutEvent = 433,
+        MouseEventMovementX = 434,
+        MouseEventMovementY = 435,
+        MixedContentRaw = 437,
+        MixedContentImage = 438,
+        MixedContentMedia = 439,
+        DocumentFonts = 440,
+        MixedContentFormsSubmitted = 441,
+        FormsSubmitted = 442,
+        TextInputEventOnInput = 443,
+        TextInputEventOnTextArea = 444,
+        TextInputEventOnContentEditable = 445,
+        TextInputEventOnNotNode = 446,
+        WebkitBeforeTextInsertedOnInput = 447,
+        WebkitBeforeTextInsertedOnTextArea = 448,
+        WebkitBeforeTextInsertedOnContentEditable = 449,
+        WebkitBeforeTextInsertedOnNotNode = 450,
+        WebkitEditableContentChangedOnInput = 451,
+        WebkitEditableContentChangedOnTextArea = 452,
+        WebkitEditableContentChangedOnContentEditable = 453,
+        WebkitEditableContentChangedOnNotNode = 454,
+        HTMLImports = 455,
+        ElementCreateShadowRoot = 456,
+        DocumentRegisterElement = 457,
+        EditingAppleInterchangeNewline = 458,
+        EditingAppleConvertedSpace = 459,
+        EditingApplePasteAsQuotation = 460,
+        EditingAppleStyleSpanClass = 461,
+        EditingAppleTabSpanClass = 462,
+        HTMLImportsAsyncAttribute = 463,
+        FontFaceSetReady = 464,
+        XMLHttpRequestSynchronous = 465,
+        CSSSelectorPseudoUnresolved = 466,
+        CSSSelectorPseudoShadow = 467,
+        CSSSelectorPseudoContent = 468,
+        CSSSelectorPseudoHost = 469,
+        CSSSelectorPseudoHostContext = 470,
+        CSSDeepCombinator = 471,
+        SyncXHRWithCredentials = 472,
+        // The above items are available in M37 branch.
+
+        UseAsm = 473,
+        KeyEventNotAllowedInFullScreen = 474,
+        DOMWindowOpen = 475,
+        DOMWindowOpenFeatures = 476,
+        MediaStreamTrackGetSources = 478,
+        AspectRatioFlexItem = 479,
+        DetailsElement = 480,
+        DialogElement = 481,
+        MapElement = 482,
+        MeterElement = 483,
+        ProgressElement = 484,
+        VideoFullscreenAllowedExemption = 485,
+        WebKitPoint = 488,
+        PrefixedHTMLElementDropzone = 490,
+        WheelEventWheelDeltaX = 491,
+        WheelEventWheelDeltaY = 492,
+        WheelEventWheelDelta = 493,
+        SendBeacon = 494,
+        SendBeaconQuotaExceeded = 495,
+        SVGSMILElementInDocument = 501,
+        MouseEventOffsetX = 502,
+        MouseEventOffsetY = 503,
+        MouseEventX = 504,
+        MouseEventY = 505,
+        MouseEventFromElement = 506,
+        MouseEventToElement = 507,
+        RequestFileSystem = 508,
+        RequestFileSystemWorker = 509,
+        RequestFileSystemSyncWorker = 510,
+        UIEventLayerX = 511,
+        UIEventLayerY = 512,
+        UIEventPageX = 513,
+        UIEventPageY = 514,
+        BgPropertiesFixed = 515,
+        HTMLImageElementComposite = 516,
+        DevToolsConsoleTimeline = 517,
+        DevToolsConsoleProfile = 518,
+        SVGStyleElementTitle = 519,
+        PictureSourceSrc = 520,
         // Add new features immediately above this line. Don't change assigned
         // numbers of any item, and don't reuse removed slots.
+        // Also, run update_use_counter_feature_enum.py in chromium/src/tools/metrics/histograms/
+        // to update the UMA mapping.
         NumberOfFeatures, // This enum value must be last.
     };
 
     // "count" sets the bit for this feature to 1. Repeated calls are ignored.
     static void count(const Document&, Feature);
+    // This doesn't count for ExecutionContexts for shared workers and service
+    // workers.
     static void count(const ExecutionContext*, Feature);
     void count(CSSParserContext, CSSPropertyID);
     void count(Feature);
@@ -361,9 +506,13 @@ public:
     // "countDeprecation" sets the bit for this feature to 1, and sends a deprecation
     // warning to the console. Repeated calls are ignored.
     //
-    // Be considerate to developers' consoles: features should only send deprecation warnings
-    // when we're actively interested in removing them from the platform.
-    static void countDeprecation(const DOMWindow*, Feature);
+    // Be considerate to developers' consoles: features should only send
+    // deprecation warnings when we're actively interested in removing them from
+    // the platform.
+    //
+    // The ExecutionContext* overload doesn't work for shared workers and
+    // service workers.
+    static void countDeprecation(const LocalDOMWindow*, Feature);
     static void countDeprecation(ExecutionContext*, Feature);
     static void countDeprecation(const Document&, Feature);
     String deprecationMessage(Feature);
@@ -406,6 +555,6 @@ private:
     BitVector m_CSSFeatureBits;
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // UseCounter_h