Changeset 247873 in webkit
- Timestamp:
- Jul 26, 2019 1:34:28 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247862 r247873 1 2019-07-26 Youenn Fablet <youenn@apple.com> 2 3 slides.google.com: opening speaker notes while presenting causes a fatal error in the web app on iPad 4 https://bugs.webkit.org/show_bug.cgi?id=199933 5 <rdar://problem/53034345> 6 7 Reviewed by Darin Adler. 8 9 docs.google.com might sometimes try to window.open an about URL that not about:blank or about:srcdoc. 10 In that case, WebKit is opening a window but is considering that the window is cross origin with its opener. 11 This breaks docs.google.com as they want to access the website. 12 Add a site-specific hack so as to treat all about URLs being opened through window.open as about:blank. 13 14 Manually tested on docs.google.com website. 15 16 * page/DOMWindow.cpp: 17 (WebCore::DOMWindow::createWindow): 18 (WebCore::DOMWindow::open): 19 * page/Quirks.cpp: 20 (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const): 21 (WebCore::Quirks::shouldOpenAsAboutBlank const): 22 * page/Quirks.h: 23 1 24 2019-07-26 Alexander Mikhaylenko <exalm7659@gmail.com> 2 25 -
trunk/Source/WebCore/page/DOMWindow.cpp
r247555 r247873 2396 2396 } 2397 2397 2398 ExceptionOr<RefPtr<WindowProxy>> DOMWindow::open(DOMWindow& activeWindow, DOMWindow& firstWindow, const String& urlString , const AtomString& frameName, const String& windowFeaturesString)2398 ExceptionOr<RefPtr<WindowProxy>> DOMWindow::open(DOMWindow& activeWindow, DOMWindow& firstWindow, const String& urlStringToOpen, const AtomString& frameName, const String& windowFeaturesString) 2399 2399 { 2400 2400 if (!isCurrentlyDisplayedInFrame()) … … 2408 2408 if (!firstFrame) 2409 2409 return RefPtr<WindowProxy> { nullptr }; 2410 2411 auto urlString = urlStringToOpen; 2412 if (activeDocument->quirks().shouldOpenAsAboutBlank(urlStringToOpen)) 2413 urlString = "about:blank"_s; 2410 2414 2411 2415 #if ENABLE(CONTENT_EXTENSIONS) -
trunk/Source/WebCore/page/Quirks.cpp
r247840 r247873 31 31 #include "Document.h" 32 32 #include "DocumentLoader.h" 33 #include "FrameLoader.h" 33 34 #include "HTMLMetaElement.h" 34 35 #include "HTMLObjectElement.h" … … 456 457 } 457 458 458 } 459 bool Quirks::shouldOpenAsAboutBlank(const String& stringToOpen) const 460 { 461 #if PLATFORM(IOS_FAMILY) 462 if (!needsQuirks()) 463 return false; 464 465 auto openerURL = m_document->url(); 466 if (!equalLettersIgnoringASCIICase(openerURL.host(), "docs.google.com")) 467 return false; 468 469 if (!m_document->frame() || !m_document->frame()->loader().userAgentForJavaScript(openerURL).contains("Macintosh")) 470 return false; 471 472 URL urlToOpen { URL { }, stringToOpen }; 473 if (!urlToOpen.protocolIsAbout()) 474 return false; 475 476 return !equalLettersIgnoringASCIICase(urlToOpen.host(), "blank") && !equalLettersIgnoringASCIICase(urlToOpen.host(), "srcdoc"); 477 #else 478 UNUSED_PARAM(stringToOpen); 479 return false; 480 #endif 481 } 482 483 } -
trunk/Source/WebCore/page/Quirks.h
r247840 r247873 71 71 bool needsYouTubeOverflowScrollQuirk() const; 72 72 73 bool shouldOpenAsAboutBlank(const String&) const; 74 73 75 private: 74 76 bool needsQuirks() const;
Note: See TracChangeset
for help on using the changeset viewer.