Bug 220944 - Expose the value of `<meta name="theme-color" content="...">` as SPI
Summary: Expose the value of `<meta name="theme-color" content="...">` as SPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: 224509 224389
  Show dependency treegraph
 
Reported: 2021-01-25 13:45 PST by Devin Rousso
Modified: 2021-04-13 14:29 PDT (History)
9 users (show)

See Also:


Attachments
Patch (29.32 KB, patch)
2021-01-25 13:46 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (41.22 KB, patch)
2021-01-26 11:50 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (41.48 KB, patch)
2021-01-26 12:16 PST, Devin Rousso
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2021-01-25 13:45:17 PST
.
Comment 1 Radar WebKit Bug Importer 2021-01-25 13:46:12 PST
<rdar://problem/73586711>
Comment 2 Devin Rousso 2021-01-25 13:46:38 PST
Created attachment 418330 [details]
Patch
Comment 3 Tim Horton 2021-01-25 14:03:33 PST
Comment on attachment 418330 [details]
Patch

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

> Source/WebCore/html/HTMLMetaElement.cpp:70
> +        process();

This seems... surprising? Did we really not support dynamic change of name before? Should we bother now?

> Source/WebKit/UIProcess/WebPageProxy.h:649
> +    // Set by the WebProcess when parsing `<meta name="theme-color" content="...">`.

Maybe "corresponds to the web content's `<meta name="theme-color" ...`"?
Comment 4 Devin Rousso 2021-01-25 14:07:35 PST
Comment on attachment 418330 [details]
Patch

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

>> Source/WebCore/html/HTMLMetaElement.cpp:70
>> +        process();
> 
> This seems... surprising? Did we really not support dynamic change of name before? Should we bother now?

AFAIK we did not.  I was surprised as well.  According to the spec we should <https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color>
> If any meta elements are inserted into the document or removed from the document, or existing meta elements have their name or content attributes changed, user agents must re-run the above algorithm and apply the result to any affected UI.
Comment 5 Devin Rousso 2021-01-25 14:08:37 PST
Also, something I just realized, I should double-check and make sure that the `_themeColor` is `nil`-d out if the page navigates and the new page doesn't have a `<meta name="theme-color" content="...">` (or at least that `_themeColor` stays `nil` until that node is processed).
Comment 6 Devin Rousso 2021-01-26 11:50:10 PST
Created attachment 418457 [details]
Patch
Comment 7 Tim Horton 2021-01-26 12:00:10 PST
Comment on attachment 418457 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:3911
> +    layerTransaction.setThemeColor(corePage()->themeColor());

Should this reset m_pendingThemeColorChange? I guess it doesn't matter, it's just a bit funny that it gets stuck if UI-side compositing is on.
Comment 8 Devin Rousso 2021-01-26 12:16:21 PST
Created attachment 418460 [details]
Patch
Comment 9 EWS 2021-01-26 16:31:28 PST
Committed r271920: <https://trac.webkit.org/changeset/271920>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418460 [details].