-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if document.createTextRange exists for IE in 'select all' plugin. #562
Conversation
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.
There are no unit and manual test. It's crucial to have them.
</div> | ||
|
||
<script> | ||
if ( ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) || bender.tools.env.mobile ) { |
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.
There is CKEDITOR.env.edge
flag could be used here.
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.
As this is only Edge issue we decided that test should be ignored for other browsers.
|
||
**Procedure:** | ||
|
||
1. Change view to source code |
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.
Source mode
.
**Procedure:** | ||
|
||
1. Change view to source code | ||
2. click `select all` button |
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.
Keep the list items consistent. It should start with uppercase and end with a dot.
|
||
**Expected result:** | ||
|
||
* The whole code should be selected |
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.
You can use content
instead of code
. Also dot on the end of the sentence missing.
@@ -0,0 +1,12 @@ | |||
@bender-ui: collapsed | |||
@bender-tags: tc, 545, 2564, 4.7.1, bug |
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.
No need to put TP issue number (2564
).
@@ -45,6 +45,34 @@ | |||
acceptableResults, | |||
bender.tools.html.prepareInnerHtmlForComparison( bender.tools.selection.getWithHtml( editor ), htmlMatchingOpts ) | |||
); | |||
}, | |||
|
|||
'test selectall in source view': function() { |
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 test look s quite complex, I would simplify it:
- The eventsRecorder is not needed, this test should check (according to its description) if
selectAll
works in source mode, no need to check for additional events. - Editor creation can be moved to
bender.editors = { ... }
, like:
editorSource: {
name: 'test_source_mode',
startupData: '<p>foo</p><p>bar</p>',
config: {
startupMode: 'source'
}
}
- And then test itself could be simplified to something like:
var editor = this.editors.editorSource;
editor.execCommand( 'selectAll' );
assert.areSame( 'source', editor.mode, 'editor.mode' );
if ( CKEDITOR.env.ie && CKEDITOR.env.version <= 8 ) {
assert.areSame( document.selection.createRange().text.length, 20 );
} else {
assert.areSame( CKEDITOR.document.getActive().$.selectionStart, 0 );
assert.areSame( CKEDITOR.document.getActive().$.selectionEnd, 20 );
}
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.
LGTM!
@mlewand Please check if all your review requests got solved. |
@f1ames I'm good with it. |
What is the purpose of this pull request?
Bug fix
Does your PR contain necessary tests?
selectall
plugin test already exists.This PR contains
What changes did you make?
selectall plugin is now checking if
createTextRange
method exists in IE.Closes #545