Files
firefox/editor/libeditor/crashtests/1381541.html
T
Makoto Kato 4d183fd097 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
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>