Skip to content

Commit

Permalink
fix regression of DevExpressgh-1150 (DevExpress#1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
LavrovArtem committed Jun 14, 2017
1 parent 173ace9 commit c56339a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export default class PropertyAccessorsInstrumentation extends SandboxBase {

el.innerHTML = processedValue;

if (domUtils.isBodyElement(el)) {
if (this.document.body === el) {
var shadowUIRoot = this.shadowUI.getRoot();

ShadowUI.markElementAndChildrenAsShadow(shadowUIRoot);
Expand Down
26 changes: 26 additions & 0 deletions test/client/fixtures/sandbox/code-instrumentation/setters-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,3 +622,29 @@ test('setter returns a correct value (GH-907)', function () {
checkReturnedValue('img', 'src', './path');
checkReturnedValue('a', 'target', '_blank');
});

test('body of new document implementation should not throw an error after set him innerHTML (GH-1172)', function () {
var iframe = document.createElement('iframe');

iframe.id = 'test' + Date.now();

document.body.appendChild(iframe);

iframe.contentDocument.write(
'<head>',
' <script>',
' var body = document.implementation.createHTMLDocument("").body;',
' try {',
' window.__set$(body, "innerHTML", "<form><\/form>");',
' window.hasError = false;',
' } catch (e) {',
' window.hasError = true;',
' }',
' <\/script>',
'</head>'
);

ok(!iframe.contentWindow.hasError);

document.body.removeChild(iframe);
});

0 comments on commit c56339a

Please sign in to comment.