| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 String message = deprecationMessage(unresolvedProperty); | 109 String message = deprecationMessage(unresolvedProperty); |
| 110 if (!message.isEmpty()) { | 110 if (!message.isEmpty()) { |
| 111 host->deprecation().suppress(unresolvedProperty); | 111 host->deprecation().suppress(unresolvedProperty); |
| 112 ConsoleMessage* consoleMessage = ConsoleMessage::create( | 112 ConsoleMessage* consoleMessage = ConsoleMessage::create( |
| 113 DeprecationMessageSource, WarningMessageLevel, message); | 113 DeprecationMessageSource, WarningMessageLevel, message); |
| 114 frame->console().addMessage(consoleMessage); | 114 frame->console().addMessage(consoleMessage); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty) { | 118 String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty) { |
| 119 switch (unresolvedProperty) { | 119 // TODO: Add a switch here when there are properties that we intend to |
| 120 case CSSPropertyAliasMotionOffset: | 120 // deprecate. |
| 121 return willBeRemoved("motion-offset", M58, "6390764217040896"); | 121 // Returning an empty string for now. |
| 122 case CSSPropertyAliasMotionRotation: | 122 return emptyString(); |
| 123 return willBeRemoved("motion-rotation", M58, "6390764217040896"); | |
| 124 case CSSPropertyAliasMotionPath: | |
| 125 case CSSPropertyMotion: | |
| 126 return willBeRemoved("motion-path", M58, "6390764217040896"); | |
| 127 | |
| 128 default: | |
| 129 return emptyString(); | |
| 130 } | |
| 131 } | 123 } |
| 132 | 124 |
| 133 void Deprecation::countDeprecation(const LocalFrame* frame, | 125 void Deprecation::countDeprecation(const LocalFrame* frame, |
| 134 UseCounter::Feature feature) { | 126 UseCounter::Feature feature) { |
| 135 if (!frame) | 127 if (!frame) |
| 136 return; | 128 return; |
| 137 FrameHost* host = frame->host(); | 129 FrameHost* host = frame->host(); |
| 138 if (!host || host->deprecation().m_muteCount) | 130 if (!host || host->deprecation().m_muteCount) |
| 139 return; | 131 return; |
| 140 | 132 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 return willBeRemoved("HTMLObjectElement legacy caller", M58, | 402 return willBeRemoved("HTMLObjectElement legacy caller", M58, |
| 411 "5715026367217664"); | 403 "5715026367217664"); |
| 412 | 404 |
| 413 // Features that aren't deprecated don't have a deprecation message. | 405 // Features that aren't deprecated don't have a deprecation message. |
| 414 default: | 406 default: |
| 415 return String(); | 407 return String(); |
| 416 } | 408 } |
| 417 } | 409 } |
| 418 | 410 |
| 419 } // namespace blink | 411 } // namespace blink |
| OLD | NEW |