Commit 674958fa authored by noel's avatar noel Committed by Commit bot

Revert of Add deprecation message for -webkit-background-composite (patchset...

Revert of Add deprecation message for -webkit-background-composite (patchset #11 id:200001 of https://codereview.chromium.org/1585383003/ )

Reason for revert:
Broke fast/backgrounds/webkit-background-composite-deprecated.html most bots.  Example:

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.6/builds/48981

Original issue's description:
> Add deprecation message for -webkit-background-composite
>
> This patch is two fold:
> 1. Adds the capability of adding deprecation messages for CSSPropertyIDs
> as they are parsed.
> 2. Adds the relevant deprecation message for
> -webkit-background-composite. The reasons for which are highlighted here
> https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/thxrbc8XOmc
>
> BUG=498588
>
> Committed: https://crrev.com/6d2d7c3b60d3e5cd9b2efd7120cae737ad1e4329
> Cr-Commit-Position: refs/heads/master@{#372040}

TBR=alancutter@chromium.org,timloh@chromium.org,nainar@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=498588

Review URL: https://codereview.chromium.org/1648593002

Cr-Commit-Position: refs/heads/master@{#372050}
parent e82a8f01
CONSOLE WARNING: '-webkit-background-composite' is deprecated and will be removed in M51, around June 2016. See https://www.chromestatus.com/features/6607299456008192 for more details.
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
......
CONSOLE WARNING: '-webkit-background-composite' is deprecated and will be removed in M51, around June 2016. See https://www.chromestatus.com/features/6607299456008192 for more details.
Tests that highlight is treated the same as an invalid value for a composite operation:
PASS
CONSOLE WARNING: '-webkit-background-composite' is deprecated and will be removed in M51, around June 2016. See https://www.chromestatus.com/features/6607299456008192 for more details.
<!DOCTYPE html>
<style>
div {
-webkit-background-composite: border;
color: red;
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
\ No newline at end of file
......@@ -1617,8 +1617,6 @@
'frame/DOMWindowTimers.h',
'frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp',
'frame/DeprecatedScheduleStyleRecalcDuringLayout.h',
'frame/Deprecation.cpp',
'frame/Deprecation.h',
'frame/DeviceSingleWindowEventController.cpp',
'frame/DeviceSingleWindowEventController.h',
'frame/EventHandlerRegistry.cpp',
......
......@@ -24,7 +24,6 @@
#include "core/css/parser/MediaQueryParser.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
#include "core/frame/Deprecation.h"
#include "core/frame/UseCounter.h"
#include "platform/TraceEvent.h"
#include "wtf/BitArray.h"
......@@ -720,11 +719,8 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Typ
if (important && (ruleType == StyleRule::FontFace || ruleType == StyleRule::Keyframe))
return;
if (unresolvedProperty != CSSPropertyInvalid) {
if (m_styleSheet && m_styleSheet->singleOwnerDocument())
Deprecation::warnOnDeprecatedProperties(m_styleSheet->singleOwnerDocument()->frame(), unresolvedProperty);
if (unresolvedProperty != CSSPropertyInvalid)
consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEnd), unresolvedProperty, important, ruleType);
}
if (m_observerWrapper && (ruleType == StyleRule::Style || ruleType == StyleRule::Keyframe)) {
m_observerWrapper->observer().observeProperty(
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/frame/Deprecation.h"
#include "core/frame/FrameConsole.h"
#include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/UseCounter.h"
#include "core/inspector/ConsoleMessage.h"
namespace blink {
Deprecation::Deprecation()
{
m_cssPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1);
m_cssPropertyDeprecationBits.clearAll();
}
Deprecation::~Deprecation()
{
m_cssPropertyDeprecationBits.clearAll();
}
void Deprecation::suppress(CSSPropertyID unresolvedProperty)
{
ASSERT(unresolvedProperty >= firstCSSProperty);
ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
m_cssPropertyDeprecationBits.quickSet(unresolvedProperty);
}
bool Deprecation::isSuppressed(CSSPropertyID unresolvedProperty)
{
ASSERT(unresolvedProperty >= firstCSSProperty);
ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty);
}
void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, CSSPropertyID unresolvedProperty)
{
FrameHost* host = frame ? frame->host() : nullptr;
if (!host || host->deprecation().isSuppressed(unresolvedProperty)) {
return;
}
String message = deprecationMessage(unresolvedProperty);
if (!message.isEmpty()) {
host->deprecation().suppress(unresolvedProperty);
frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, message));
}
}
String Deprecation::deprecationMessage(CSSPropertyID unresolvedProperty)
{
switch (unresolvedProperty) {
case CSSPropertyWebkitBackgroundComposite:
return UseCounter::willBeRemoved("'-webkit-background-composite'", 51, "6607299456008192");
default:
return emptyString();
}
}
} // namespace blink
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef Deprecation_h
#define Deprecation_h
#include "core/CSSPropertyNames.h"
#include "wtf/BitVector.h"
#include "wtf/Noncopyable.h"
namespace blink {
class LocalFrame;
class Deprecation {
DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(Deprecation);
public:
Deprecation();
~Deprecation();
static void warnOnDeprecatedProperties(const LocalFrame*, CSSPropertyID unresolvedProperty);
protected:
void suppress(CSSPropertyID unresolvedProperty);
bool isSuppressed(CSSPropertyID unresolvedProperty);
// CSSPropertyIDs that aren't deprecated return an empty string.
static String deprecationMessage(CSSPropertyID unresolvedProperty);
BitVector m_cssPropertyDeprecationBits;
};
} // namespace blink
#endif // Deprecation_h
......@@ -76,11 +76,6 @@ UseCounter& FrameHost::useCounter() const
return m_page->useCounter();
}
Deprecation& FrameHost::deprecation() const
{
return m_page->deprecation();
}
float FrameHost::deviceScaleFactor() const
{
return m_page->deviceScaleFactor();
......
......@@ -45,7 +45,6 @@ namespace blink {
class ChromeClient;
class ConsoleMessageStorage;
class Deprecation;
class EventHandlerRegistry;
class Page;
class PageScaleConstraintsSet;
......@@ -73,7 +72,6 @@ public:
Settings& settings() const;
ChromeClient& chromeClient() const;
UseCounter& useCounter() const;
Deprecation& deprecation() const;
// Corresponds to pixel density of the device where this Page is
// being displayed. In multi-monitor setups this can vary between pages.
......
......@@ -742,14 +742,11 @@ void UseCounter::countCrossOriginIframe(const Document& document, Feature featur
count(frame, feature);
}
// TODO (nainar): Migrate all console message functions to Deprecation
static const char* milestoneString(int milestone)
{
switch (milestone) {
case 50:
return "M50, around April 2016";
case 51:
return "M51, around June 2016";
case 53:
return "M53, around September 2016";
}
......@@ -763,7 +760,7 @@ static String replacedBy(const char* feature, const char* replacement)
return String::format("%s is deprecated. Please use %s instead.", feature, replacement);
}
String UseCounter::willBeRemoved(const char* feature, int milestone, const char* details)
static String willBeRemoved(const char* feature, int milestone, const char* details)
{
return String::format("%s is deprecated and will be removed in %s. See https://www.chromestatus.com/features/%s for more details.", feature, milestoneString(milestone), details);
}
......
......@@ -1049,9 +1049,6 @@ public:
// have script access into the top level document.
static void countCrossOriginIframe(const Document&, Feature);
// TODO (nainar): Migrate all console message functions to Deprecation
static String willBeRemoved(const char* feature, int milestone, const char* details);
// Return whether the Feature was previously counted for this document.
// NOTE: only for use in testing.
static bool isCounted(Document&, Feature);
......
......@@ -23,7 +23,6 @@
#include "core/CoreExport.h"
#include "core/dom/ViewportDescription.h"
#include "core/frame/Deprecation.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/OriginsUsingFeatures.h"
#include "core/frame/SettingsDelegate.h"
......@@ -164,7 +163,6 @@ public:
Settings& settings() const { return *m_settings; }
UseCounter& useCounter() { return m_useCounter; }
Deprecation& deprecation() { return m_deprecation; }
OriginsUsingFeatures& originsUsingFeatures() { return m_originsUsingFeatures; }
void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
......@@ -270,7 +268,6 @@ private:
OwnPtrWillBeMember<ValidationMessageClient> m_validationMessageClient;
UseCounter m_useCounter;
Deprecation m_deprecation;
OriginsUsingFeatures m_originsUsingFeatures;
bool m_openedByDOM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment