Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 0d7dc24

Browse files
author
Kamil Piechaczek
committed
Removed "renderer-skipped-selection-rendering" warning.
1 parent d55dd3e commit 0d7dc24

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

src/view/renderer.js

-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import mix from '@ckeditor/ckeditor5-utils/src/mix';
1515
import diff from '@ckeditor/ckeditor5-utils/src/diff';
1616
import insertAt from '@ckeditor/ckeditor5-utils/src/dom/insertat';
1717
import remove from '@ckeditor/ckeditor5-utils/src/dom/remove';
18-
import log from '@ckeditor/ckeditor5-utils/src/log';
1918
import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
2019
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
2120

@@ -640,16 +639,6 @@ export default class Renderer {
640639

641640
// If selection is not collapsed, it does not need to be updated if it is similar.
642641
if ( !this.selection.isCollapsed && this.selection.isSimilar( oldViewSelection ) ) {
643-
const data = {
644-
oldSelection: oldViewSelection,
645-
currentSelection: this.selection
646-
};
647-
648-
log.warn(
649-
'renderer-skipped-selection-rendering: The selection was not rendered due to its similarity to the current one.',
650-
data
651-
);
652-
653642
// Selection did not changed and is correct, do not update.
654643
return false;
655644
}

tests/view/renderer.js

+1-18
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { parse, setData as setViewData, getData as getViewData } from '../../src
2020
import { INLINE_FILLER, INLINE_FILLER_LENGTH, isBlockFiller, BR_FILLER } from '../../src/view/filler';
2121
import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
2222
import createElement from '@ckeditor/ckeditor5-utils/src/dom/createelement';
23-
import log from '@ckeditor/ckeditor5-utils/src/log';
2423
import { unwrap, insert, remove } from '../../src/view/writer';
2524
import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';
2625

@@ -1459,11 +1458,7 @@ describe( 'Renderer', () => {
14591458
describe( 'similar selection', () => {
14601459
// Use spies to check selection updates. Some selection positions are not achievable in some
14611460
// browsers (e.g. <p>Foo<b>{}Bar</b></p> in Chrome) so asserting dom selection after rendering would fail.
1462-
let selectionCollapseSpy, selectionExtendSpy, logWarnStub;
1463-
1464-
before( () => {
1465-
logWarnStub = sinon.stub( log, 'warn' );
1466-
} );
1461+
let selectionCollapseSpy, selectionExtendSpy;
14671462

14681463
afterEach( () => {
14691464
if ( selectionCollapseSpy ) {
@@ -1475,11 +1470,6 @@ describe( 'Renderer', () => {
14751470
selectionExtendSpy.restore();
14761471
selectionExtendSpy = null;
14771472
}
1478-
logWarnStub.reset();
1479-
} );
1480-
1481-
after( () => {
1482-
logWarnStub.restore();
14831473
} );
14841474

14851475
it( 'should always render collapsed selection even if it is similar', () => {
@@ -1520,7 +1510,6 @@ describe( 'Renderer', () => {
15201510
expect( selectionCollapseSpy.calledWith( domB.childNodes[ 0 ], 0 ) ).to.true;
15211511
expect( selectionExtendSpy.calledOnce ).to.true;
15221512
expect( selectionExtendSpy.calledWith( domB.childNodes[ 0 ], 0 ) ).to.true;
1523-
expect( logWarnStub.notCalled ).to.true;
15241513
} );
15251514

15261515
it( 'should always render collapsed selection even if it is similar (with empty element)', () => {
@@ -1560,7 +1549,6 @@ describe( 'Renderer', () => {
15601549
expect( selectionCollapseSpy.calledWith( domP.childNodes[ 0 ], 3 ) ).to.true;
15611550
expect( selectionExtendSpy.calledOnce ).to.true;
15621551
expect( selectionExtendSpy.calledWith( domP.childNodes[ 0 ], 3 ) ).to.true;
1563-
expect( logWarnStub.notCalled ).to.true;
15641552
} );
15651553

15661554
it( 'should always render non-collapsed selection if it not is similar', () => {
@@ -1601,7 +1589,6 @@ describe( 'Renderer', () => {
16011589
expect( selectionCollapseSpy.calledWith( domP.childNodes[ 0 ], 2 ) ).to.true;
16021590
expect( selectionExtendSpy.calledOnce ).to.true;
16031591
expect( selectionExtendSpy.calledWith( domB.childNodes[ 0 ], 1 ) ).to.true;
1604-
expect( logWarnStub.notCalled ).to.true;
16051592
} );
16061593

16071594
it( 'should always render selection (even if it is same in view) if current dom selection is in incorrect place', () => {
@@ -1669,7 +1656,6 @@ describe( 'Renderer', () => {
16691656

16701657
expect( selectionCollapseSpy.notCalled ).to.true;
16711658
expect( selectionExtendSpy.notCalled ).to.true;
1672-
expect( logWarnStub.called ).to.true;
16731659
} );
16741660

16751661
it( 'should not render non-collapsed selection it is similar (element end)', () => {
@@ -1708,7 +1694,6 @@ describe( 'Renderer', () => {
17081694

17091695
expect( selectionCollapseSpy.notCalled ).to.true;
17101696
expect( selectionExtendSpy.notCalled ).to.true;
1711-
expect( logWarnStub.called ).to.true;
17121697
} );
17131698

17141699
it( 'should not render non-collapsed selection it is similar (element start - nested)', () => {
@@ -1747,7 +1732,6 @@ describe( 'Renderer', () => {
17471732

17481733
expect( selectionCollapseSpy.notCalled ).to.true;
17491734
expect( selectionExtendSpy.notCalled ).to.true;
1750-
expect( logWarnStub.called ).to.true;
17511735
} );
17521736

17531737
it( 'should not render non-collapsed selection it is similar (element end - nested)', () => {
@@ -1785,7 +1769,6 @@ describe( 'Renderer', () => {
17851769

17861770
expect( selectionCollapseSpy.notCalled ).to.true;
17871771
expect( selectionExtendSpy.notCalled ).to.true;
1788-
expect( logWarnStub.called ).to.true;
17891772
} );
17901773
} );
17911774
} );

0 commit comments

Comments
 (0)