| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/Deprecation.h" | 5 #include "core/frame/Deprecation.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/ExecutionContext.h" | 8 #include "core/dom/ExecutionContext.h" |
| 9 #include "core/frame/FrameConsole.h" | 9 #include "core/frame/FrameConsole.h" |
| 10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 String message = deprecationMessage(unresolvedProperty); | 106 String message = deprecationMessage(unresolvedProperty); |
| 107 if (!message.isEmpty()) { | 107 if (!message.isEmpty()) { |
| 108 host->deprecation().suppress(unresolvedProperty); | 108 host->deprecation().suppress(unresolvedProperty); |
| 109 ConsoleMessage* consoleMessage = ConsoleMessage::create( | 109 ConsoleMessage* consoleMessage = ConsoleMessage::create( |
| 110 DeprecationMessageSource, WarningMessageLevel, message); | 110 DeprecationMessageSource, WarningMessageLevel, message); |
| 111 frame->console().addMessage(consoleMessage); | 111 frame->console().addMessage(consoleMessage); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty) { | 115 String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty) { |
| 116 switch (unresolvedProperty) { | 116 // TODO: Add a switch here when there are properties that we intend to |
| 117 case CSSPropertyAliasMotionOffset: | 117 // deprecate. |
| 118 return willBeRemoved("motion-offset", M58, "6390764217040896"); | 118 // Returning an empty string for now. |
| 119 case CSSPropertyAliasMotionRotation: | 119 return emptyString(); |
| 120 return willBeRemoved("motion-rotation", M58, "6390764217040896"); | |
| 121 case CSSPropertyAliasMotionPath: | |
| 122 case CSSPropertyMotion: | |
| 123 return willBeRemoved("motion-path", M58, "6390764217040896"); | |
| 124 | |
| 125 default: | |
| 126 return emptyString(); | |
| 127 } | |
| 128 } | 120 } |
| 129 | 121 |
| 130 void Deprecation::countDeprecation(const LocalFrame* frame, | 122 void Deprecation::countDeprecation(const LocalFrame* frame, |
| 131 UseCounter::Feature feature) { | 123 UseCounter::Feature feature) { |
| 132 if (!frame) | 124 if (!frame) |
| 133 return; | 125 return; |
| 134 FrameHost* host = frame->host(); | 126 FrameHost* host = frame->host(); |
| 135 if (!host || host->deprecation().m_muteCount) | 127 if (!host || host->deprecation().m_muteCount) |
| 136 return; | 128 return; |
| 137 | 129 |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 case UseCounter::PaymentAddressCareOf: | 472 case UseCounter::PaymentAddressCareOf: |
| 481 return willBeRemoved("PaymentAddress.careOf", M56, "5728579069411328"); | 473 return willBeRemoved("PaymentAddress.careOf", M56, "5728579069411328"); |
| 482 | 474 |
| 483 // Features that aren't deprecated don't have a deprecation message. | 475 // Features that aren't deprecated don't have a deprecation message. |
| 484 default: | 476 default: |
| 485 return String(); | 477 return String(); |
| 486 } | 478 } |
| 487 } | 479 } |
| 488 | 480 |
| 489 } // namespace blink | 481 } // namespace blink |
| OLD | NEW |