create runtime flags for CSS Compositing

https://bugs.webkit.org/show_bug.cgi?id=111818

Patch by Rik Cabanier <cabanier@adobe.com> on 2013-03-13
Reviewed by Ryosuke Niwa.

Source/WebCore:

No new tests, no change in functionality.

Added a runtime flags that enables CSS compositing

* WebCore.exp.in:
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore):
* bindings/generic/RuntimeEnabledFeatures.h:
(RuntimeEnabledFeatures):
(WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled):
(WebCore::RuntimeEnabledFeatures::cssCompositingEnabled):
* css/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::cssCompositingEnabled):
(WebCore):
* css/CSSParser.h:
* css/CSSParserMode.h:
(CSSParserContext):
* dom/Document.cpp:
(WebCore::Document::cssCompositingEnabled):
(WebCore):
* dom/Document.h:
(Document):

Source/WebKit/chromium:

Added a runtime flags to enable CSS compositing for chromium.

* public/WebRuntimeFeatures.h:
(WebRuntimeFeatures):
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableCSSCompositing):
(WebKit):
(WebKit::WebRuntimeFeatures::isCSSCompositingEnabled):

Source/WebKit/mac:

Added a preference to enable CSS compositing.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences cssCompositingEnabled]):
(-[WebPreferences setCSSCompositingEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Added a preference to enable CSS compositing.

* Shared/WebPreferencesStore.h:
(WebKit):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
(WebKit::InjectedBundle::setCSSCompositingEnabled):
(WebKit):
* WebProcess/InjectedBundle/InjectedBundle.h:
(InjectedBundle):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 63b97eb1
2013-03-13 Rik Cabanier <cabanier@adobe.com>
create runtime flags for CSS Compositing
https://bugs.webkit.org/show_bug.cgi?id=111818
Reviewed by Ryosuke Niwa.
No new tests, no change in functionality.
Added a runtime flags that enables CSS compositing
* WebCore.exp.in:
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore):
* bindings/generic/RuntimeEnabledFeatures.h:
(RuntimeEnabledFeatures):
(WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled):
(WebCore::RuntimeEnabledFeatures::cssCompositingEnabled):
* css/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::cssCompositingEnabled):
(WebCore):
* css/CSSParser.h:
* css/CSSParserMode.h:
(CSSParserContext):
* dom/Document.cpp:
(WebCore::Document::cssCompositingEnabled):
(WebCore):
* dom/Document.h:
(Document):
2013-03-11 Kinuko Yasuda <kinuko@chromium.org>
Quota API: Update IDL to make it match the latest WD
......@@ -2832,6 +2832,10 @@ __ZN7WebCore18HTMLContentElement6createEPNS_8DocumentE
__ZN7WebCore22RuntimeEnabledFeatures19isCSSRegionsEnabledE
#endif
#if ENABLE(CSS_COMPOSITING)
__ZN7WebCore22RuntimeEnabledFeatures23isCSSCompositingEnabledE
#endif
#if ENABLE(IFRAME_SEAMLESS)
__ZN7WebCore22RuntimeEnabledFeatures25areSeamlessIFramesEnabledE
#endif
......
......@@ -57,6 +57,7 @@ bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
bool RuntimeEnabledFeatures::isCanvasPathEnabled = false;
bool RuntimeEnabledFeatures::isCSSExclusionsEnabled = false;
bool RuntimeEnabledFeatures::isCSSRegionsEnabled = false;
bool RuntimeEnabledFeatures::isCSSCompositingEnabled = false;
bool RuntimeEnabledFeatures::isLangAttributeAwareFormControlUIEnabled = false;
#if ENABLE(SCRIPTED_SPEECH)
......
......@@ -87,6 +87,14 @@ public:
static bool cssRegionsEnabled() { return false; }
#endif
#if ENABLE(CSS_COMPOSITING)
static void setCSSCompositingEnabled(bool isEnabled) { isCSSCompositingEnabled = isEnabled; }
static bool cssCompositingEnabled() { return isCSSCompositingEnabled; }
#else
static void setCSSCompositingEnabled(bool) { }
static bool cssCompositingEnabled() { return false; }
#endif
#if ENABLE(FONT_LOAD_EVENTS)
static void setFontLoadEventsEnabled(bool isEnabled) { isFontLoadEventsEnabled = isEnabled; }
static bool fontLoadEventsEnabled() { return isFontLoadEventsEnabled; }
......@@ -309,6 +317,7 @@ private:
static bool isCanvasPathEnabled;
static bool isCSSExclusionsEnabled;
static bool isCSSRegionsEnabled;
static bool isCSSCompositingEnabled;
WEBCORE_TESTING static bool isLangAttributeAwareFormControlUIEnabled;
#if ENABLE(SCRIPTED_SPEECH)
static bool isScriptedSpeechEnabled;
......
......@@ -257,6 +257,7 @@ CSSParserContext::CSSParserContext(CSSParserMode mode, const KURL& baseURL)
, isCSSCustomFilterEnabled(false)
, isCSSStickyPositionEnabled(false)
, isCSSRegionsEnabled(false)
, isCSSCompositingEnabled(false)
, isCSSGridLayoutEnabled(false)
#if ENABLE(CSS_VARIABLES)
, isCSSVariablesEnabled(false)
......@@ -274,6 +275,7 @@ CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons
, isCSSCustomFilterEnabled(document->settings() ? document->settings()->isCSSCustomFilterEnabled() : false)
, isCSSStickyPositionEnabled(document->cssStickyPositionEnabled())
, isCSSRegionsEnabled(document->cssRegionsEnabled())
, isCSSCompositingEnabled(document->cssCompositingEnabled())
, isCSSGridLayoutEnabled(document->cssGridLayoutEnabled())
#if ENABLE(CSS_VARIABLES)
, isCSSVariablesEnabled(document->settings() ? document->settings()->cssVariablesEnabled() : false)
......@@ -292,6 +294,7 @@ bool operator==(const CSSParserContext& a, const CSSParserContext& b)
&& a.isCSSCustomFilterEnabled == b.isCSSCustomFilterEnabled
&& a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled
&& a.isCSSRegionsEnabled == b.isCSSRegionsEnabled
&& a.isCSSCompositingEnabled == b.isCSSCompositingEnabled
&& a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled
#if ENABLE(CSS_VARIABLES)
&& a.isCSSVariablesEnabled == b.isCSSVariablesEnabled
......@@ -820,10 +823,11 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
break;
#if ENABLE(CSS_COMPOSITING)
case CSSPropertyWebkitBlendMode:
if (valueID == CSSValueNormal || valueID == CSSValueMultiply || valueID == CSSValueScreen || valueID == CSSValueOverlay
|| valueID == CSSValueDarken || valueID == CSSValueLighten || valueID == CSSValueColorDodge || valueID == CSSValueColorBurn
|| valueID == CSSValueHardLight || valueID == CSSValueSoftLight || valueID == CSSValueDifference || valueID == CSSValueExclusion
|| valueID == CSSValueHue || valueID == CSSValueSaturation || valueID == CSSValueColor || valueID == CSSValueLuminosity)
if (parserContext.isCSSCompositingEnabled && (valueID == CSSValueNormal || valueID == CSSValueMultiply || valueID == CSSValueScreen
|| valueID == CSSValueOverlay || valueID == CSSValueDarken || valueID == CSSValueLighten || valueID == CSSValueColorDodge
|| valueID == CSSValueColorBurn || valueID == CSSValueHardLight || valueID == CSSValueSoftLight || valueID == CSSValueDifference
|| valueID == CSSValueExclusion || valueID == CSSValueHue || valueID == CSSValueSaturation || valueID == CSSValueColor
|| valueID == CSSValueLuminosity))
return true;
break;
#endif
......@@ -2453,6 +2457,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
#endif
#if ENABLE(CSS_COMPOSITING)
case CSSPropertyWebkitBlendMode:
if (cssCompositingEnabled())
validPrimitive = true;
break;
#endif
......@@ -4318,11 +4323,12 @@ bool CSSParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1,
break;
#if ENABLE(CSS_COMPOSITING)
case CSSPropertyWebkitBackgroundBlendMode:
if (val->id == CSSValueNormal || val->id == CSSValueMultiply || val->id == CSSValueScreen || val->id == CSSValueOverlay
|| val->id == CSSValueDarken || val->id == CSSValueLighten || val->id == CSSValueColorDodge
|| val->id == CSSValueColorBurn || val->id == CSSValueHardLight || val->id == CSSValueSoftLight
|| val->id == CSSValueDifference || val->id == CSSValueExclusion || val->id == CSSValueHue
|| val->id == CSSValueSaturation || val->id == CSSValueColor || val->id == CSSValueLuminosity) {
if (cssCompositingEnabled() && (val->id == CSSValueNormal || val->id == CSSValueMultiply
|| val->id == CSSValueScreen || val->id == CSSValueOverlay || val->id == CSSValueDarken
|| val->id == CSSValueLighten || val->id == CSSValueColorDodge || val->id == CSSValueColorBurn
|| val->id == CSSValueHardLight || val->id == CSSValueSoftLight || val->id == CSSValueDifference
|| val->id == CSSValueExclusion || val->id == CSSValueHue || val->id == CSSValueSaturation
|| val->id == CSSValueColor || val->id == CSSValueLuminosity)) {
currValue = cssValuePool().createIdentifierValue(val->id);
m_valueList->next();
}
......@@ -8930,6 +8936,11 @@ bool CSSParser::cssRegionsEnabled() const
return m_context.isCSSRegionsEnabled;
}
bool CSSParser::cssCompositingEnabled() const
{
return m_context.isCSSCompositingEnabled;
}
bool CSSParser::cssGridLayoutEnabled() const
{
return m_context.isCSSGridLayoutEnabled;
......
......@@ -275,6 +275,7 @@ public:
bool parseFontFeatureSettings(bool important);
bool cssRegionsEnabled() const;
bool cssCompositingEnabled() const;
bool parseFlowThread(const String& flowName);
bool parseFlowThread(CSSPropertyID, bool important);
bool parseRegionThread(CSSPropertyID, bool important);
......
......@@ -67,6 +67,7 @@ public:
bool isCSSCustomFilterEnabled;
bool isCSSStickyPositionEnabled;
bool isCSSRegionsEnabled;
bool isCSSCompositingEnabled;
bool isCSSGridLayoutEnabled;
#if ENABLE(CSS_VARIABLES)
bool isCSSVariablesEnabled;
......
......@@ -1126,6 +1126,11 @@ bool Document::cssRegionsEnabled() const
return RuntimeEnabledFeatures::cssRegionsEnabled();
}
bool Document::cssCompositingEnabled() const
{
return RuntimeEnabledFeatures::cssCompositingEnabled();
}
bool Document::cssGridLayoutEnabled() const
{
return settings() && settings()->cssGridLayoutEnabled();
......
......@@ -340,6 +340,7 @@ public:
bool cssStickyPositionEnabled() const;
bool cssRegionsEnabled() const;
bool cssCompositingEnabled() const;
#if ENABLE(CSS_REGIONS)
PassRefPtr<DOMNamedFlowCollection> webkitGetNamedFlows();
#endif
......
2013-03-13 Rik Cabanier <cabanier@adobe.com>
create runtime flags for CSS Compositing
https://bugs.webkit.org/show_bug.cgi?id=111818
Reviewed by Ryosuke Niwa.
Added a runtime flags to enable CSS compositing for chromium.
* public/WebRuntimeFeatures.h:
(WebRuntimeFeatures):
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableCSSCompositing):
(WebKit):
(WebKit::WebRuntimeFeatures::isCSSCompositingEnabled):
2013-03-11 Kinuko Yasuda <kinuko@chromium.org>
Quota API: Update IDL to make it match the latest WD
......
......@@ -163,6 +163,9 @@ public:
WEBKIT_EXPORT static void enableCSSRegions(bool);
WEBKIT_EXPORT static bool isCSSRegionsEnabled();
WEBKIT_EXPORT static void enableCSSCompositing(bool);
WEBKIT_EXPORT static bool isCSSCompositingEnabled();
WEBKIT_EXPORT static void enableFontLoadEvents(bool);
WEBKIT_EXPORT static bool isFontLoadEventsEnabled();
......
......@@ -710,6 +710,16 @@ bool WebRuntimeFeatures::isCSSRegionsEnabled()
return RuntimeEnabledFeatures::cssRegionsEnabled();
}
void WebRuntimeFeatures::enableCSSCompositing(bool enable)
{
RuntimeEnabledFeatures::setCSSCompositingEnabled(enable);
}
bool WebRuntimeFeatures::isCSSCompositingEnabled()
{
return RuntimeEnabledFeatures::cssCompositingEnabled();
}
void WebRuntimeFeatures::enableFontLoadEvents(bool enable)
{
RuntimeEnabledFeatures::setFontLoadEventsEnabled(enable);
......
2013-03-13 Rik Cabanier <cabanier@adobe.com>
create runtime flags for CSS Compositing
https://bugs.webkit.org/show_bug.cgi?id=111818
Reviewed by Ryosuke Niwa.
Added a preference to enable CSS compositing.
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences cssCompositingEnabled]):
(-[WebPreferences setCSSCompositingEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
2013-03-13 Ryosuke Niwa <rniwa@webkit.org>
Threaded HTML Parser is missing feature define flags in all but Chromium port's build files
......
......@@ -97,6 +97,7 @@
#define WebKitAcceleratedCompositingEnabledPreferenceKey @"WebKitAcceleratedCompositingEnabled"
#define WebKitCSSCustomFilterEnabledPreferenceKey @"WebKitCSSCustomFilterEnabled"
#define WebKitCSSRegionsEnabledPreferenceKey @"WebKitCSSRegionsEnabled"
#define WebKitCSSCompositingEnabledPreferenceKey @"WebKitCSSCompositingEnabled"
#define WebKitCSSGridLayoutEnabledPreferenceKey @"WebKitCSSGridLayoutEnabled"
#define WebKitShowDebugBordersPreferenceKey @"WebKitShowDebugBorders"
#define WebKitShowRepaintCounterPreferenceKey @"WebKitShowRepaintCounter"
......
......@@ -378,6 +378,7 @@ public:
// CSS Shaders also need WebGL enabled (which is disabled by default), so we can keep it enabled for now.
[NSNumber numberWithBool:YES], WebKitCSSCustomFilterEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitCSSRegionsEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitCSSCompositingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitCSSGridLayoutEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitAcceleratedDrawingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
......@@ -1394,6 +1395,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:enabled forKey:WebKitCSSRegionsEnabledPreferenceKey];
}
- (BOOL)cssCompositingEnabled
{
return [self _boolValueForKey:WebKitCSSCompositingEnabledPreferenceKey];
}
- (void)setCSSCompositingEnabled:(BOOL)enabled
{
[self _setBoolValue:enabled forKey:WebKitCSSCompositingEnabledPreferenceKey];
}
- (BOOL)cssGridLayoutEnabled
{
return [self _boolValueForKey:WebKitCSSGridLayoutEnabledPreferenceKey];
......
......@@ -193,6 +193,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
- (BOOL)cssRegionsEnabled;
- (void)setCSSRegionsEnabled:(BOOL)enabled;
- (BOOL)cssCompositingEnabled;
- (void)setCSSCompositingEnabled:(BOOL)enabled;
- (BOOL)cssGridLayoutEnabled;
- (void)setCSSGridLayoutEnabled:(BOOL)enabled;
......
......@@ -1533,6 +1533,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
settings->setCSSCustomFilterEnabled([preferences cssCustomFilterEnabled]);
#endif
RuntimeEnabledFeatures::setCSSRegionsEnabled([preferences cssRegionsEnabled]);
RuntimeEnabledFeatures::setCSSCompositingEnabled([preferences cssCompositingEnabled]);
#if ENABLE(IFRAME_SEAMLESS)
RuntimeEnabledFeatures::setSeamlessIFramesEnabled([preferences seamlessIFramesEnabled]);
#endif
......
2013-03-13 Rik Cabanier <cabanier@adobe.com>
create runtime flags for CSS Compositing
https://bugs.webkit.org/show_bug.cgi?id=111818
Reviewed by Ryosuke Niwa.
Added a preference to enable CSS compositing.
* Shared/WebPreferencesStore.h:
(WebKit):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
(WebKit::InjectedBundle::setCSSCompositingEnabled):
(WebKit):
* WebProcess/InjectedBundle/InjectedBundle.h:
(InjectedBundle):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2013-03-13 Ryosuke Niwa <rniwa@webkit.org>
Threaded HTML Parser is missing feature define flags in all but Chromium port's build files
......@@ -84,6 +84,7 @@ namespace WebKit {
macro(WebGLEnabled, webGLEnabled, Bool, bool, false) \
macro(Accelerated2dCanvasEnabled, accelerated2dCanvasEnabled, Bool, bool, false) \
macro(CSSRegionsEnabled, cssRegionsEnabled, Bool, bool, true) \
macro(CSSCompositingEnabled, cssCompositingEnabled, Bool, bool, true) \
macro(CSSGridLayoutEnabled, cssGridLayoutEnabled, Bool, bool, false) \
macro(RegionBasedColumnsEnabled, regionBasedColumnsEnabled, Bool, bool, false) \
macro(ForceFTPDirectoryListings, forceFTPDirectoryListings, Bool, bool, false) \
......
......@@ -73,7 +73,7 @@
#include <wtf/OwnArrayPtr.h>
#include <wtf/PassOwnArrayPtr.h>
#if ENABLE(SHADOW_DOM) || ENABLE(CSS_REGIONS) || ENABLE(IFRAME_SEAMLESS)
#if ENABLE(SHADOW_DOM) || ENABLE(CSS_REGIONS) || ENABLE(IFRAME_SEAMLESS) || ENABLE(CSS_COMPOSITING)
#include <WebCore/RuntimeEnabledFeatures.h>
#endif
......@@ -197,6 +197,11 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
RuntimeEnabledFeatures::setCSSRegionsEnabled(enabled);
#endif
#if ENABLE(CSS_COMPOSITING)
if (preference == "WebKitCSSCompositingEnabled")
RuntimeEnabledFeatures::setCSSCompositingEnabled(enabled);
#endif
// Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
#define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
......@@ -663,6 +668,15 @@ void InjectedBundle::setCSSRegionsEnabled(bool enabled)
#endif
}
void InjectedBundle::setCSSCompositingEnabled(bool enabled)
{
#if ENABLE(CSS_COMPOSITING)
RuntimeEnabledFeatures::setCSSCompositingEnabled(enabled);
#else
UNUSED_PARAM(enabled);
#endif
}
void InjectedBundle::setSeamlessIFramesEnabled(bool enabled)
{
#if ENABLE(IFRAME_SEAMLESS)
......
......@@ -172,6 +172,7 @@ public:
void setSerialLoadingEnabled(bool);
void setShadowDOMEnabled(bool);
void setCSSRegionsEnabled(bool);
void setCSSCompositingEnabled(bool);
void setSeamlessIFramesEnabled(bool);
void dispatchPendingLoadRequests();
......
......@@ -2341,6 +2341,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
settings->setAggressiveTileRetentionEnabled(store.getBoolValueForKey(WebPreferencesKey::aggressiveTileRetentionEnabledKey()));
settings->setCSSCustomFilterEnabled(store.getBoolValueForKey(WebPreferencesKey::cssCustomFilterEnabledKey()));
RuntimeEnabledFeatures::setCSSRegionsEnabled(store.getBoolValueForKey(WebPreferencesKey::cssRegionsEnabledKey()));
RuntimeEnabledFeatures::setCSSCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::cssCompositingEnabledKey()));
settings->setCSSGridLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::cssGridLayoutEnabledKey()));
settings->setRegionBasedColumnsEnabled(store.getBoolValueForKey(WebPreferencesKey::regionBasedColumnsEnabledKey()));
settings->setWebGLEnabled(store.getBoolValueForKey(WebPreferencesKey::webGLEnabledKey()));
......
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