Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright (C) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 662 UseCounter::countDeprecation(document.frame(), feature); | 662 UseCounter::countDeprecation(document.frame(), feature); |
| 663 } | 663 } |
| 664 | 664 |
| 665 void UseCounter::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execut ionContext* context, Feature feature) | 665 void UseCounter::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execut ionContext* context, Feature feature) |
| 666 { | 666 { |
| 667 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) | 667 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) |
| 668 return; | 668 return; |
| 669 UseCounter::countDeprecation(context, feature); | 669 UseCounter::countDeprecation(context, feature); |
| 670 } | 670 } |
| 671 | 671 |
| 672 // FIXME: Update other UseCounter::deprecationMessage() cases to use this. | |
| 673 static String replacedBy(const char* oldString, const char* newString) | 672 static String replacedBy(const char* oldString, const char* newString) |
| 674 { | 673 { |
| 675 return String::format("'%s' is deprecated. Please use '%s' instead.", oldStr ing, newString); | 674 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
| |
| 676 } | 675 } |
| 677 | 676 |
| 678 String UseCounter::deprecationMessage(Feature feature) | 677 String UseCounter::deprecationMessage(Feature feature) |
| 679 { | 678 { |
| 680 switch (feature) { | 679 switch (feature) { |
| 681 // Quota | 680 // Quota |
| 682 case PrefixedStorageInfo: | 681 case PrefixedStorageInfo: |
| 683 return "'window.webkitStorageInfo' is deprecated. Please use 'navigator. webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead."; | 682 return replacedBy("window.webkitStorageInfo", "navigator.webkitTemporary Storage or navigator.webkitPersistentStorage"); |
| 684 | 683 |
| 685 // Keyboard Event (DOM Level 3) | 684 // Keyboard Event (DOM Level 3) |
| 686 case KeyboardEventKeyLocation: | 685 case KeyboardEventKeyLocation: |
| 687 return replacedBy("KeyboardEvent.keyLocation", "KeyboardEvent.location") ; | 686 return replacedBy("KeyboardEvent.keyLocation", "KeyboardEvent.location") ; |
| 688 | 687 |
| 689 case ConsoleMarkTimeline: | 688 case ConsoleMarkTimeline: |
| 690 return "console.markTimeline is deprecated. Please use the console.timeS tamp instead."; | 689 return replacedBy("console.markTimeline", "console.timeStamp"); |
| 691 | 690 |
| 692 case FileError: | 691 case FileError: |
| 693 return "FileError is deprecated. Please use the 'name' or 'message' attr ibutes of DOMError rather than 'code'."; | 692 return "FileError is deprecated. Please use the 'name' or 'message' attr ibutes of DOMError rather than 'code'."; |
| 694 | 693 |
| 695 case ShowModalDialog: | 694 case ShowModalDialog: |
| 696 return "showModalDialog is deprecated. Please use window.open and postMe ssage instead."; | 695 return replacedBy("showModalDialog", "window.open or postMessage"); |
| 697 | 696 |
| 698 case CSSStyleSheetInsertRuleOptionalArg: | 697 case CSSStyleSheetInsertRuleOptionalArg: |
| 699 return "Calling CSSStyleSheet.insertRule() with one argument is deprecat ed. Please pass the index argument as well: insertRule(x, 0)."; | 698 return "Calling CSSStyleSheet.insertRule() with one argument is deprecat ed. Please pass the index argument as well: insertRule(x, 0)."; |
| 700 | 699 |
| 701 case PrefixedVideoSupportsFullscreen: | 700 case PrefixedVideoSupportsFullscreen: |
| 702 return "'HTMLVideoElement.webkitSupportsFullscreen' is deprecated. Its v alue is true if the video is loaded."; | 701 return "'HTMLVideoElement.webkitSupportsFullscreen' is deprecated. Its v alue is true if the video is loaded."; |
| 703 | 702 |
| 704 case PrefixedVideoDisplayingFullscreen: | 703 case PrefixedVideoDisplayingFullscreen: |
| 705 return "'HTMLVideoElement.webkitDisplayingFullscreen' is deprecated. Ple ase use the 'fullscreenchange' and 'webkitfullscreenchange' events instead."; | 704 return replacedBy("HTMLVideoElement.webkitDisplayingFullscreen", "fullsc reenchange or webkitfullscreenchange"); |
| 706 | 705 |
| 707 case PrefixedVideoEnterFullscreen: | 706 case PrefixedVideoEnterFullscreen: |
| 708 return "'HTMLVideoElement.webkitEnterFullscreen()' is deprecated. Please use 'Element.requestFullscreen()' and 'Element.webkitRequestFullscreen()' inste ad."; | 707 return replacedBy("HTMLVideoElement.webkitEnterFullscreen()", "Element.r equestFullscreen() or Element.webkitRequestFullscreen()"); |
| 709 | 708 |
| 710 case PrefixedVideoExitFullscreen: | 709 case PrefixedVideoExitFullscreen: |
| 711 return "'HTMLVideoElement.webkitExitFullscreen()' is deprecated. Please use 'Document.exitFullscreen()' and 'Document.webkitExitFullscreen()' instead."; | 710 return replacedBy("HTMLVideoElement.webkitExitFullscreen()", "Document.e xitFullscreen() or Document.webkitExitFullscreen()"); |
| 712 | 711 |
| 713 case PrefixedVideoEnterFullScreen: | 712 case PrefixedVideoEnterFullScreen: |
| 714 return "'HTMLVideoElement.webkitEnterFullScreen()' is deprecated. Please use 'Element.requestFullscreen()' and 'Element.webkitRequestFullscreen()' inste ad."; | 713 return replacedBy("HTMLVideoElement.webkitEnterFullScreen()", "Element.r equestFullscreen() or Element.webkitRequestFullscreen()"); |
| 715 | 714 |
| 716 case PrefixedVideoExitFullScreen: | 715 case PrefixedVideoExitFullScreen: |
| 717 return "'HTMLVideoElement.webkitExitFullScreen()' is deprecated. Please use 'Document.exitFullscreen()' and 'Document.webkitExitFullscreen()' instead."; | 716 return replacedBy("HTMLVideoElement.webkitExitFullScreen()", "Document.e xitFullscreen() or Document.webkitExitFullscreen()"); |
| 718 | 717 |
| 719 case PrefixedGamepad: | 718 case PrefixedGamepad: |
| 720 return replacedBy("navigator.webkitGetGamepads", "navigator.getGamepads" ); | 719 return replacedBy("navigator.webkitGetGamepads", "navigator.getGamepads" ); |
| 721 | 720 |
| 722 case PrefixedIndexedDB: | 721 case PrefixedIndexedDB: |
| 723 return replacedBy("webkitIndexedDB", "indexedDB"); | 722 return replacedBy("webkitIndexedDB", "indexedDB"); |
| 724 | 723 |
| 725 case PrefixedIDBCursorConstructor: | 724 case PrefixedIDBCursorConstructor: |
| 726 return replacedBy("webkitIDBCursor", "IDBCursor"); | 725 return replacedBy("webkitIDBCursor", "IDBCursor"); |
| 727 | 726 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 case RangeDetach: | 760 case RangeDetach: |
| 762 return "'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatw g.org/#dom-range-detach)."; | 761 return "'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatw g.org/#dom-range-detach)."; |
| 763 | 762 |
| 764 case OverflowChangedEvent: | 763 case OverflowChangedEvent: |
| 765 return "The 'overflowchanged' event is deprecated and may be removed. Pl ease do not use it."; | 764 return "The 'overflowchanged' event is deprecated and may be removed. Pl ease do not use it."; |
| 766 | 765 |
| 767 case SyncXHRWithCredentials: | 766 case SyncXHRWithCredentials: |
| 768 return "Setting 'XMLHttpRequest.withCredentials' for synchronous request s is deprecated."; | 767 return "Setting 'XMLHttpRequest.withCredentials' for synchronous request s is deprecated."; |
| 769 | 768 |
| 770 case EventSourceURL: | 769 case EventSourceURL: |
| 771 return "'EventSource.URL' is deprecated. Please use 'EventSource.url' in stead."; | 770 return replacedBy("EventSource.URL", "EventSource.url"); |
| 772 | 771 |
| 773 case WebSocketURL: | 772 case WebSocketURL: |
| 774 return "'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instea d."; | 773 return replacedBy("WebSocket.URL", "WebSocket.url"); |
| 775 | 774 |
| 776 case HTMLTableElementVspace: | 775 case HTMLTableElementVspace: |
| 777 return "The 'vspace' attribute on table is deprecated. Please use CSS in stead."; | 776 return replacedBy("'vspace' attribute on table", "CSS margin property"); |
| 778 | 777 |
| 779 case HTMLTableElementHspace: | 778 case HTMLTableElementHspace: |
| 780 return "The 'hspace' attribute on table is deprecated. Please use CSS in stead."; | 779 return replacedBy("'hspace' attribute on table", "CSS margin property"); |
| 781 | 780 |
| 782 case PictureSourceSrc: | 781 case PictureSourceSrc: |
| 783 return "<source src> with a <picture> parent is invalid and therefore ig nored. Please use <source srcset> instead."; | 782 return "<source src> with a <picture> parent is invalid and therefore ig nored. Please use <source srcset> instead."; |
| 784 | 783 |
| 785 case XHRProgressEventPosition: | 784 case XHRProgressEventPosition: |
| 786 return "The XMLHttpRequest progress event property 'position' is depreca ted. Please use 'loaded' instead."; | 785 return replacedBy("The XMLHttpRequest progress event property position", "loaded"); |
| 787 | 786 |
| 788 case XHRProgressEventTotalSize: | 787 case XHRProgressEventTotalSize: |
| 789 return "The XMLHttpRequest progress event property 'totalSize' is deprec ated. Please use 'total' instead."; | 788 return replacedBy("The XMLHttpRequest progress event property totalSize" , "total"); |
| 790 | 789 |
| 791 case ConsoleTimeline: | 790 case ConsoleTimeline: |
| 792 return "console.timeline is deprecated. Please use the console.time inst ead."; | 791 return replacedBy("console.timeline", "console.time"); |
| 793 | 792 |
| 794 case ConsoleTimelineEnd: | 793 case ConsoleTimelineEnd: |
| 795 return "console.timelineEnd is deprecated. Please use the console.timeEn d instead."; | 794 return replacedBy("console.timelineEnd", "console.timeEnd"); |
| 796 | 795 |
| 797 case XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: | 796 case XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: |
| 798 return "Synchronous XMLHttpRequest on the main thread is deprecated beca use of its detrimental effects to the end user's experience. For more help, chec k http://xhr.spec.whatwg.org/."; | 797 return "Synchronous XMLHttpRequest on the main thread is deprecated beca use of its detrimental effects to the end user's experience. For more help, chec k http://xhr.spec.whatwg.org/."; |
| 799 | 798 |
| 800 case FontFaceSetReady: | 799 case FontFaceSetReady: |
| 801 return "document.fonts.ready() method is going to be replaced with docum ent.fonts.ready attribute in future releases. Please be prepared. For more help, check https://code.google.com/p/chromium/issues/detail?id=392077#c3 ."; | 800 return "document.fonts.ready() method is going to be replaced with docum ent.fonts.ready attribute in future releases. Please be prepared. For more help, check https://code.google.com/p/chromium/issues/detail?id=392077#c3 ."; |
| 802 | 801 |
| 803 case DOMImplementationHasFeatureReturnFalse: | 802 case DOMImplementationHasFeatureReturnFalse: |
| 804 return "'DOMImplementation.hasFeature()' returning false is deprecated. Please do not use it, as per DOM it should always return true (https://dom.spec. whatwg.org/#dom-domimplementation-hasfeature)."; | 803 return "'DOMImplementation.hasFeature()' returning false is deprecated. Please do not use it, as per DOM it should always return true (https://dom.spec. whatwg.org/#dom-domimplementation-hasfeature)."; |
| 805 | 804 |
| 806 case GetMatchedCSSRules: | 805 case GetMatchedCSSRules: |
| 807 return "'getMatchedCSSRules()' is deprecated. For more help, check https ://code.google.com/p/chromium/issues/detail?id=437569#c2"; | 806 return "'getMatchedCSSRules()' is deprecated. For more help, check https ://code.google.com/p/chromium/issues/detail?id=437569#c2"; |
| 808 | 807 |
| 809 case DocumentSetCharset: | 808 case DocumentSetCharset: |
| 810 return "Setting 'Document.charset' is deprecated. Please use '<meta char set=\"UTF-8\">' instead."; | 809 return replacedBy("Setting 'Document.charset'", "<meta charset=\"UTF-8\" >"); |
| 811 | 810 |
| 812 case PrefixedImageSmoothingEnabled: | 811 case PrefixedImageSmoothingEnabled: |
| 813 return replacedBy("CanvasRenderingContext2D.webkitImageSmoothingEnabled" , "CanvasRenderingContext2D.imageSmoothingEnabled"); | 812 return replacedBy("CanvasRenderingContext2D.webkitImageSmoothingEnabled" , "CanvasRenderingContext2D.imageSmoothingEnabled"); |
| 814 | 813 |
| 815 case DeprecatedDopplerFactor: | 814 case DeprecatedDopplerFactor: |
| 816 return "dopplerFactor is deprecated and will be removed in M45 when all doppler effects are removed"; | 815 return "dopplerFactor is deprecated and will be removed in M45 when all doppler effects are removed"; |
| 817 case DeprecatedSpeedOfSound: | 816 case DeprecatedSpeedOfSound: |
| 818 return "speedOfSound is deprecated and will be removed in M45 when all d oppler effects are removed"; | 817 return "speedOfSound is deprecated and will be removed in M45 when all d oppler effects are removed"; |
| 819 case DeprecatedSetVelocity: | 818 case DeprecatedSetVelocity: |
| 820 return "setVelocity() is deprecated and will be removed in M45 when all doppler effects are removed"; | 819 return "setVelocity() is deprecated and will be removed in M45 when all doppler effects are removed"; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 860 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) | 859 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
| 861 { | 860 { |
| 862 // FIXME: We may want to handle stylesheets that have multiple owners | 861 // FIXME: We may want to handle stylesheets that have multiple owners |
| 863 // http://crbug.com/242125 | 862 // http://crbug.com/242125 |
| 864 if (sheetContents && sheetContents->hasSingleOwnerNode()) | 863 if (sheetContents && sheetContents->hasSingleOwnerNode()) |
| 865 return getFrom(sheetContents->singleOwnerDocument()); | 864 return getFrom(sheetContents->singleOwnerDocument()); |
| 866 return 0; | 865 return 0; |
| 867 } | 866 } |
| 868 | 867 |
| 869 } // namespace blink | 868 } // namespace blink |
| OLD | NEW |