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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 String message = deprecationMessage(unresolvedProperty); | 50 String message = deprecationMessage(unresolvedProperty); |
51 if (!message.isEmpty()) { | 51 if (!message.isEmpty()) { |
52 host->deprecation().suppress(unresolvedProperty); | 52 host->deprecation().suppress(unresolvedProperty); |
53 frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSou
rce, WarningMessageLevel, message)); | 53 frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSou
rce, WarningMessageLevel, message)); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty) | 57 String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty) |
58 { | 58 { |
59 switch (unresolvedProperty) { | 59 // TODO: Add a switch here when there are properties that we intend to depre
cate. |
60 case CSSPropertyWebkitBackgroundComposite: | 60 // Returning an empty string for now. |
61 return willBeRemoved("'-webkit-background-composite'", 51, "660729945600
8192"); | 61 return emptyString(); |
62 default: | |
63 return emptyString(); | |
64 } | |
65 } | 62 } |
66 | 63 |
67 void Deprecation::countDeprecation(const LocalFrame* frame, UseCounter::Feature
feature) | 64 void Deprecation::countDeprecation(const LocalFrame* frame, UseCounter::Feature
feature) |
68 { | 65 { |
69 if (!frame) | 66 if (!frame) |
70 return; | 67 return; |
71 FrameHost* host = frame->host(); | 68 FrameHost* host = frame->host(); |
72 if (!host) | 69 if (!host) |
73 return; | 70 return; |
74 | 71 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 case UseCounter::HTMLKeygenElement: | 337 case UseCounter::HTMLKeygenElement: |
341 return willBeRemoved("The <keygen> element", 54, "5716060992962560"); | 338 return willBeRemoved("The <keygen> element", 54, "5716060992962560"); |
342 | 339 |
343 // Features that aren't deprecated don't have a deprecation message. | 340 // Features that aren't deprecated don't have a deprecation message. |
344 default: | 341 default: |
345 return String(); | 342 return String(); |
346 } | 343 } |
347 } | 344 } |
348 | 345 |
349 } // namespace blink | 346 } // namespace blink |
OLD | NEW |