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

Commit

Permalink
Made the ViewStringify stringify the UIElements in the output.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Aug 8, 2018
1 parent 00fbf7f commit af56cfd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/dev-utils/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* @module engine/dev-utils/view
*/

/* globals document */

/**
* Collection of methods for manipulating the {@link module:engine/view/view view} for testing purposes.
*/
Expand Down Expand Up @@ -652,13 +654,17 @@ class ViewStringify {
callback( this._stringifyElementOpen( root ) );
}

let offset = 0;
callback( this._stringifyElementRanges( root, offset ) );

for ( const child of root.getChildren() ) {
this._walkView( child, callback );
offset++;
if ( root.is( 'uiElement' ) ) {
callback( root.render( document ).innerHTML );
} else {
let offset = 0;
callback( this._stringifyElementRanges( root, offset ) );

for ( const child of root.getChildren() ) {
this._walkView( child, callback );
offset++;
callback( this._stringifyElementRanges( root, offset ) );
}
}

if ( root.is( 'element' ) && !ignore ) {
Expand Down

0 comments on commit af56cfd

Please sign in to comment.