Bug 182938 - Copying a list from Microsoft Word to TinyMCE fails when mso-list is the first property
Summary: Copying a list from Microsoft Word to TinyMCE fails when mso-list is the firs...
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: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on: 182564
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-19 13:23 PST by Ryosuke Niwa
Modified: 2018-04-03 00:48 PDT (History)
4 users (show)

See Also:


Attachments
Fixes the bug (6.61 KB, patch)
2018-03-30 00:00 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2018-02-19 13:23:37 PST
See https://bugs.webkit.org/show_bug.cgi?id=182564#c51

When mso-list is the first CSS property, our workaround doesn't kick in.
Comment 1 Radar WebKit Bug Importer 2018-02-19 13:29:41 PST
<rdar://problem/37683007>
Comment 2 Andrew Herron 2018-02-19 15:43:12 PST
As we finished capturing the Safari clipboard data for our test documents, another failing case popped up - Word can also put newlines in the style attribute :)

<p class=MsoNormal style='margin-left:0cm;text-indent:0cm;mso-pagination:none;
mso-list:l0 level1 lfo1;mso-layout-grid-align:none;text-autospace:none'>
Comment 3 Ryosuke Niwa 2018-03-30 00:00:29 PDT
Created attachment 336844 [details]
Fixes the bug
Comment 4 Wenson Hsieh 2018-03-30 12:28:18 PDT
Comment on attachment 336844 [details]
Fixes the bug

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

r=me

> Source/WebCore/editing/markup.cpp:432
> +        return style.startsWith("mso-list:") || style.contains(";mso-list:") || style.contains("\nmso-list:");

I wonder if we should just regex this at some point :P
Comment 5 Ryosuke Niwa 2018-03-30 16:31:47 PDT
(In reply to Wenson Hsieh from comment #4)
> Comment on attachment 336844 [details]
> Fixes the bug
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=336844&action=review
> 
> r=me
> 
> > Source/WebCore/editing/markup.cpp:432
> > +        return style.startsWith("mso-list:") || style.contains(";mso-list:") || style.contains("\nmso-list:");
> 
> I wonder if we should just regex this at some point :P

Haha, I did think about that.
Comment 6 Ryosuke Niwa 2018-03-30 16:32:04 PDT
Comment on attachment 336844 [details]
Fixes the bug

Thanks for the review. We'd consider using a regular expression if we find more bugs.
Comment 7 WebKit Commit Bot 2018-03-30 16:57:55 PDT
Comment on attachment 336844 [details]
Fixes the bug

Clearing flags on attachment: 336844

Committed r230120: <https://trac.webkit.org/changeset/230120>
Comment 8 WebKit Commit Bot 2018-03-30 16:57:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Andrew Herron 2018-04-03 00:48:52 PDT
I have just downloaded r230195 and confirmed that this seems to fix pasting for the relevant documents in our test suite. Thanks :D