- From: snianu <notifications@github.com>
- Date: Thu, 09 Sep 2021 18:35:29 -0700
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 10 September 2021 01:35:41 UTC
@annevk > @snianu I would also like to understand why the fragment parser does not suffice, as it seems to preserve the elements you indicated were dropped. If we parse the HTML markup string in the context of `body` element, then it wouldn't parse the contents of the `html` & `head` elements properly. We want to process the string as a complete HTML document using the `DOMParser` so it parses the contents of `html` & `head` in the context that the authors intended. Also, if we inline each and every style that are applicable to the content of the `body`, then it would bloat the HTML markup on the clipboard. e.g. If you copy a grid from Excel Online where the cells have different formats, inlining the styles would produce a huge markup where each `td` & `tr` elements would have a different style. Having just a `style` element in the `head` not only preserves the styles applicable to all the cells, but also produces a small HTML markup on the clipboard. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/clipboard-apis/issues/150#issuecomment-916562798
Received on Friday, 10 September 2021 01:35:41 UTC