Diff
Modified: trunk/LayoutTests/ChangeLog (204985 => 204986)
--- trunk/LayoutTests/ChangeLog 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/LayoutTests/ChangeLog 2016-08-25 21:48:33 UTC (rev 204986)
@@ -1,3 +1,16 @@
+2016-08-25 Chris Dumez <cdu...@apple.com>
+
+ Regression(r203623): Breaks App Store application
+ https://bugs.webkit.org/show_bug.cgi?id=161206
+ <rdar://problem/28015060>
+
+ Reviewed by Ryosuke Niwa.
+
+ Rebaseline existing test as the exception message is slightly different.
+
+ * fast/dom/Window/getComputedStyle-missing-parameter-expected.txt:
+ * fast/dom/Window/getComputedStyle-missing-parameter.html:
+
2016-08-25 Jiewen Tan <jiewen_...@apple.com>
Unreviewed, rebase iOS simulator WK1 fast/css tests
Modified: trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter-expected.txt (204985 => 204986)
--- trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter-expected.txt 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter-expected.txt 2016-08-25 21:48:33 UTC (rev 204986)
@@ -4,7 +4,7 @@
PASS window.getComputedStyle() threw exception TypeError: Not enough arguments.
-PASS window.getComputedStyle(null) threw exception TypeError: Argument 1 ('element') to Window.getComputedStyle must be an instance of Element.
+PASS window.getComputedStyle(null) threw exception TypeError: Type error.
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter.html (204985 => 204986)
--- trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter.html 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter.html 2016-08-25 21:48:33 UTC (rev 204986)
@@ -5,8 +5,8 @@
<script>
description("Test that the first parameter to Window.getComputedStyle() is mandatory and not nullable.");
-shouldThrow("window.getComputedStyle()", "'TypeError: Not enough arguments'");
-shouldThrow("window.getComputedStyle(null)", "'TypeError: Argument 1 (\\'element\\') to Window.getComputedStyle must be an instance of Element'");
+shouldThrowErrorName("window.getComputedStyle()", "TypeError");
+shouldThrowErrorName("window.getComputedStyle(null)", "TypeError");
</script>
<script src=""
</body>
Modified: trunk/Source/WebCore/ChangeLog (204985 => 204986)
--- trunk/Source/WebCore/ChangeLog 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/Source/WebCore/ChangeLog 2016-08-25 21:48:33 UTC (rev 204986)
@@ -1,3 +1,23 @@
+2016-08-25 Chris Dumez <cdu...@apple.com>
+
+ Regression(r203623): Breaks App Store application
+ https://bugs.webkit.org/show_bug.cgi?id=161206
+ <rdar://problem/28015060>
+
+ Reviewed by Ryosuke Niwa.
+
+ Add quirks for the App Store application so that we log an error message
+ when passing a Document node to Window.getComputedStyle() instead of
+ throwing an exception.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::getComputedStyle):
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+ * platform/RuntimeApplicationChecks.h:
+ * platform/RuntimeApplicationChecks.mm:
+ (WebCore::MacApplication::isAppStore):
+
2016-08-25 Said Abou-Hallawa <sabouhall...@apple.com>
REGRESSION (r203378): [iOS] The PDF image is rendered stretched if a sub image of it is cached first
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (204985 => 204986)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2016-08-25 21:48:33 UTC (rev 204986)
@@ -81,6 +81,7 @@
#include "PageTransitionEvent.h"
#include "Performance.h"
#include "ResourceLoadInfo.h"
+#include "RuntimeApplicationChecks.h"
#include "RuntimeEnabledFeatures.h"
#include "ScheduledAction.h"
#include "Screen.h"
@@ -1405,6 +1406,19 @@
return CSSComputedStyleDeclaration::create(element, false, pseudoElt);
}
+// FIXME: Drop this overload once <rdar://problem/28016778> has been fixed.
+RefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Document&, const String&, ExceptionCode& ec)
+{
+#if PLATFORM(MAC)
+ if (MacApplication::isAppStore()) {
+ printErrorMessage(ASCIILiteral("Passing a non-Element as first parameter to window.getComputedStyle() is invalid and always returns null"));
+ return nullptr;
+ }
+#endif
+ ec = TypeError;
+ return nullptr;
+}
+
RefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* element, const String& pseudoElement, bool authorOnly) const
{
if (!isCurrentlyDisplayedInFrame())
Modified: trunk/Source/WebCore/page/DOMWindow.h (204985 => 204986)
--- trunk/Source/WebCore/page/DOMWindow.h 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/Source/WebCore/page/DOMWindow.h 2016-08-25 21:48:33 UTC (rev 204986)
@@ -229,6 +229,7 @@
// DOM Level 2 Style Interface
WEBCORE_EXPORT RefPtr<CSSStyleDeclaration> getComputedStyle(Element&, const String& pseudoElt) const;
+ RefPtr<CSSStyleDeclaration> getComputedStyle(Document&, const String& pseudoElt, ExceptionCode&);
// WebKit extensions
Modified: trunk/Source/WebCore/page/DOMWindow.idl (204985 => 204986)
--- trunk/Source/WebCore/page/DOMWindow.idl 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/Source/WebCore/page/DOMWindow.idl 2016-08-25 21:48:33 UTC (rev 204986)
@@ -147,6 +147,8 @@
// DOM Level 2 Style Interface
[NewObject] CSSStyleDeclaration getComputedStyle(Element element, optional DOMString? pseudoElement = null);
+ // FIXME: Drop this overload once <rdar://problem/28016778> has been fixed.
+ [NewObject, RaisesException] CSSStyleDeclaration getComputedStyle(Document document, optional DOMString? pseudoElement = null);
// WebKit extensions
#if !(defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT)
Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.h (204985 => 204986)
--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2016-08-25 21:48:33 UTC (rev 204986)
@@ -51,6 +51,7 @@
bool isSolidStateNetworksDownloader();
WEBCORE_EXPORT bool isVersions();
WEBCORE_EXPORT bool isHRBlock();
+WEBCORE_EXPORT bool isAppStore();
} // MacApplication
Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm (204985 => 204986)
--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm 2016-08-25 20:53:15 UTC (rev 204985)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm 2016-08-25 21:48:33 UTC (rev 204986)
@@ -154,6 +154,12 @@
return isSolidStateNetworksDownloader;
}
+bool MacApplication::isAppStore()
+{
+ static bool isAppStore = applicationBundleIsEqualTo("com.apple.appstore");
+ return isAppStore;
+}
+
#endif // PLATFORM(MAC)
#if PLATFORM(IOS)