RESOLVED FIXED Bug 200609
Disable ContentChangeObserver on the mobile version of youtube.com
https://bugs.webkit.org/show_bug.cgi?id=200609
Summary Disable ContentChangeObserver on the mobile version of youtube.com
Alex Christensen
Reported 2019-08-09 23:58:25 PDT
Disable ContentChangeObserver on youtube.com
Attachments
Patch (10.68 KB, patch)
2019-08-10 00:04 PDT, Alex Christensen
no flags
Patch (10.60 KB, patch)
2019-08-10 00:09 PDT, Alex Christensen
no flags
Patch (11.98 KB, patch)
2019-08-10 10:02 PDT, Alex Christensen
mjs: review+
Alex Christensen
Comment 1 2019-08-10 00:04:24 PDT
Alex Christensen
Comment 2 2019-08-10 00:04:27 PDT
Alex Christensen
Comment 3 2019-08-10 00:09:46 PDT
Maciej Stachowiak
Comment 4 2019-08-10 00:11:33 PDT
Comment on attachment 376001 [details] Patch We should almost certainly do this only in mobile content mode. Otherwise, this change is likely to break YouTube on iPad as it was necessary for reasonable hover interaction. (ContentChangeObserver isn't a web platform feature, it's just part of the new hover heuristic for desktop websites on iPad.)
Alex Christensen
Comment 5 2019-08-10 00:16:24 PDT
Comment on attachment 376001 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=376001&action=review > Source/WebCore/page/Quirks.cpp:141 > +bool Quirks::shouldDisableContentChangeObserver() const I'm not sure where or how to check if it's in mobile content mode. I have a Document here. Any tips would be appreciated.
Alex Christensen
Comment 6 2019-08-10 00:24:02 PDT
I'm going to bed. If someone wants to take this one home, be my guest.
Tim Horton
Comment 7 2019-08-10 00:41:34 PDT
(In reply to Alex Christensen from comment #5) > Comment on attachment 376001 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=376001&action=review > > > Source/WebCore/page/Quirks.cpp:141 > > +bool Quirks::shouldDisableContentChangeObserver() const > > I'm not sure where or how to check if it's in mobile content mode. I have a > Document here. Any tips would be appreciated. You want WebsitePoliciesData
Maciej Stachowiak
Comment 8 2019-08-10 00:51:52 PDT
(In reply to Tim Horton from comment #7) > (In reply to Alex Christensen from comment #5) > > Comment on attachment 376001 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=376001&action=review > > > > > Source/WebCore/page/Quirks.cpp:141 > > > +bool Quirks::shouldDisableContentChangeObserver() const > > > > I'm not sure where or how to check if it's in mobile content mode. I have a > > Document here. Any tips would be appreciated. > > You want WebsitePoliciesData That doesn't seem to exist anywhere in WebCore, and it also doesn't seem to directly contain the content mode (though it does contain some things controlled by it, like meta viewport mode). In fact I don't think any explicit knowledge of the content mode exists in the WebContent process. Could you be a bit more explicit in your suggestion? Does WebsitePoliciesData contain something that can be used to infer the content mode, and if so how does one get to it from WebCore?
Tim Horton
Comment 9 2019-08-10 00:55:32 PDT
(In reply to Maciej Stachowiak from comment #8) > (In reply to Tim Horton from comment #7) > > (In reply to Alex Christensen from comment #5) > > > Comment on attachment 376001 [details] > > > Patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=376001&action=review > > > > > > > Source/WebCore/page/Quirks.cpp:141 > > > > +bool Quirks::shouldDisableContentChangeObserver() const > > > > > > I'm not sure where or how to check if it's in mobile content mode. I have a > > > Document here. Any tips would be appreciated. > > > > You want WebsitePoliciesData > > That doesn't seem to exist anywhere in WebCore, and it also doesn't seem to > directly contain the content mode (though it does contain some things > controlled by it, like meta viewport mode). In fact I don't think any > explicit knowledge of the content mode exists in the WebContent process. Agreed, but it's where you would go with such a bit if you were to add one. > Could you be a bit more explicit in your suggestion? Does > WebsitePoliciesData contain something that can be used to infer the content > mode, and if so how does one get to it from WebCore? You add a bit to WebsitePoliciesData, a bit to DocumentLoader, propagate it in WebsitePoliciesData::applyToDocumentLoader, and then you can get to it from WebCore. Not beautiful, but it's how all the others work.
Simon Fraser (smfr)
Comment 10 2019-08-10 08:26:04 PDT
Comment on attachment 376001 [details] Patch Rather than disable all content observation, i think it would be better to figure out which specific behavior causes the bug. Content Observation is about whether to simulate hover or just send simulated clicks. There's a log channel you can turn on to figure out what it's doing.
Alex Christensen
Comment 11 2019-08-10 08:58:35 PDT
Good morning! I'm back on this. I'll add a mobile content only check and bisect this change to find out which behavior change is needed.
Alex Christensen
Comment 12 2019-08-10 10:02:30 PDT
Alex Christensen
Comment 13 2019-08-10 12:46:58 PDT
Alan is looking into whether the quirk check should be moved to ContentChangeObserver::shouldObserveVisibilityChangeForElement (which I verified also fixes the problem) or an even less invasive change that has lower risk.
Maciej Stachowiak
Comment 14 2019-08-10 14:58:43 PDT
Comment on attachment 376013 [details] Patch This change seems to address previous comments and looks like it will work. I'm gonna guess quirks are untestable, but if not I'd suggest a test case. I think it would be good to land some working version ASAP, and consider refining further from there. r=me
zalan
Comment 15 2019-08-10 15:37:22 PDT
the mobile version of youtube.com 1. constructs a visible and actionable content 2. attaches it to the tree 3. and later destroys it completely Content change observer (historically) stops at the first visible change. I've seen this type of behavior on another page and was planning to 1. not stop at the first visible change but instead collect all the qualified nodes. 2. check if the collected nodes are still considered visible right at the end of the observation window.
Alex Christensen
Comment 16 2019-08-10 15:46:36 PDT
Alan's plan sounds like a good plan longer term, but too risky for this particular change. I committed the patch to http://trac.webkit.org/r248502
zalan
Comment 17 2019-08-10 15:49:06 PDT
(In reply to Alex Christensen from comment #16) > Alan's plan sounds like a good plan longer term, but too risky for this > particular change. I committed the patch to http://trac.webkit.org/r248502 Agree!
Note You need to log in before you can comment on or make changes to this bug.