[Webkit-unassigned] [Bug 229597] New: Content loss when copying or pasting lists with an empty first list item

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 26 17:59:16 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=229597

            Bug ID: 229597
           Summary: Content loss when copying or pasting lists with an
                    empty first list item
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Intel)
                OS: macOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: james at toohey.io

Created attachment 436596

  --> https://bugs.webkit.org/attachment.cgi?id=436596&action=review

A simple HTML file to replicate the bug

Hi team,

We discovered some cases where copying or pasting content in Safari 14 would cause content loss.

Context: Google Docs uses a `b` element to wrap their content with the document id when copying content e.g. `<b id="docs-internal-guid-[uuid goes here]">`. When creating a Google Doc with an empty line or empty list item as the first element, Safari converts this element into a style and strips other elements.

I have attached a very simple HTML reproduction case with the following example:

Input (clipboard content):
<b data-important-attr="xyz">
  <ul>
    <li></li>
    <li>text</li>
  </ul>
</b>

Output (result from paste):
<br>
<div>
  <span style="font-weight: bold;">text</span>
</div>

Adding any content into the first list item results in the expected output:

Input (clipboard content):
<b data-important-attr="xyz">
  <ul>
    <li>text</li>
    <li>text</li>
  </ul>
</b>

Output (result from paste):
<b data-important-attr="xyz">
  <ul>
    <li>text</li>
    <li>text</li>
  </ul>
</b>

It is also worth noting that this occurs even without the wrapping `b` element:

Input (clipboard content):
<ul>
  <li></li>
  <li>text</li>
</ul>

Output (result from paste):
<br>
<div>text</div>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210827/692887af/attachment-0001.htm>


More information about the webkit-unassigned mailing list