Add Helper method for creating new WebFontDocumentContext

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
This commit is contained in:
Uthman Yahaya Baba 2025-05-19 20:59:36 +01:00
parent e9e360edef
commit 8ac9dfcde6
4 changed files with 17 additions and 36 deletions

View file

@ -4918,15 +4918,7 @@ impl Document {
if self.has_browsing_context() {
// Construct WebFontDocumentContext for font fetching
let document_context = WebFontDocumentContext {
policy_container: self.window.global().policy_container(),
document_url: self.window.global().api_base_url(),
has_trustworthy_ancestor_origin: self
.window
.global()
.has_trustworthy_ancestor_origin(),
insecure_requests_policy: self.window.global().insecure_requests_policy(),
};
let document_context = self.window.new_document_context();
self.window.layout_mut().add_stylesheet(
sheet.clone(),