Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: third_party/WebKit/Source/core/frame/Deprecation.cpp

Issue 1648593002: Revert of Add deprecation message for -webkit-background-composite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "core/frame/Deprecation.h"
6
7 #include "core/frame/FrameConsole.h"
8 #include "core/frame/FrameHost.h"
9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/UseCounter.h"
11 #include "core/inspector/ConsoleMessage.h"
12
13 namespace blink {
14
15 Deprecation::Deprecation()
16 {
17 m_cssPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1);
18 m_cssPropertyDeprecationBits.clearAll();
19 }
20
21 Deprecation::~Deprecation()
22 {
23 m_cssPropertyDeprecationBits.clearAll();
24 }
25
26 void Deprecation::suppress(CSSPropertyID unresolvedProperty)
27 {
28 ASSERT(unresolvedProperty >= firstCSSProperty);
29 ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
30 m_cssPropertyDeprecationBits.quickSet(unresolvedProperty);
31 }
32 bool Deprecation::isSuppressed(CSSPropertyID unresolvedProperty)
33 {
34 ASSERT(unresolvedProperty >= firstCSSProperty);
35 ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
36 return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty);
37 }
38
39 void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, CSSPropert yID unresolvedProperty)
40 {
41 FrameHost* host = frame ? frame->host() : nullptr;
42 if (!host || host->deprecation().isSuppressed(unresolvedProperty)) {
43 return;
44 }
45
46 String message = deprecationMessage(unresolvedProperty);
47 if (!message.isEmpty()) {
48 host->deprecation().suppress(unresolvedProperty);
49 frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSou rce, WarningMessageLevel, message));
50 }
51 }
52
53 String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty)
54 {
55 switch (unresolvedProperty) {
56 case CSSPropertyWebkitBackgroundComposite:
57 return UseCounter::willBeRemoved("'-webkit-background-composite'", 51, " 6607299456008192");
58 default:
59 return emptyString();
60 }
61 }
62
63 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Deprecation.h ('k') | third_party/WebKit/Source/core/frame/FrameHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698