Skip to content

Remove unused TreeBuilder option. Document scripting_enabled and iframe_srcdoc options #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions html5ever/src/tree_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,24 @@ mod types;
#[derive(Copy, Clone)]
pub struct TreeBuilderOpts {
/// Report all parse errors described in the spec, at some
/// performance penalty? Default: false
/// performance penalty? Default: false
pub exact_errors: bool,

/// Is scripting enabled?
///
/// This affects how `<noscript>` elements are parsed:
/// - If scripting **is** enabled then the contents of a `<noscript>` element are parsed as a single text node
/// - If scriping is **not** enabled then the contents of a `<noscript>` element are parsed as a normal tree of nodes
pub scripting_enabled: bool,

/// Is this an `iframe srcdoc` document?
/// Is this document being parsed from the `srcdoc` attribute of an `<iframe>` element?
///
/// This affects heuristics that infer `QuirksMode` from `<!DOCTYPE>`.
pub iframe_srcdoc: bool,

/// Should we drop the DOCTYPE (if any) from the tree?
pub drop_doctype: bool,

/// Obsolete, ignored.
pub ignore_missing_rules: bool,

/// Initial TreeBuilder quirks mode. Default: NoQuirks
pub quirks_mode: QuirksMode,
}
Expand All @@ -72,7 +75,6 @@ impl Default for TreeBuilderOpts {
scripting_enabled: true,
iframe_srcdoc: false,
drop_doctype: false,
ignore_missing_rules: false,
quirks_mode: NoQuirks,
}
}
Expand Down