Commit d75f3089 authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Handle a nullptr ExecutionContext in ConvertNodesIntoNode

Bug: 1085075
Change-Id: I0ffcd576cfec8545d466b2d24187e6d3be75160d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209607
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Nate Chapin <japhet@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770844}
parent 4aff4a89
...@@ -4462,10 +4462,6 @@ void Document::writeln(v8::Isolate* isolate, ...@@ -4462,10 +4462,6 @@ void Document::writeln(v8::Isolate* isolate,
writeln(string, EnteredDOMWindow(isolate)->document(), exception_state); writeln(string, EnteredDOMWindow(isolate)->document(), exception_state);
} }
bool Document::IsTrustedTypesEnabledForDoc() const {
return GetExecutionContext()->RequireTrustedTypes();
}
void Document::write(v8::Isolate* isolate, void Document::write(v8::Isolate* isolate,
TrustedHTML* text, TrustedHTML* text,
ExceptionState& exception_state) { ExceptionState& exception_state) {
......
...@@ -766,7 +766,6 @@ class CORE_EXPORT Document : public ContainerNode, ...@@ -766,7 +766,6 @@ class CORE_EXPORT Document : public ContainerNode,
// TODO(mkwst): Write a spec for this. // TODO(mkwst): Write a spec for this.
void write(v8::Isolate*, TrustedHTML*, ExceptionState&); void write(v8::Isolate*, TrustedHTML*, ExceptionState&);
void writeln(v8::Isolate*, TrustedHTML*, ExceptionState&); void writeln(v8::Isolate*, TrustedHTML*, ExceptionState&);
bool IsTrustedTypesEnabledForDoc() const;
bool WellFormed() const { return well_formed_; } bool WellFormed() const { return well_formed_; }
......
...@@ -840,8 +840,9 @@ static Node* ConvertNodesIntoNode( ...@@ -840,8 +840,9 @@ static Node* ConvertNodesIntoNode(
const HeapVector<NodeOrStringOrTrustedScript>& nodes, const HeapVector<NodeOrStringOrTrustedScript>& nodes,
Document& document, Document& document,
ExceptionState& exception_state) { ExceptionState& exception_state) {
bool needs_check = bool needs_check = IsA<HTMLScriptElement>(parent) &&
IsA<HTMLScriptElement>(parent) && document.IsTrustedTypesEnabledForDoc(); document.GetExecutionContext() &&
document.GetExecutionContext()->RequireTrustedTypes();
if (nodes.size() == 1) if (nodes.size() == 1)
return NodeOrStringToNode(nodes[0], document, needs_check, exception_state); return NodeOrStringToNode(nodes[0], document, needs_check, exception_state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment