Commit 495a36aa authored by Charlie Hu's avatar Charlie Hu Committed by Commit Bot

Add null-check to CSSParserContext::ReportLayoutAnimationsViolationIfNeeded

Previously Document was an instance of ExecutionContext. |document_| not
null is equivalent to ExecutionContext not null. However, after recent
migration of ExecutionContext to DomWindow, this assumption no longer
holds.

This CL adds null-check on |document_->GetExecutionContext()| to avoid
deref nullptr.

Bug: 1069848
Change-Id: Ifadc47b889bf5cd5fc3975b511c92d1dda7d4205
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149317Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Commit-Queue: Charlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/master@{#759247}
parent c923cc3a
......@@ -263,7 +263,7 @@ const ExecutionContext* CSSParserContext::GetExecutionContext() const {
void CSSParserContext::ReportLayoutAnimationsViolationIfNeeded(
const StyleRuleKeyframe& rule) const {
if (!document_)
if (!document_ || !document_->GetExecutionContext())
return;
for (size_t i = 0; i < rule.Properties().PropertyCount(); ++i) {
const CSSProperty& property = rule.Properties().PropertyAt(i).Property();
......
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