RESOLVED FIXED 200605
[iOS] Add a quirk for gmail.com messages on iPhone iOS13
https://bugs.webkit.org/show_bug.cgi?id=200605
Summary [iOS] Add a quirk for gmail.com messages on iPhone iOS13
Said Abou-Hallawa
Reported 2019-08-09 21:39:25 PDT
On iPhone iOS 13, the images in gmail.com messages are not rendered. The user agent for iOS 13 causes gmail.com to send all the images encapsulated in <iframe> elements whose dimensions are { width: 2px; height: 2px }. The bug was reported to Google. But till it is fixed, we are going to add a quirk which sets the user agent of iPhone iOS 12 for gmail messages only on iPhone iOS 13.
Attachments
Patch (4.57 KB, patch)
2019-08-09 21:47 PDT, Said Abou-Hallawa
no flags
Patch (7.93 KB, patch)
2019-08-10 01:52 PDT, Said Abou-Hallawa
no flags
Patch (8.83 KB, patch)
2019-08-10 03:39 PDT, Said Abou-Hallawa
no flags
Patch (8.83 KB, patch)
2019-08-10 03:52 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2019-08-09 21:47:40 PDT
Said Abou-Hallawa
Comment 2 2019-08-09 21:49:25 PDT
Ryosuke Niwa
Comment 3 2019-08-10 01:00:26 PDT
Comment on attachment 375997 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375997&action=review > Source/WebCore/page/Quirks.cpp:354 > +bool Quirks::isGoogleMail() const The pattern of quirks is to define method like shouldAvoidUsingIOS13ForGmail here, and have the main logic for computing the actual UA where it's used. > Source/WebCore/page/Quirks.cpp:362 > + if (!isGoogleMail()) Please add a check for if (!needsQuirks()) first. This is important so that Google developers, etc... can disable this quirk via Web Inspector. > Source/WebCore/page/Quirks.cpp:365 > + static const NeverDestroyed<String> iPhoneOS13 = MAKE_STATIC_STRING_IMPL("iPhone OS 13_1"); All of this logic should really appear in WebPage::platformUserAgent instead. > Source/WebCore/page/Quirks.h:77 > +#if PLATFORM(IOS_FAMILY) Member functions of Quirk should never have if-def like this. If-def should appear in the implementation of this function and should always return false for #else~#endif. > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3788 > + auto document = m_page->focusController().focusedOrMainFrame().document(); Please use m_frame->coreFrame()'s document instead.
Said Abou-Hallawa
Comment 4 2019-08-10 01:52:23 PDT
Said Abou-Hallawa
Comment 5 2019-08-10 03:39:03 PDT
Said Abou-Hallawa
Comment 6 2019-08-10 03:52:31 PDT
Said Abou-Hallawa
Comment 7 2019-08-10 14:36:47 PDT
Comment on attachment 375997 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375997&action=review >> Source/WebCore/page/Quirks.cpp:354 >> +bool Quirks::isGoogleMail() const > > The pattern of quirks is to define method like shouldAvoidUsingIOS13ForGmail here, > and have the main logic for computing the actual UA where it's used. shouldAvoidUsingIOS13ForGmail() was added to Quirks. And the logic for changing the user agent was moved to WebPage::platformUserAgent() in WebPageIOS.mm. >> Source/WebCore/page/Quirks.cpp:362 >> + if (!isGoogleMail()) > > Please add a check for if (!needsQuirks()) first. > This is important so that Google developers, etc... can disable this quirk via Web Inspector. The check was added to Quirks::shouldAvoidUsingIOS13ForGmail(). >> Source/WebCore/page/Quirks.h:77 >> +#if PLATFORM(IOS_FAMILY) > > Member functions of Quirk should never have if-def like this. > If-def should appear in the implementation of this function and should always return false for #else~#endif. Done in Quirks::shouldAvoidUsingIOS13ForGmail(). >> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3788 >> + auto document = m_page->focusController().focusedOrMainFrame().document(); > > Please use m_frame->coreFrame()'s document instead. This was changed to: auto document = m_mainFrame->coreFrame()->document();
Maciej Stachowiak
Comment 8 2019-08-10 14:51:50 PDT
Comment on attachment 376010 [details] Patch Is there a way to add a test case? (I'm not sure if quirks are testable). The code change looks ok and it seems like all the comments from the previous round of review have been addressed.
Said Abou-Hallawa
Comment 9 2019-08-10 14:55:54 PDT
(In reply to Maciej Stachowiak from comment #8) > Comment on attachment 376010 [details] > Patch > > Is there a way to add a test case? (I'm not sure if quirks are testable). > The code change looks ok and it seems like all the comments from the > previous round of review have been addressed. I am not aware of a way for doing that especially gmail needs log-in credentials and navigating to a message with images. I will ask around and if there a way for doing that I will post a follow up patch.
Maciej Stachowiak
Comment 10 2019-08-10 15:23:10 PDT
(In reply to Said Abou-Hallawa from comment #9) > > I will ask around and if there a way for doing that I will post a follow up > patch. Sounds good.
WebKit Commit Bot
Comment 11 2019-08-10 15:25:54 PDT
Comment on attachment 376010 [details] Patch Clearing flags on attachment: 376010 Committed r248501: <https://trac.webkit.org/changeset/248501>
WebKit Commit Bot
Comment 12 2019-08-10 15:25:56 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.