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

Commit

Permalink
Merge pull request #1166 from ckeditor/t/1158
Browse files Browse the repository at this point in the history
Other: Removed the `renderer-skipped-selection-rendering` warning since it doesn't bring any value. Closes #1158.
  • Loading branch information
Reinmar authored Nov 9, 2017
2 parents 79da6fb + 0d7dc24 commit 4a5a5d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
11 changes: 0 additions & 11 deletions src/view/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import mix from '@ckeditor/ckeditor5-utils/src/mix';
import diff from '@ckeditor/ckeditor5-utils/src/diff';
import insertAt from '@ckeditor/ckeditor5-utils/src/dom/insertat';
import remove from '@ckeditor/ckeditor5-utils/src/dom/remove';
import log from '@ckeditor/ckeditor5-utils/src/log';
import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';

Expand Down Expand Up @@ -646,16 +645,6 @@ export default class Renderer {

// If selection is not collapsed, it does not need to be updated if it is similar.
if ( !this.selection.isCollapsed && this.selection.isSimilar( oldViewSelection ) ) {
const data = {
oldSelection: oldViewSelection,
currentSelection: this.selection
};

log.warn(
'renderer-skipped-selection-rendering: The selection was not rendered due to its similarity to the current one.',
data
);

// Selection did not changed and is correct, do not update.
return false;
}
Expand Down
19 changes: 1 addition & 18 deletions tests/view/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { parse, setData as setViewData, getData as getViewData } from '../../src
import { INLINE_FILLER, INLINE_FILLER_LENGTH, isBlockFiller, BR_FILLER } from '../../src/view/filler';
import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
import createElement from '@ckeditor/ckeditor5-utils/src/dom/createelement';
import log from '@ckeditor/ckeditor5-utils/src/log';
import { unwrap, insert, remove } from '../../src/view/writer';
import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';

Expand Down Expand Up @@ -1503,11 +1502,7 @@ describe( 'Renderer', () => {
describe( 'similar selection', () => {
// Use spies to check selection updates. Some selection positions are not achievable in some
// browsers (e.g. <p>Foo<b>{}Bar</b></p> in Chrome) so asserting dom selection after rendering would fail.
let selectionCollapseSpy, selectionExtendSpy, logWarnStub;

before( () => {
logWarnStub = sinon.stub( log, 'warn' );
} );
let selectionCollapseSpy, selectionExtendSpy;

afterEach( () => {
if ( selectionCollapseSpy ) {
Expand All @@ -1519,11 +1514,6 @@ describe( 'Renderer', () => {
selectionExtendSpy.restore();
selectionExtendSpy = null;
}
logWarnStub.reset();
} );

after( () => {
logWarnStub.restore();
} );

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

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

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

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

expect( selectionCollapseSpy.notCalled ).to.true;
expect( selectionExtendSpy.notCalled ).to.true;
expect( logWarnStub.called ).to.true;
} );

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

expect( selectionCollapseSpy.notCalled ).to.true;
expect( selectionExtendSpy.notCalled ).to.true;
expect( logWarnStub.called ).to.true;
} );

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

expect( selectionCollapseSpy.notCalled ).to.true;
expect( selectionExtendSpy.notCalled ).to.true;
expect( logWarnStub.called ).to.true;
} );

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

expect( selectionCollapseSpy.notCalled ).to.true;
expect( selectionExtendSpy.notCalled ).to.true;
expect( logWarnStub.called ).to.true;
} );
} );
} );
Expand Down

0 comments on commit 4a5a5d1

Please sign in to comment.