Bug 188067 - Use the Page's appearance when converting pasteboard attributed strings
Summary: Use the Page's appearance when converting pasteboard attributed strings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-26 11:44 PDT by Timothy Hatcher
Modified: 2018-07-26 13:30 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.11 KB, patch)
2018-07-26 11:48 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2018-07-26 11:44:44 PDT
The color conversion of NSAttributedString rely on the appearance. We should use the page's appearance in this case.
Comment 1 Radar WebKit Bug Importer 2018-07-26 11:45:11 PDT
<rdar://problem/42632246>
Comment 2 Timothy Hatcher 2018-07-26 11:48:53 PDT
Created attachment 345856 [details]
Patch
Comment 3 Megan Gardner 2018-07-26 11:54:35 PDT
Comment on attachment 345856 [details]
Patch

r=me, unofficial
Comment 4 Wenson Hsieh 2018-07-26 12:39:13 PDT
Comment on attachment 345856 [details]
Patch

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

Is this testable in any way?

> Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:128
> +    auto* page = frame.page();

I was wondering if there's ever a case where page could be null, but it looks like we're okay here because createFragmentAndAddResources will bail if !frame.page().
Comment 5 Timothy Hatcher 2018-07-26 13:02:12 PDT
(In reply to Wenson Hsieh from comment #4)
> Comment on attachment 345856 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=345856&action=review
> 
> Is this testable in any way?

Not currently. I am working on dark mode testing support in general and have many tests to add.
Comment 6 WebKit Commit Bot 2018-07-26 13:30:14 PDT
Comment on attachment 345856 [details]
Patch

Clearing flags on attachment: 345856

Committed r234270: <https://trac.webkit.org/changeset/234270>
Comment 7 WebKit Commit Bot 2018-07-26 13:30:16 PDT
All reviewed patches have been landed.  Closing bug.