Chromium Code Reviews| Index: Source/core/frame/UseCounter.cpp |
| diff --git a/Source/core/frame/UseCounter.cpp b/Source/core/frame/UseCounter.cpp |
| index e9075f53cb20dbe098fad307e7e133a13dc91553..a9d798c927195e0e5bdbec701fc8ed8a71253ea8 100644 |
| --- a/Source/core/frame/UseCounter.cpp |
| +++ b/Source/core/frame/UseCounter.cpp |
| @@ -669,10 +669,9 @@ void UseCounter::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execut |
| UseCounter::countDeprecation(context, feature); |
| } |
| -// FIXME: Update other UseCounter::deprecationMessage() cases to use this. |
| static String replacedBy(const char* oldString, const char* newString) |
| { |
| - return String::format("'%s' is deprecated. Please use '%s' instead.", oldString, newString); |
| + return String::format("%s is deprecated. Please use %s instead.", oldString, newString); |
|
Julien - ping for review
2014/12/16 16:32:41
You're removing the quoting, which was neat, but I
|
| } |
| String UseCounter::deprecationMessage(Feature feature) |
| @@ -680,20 +679,20 @@ String UseCounter::deprecationMessage(Feature feature) |
| switch (feature) { |
| // Quota |
| case PrefixedStorageInfo: |
| - return "'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead."; |
| + return replacedBy("window.webkitStorageInfo", "navigator.webkitTemporaryStorage or navigator.webkitPersistentStorage"); |
| // Keyboard Event (DOM Level 3) |
| case KeyboardEventKeyLocation: |
| return replacedBy("KeyboardEvent.keyLocation", "KeyboardEvent.location"); |
| case ConsoleMarkTimeline: |
| - return "console.markTimeline is deprecated. Please use the console.timeStamp instead."; |
| + return replacedBy("console.markTimeline", "console.timeStamp"); |
| case FileError: |
| return "FileError is deprecated. Please use the 'name' or 'message' attributes of DOMError rather than 'code'."; |
| case ShowModalDialog: |
| - return "showModalDialog is deprecated. Please use window.open and postMessage instead."; |
| + return replacedBy("showModalDialog", "window.open or postMessage"); |
| case CSSStyleSheetInsertRuleOptionalArg: |
| return "Calling CSSStyleSheet.insertRule() with one argument is deprecated. Please pass the index argument as well: insertRule(x, 0)."; |
| @@ -702,19 +701,19 @@ String UseCounter::deprecationMessage(Feature feature) |
| return "'HTMLVideoElement.webkitSupportsFullscreen' is deprecated. Its value is true if the video is loaded."; |
| case PrefixedVideoDisplayingFullscreen: |
| - return "'HTMLVideoElement.webkitDisplayingFullscreen' is deprecated. Please use the 'fullscreenchange' and 'webkitfullscreenchange' events instead."; |
| + return replacedBy("HTMLVideoElement.webkitDisplayingFullscreen", "fullscreenchange or webkitfullscreenchange"); |
| case PrefixedVideoEnterFullscreen: |
| - return "'HTMLVideoElement.webkitEnterFullscreen()' is deprecated. Please use 'Element.requestFullscreen()' and 'Element.webkitRequestFullscreen()' instead."; |
| + return replacedBy("HTMLVideoElement.webkitEnterFullscreen()", "Element.requestFullscreen() or Element.webkitRequestFullscreen()"); |
| case PrefixedVideoExitFullscreen: |
| - return "'HTMLVideoElement.webkitExitFullscreen()' is deprecated. Please use 'Document.exitFullscreen()' and 'Document.webkitExitFullscreen()' instead."; |
| + return replacedBy("HTMLVideoElement.webkitExitFullscreen()", "Document.exitFullscreen() or Document.webkitExitFullscreen()"); |
| case PrefixedVideoEnterFullScreen: |
| - return "'HTMLVideoElement.webkitEnterFullScreen()' is deprecated. Please use 'Element.requestFullscreen()' and 'Element.webkitRequestFullscreen()' instead."; |
| + return replacedBy("HTMLVideoElement.webkitEnterFullScreen()", "Element.requestFullscreen() or Element.webkitRequestFullscreen()"); |
| case PrefixedVideoExitFullScreen: |
| - return "'HTMLVideoElement.webkitExitFullScreen()' is deprecated. Please use 'Document.exitFullscreen()' and 'Document.webkitExitFullscreen()' instead."; |
| + return replacedBy("HTMLVideoElement.webkitExitFullScreen()", "Document.exitFullscreen() or Document.webkitExitFullscreen()"); |
| case PrefixedGamepad: |
| return replacedBy("navigator.webkitGetGamepads", "navigator.getGamepads"); |
| @@ -768,31 +767,31 @@ String UseCounter::deprecationMessage(Feature feature) |
| return "Setting 'XMLHttpRequest.withCredentials' for synchronous requests is deprecated."; |
| case EventSourceURL: |
| - return "'EventSource.URL' is deprecated. Please use 'EventSource.url' instead."; |
| + return replacedBy("EventSource.URL", "EventSource.url"); |
| case WebSocketURL: |
| - return "'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instead."; |
| + return replacedBy("WebSocket.URL", "WebSocket.url"); |
| case HTMLTableElementVspace: |
| - return "The 'vspace' attribute on table is deprecated. Please use CSS instead."; |
| + return replacedBy("'vspace' attribute on table", "CSS margin property"); |
| case HTMLTableElementHspace: |
| - return "The 'hspace' attribute on table is deprecated. Please use CSS instead."; |
| + return replacedBy("'hspace' attribute on table", "CSS margin property"); |
| case PictureSourceSrc: |
| return "<source src> with a <picture> parent is invalid and therefore ignored. Please use <source srcset> instead."; |
| case XHRProgressEventPosition: |
| - return "The XMLHttpRequest progress event property 'position' is deprecated. Please use 'loaded' instead."; |
| + return replacedBy("The XMLHttpRequest progress event property position", "loaded"); |
| case XHRProgressEventTotalSize: |
| - return "The XMLHttpRequest progress event property 'totalSize' is deprecated. Please use 'total' instead."; |
| + return replacedBy("The XMLHttpRequest progress event property totalSize", "total"); |
| case ConsoleTimeline: |
| - return "console.timeline is deprecated. Please use the console.time instead."; |
| + return replacedBy("console.timeline", "console.time"); |
| case ConsoleTimelineEnd: |
| - return "console.timelineEnd is deprecated. Please use the console.timeEnd instead."; |
| + return replacedBy("console.timelineEnd", "console.timeEnd"); |
| case XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: |
| return "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/."; |
| @@ -807,7 +806,7 @@ String UseCounter::deprecationMessage(Feature feature) |
| return "'getMatchedCSSRules()' is deprecated. For more help, check https://code.google.com/p/chromium/issues/detail?id=437569#c2"; |
| case DocumentSetCharset: |
| - return "Setting 'Document.charset' is deprecated. Please use '<meta charset=\"UTF-8\">' instead."; |
| + return replacedBy("Setting 'Document.charset'", "<meta charset=\"UTF-8\">"); |
| case PrefixedImageSmoothingEnabled: |
| return replacedBy("CanvasRenderingContext2D.webkitImageSmoothingEnabled", "CanvasRenderingContext2D.imageSmoothingEnabled"); |