Bug 207676

Summary: Dark Mode: In Notes, list item becomes invisible in dark mode after outdenting
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, mifenton, simon.fraser, timothy, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fixes the bug
none
Fixes the bug
none
Fixed the bug timothy: review+

Description Ryosuke Niwa 2020-02-12 19:45:22 PST
Steps To Reproduce:
1. System Preferences —> General —> Appearance = Dark
2. Sign in with an IMAP account with HTML notes (i.e. Gmail)
3. Launch Notes
4. Create a new HTML note
5. Start a numbered list (i.e. type “1.” followed by text)
6. Outdent the list item

Result: The test becomes invisible

<rdar://problem/56682679>
Comment 1 Ryosuke Niwa 2020-02-12 20:48:07 PST
Created attachment 390612 [details]
Fixes the bug
Comment 2 Ryosuke Niwa 2020-02-12 22:15:30 PST
Comment on attachment 390612 [details]
Fixes the bug

Hm... looks like PasteRTFD.TransformColorsOfDarkContent is failing on iOS.
Comment 3 Ryosuke Niwa 2020-02-12 23:02:32 PST
Comment on attachment 390612 [details]
Fixes the bug

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

> Source/WebCore/editing/ReplaceSelectionCommand.cpp:579
> -    return true;
> +    return hasVisibleNonSemanticColor;

Alright, this doesn't work :( Reverting this.
Comment 4 Ryosuke Niwa 2020-02-12 23:07:58 PST
Created attachment 390620 [details]
Fixes the bug
Comment 5 Ryosuke Niwa 2020-02-13 12:21:01 PST
Oh, looks like iOS just needs platform specific result for the test due to auto size propert as usual but that should not block the code review.
Comment 6 Timothy Hatcher 2020-02-13 15:16:55 PST
Comment on attachment 390620 [details]
Fixes the bug

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

> Source/WebCore/editing/EditingStyle.cpp:1385
> +            m_mutableStyle->setProperty(CSSPropertyColor, computedValue);

This should use id, otherwise CSSPropertyBackgroundColor and CSSPropertyCaretColor will overwrite CSSPropertyColor.
Comment 7 Ryosuke Niwa 2020-02-13 17:03:15 PST
Created attachment 390705 [details]
Fixed the bug
Comment 8 Ryosuke Niwa 2020-02-13 18:56:34 PST
Committed r256580: <https://trac.webkit.org/changeset/256580>