Commit 07d632dc authored by Rob Buis's avatar Rob Buis Committed by Commit Bot

Fix null-dereference caused by r532302

We need to check if there is a frame before calling CanExecuteScripts.

Bug: 806681, 806705
Change-Id: I717cbb92478806b8f2687b099c62558f5abc7f03
Reviewed-on: https://chromium-review.googlesource.com/891304Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Rob Buis <rob.buis@samsung.com>
Cr-Commit-Position: refs/heads/master@{#532850}
parent 58a3eddf
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
test(function() {
var d = document.implementation.createHTMLDocument();
var e = d.body.innerHTML = '<noscript>noscript</noscript>';
assert_equals(d.querySelector('noscript').innerHTML, 'noscript');
});
</script>
......@@ -479,7 +479,7 @@ EntityMask MarkupFormatter::EntityMaskForText(const Text& text) const {
*parent_name == xmpTag || *parent_name == iframeTag ||
*parent_name == plaintextTag || *parent_name == noembedTag ||
*parent_name == noframesTag ||
(*parent_name == noscriptTag &&
(*parent_name == noscriptTag && text.GetDocument().GetFrame() &&
text.GetDocument().CanExecuteScripts(kNotAboutToExecuteScript))))
return kEntityMaskInCDATA;
return kEntityMaskInHTMLPCDATA;
......
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