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 #1199 from ckeditor/t/1177
Browse files Browse the repository at this point in the history
Tests: Fixed failed tests on other browsers than Chrome when using BrowserStack. Closes #1177.
  • Loading branch information
szymonkups authored Dec 5, 2017
2 parents 53ad06c + f11d08f commit 7755349
Show file tree
Hide file tree
Showing 7 changed files with 408 additions and 97 deletions.
4 changes: 3 additions & 1 deletion src/view/domconverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,9 @@ export default class DomConverter {

const direction = getNext ? 'nextNode' : 'previousNode';
const document = node.ownerDocument;
const treeWalker = document.createTreeWalker( document.childNodes[ 0 ], NodeFilter.SHOW_TEXT );
const topmostParent = getAncestors( node )[ 0 ];

const treeWalker = document.createTreeWalker( topmostParent, NodeFilter.SHOW_TEXT );

treeWalker.currentNode = node;

Expand Down
7 changes: 6 additions & 1 deletion tests/controller/editingcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ describe( 'EditingController', () => {
editing = new EditingController( model );

domRoot = document.createElement( 'div' );
domRoot.contentEditable = true;

document.body.appendChild( domRoot );
viewRoot = editing.createRoot( domRoot );

Expand Down Expand Up @@ -218,12 +220,15 @@ describe( 'EditingController', () => {
expect( getModelData( model ) ).to.equal(
'<paragraph>foo</paragraph>' +
'<paragraph></paragraph>' +
'<paragraph>b[a]r</paragraph>' );
'<paragraph>b[a]r</paragraph>'
);

done();
} );
} );

editing.view.isFocused = true;
editing.view.render();

const domSelection = document.getSelection();
domSelection.removeAllRanges();
Expand Down
Loading

0 comments on commit 7755349

Please sign in to comment.