Bug 199349 - Tapping on the bottom part of youtube video behaves as if controls were visible
Summary: Tapping on the bottom part of youtube video behaves as if controls were visible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-30 10:08 PDT by zalan
Modified: 2019-07-04 22:51 PDT (History)
9 users (show)

See Also:


Attachments
Patch (7.08 KB, patch)
2019-06-30 10:13 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (12.46 KB, patch)
2019-06-30 20:04 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (12.49 KB, patch)
2019-06-30 20:30 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (12.49 KB, patch)
2019-06-30 20:36 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (12.75 KB, patch)
2019-07-01 12:13 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2019-06-30 10:08:01 PDT
<rdar://problem/51955744>
Comment 1 zalan 2019-06-30 10:13:52 PDT
Created attachment 373192 [details]
Patch
Comment 2 Brent Fulgham 2019-06-30 12:54:40 PDT
Comment on attachment 373192 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=373192&action=review

Looks good. Is this ready for review?

> Source/WebCore/page/ios/ContentChangeObserver.cpp:84
> +    for (auto* parent = node.parentNode(); parent && i < 3; parent = parent->parentNode(), ++i) {

What is magic about the grandparent node? Should this be encoded as a constant explaining it’s importance?
Comment 3 zalan 2019-06-30 12:59:53 PDT
(In reply to Brent Fulgham from comment #2)
> Comment on attachment 373192 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=373192&action=review
> 
> Looks good. Is this ready for review?
Almost.

> 
> > Source/WebCore/page/ios/ContentChangeObserver.cpp:84
> > +    for (auto* parent = node.parentNode(); parent && i < 3; parent = parent->parentNode(), ++i) {
> 
> What is magic about the grandparent node? Should this be encoded as a
> constant explaining it’s importance?
Will explain it in the final patch. Opacity behaves different in the context of hittesting than display: none or visibility: hidden.
Comment 4 zalan 2019-06-30 20:04:57 PDT
Created attachment 373202 [details]
Patch
Comment 5 zalan 2019-06-30 20:30:28 PDT
Created attachment 373207 [details]
Patch
Comment 6 zalan 2019-06-30 20:36:57 PDT
Created attachment 373208 [details]
Patch
Comment 7 Simon Fraser (smfr) 2019-07-01 10:51:41 PDT
Comment on attachment 373208 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=373208&action=review

> Source/WebCore/ChangeLog:9
> +        Synthetic click event should not be dispatched to a node that is initially hidden and becomes visible by the touchStart event.

Quality "hidden" here as including opacity:0. Also say that we're deliberately choose a different behavior from macOS.
Comment 8 zalan 2019-07-01 12:13:05 PDT
Created attachment 373247 [details]
Patch
Comment 9 WebKit Commit Bot 2019-07-01 12:57:45 PDT
Comment on attachment 373247 [details]
Patch

Clearing flags on attachment: 373247

Committed r247015: <https://trac.webkit.org/changeset/247015>
Comment 10 WebKit Commit Bot 2019-07-01 12:57:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2019-07-01 12:58:17 PDT
<rdar://problem/52477135>
Comment 12 Daniel Bates 2019-07-04 22:51:09 PDT
Comment on attachment 373247 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=373247&action=review

> Source/WebCore/page/ios/ContentChangeObserver.cpp:85
> +    constexpr static unsigned numberOfAncestorsToCheckForOpacity = 4;

The static is absolutely unnecessary here. constexpr static == constexpr unless the compiler is a piece of nonsensical garbage 😃. In my opinion I would remove the static.

> Source/WebCore/page/ios/ContentChangeObserver.cpp:86
> +    unsigned i = 0;

In my opinion, it is more idiomatic to define this **in*** the for loop ()s <— also scopes it!

> Source/WebCore/page/ios/ContentChangeObserver.cpp:88
> +        if (!parent->renderStyle() || !parent->renderStyle()->opacity())

Use C++17 if init-statement? 🤷‍♂️

(My line of thinking...dumb compiler will do two calls instead of hoisting the load and doing one for renderStyle(); init-statement is unambiguous what to do...)