This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
T/629b Alternative fix infinite selection loop. #671
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f4c0d25
Fixed: infinite selection fixing loop.
scofalik b9d6bc2
Fixed: clear infinite loop counter after user interaction.
scofalik 1b39bfb
Fixed: view.Selection#isEqual better algorithm.
scofalik d2d1e73
Fixed: view.Selection#isEqual for fake selections.
scofalik a656829
Tests: fixed failed tests and 100% CC.
scofalik d80b367
Changed: SelectionObserver clearing infinite loop counter in time int…
scofalik 317d3dc
Tests: SelectionObserver infinite loop removed unstable unit tests an…
scofalik f220109
Tests: updated manual test description.
scofalik a83c2ab
Merge branch 'master' into t/629b
Reinmar 6b6da0c
Manual ticket tests should also be inside manual/ directory.
Reinmar 3768f04
Tests: Improved cleanup.
Reinmar 3dc704c
Tests: Cleaning listeners should not be necessary since we're disabli…
Reinmar a8e53ca
Tests: Fixed a selection observer test which could never work, but wa…
Reinmar dcf65b8
Added: Implemented destroy chain for EditingController->observers->do…
scofalik 0de2bf7
Fixed: Selection#isEqual was throwing in the selection had no ranges.
scofalik 25b8ba2
Docs: added/fixed code comments.
scofalik a3690d5
Tests: Additional tests for model.Selection and view.SelectionObserver.
scofalik b1e0e1f
Merge branch 'master' into t/629b
Reinmar adcdbdc
Changed: simplified implementation of model/view.Selection#isEqual.
scofalik 6a2418b
Tests: added additional test for EditingController#destroy.
scofalik 7ccaa13
Docs: added missing documentation.
scofalik bf9fc9f
Tests: expanded tests for model/view.Selection to cover more cases.
scofalik bf87840
Tests: Should not log a warning which is expected to be logged.
Reinmar 6a9306e
Merge branch 'master' into t/629b
Reinmar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,18 +27,16 @@ import { getData as getViewData } from 'ckeditor5/engine/dev-utils/view.js'; | |
|
||
describe( 'EditingController', () => { | ||
describe( 'constructor()', () => { | ||
let model, editing; | ||
|
||
beforeEach( () => { | ||
model = new ModelDocument(); | ||
editing = new EditingController( model ); | ||
} ); | ||
|
||
it( 'should create controller with properties', () => { | ||
const model = new ModelDocument(); | ||
const editing = new EditingController( model ); | ||
|
||
expect( editing ).to.have.property( 'model' ).that.equals( model ); | ||
expect( editing ).to.have.property( 'view' ).that.is.instanceof( ViewDocument ); | ||
expect( editing ).to.have.property( 'mapper' ).that.is.instanceof( Mapper ); | ||
expect( editing ).to.have.property( 'modelToView' ).that.is.instanceof( ModelConversionDispatcher ); | ||
|
||
editing.destroy(); | ||
} ); | ||
} ); | ||
|
||
|
@@ -53,6 +51,10 @@ describe( 'EditingController', () => { | |
editing = new EditingController( model ); | ||
} ); | ||
|
||
afterEach( () => { | ||
editing.destroy(); | ||
} ); | ||
|
||
it( 'should create root', () => { | ||
const domRoot = createElement( document, 'div', null, createElement( document, 'p' ) ); | ||
|
||
|
@@ -127,6 +129,7 @@ describe( 'EditingController', () => { | |
after( () => { | ||
document.body.removeChild( domRoot ); | ||
listener.stopListening(); | ||
editing.destroy(); | ||
} ); | ||
|
||
beforeEach( () => { | ||
|
@@ -273,6 +276,24 @@ describe( 'EditingController', () => { | |
} ); | ||
|
||
expect( spy.called ).to.be.false; | ||
|
||
editing.destroy(); | ||
} ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I miss a test that destroy() destroys the view. |
||
|
||
it( 'should destroy view', () => { | ||
let model, editing; | ||
|
||
model = new ModelDocument(); | ||
model.createRoot(); | ||
model.schema.registerItem( 'paragraph', '$block' ); | ||
|
||
editing = new EditingController( model ); | ||
|
||
const spy = sinon.spy( editing.view, 'destroy' ); | ||
|
||
editing.destroy(); | ||
|
||
expect( spy.called ).to.be.true; | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deserves some comment that you empirically tested that making more than 50 selection changes in 2s is not possible. BTW. What about making selections by dragging over the text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The selection has to be same as previous or pre-previous selection, so you would have to drag precisly, which means that it would be probably impossible to do 50 changes in 2 secs.