Changeset 204986 in webkit
- Timestamp:
- Aug 25, 2016 2:48:33 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r204984 r204986 1 2016-08-25 Chris Dumez <cdumez@apple.com> 2 3 Regression(r203623): Breaks App Store application 4 https://bugs.webkit.org/show_bug.cgi?id=161206 5 <rdar://problem/28015060> 6 7 Reviewed by Ryosuke Niwa. 8 9 Rebaseline existing test as the exception message is slightly different. 10 11 * fast/dom/Window/getComputedStyle-missing-parameter-expected.txt: 12 * fast/dom/Window/getComputedStyle-missing-parameter.html: 13 1 14 2016-08-25 Jiewen Tan <jiewen_tan@apple.com> 2 15 -
trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter-expected.txt
r203858 r204986 5 5 6 6 PASS window.getComputedStyle() threw exception TypeError: Not enough arguments. 7 PASS window.getComputedStyle(null) threw exception TypeError: Argument 1 ('element') to Window.getComputedStyle must be an instance of Element.7 PASS window.getComputedStyle(null) threw exception TypeError: Type error. 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/fast/dom/Window/getComputedStyle-missing-parameter.html
r203858 r204986 6 6 description("Test that the first parameter to Window.getComputedStyle() is mandatory and not nullable."); 7 7 8 shouldThrow ("window.getComputedStyle()", "'TypeError: Not enough arguments'");9 shouldThrow ("window.getComputedStyle(null)", "'TypeError: Argument 1 (\\'element\\') to Window.getComputedStyle must be an instance of Element'");8 shouldThrowErrorName("window.getComputedStyle()", "TypeError"); 9 shouldThrowErrorName("window.getComputedStyle(null)", "TypeError"); 10 10 </script> 11 11 <script src="../../../resources/js-test-post.js"></script> -
trunk/Source/WebCore/ChangeLog
r204983 r204986 1 2016-08-25 Chris Dumez <cdumez@apple.com> 2 3 Regression(r203623): Breaks App Store application 4 https://bugs.webkit.org/show_bug.cgi?id=161206 5 <rdar://problem/28015060> 6 7 Reviewed by Ryosuke Niwa. 8 9 Add quirks for the App Store application so that we log an error message 10 when passing a Document node to Window.getComputedStyle() instead of 11 throwing an exception. 12 13 * page/DOMWindow.cpp: 14 (WebCore::DOMWindow::getComputedStyle): 15 * page/DOMWindow.h: 16 * page/DOMWindow.idl: 17 * platform/RuntimeApplicationChecks.h: 18 * platform/RuntimeApplicationChecks.mm: 19 (WebCore::MacApplication::isAppStore): 20 1 21 2016-08-25 Said Abou-Hallawa <sabouhallawa@apple.com> 2 22 -
trunk/Source/WebCore/page/DOMWindow.cpp
r204732 r204986 82 82 #include "Performance.h" 83 83 #include "ResourceLoadInfo.h" 84 #include "RuntimeApplicationChecks.h" 84 85 #include "RuntimeEnabledFeatures.h" 85 86 #include "ScheduledAction.h" … … 1406 1407 } 1407 1408 1409 // FIXME: Drop this overload once <rdar://problem/28016778> has been fixed. 1410 RefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Document&, const String&, ExceptionCode& ec) 1411 { 1412 #if PLATFORM(MAC) 1413 if (MacApplication::isAppStore()) { 1414 printErrorMessage(ASCIILiteral("Passing a non-Element as first parameter to window.getComputedStyle() is invalid and always returns null")); 1415 return nullptr; 1416 } 1417 #endif 1418 ec = TypeError; 1419 return nullptr; 1420 } 1421 1408 1422 RefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* element, const String& pseudoElement, bool authorOnly) const 1409 1423 { -
trunk/Source/WebCore/page/DOMWindow.h
r204732 r204986 230 230 231 231 WEBCORE_EXPORT RefPtr<CSSStyleDeclaration> getComputedStyle(Element&, const String& pseudoElt) const; 232 RefPtr<CSSStyleDeclaration> getComputedStyle(Document&, const String& pseudoElt, ExceptionCode&); 232 233 233 234 // WebKit extensions -
trunk/Source/WebCore/page/DOMWindow.idl
r204732 r204986 148 148 // DOM Level 2 Style Interface 149 149 [NewObject] CSSStyleDeclaration getComputedStyle(Element element, optional DOMString? pseudoElement = null); 150 // FIXME: Drop this overload once <rdar://problem/28016778> has been fixed. 151 [NewObject, RaisesException] CSSStyleDeclaration getComputedStyle(Document document, optional DOMString? pseudoElement = null); 150 152 151 153 // WebKit extensions -
trunk/Source/WebCore/platform/RuntimeApplicationChecks.h
r203392 r204986 52 52 WEBCORE_EXPORT bool isVersions(); 53 53 WEBCORE_EXPORT bool isHRBlock(); 54 WEBCORE_EXPORT bool isAppStore(); 54 55 55 56 } // MacApplication -
trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm
r203392 r204986 155 155 } 156 156 157 bool MacApplication::isAppStore() 158 { 159 static bool isAppStore = applicationBundleIsEqualTo("com.apple.appstore"); 160 return isAppStore; 161 } 162 157 163 #endif // PLATFORM(MAC) 158 164
Note: See TracChangeset
for help on using the changeset viewer.