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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 UseCounter::countDeprecation(document.frame(), feature); | 654 UseCounter::countDeprecation(document.frame(), feature); |
655 } | 655 } |
656 | 656 |
657 void UseCounter::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execut
ionContext* context, Feature feature) | 657 void UseCounter::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execut
ionContext* context, Feature feature) |
658 { | 658 { |
659 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) | 659 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) |
660 return; | 660 return; |
661 UseCounter::countDeprecation(context, feature); | 661 UseCounter::countDeprecation(context, feature); |
662 } | 662 } |
663 | 663 |
664 // FIXME: Update other UseCounter::deprecationMessage() cases to use this. | |
665 static String replacedBy(const char* oldString, const char* newString) | 664 static String replacedBy(const char* oldString, const char* newString) |
666 { | 665 { |
667 return String::format("'%s' is deprecated. Please use '%s' instead.", oldStr
ing, newString); | 666 return String::format("'%s' is deprecated. Please use '%s' instead.", oldStr
ing, newString); |
668 } | 667 } |
669 | 668 |
670 String UseCounter::deprecationMessage(Feature feature) | 669 String UseCounter::deprecationMessage(Feature feature) |
671 { | 670 { |
672 switch (feature) { | 671 switch (feature) { |
673 // Quota | 672 // Quota |
674 case PrefixedStorageInfo: | 673 case PrefixedStorageInfo: |
675 return "'window.webkitStorageInfo' is deprecated. Please use 'navigator.
webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead."; | 674 return "'window.webkitStorageInfo' is deprecated. Please use 'navigator.
webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead."; |
676 | 675 |
677 // Keyboard Event (DOM Level 3) | 676 // Keyboard Event (DOM Level 3) |
678 case KeyboardEventKeyLocation: | 677 case KeyboardEventKeyLocation: |
679 return replacedBy("KeyboardEvent.keyLocation", "KeyboardEvent.location")
; | 678 return replacedBy("KeyboardEvent.keyLocation", "KeyboardEvent.location")
; |
680 | 679 |
681 case ConsoleMarkTimeline: | 680 case ConsoleMarkTimeline: |
682 return "console.markTimeline is deprecated. Please use the console.timeS
tamp instead."; | 681 return replacedBy("console.markTimeline", "console.timeStamp"); |
683 | 682 |
684 case FileError: | 683 case FileError: |
685 return "FileError is deprecated. Please use the 'name' or 'message' attr
ibutes of DOMError rather than 'code'."; | 684 return "FileError is deprecated. Please use the 'name' or 'message' attr
ibutes of DOMError rather than 'code'."; |
686 | 685 |
687 case ShowModalDialog: | 686 case ShowModalDialog: |
688 return "showModalDialog is deprecated. Please use window.open and postMe
ssage instead."; | 687 return "showModalDialog is deprecated. Please use window.open and postMe
ssage instead."; |
689 | 688 |
690 case CSSStyleSheetInsertRuleOptionalArg: | 689 case CSSStyleSheetInsertRuleOptionalArg: |
691 return "Calling CSSStyleSheet.insertRule() with one argument is deprecat
ed. Please pass the index argument as well: insertRule(x, 0)."; | 690 return "Calling CSSStyleSheet.insertRule() with one argument is deprecat
ed. Please pass the index argument as well: insertRule(x, 0)."; |
692 | 691 |
693 case PrefixedVideoSupportsFullscreen: | 692 case PrefixedVideoSupportsFullscreen: |
694 return "'HTMLVideoElement.webkitSupportsFullscreen' is deprecated. Its v
alue is true if the video is loaded."; | 693 return "'HTMLVideoElement.webkitSupportsFullscreen' is deprecated. Its v
alue is true if the video is loaded."; |
695 | 694 |
696 case PrefixedVideoDisplayingFullscreen: | 695 case PrefixedVideoDisplayingFullscreen: |
697 return "'HTMLVideoElement.webkitDisplayingFullscreen' is deprecated. Ple
ase use the 'fullscreenchange' and 'webkitfullscreenchange' events instead."; | 696 return "'HTMLVideoElement.webkitDisplayingFullscreen' is deprecated. Ple
ase use the 'fullscreenchange' event instead."; |
698 | 697 |
699 case PrefixedVideoEnterFullscreen: | 698 case PrefixedVideoEnterFullscreen: |
700 return "'HTMLVideoElement.webkitEnterFullscreen()' is deprecated. Please
use 'Element.requestFullscreen()' and 'Element.webkitRequestFullscreen()' inste
ad."; | 699 return replacedBy("HTMLVideoElement.webkitEnterFullscreen()", "Element.r
equestFullscreen()"); |
701 | 700 |
702 case PrefixedVideoExitFullscreen: | 701 case PrefixedVideoExitFullscreen: |
703 return "'HTMLVideoElement.webkitExitFullscreen()' is deprecated. Please
use 'Document.exitFullscreen()' and 'Document.webkitExitFullscreen()' instead."; | 702 return replacedBy("HTMLVideoElement.webkitExitFullscreen()", "Document.e
xitFullscreen()"); |
704 | 703 |
705 case PrefixedVideoEnterFullScreen: | 704 case PrefixedVideoEnterFullScreen: |
706 return "'HTMLVideoElement.webkitEnterFullScreen()' is deprecated. Please
use 'Element.requestFullscreen()' and 'Element.webkitRequestFullscreen()' inste
ad."; | 705 return replacedBy("HTMLVideoElement.webkitEnterFullScreen()", "Element.r
equestFullscreen()"); |
707 | 706 |
708 case PrefixedVideoExitFullScreen: | 707 case PrefixedVideoExitFullScreen: |
709 return "'HTMLVideoElement.webkitExitFullScreen()' is deprecated. Please
use 'Document.exitFullscreen()' and 'Document.webkitExitFullscreen()' instead."; | 708 return replacedBy("HTMLVideoElement.webkitExitFullScreen()", "Document.e
xitFullscreen()"); |
710 | 709 |
711 case PrefixedIndexedDB: | 710 case PrefixedIndexedDB: |
712 return replacedBy("webkitIndexedDB", "indexedDB"); | 711 return replacedBy("webkitIndexedDB", "indexedDB"); |
713 | 712 |
714 case PrefixedIDBCursorConstructor: | 713 case PrefixedIDBCursorConstructor: |
715 return replacedBy("webkitIDBCursor", "IDBCursor"); | 714 return replacedBy("webkitIDBCursor", "IDBCursor"); |
716 | 715 |
717 case PrefixedIDBDatabaseConstructor: | 716 case PrefixedIDBDatabaseConstructor: |
718 return replacedBy("webkitIDBDatabase", "IDBDatabase"); | 717 return replacedBy("webkitIDBDatabase", "IDBDatabase"); |
719 | 718 |
(...skipping 30 matching lines...) Expand all Loading... |
750 case RangeDetach: | 749 case RangeDetach: |
751 return "'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatw
g.org/#dom-range-detach)."; | 750 return "'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatw
g.org/#dom-range-detach)."; |
752 | 751 |
753 case OverflowChangedEvent: | 752 case OverflowChangedEvent: |
754 return "The 'overflowchanged' event is deprecated and may be removed. Pl
ease do not use it."; | 753 return "The 'overflowchanged' event is deprecated and may be removed. Pl
ease do not use it."; |
755 | 754 |
756 case SyncXHRWithCredentials: | 755 case SyncXHRWithCredentials: |
757 return "Setting 'XMLHttpRequest.withCredentials' for synchronous request
s is deprecated."; | 756 return "Setting 'XMLHttpRequest.withCredentials' for synchronous request
s is deprecated."; |
758 | 757 |
759 case EventSourceURL: | 758 case EventSourceURL: |
760 return "'EventSource.URL' is deprecated. Please use 'EventSource.url' in
stead."; | 759 return replacedBy("EventSource.URL", "EventSource.url"); |
761 | 760 |
762 case WebSocketURL: | 761 case WebSocketURL: |
763 return "'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instea
d."; | 762 return replacedBy("WebSocket.URL", "WebSocket.url"); |
764 | 763 |
765 case HTMLTableElementVspace: | 764 case HTMLTableElementVspace: |
766 return "The 'vspace' attribute on table is deprecated. Please use CSS in
stead."; | 765 return "The 'vspace' attribute on table is deprecated. Please use CSS ma
rgin-top and margin-bottom property instead."; |
767 | 766 |
768 case HTMLTableElementHspace: | 767 case HTMLTableElementHspace: |
769 return "The 'hspace' attribute on table is deprecated. Please use CSS in
stead."; | 768 return "The 'hspace' attribute on table is deprecated. Please use CSS ma
rgin-left and margin-right property instead."; |
770 | 769 |
771 case PictureSourceSrc: | 770 case PictureSourceSrc: |
772 return "<source src> with a <picture> parent is invalid and therefore ig
nored. Please use <source srcset> instead."; | 771 return "<source src> with a <picture> parent is invalid and therefore ig
nored. Please use <source srcset> instead."; |
773 | 772 |
774 case XHRProgressEventPosition: | 773 case XHRProgressEventPosition: |
775 return "The XMLHttpRequest progress event property 'position' is depreca
ted. Please use 'loaded' instead."; | 774 return "The XMLHttpRequest progress event property 'position' is depreca
ted. Please use 'loaded' instead."; |
776 | 775 |
777 case XHRProgressEventTotalSize: | 776 case XHRProgressEventTotalSize: |
778 return "The XMLHttpRequest progress event property 'totalSize' is deprec
ated. Please use 'total' instead."; | 777 return "The XMLHttpRequest progress event property 'totalSize' is deprec
ated. Please use 'total' instead."; |
779 | 778 |
780 case ConsoleTimeline: | 779 case ConsoleTimeline: |
781 return "console.timeline is deprecated. Please use the console.time inst
ead."; | 780 return replacedBy("console.timeline", "console.time"); |
782 | 781 |
783 case ConsoleTimelineEnd: | 782 case ConsoleTimelineEnd: |
784 return "console.timelineEnd is deprecated. Please use the console.timeEn
d instead."; | 783 return replacedBy("console.timelineEnd", "console.timeEnd"); |
785 | 784 |
786 case XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: | 785 case XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: |
787 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/."; | 786 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/."; |
788 | 787 |
789 case DOMImplementationHasFeatureReturnFalse: | 788 case DOMImplementationHasFeatureReturnFalse: |
790 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)."; | 789 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)."; |
791 | 790 |
792 case GetMatchedCSSRules: | 791 case GetMatchedCSSRules: |
793 return "'getMatchedCSSRules()' is deprecated. For more help, check https
://code.google.com/p/chromium/issues/detail?id=437569#c2"; | 792 return "'getMatchedCSSRules()' is deprecated. For more help, check https
://code.google.com/p/chromium/issues/detail?id=437569#c2"; |
794 | 793 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) | 871 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
873 { | 872 { |
874 // FIXME: We may want to handle stylesheets that have multiple owners | 873 // FIXME: We may want to handle stylesheets that have multiple owners |
875 // http://crbug.com/242125 | 874 // http://crbug.com/242125 |
876 if (sheetContents && sheetContents->hasSingleOwnerNode()) | 875 if (sheetContents && sheetContents->hasSingleOwnerNode()) |
877 return getFrom(sheetContents->singleOwnerDocument()); | 876 return getFrom(sheetContents->singleOwnerDocument()); |
878 return 0; | 877 return 0; |
879 } | 878 } |
880 | 879 |
881 } // namespace blink | 880 } // namespace blink |
OLD | NEW |