https://bugs.webkit.org/show_bug.cgi?id=83832
Reviewed by Alexey Proskuryakov.
Source/WebCore:
Shipping versions of iAd Producer rely on the pre-r102262 behavior of
respecting '!important' when specified in a CSSStyleDeclaration
property setter. Restore this quirky behavior for versions of the app
that expect it.
* WebCore.exp.in: Export
Settings::setShouldRespectPriorityInCSSAttributeSetters().
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate): If
setShouldRespectPriorityInCSSAttributeSetters() is true, restore the
pre-r102262 behavior wherein we attempt to parse '!important' out of
the property value.
* page/Settings.cpp:
(WebCore::Settings::setShouldRespectPriorityInCSSAttributeSetters):
(WebCore::Settings::shouldRespectPriorityInCSSAttributeSetters):
* page/Settings.h:
Source/WebKit/mac:
* Misc/WebKitVersionChecks.h: Indicate that 535.13.0 was the first
version of WebKit.framework to ignore '!important' in
CSSStyleDeclaration property setters.
* WebView/WebView.mm:
(shouldRespectPriorityInCSSAttributeSetters):
(-[WebView _commonInitializationWithFrameName:groupName:]): Enable a
quirk to restore pre-r102262 behavior if the application is iAd Producer
and was linked against a version of WebKit.framework that had the old behavior.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114048
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-12 Andy Estes <aestes@apple.com>
+
+ REGRESSION (r102262): iAd Producer relies on CSSStyleDeclaration property setters respecting '!important'
+ https://bugs.webkit.org/show_bug.cgi?id=83832
+
+ Reviewed by Alexey Proskuryakov.
+
+ Shipping versions of iAd Producer rely on the pre-r102262 behavior of
+ respecting '!important' when specified in a CSSStyleDeclaration
+ property setter. Restore this quirky behavior for versions of the app
+ that expect it.
+
+ * WebCore.exp.in: Export
+ Settings::setShouldRespectPriorityInCSSAttributeSetters().
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ (WebCore::JSCSSStyleDeclaration::putDelegate): If
+ setShouldRespectPriorityInCSSAttributeSetters() is true, restore the
+ pre-r102262 behavior wherein we attempt to parse '!important' out of
+ the property value.
+ * page/Settings.cpp:
+ (WebCore::Settings::setShouldRespectPriorityInCSSAttributeSetters):
+ (WebCore::Settings::shouldRespectPriorityInCSSAttributeSetters):
+ * page/Settings.h:
+
2012-04-12 Alexandru Chiculita <achicu@adobe.com>
REGRESSION(112745) [CSS Filters] Memory use explosion for offscreen filtered elements
__ZN7WebCore8Settings40setTextDirectionSubmenuInclusionBehaviorENS_37TextDirectionSubmenuInclusionBehaviorE
__ZN7WebCore8Settings41setNeedsKeyboardEventDisambiguationQuirksEb
__ZN7WebCore8Settings44setLoadsSiteIconsIgnoringImageLoadingSettingEb
+__ZN7WebCore8Settings45setShouldRespectPriorityInCSSAttributeSettersEb
__ZN7WebCore8blankURLEv
__ZN7WebCore8makeRGBAEiiii
__ZN7WebCore8openFileERKN3WTF6StringENS_12FileOpenModeE
#include "JSCSSValue.h"
#include "JSNode.h"
#include "PlatformString.h"
+#include "Settings.h"
#include "StylePropertySet.h"
#include <runtime/StringPrototype.h>
#include <wtf/ASCIICType.h>
String propValue = valueToStringWithNullCheck(exec, value);
if (propertyInfo.hadPixelOrPosPrefix)
propValue += "px";
+
+ bool important = false;
+ if (Settings::shouldRespectPriorityInCSSAttributeSetters()) {
+ size_t importantIndex = propValue.find("!important", 0, false);
+ if (importantIndex != notFound) {
+ important = true;
+ propValue = propValue.left(importantIndex - 1);
+ }
+ }
+
ExceptionCode ec = 0;
- impl()->setPropertyInternal(static_cast<CSSPropertyID>(propertyInfo.propertyID), propValue, false, ec);
+ impl()->setPropertyInternal(static_cast<CSSPropertyID>(propertyInfo.propertyID), propValue, important, ec);
setDOMException(exec, ec);
return true;
}
#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
bool Settings::gShouldUseHighResolutionTimers = true;
#endif
+
+#if USE(JSC)
+bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false;
+#endif
// NOTEs
// 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well QtWebKit and Chromium when built on Mac;
return gMockScrollbarsEnabled;
}
+#if USE(JSC)
+void Settings::setShouldRespectPriorityInCSSAttributeSetters(bool flag)
+{
+ gShouldRespectPriorityInCSSAttributeSetters = flag;
+}
+
+bool Settings::shouldRespectPriorityInCSSAttributeSetters()
+{
+ return gShouldRespectPriorityInCSSAttributeSetters;
+}
+#endif
+
} // namespace WebCore
void setShouldRespectImageOrientation(bool enabled) { m_shouldRespectImageOrientation = enabled; }
bool shouldRespectImageOrientation() const { return m_shouldRespectImageOrientation; }
+
+#if USE(JSC)
+ static void setShouldRespectPriorityInCSSAttributeSetters(bool);
+ static bool shouldRespectPriorityInCSSAttributeSetters();
+#endif
private:
Settings(Page*);
#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
static bool gShouldUseHighResolutionTimers;
#endif
+#if USE(JSC)
+ static bool gShouldRespectPriorityInCSSAttributeSetters;
+#endif
};
} // namespace WebCore
2012-04-12 Andy Estes <aestes@apple.com>
+ REGRESSION (r102262): iAd Producer relies on CSSStyleDeclaration property setters respecting '!important'
+ https://bugs.webkit.org/show_bug.cgi?id=83832
+
+ Reviewed by Alexey Proskuryakov.
+
+ * Misc/WebKitVersionChecks.h: Indicate that 535.13.0 was the first
+ version of WebKit.framework to ignore '!important' in
+ CSSStyleDeclaration property setters.
+ * WebView/WebView.mm:
+ (shouldRespectPriorityInCSSAttributeSetters):
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Enable a
+ quirk to restore pre-r102262 behavior if the application is iAd Producer
+ and was linked against a version of WebKit.framework that had the old behavior.
+
+2012-04-12 Andy Estes <aestes@apple.com>
+
Remove unused WebKit1 SPI for suppressing incremental rendering.
https://bugs.webkit.org/show_bug.cgi?id=83801
#define WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK 0x02130200 // 531.2.0
#define WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER 0x02160900 // 534.9.0
#define WEBKIT_FIRST_VERSION_WITH_GET_MATCHED_CSS_RULES_RESTRICTIONS 0x02160B00 // 534.11.0
+#define WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY 0x02170D00 // 535.13.0
#ifdef __cplusplus
extern "C" {
outlookQuirksScriptContents, KURL(), nullptr, nullptr, InjectAtDocumentEnd, InjectInAllFrames);
}
+static bool shouldRespectPriorityInCSSAttributeSetters()
+{
+ static bool isIAdProducerNeedingAttributeSetterQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY)
+ && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.iAdProducer"];
+ return isIAdProducerNeedingAttributeSetterQuirk;
+}
+
- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName
{
WebCoreThreadViolationCheckRoundTwo();
// Initialize our platform strategies.
WebPlatformStrategies::initialize();
Settings::setDefaultMinDOMTimerInterval(0.004);
+
+ Settings::setShouldRespectPriorityInCSSAttributeSetters(shouldRespectPriorityInCSSAttributeSetters());
didOneTimeInitialization = true;
}