Bug 1930618 Comment 15 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Prior to this patch, stylesheets cloned into a static document without the reference between them and relevant `<style>` and `<link>` elements preserved, which is the root cause of this bug.
... However, fixing this broke Print Selection, because it deletes all the nodes not selected as part of the printing process, which includes `<style>` and `<link>` elements. Now that those are linked to `Stylesheet` objects properly, they also get deleted, effectively leaving the selected element unstyled.
Prior to this patch, stylesheets cloned into a static document without the reference between them and relevant `<style>` and `<link>` elements preserved, which is the root cause of this bug.
... However, fixing this broke Print Selection, because it [deletes all the nodes not selected](https://searchfox.org/mozilla-central/rev/234f91a9d3ebef0d514868701cfb022d5f199cb5/layout/printing/nsPrintJob.cpp#1649) as part of the printing process, which includes `<style>` and `<link>` elements. Now that those are linked to `Stylesheet` objects properly, they also get deleted, effectively leaving the selected element unstyled.

Back to Bug 1930618 Comment 15