mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Introduce Document::has_pending_parsing_blocking_script
This commit is contained in:
parent
749ac42854
commit
438182a7de
2 changed files with 5 additions and 5 deletions
|
@ -1451,12 +1451,12 @@ impl Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_pending_parsing_blocking_script(&self, script: &HTMLScriptElement) {
|
pub fn set_pending_parsing_blocking_script(&self, script: &HTMLScriptElement) {
|
||||||
assert!(self.get_pending_parsing_blocking_script().is_none());
|
assert!(!self.has_pending_parsing_blocking_script());
|
||||||
self.pending_parsing_blocking_script.set(Some(script));
|
self.pending_parsing_blocking_script.set(Some(script));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_pending_parsing_blocking_script(&self) -> Option<Root<HTMLScriptElement>> {
|
pub fn has_pending_parsing_blocking_script(&self) -> bool {
|
||||||
self.pending_parsing_blocking_script.get()
|
self.pending_parsing_blocking_script.get().is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_deferred_script(&self, script: &HTMLScriptElement) {
|
pub fn add_deferred_script(&self, script: &HTMLScriptElement) {
|
||||||
|
|
|
@ -196,7 +196,7 @@ impl ServoParser {
|
||||||
pub fn write(&self, text: Vec<DOMString>) {
|
pub fn write(&self, text: Vec<DOMString>) {
|
||||||
assert!(self.script_nesting_level.get() > 0);
|
assert!(self.script_nesting_level.get() > 0);
|
||||||
|
|
||||||
if self.document.get_pending_parsing_blocking_script().is_some() {
|
if self.document.has_pending_parsing_blocking_script() {
|
||||||
// There is already a pending parsing blocking script so the
|
// There is already a pending parsing blocking script so the
|
||||||
// parser is suspended, we just append everything to the
|
// parser is suspended, we just append everything to the
|
||||||
// script input and abort these steps.
|
// script input and abort these steps.
|
||||||
|
@ -326,7 +326,7 @@ impl ServoParser {
|
||||||
script.prepare();
|
script.prepare();
|
||||||
self.script_nesting_level.set(script_nesting_level);
|
self.script_nesting_level.set(script_nesting_level);
|
||||||
|
|
||||||
if self.document.get_pending_parsing_blocking_script().is_some() {
|
if self.document.has_pending_parsing_blocking_script() {
|
||||||
self.suspended.set(true);
|
self.suspended.set(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue