[Webkit-unassigned] [Bug 234193] Page doesn't draw content if a <style> tag with a font @import is removed during the DOMContentLoaded event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 13 10:57:05 PST 2021


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

--- Comment #2 from Neil Jhaveri <neil at neiljhaveri.com> ---
Sure, happy to give context. In an email client, when replying to certain messages (e.g. with Google fonts imports), the compose window's web view was drawing blank (this bug).

When replying to or forwarding a message, the client takes the original message's text/html part, inserts it into a `<blockquote>`, and loads this into a `WKWebView`. During load, there is logic to inline styles resulting from `<style>` and `<link>` elements in the quoted text, and remove them from the DOM, so they don't impact the style of newly-typed text above the quote block. This is done as early as possible (e.g. during `DOMContentLoaded`) to avoid visual flicker.

For now, I have deferred the removal of `<style>` elements with @imports until the `load` event fires, which works around this issue. However, it has the trade-off of seeing some possible "flicker" on screen because `<style>` element removal has been deferred. I haven't fully investigated if there are any other good approaches to solving this general style-inlining problem.

-- 
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/20211213/2c2f6b10/attachment.htm>


More information about the webkit-unassigned mailing list