gecko-dev/editor/libeditor/crashtests/1381541.html
Makoto Kato 3ee9303468 Bug 1381541 - queryCommandState should consider that parent node of selection is null. r=masayuki
When parent node of selected node is null, crash might occur in GetCSSBackgroundColorState.  So when parent is null, we should return default value.  In this situation, Edge and Blink don't throw error, Gecko shouldn't return error too.

MozReview-Commit-ID: 5C6jSAFkCso

--HG--
extra : rebase_source : 0185f9fb5fde92eee5611e6bb95e8676c10b135c
2017-08-18 14:48:39 +09:00

21 lines
630 B
HTML

<!DOCTYPE html>
<html>
<head>
<script type="application/javascript">
var editable = document.createElement('div');
document.documentElement.appendChild(editable);
editable.contentEditable = 'true';
var div = document.createElement('div');
document.documentElement.appendChild(div);
// Flush content
div.offsetLeft;
document.execCommand('styleWithCSS', false, true);
var range = new Range();
window.getSelection().addRange(range);
range.setStart(document.createTextNode(''), 0);
document.queryCommandState('backcolor');
</script>
</head>
</html>