Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
290 additions
and
27 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* bender-tags: editor,unit,panel */ | ||
/* bender-ckeditor-plugins: pagebreak,toolbar,clipboard,panel */ | ||
|
||
( function() { | ||
'use strict'; | ||
|
||
bender.editor = { | ||
creator: 'replace' | ||
}; | ||
|
||
function createBlock() { | ||
var parent = new CKEDITOR.dom.element( 'div' ); | ||
CKEDITOR.document.getBody().append( parent ); | ||
|
||
var block = new CKEDITOR.ui.panel.block( parent, { attributes: {} } ); | ||
|
||
for ( var i = 0; i < 4; i++ ) { | ||
var item = new CKEDITOR.dom.element( 'p' ); | ||
var link = new CKEDITOR.dom.element( 'a' ); | ||
item.append( link ); | ||
block.element.append( item ); | ||
} | ||
block.show(); | ||
|
||
return block; | ||
} | ||
|
||
bender.test( { | ||
'test mark first panel block item': function() { | ||
var block = createBlock(), | ||
timeout = CKEDITOR.tools.setTimeout; | ||
|
||
block.onMark = sinon.spy(); | ||
|
||
CKEDITOR.tools.setTimeout = function( callback ) { | ||
callback(); | ||
}; | ||
|
||
block._.markFirstDisplayed(); | ||
|
||
CKEDITOR.tools.setTimeout = timeout; | ||
|
||
assert.isTrue( block.onMark.calledWith( block.element.getElementsByTag( 'a' ).getItem( 0 ) ) ); | ||
}, | ||
|
||
'test mark first displayed panel block item': function() { | ||
var block = createBlock(), | ||
timeout = CKEDITOR.tools.setTimeout; | ||
|
||
block.onMark = sinon.spy(); | ||
block.element.getElementsByTag( 'p' ).getItem( 0 ).setStyle( 'display', 'none' ); | ||
|
||
CKEDITOR.tools.setTimeout = function( callback ) { | ||
callback(); | ||
}; | ||
|
||
block._.markFirstDisplayed(); | ||
|
||
CKEDITOR.tools.setTimeout = timeout; | ||
|
||
assert.isTrue( block.onMark.calledWith( block.element.getElementsByTag( 'a' ).getItem( 1 ) ) ); | ||
}, | ||
|
||
'test mark first displayed item with aria-selected': function() { | ||
var block = createBlock(), | ||
itemIndex = 2, | ||
timeout = CKEDITOR.tools.setTimeout; | ||
|
||
block.onMark = sinon.spy(); | ||
block.element.getElementsByTag( 'a' ).getItem( itemIndex ).setAttribute( 'aria-selected', true ); | ||
|
||
CKEDITOR.tools.setTimeout = function( callback ) { | ||
callback(); | ||
}; | ||
|
||
block._.markFirstDisplayed(); | ||
|
||
CKEDITOR.tools.setTimeout = timeout; | ||
|
||
assert.isTrue( block.onMark.calledWith( block.element.getElementsByTag( 'a' ).getItem( itemIndex ) ) ); | ||
} | ||
} ); | ||
} )(); |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div id="editor"> | ||
<table> | ||
<tr> | ||
<td>Check the cell's properties</td> | ||
<td></td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
<script> | ||
CKEDITOR.replace( 'editor' ); | ||
</script> |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@bender-tags: 4.7.0, tc, 16804 | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: wysiwygarea,toolbar,elementspath,floatpanel,panel,menu,contextmenu,clipboard,a11yhelp,table,tabletools | ||
|
||
### Test Scenario | ||
|
||
1. Focus the editor and press `Ctrl + Shift + F10` to open the context menu. | ||
2. Navigate through the menu. | ||
|
||
#### Expected | ||
|
||
In each opened menu or submenu the first active element is focused. | ||
|
||
#### Unexpected | ||
|
||
The first element is not focused. |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div id="editor"> | ||
</div> | ||
|
||
<script> | ||
CKEDITOR.replace( 'editor' ); | ||
</script> |
Oops, something went wrong.