Bug 209126 - Simplify the mechanism to paint captions in video fullscreen and picture-in-picture
Summary: Simplify the mechanism to paint captions in video fullscreen and picture-in-p...
Status: CLOSED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-15 11:27 PDT by Peng Liu
Modified: 2020-03-16 13:45 PDT (History)
14 users (show)

See Also:


Attachments
Patch (14.24 KB, patch)
2020-03-15 11:43 PDT, Peng Liu
simon.fraser: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peng Liu 2020-03-15 11:27:16 PDT
Simply the mechanism to paint captions in video fullscreen and picture-in-picture
Comment 1 Radar WebKit Bug Importer 2020-03-15 11:28:40 PDT
<rdar://problem/60471459>
Comment 2 Peng Liu 2020-03-15 11:43:21 PDT
Created attachment 393621 [details]
Patch
Comment 3 Eric Carlson 2020-03-15 16:30:16 PDT
Comment on attachment 393621 [details]
Patch

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

> Source/WebCore/html/shadow/MediaControlElements.cpp:1331
> +        if (document().page()) {

Nit: "if (auto* page = document().page())" would be slightly more efficient.

> Source/WebCore/page/Page.cpp:1368
> +    for (auto& callback : m_updateRenderingCallbacks.values())

A callback could mutate m_updateRenderingCallbacks so you should iterate over a copy. It is also possible for an existing callback to be removed during a client callback, so you should probably copy the keys to a vector and make a callback only if an identifier is still in m_updateRenderingCallbacks.

> Source/WebCore/page/Page.h:952
> +    uint64_t m_nextUpdateRenderingCallbackID { 0 };

An ObjectIdentifier would be better than a uint64_t.
Comment 4 Simon Fraser (smfr) 2020-03-16 09:42:52 PDT
Comment on attachment 393621 [details]
Patch

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

Seems OK but let's see another patch.

> Source/WebCore/page/Page.cpp:1367
>  #if ENABLE(VIDEO_TRACK)

This shouldn't be inside the #ifdef any more.
Comment 5 Peng Liu 2020-03-16 13:44:19 PDT
Because of concerns about arbitrary callbacks running post-updateRendering, e.g., it will encourage people to run code that will dirty layout. Let's close this bug without landing the patch.