Title: [204988] tags/Safari-603.1.3

Diff

Modified: tags/Safari-603.1.3/LayoutTests/ChangeLog (204987 => 204988)


--- tags/Safari-603.1.3/LayoutTests/ChangeLog	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/LayoutTests/ChangeLog	2016-08-25 21:59:54 UTC (rev 204988)
@@ -1,3 +1,20 @@
+2016-08-25  Babak Shafiei  <[email protected]>
+
+        Merge r204986.
+
+    2016-08-25  Chris Dumez  <[email protected]>
+
+            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-23  Dean Jackson  <[email protected]>
 
         fast/canvas/canvas-alphaImageData-behavior.html doesn't appear to be flakey any

Modified: tags/Safari-603.1.3/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter-expected.txt (204987 => 204988)


--- tags/Safari-603.1.3/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter-expected.txt	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter-expected.txt	2016-08-25 21:59:54 UTC (rev 204988)
@@ -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: tags/Safari-603.1.3/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter.html (204987 => 204988)


--- tags/Safari-603.1.3/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter.html	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter.html	2016-08-25 21:59:54 UTC (rev 204988)
@@ -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: tags/Safari-603.1.3/Source/WebCore/ChangeLog (204987 => 204988)


--- tags/Safari-603.1.3/Source/WebCore/ChangeLog	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/Source/WebCore/ChangeLog	2016-08-25 21:59:54 UTC (rev 204988)
@@ -1,3 +1,27 @@
+2016-08-25  Babak Shafiei  <[email protected]>
+
+        Merge r204986.
+
+    2016-08-25  Chris Dumez  <[email protected]>
+
+            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-23  Said Abou-Hallawa  <[email protected]>
 
         REGRESSION: SVG clip-path doesn't work on root <svg>

Modified: tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.cpp (204987 => 204988)


--- tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.cpp	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.cpp	2016-08-25 21:59:54 UTC (rev 204988)
@@ -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: tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.h (204987 => 204988)


--- tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.h	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.h	2016-08-25 21:59:54 UTC (rev 204988)
@@ -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: tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.idl (204987 => 204988)


--- tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.idl	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/Source/WebCore/page/DOMWindow.idl	2016-08-25 21:59:54 UTC (rev 204988)
@@ -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: tags/Safari-603.1.3/Source/WebCore/platform/RuntimeApplicationChecks.h (204987 => 204988)


--- tags/Safari-603.1.3/Source/WebCore/platform/RuntimeApplicationChecks.h	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/Source/WebCore/platform/RuntimeApplicationChecks.h	2016-08-25 21:59:54 UTC (rev 204988)
@@ -51,6 +51,7 @@
 bool isSolidStateNetworksDownloader();
 WEBCORE_EXPORT bool isVersions();
 WEBCORE_EXPORT bool isHRBlock();
+WEBCORE_EXPORT bool isAppStore();
 
 } // MacApplication
 

Modified: tags/Safari-603.1.3/Source/WebCore/platform/RuntimeApplicationChecks.mm (204987 => 204988)


--- tags/Safari-603.1.3/Source/WebCore/platform/RuntimeApplicationChecks.mm	2016-08-25 21:57:13 UTC (rev 204987)
+++ tags/Safari-603.1.3/Source/WebCore/platform/RuntimeApplicationChecks.mm	2016-08-25 21:59:54 UTC (rev 204988)
@@ -154,6 +154,12 @@
     return isSolidStateNetworksDownloader;
 }
 
+bool MacApplication::isAppStore()
+{
+    static bool isAppStore = applicationBundleIsEqualTo("com.apple.appstore");
+    return isAppStore;
+}
+
 #endif // PLATFORM(MAC)
 
 #if PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to