mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Implement Trusted types document write sinks (#36824)
Implements the Document.write algorithm covering Trusted HTML. Part of #36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
43edab336a
commit
c00e0aae61
9 changed files with 142 additions and 107 deletions
|
@ -357,16 +357,14 @@ impl ServoParser {
|
|||
}
|
||||
|
||||
/// Steps 6-8 of <https://html.spec.whatwg.org/multipage/#document.write()>
|
||||
pub(crate) fn write(&self, text: Vec<DOMString>, can_gc: CanGc) {
|
||||
pub(crate) fn write(&self, text: DOMString, can_gc: CanGc) {
|
||||
assert!(self.can_write());
|
||||
|
||||
if self.document.has_pending_parsing_blocking_script() {
|
||||
// There is already a pending parsing blocking script so the
|
||||
// parser is suspended, we just append everything to the
|
||||
// script input and abort these steps.
|
||||
for chunk in text {
|
||||
self.script_input.push_back(String::from(chunk).into());
|
||||
}
|
||||
self.script_input.push_back(String::from(text).into());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -376,9 +374,7 @@ impl ServoParser {
|
|||
assert!(self.script_input.is_empty());
|
||||
|
||||
let input = BufferQueue::default();
|
||||
for chunk in text {
|
||||
input.push_back(String::from(chunk).into());
|
||||
}
|
||||
input.push_back(String::from(text).into());
|
||||
|
||||
let profiler_chan = self
|
||||
.document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue