mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
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
21 lines
630 B
HTML
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>
|