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

Commit 4a5a5d1

Browse files
authored
Merge pull request #1166 from ckeditor/t/1158
Other: Removed the `renderer-skipped-selection-rendering` warning since it doesn't bring any value. Closes #1158.
2 parents 79da6fb + 0d7dc24 commit 4a5a5d1

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

@@ -646,16 +645,6 @@ export default class Renderer {
646645

647646
// If selection is not collapsed, it does not need to be updated if it is similar.
648647
if ( !this.selection.isCollapsed && this.selection.isSimilar( oldViewSelection ) ) {
649-
const data = {
650-
oldSelection: oldViewSelection,
651-
currentSelection: this.selection
652-
};
653-
654-
log.warn(
655-
'renderer-skipped-selection-rendering: The selection was not rendered due to its similarity to the current one.',
656-
data
657-
);
658-
659648
// Selection did not changed and is correct, do not update.
660649
return false;
661650
}

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

@@ -1503,11 +1502,7 @@ describe( 'Renderer', () => {
15031502
describe( 'similar selection', () => {
15041503
// Use spies to check selection updates. Some selection positions are not achievable in some
15051504
// browsers (e.g. <p>Foo<b>{}Bar</b></p> in Chrome) so asserting dom selection after rendering would fail.
1506-
let selectionCollapseSpy, selectionExtendSpy, logWarnStub;
1507-
1508-
before( () => {
1509-
logWarnStub = sinon.stub( log, 'warn' );
1510-
} );
1505+
let selectionCollapseSpy, selectionExtendSpy;
15111506

15121507
afterEach( () => {
15131508
if ( selectionCollapseSpy ) {
@@ -1519,11 +1514,6 @@ describe( 'Renderer', () => {
15191514
selectionExtendSpy.restore();
15201515
selectionExtendSpy = null;
15211516
}
1522-
logWarnStub.reset();
1523-
} );
1524-
1525-
after( () => {
1526-
logWarnStub.restore();
15271517
} );
15281518

15291519
it( 'should always render collapsed selection even if it is similar', () => {
@@ -1564,7 +1554,6 @@ describe( 'Renderer', () => {
15641554
expect( selectionCollapseSpy.calledWith( domB.childNodes[ 0 ], 0 ) ).to.true;
15651555
expect( selectionExtendSpy.calledOnce ).to.true;
15661556
expect( selectionExtendSpy.calledWith( domB.childNodes[ 0 ], 0 ) ).to.true;
1567-
expect( logWarnStub.notCalled ).to.true;
15681557
} );
15691558

15701559
it( 'should always render collapsed selection even if it is similar (with empty element)', () => {
@@ -1604,7 +1593,6 @@ describe( 'Renderer', () => {
16041593
expect( selectionCollapseSpy.calledWith( domP.childNodes[ 0 ], 3 ) ).to.true;
16051594
expect( selectionExtendSpy.calledOnce ).to.true;
16061595
expect( selectionExtendSpy.calledWith( domP.childNodes[ 0 ], 3 ) ).to.true;
1607-
expect( logWarnStub.notCalled ).to.true;
16081596
} );
16091597

16101598
it( 'should always render non-collapsed selection if it not is similar', () => {
@@ -1645,7 +1633,6 @@ describe( 'Renderer', () => {
16451633
expect( selectionCollapseSpy.calledWith( domP.childNodes[ 0 ], 2 ) ).to.true;
16461634
expect( selectionExtendSpy.calledOnce ).to.true;
16471635
expect( selectionExtendSpy.calledWith( domB.childNodes[ 0 ], 1 ) ).to.true;
1648-
expect( logWarnStub.notCalled ).to.true;
16491636
} );
16501637

16511638
it( 'should always render selection (even if it is same in view) if current dom selection is in incorrect place', () => {
@@ -1713,7 +1700,6 @@ describe( 'Renderer', () => {
17131700

17141701
expect( selectionCollapseSpy.notCalled ).to.true;
17151702
expect( selectionExtendSpy.notCalled ).to.true;
1716-
expect( logWarnStub.called ).to.true;
17171703
} );
17181704

17191705
it( 'should not render non-collapsed selection it is similar (element end)', () => {
@@ -1752,7 +1738,6 @@ describe( 'Renderer', () => {
17521738

17531739
expect( selectionCollapseSpy.notCalled ).to.true;
17541740
expect( selectionExtendSpy.notCalled ).to.true;
1755-
expect( logWarnStub.called ).to.true;
17561741
} );
17571742

17581743
it( 'should not render non-collapsed selection it is similar (element start - nested)', () => {
@@ -1791,7 +1776,6 @@ describe( 'Renderer', () => {
17911776

17921777
expect( selectionCollapseSpy.notCalled ).to.true;
17931778
expect( selectionExtendSpy.notCalled ).to.true;
1794-
expect( logWarnStub.called ).to.true;
17951779
} );
17961780

17971781
it( 'should not render non-collapsed selection it is similar (element end - nested)', () => {
@@ -1829,7 +1813,6 @@ describe( 'Renderer', () => {
18291813

18301814
expect( selectionCollapseSpy.notCalled ).to.true;
18311815
expect( selectionExtendSpy.notCalled ).to.true;
1832-
expect( logWarnStub.called ).to.true;
18331816
} );
18341817
} );
18351818
} );

0 commit comments

Comments
 (0)