-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3059 from ckeditor/t/2235
Fix for: Image in table cell has an empty URL field when edited from context menu opened by right-click
- Loading branch information
Showing
7 changed files
with
139 additions
and
5 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
27 changes: 27 additions & 0 deletions
27
tests/plugins/tableselection/integrations/image/imageurl.html
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,27 @@ | ||
<div id="test"> | ||
<table border="1" cellpadding="5" cellspacing="5" style="width:500px"> | ||
<tbody> | ||
<tr> | ||
<td> </td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<table border="1" cellpadding="5" cellspacing="5" style="width:300px"> | ||
<tbody> | ||
<tr> | ||
<td>[<img alt="" src="%BASE_PATH%_assets/lena.jpg" style="height:100px; width:100px" />]</td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td> </td> | ||
<td> </td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</td> | ||
<td> </td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> |
27 changes: 27 additions & 0 deletions
27
tests/plugins/tableselection/integrations/image/imageurl.js
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,27 @@ | ||
/* bender-tags: tableselection,2235,4.12.0 */ | ||
/* bender-ckeditor-plugins: tableselection */ | ||
/* bender-include: ../../_helpers/tableselection.js */ | ||
/* global tableSelectionHelpers */ | ||
|
||
( function() { | ||
'use strict'; | ||
|
||
bender.editor = true; | ||
|
||
var tests = { | ||
'Is whole cell fake selected when img inside is selected': function() { | ||
var editor = this.editor, | ||
bot = this.editorBot, | ||
html = CKEDITOR.document.getById( 'test' ).getHtml(); | ||
|
||
bot.setHtmlWithSelection( html ); | ||
|
||
assert.isFalse( editor.getSelection().getSelectedElement().hasClass( 'cke_table-faked-selection' ) ); | ||
} | ||
}; | ||
|
||
// Tests should be ignored in browsers which don't support tableselection plugin, i.e. IE < 11 | ||
tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); | ||
bender.test( tests ); | ||
|
||
} )(); |
36 changes: 36 additions & 0 deletions
36
tests/plugins/tableselection/manual/integrations/image/nestedimage.html
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,36 @@ | ||
<div id="editor"> | ||
<table border="1" cellpadding="5" cellspacing="5" style="width:500px"> | ||
<tbody> | ||
<tr> | ||
<td> </td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<table border="1" cellpadding="5" cellspacing="5" style="width:300px"> | ||
<tbody> | ||
<tr> | ||
<td><img alt="" src="%BASE_PATH%_assets/lena.jpg" style="height:100px; width:100px"/></td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td> </td> | ||
<td> </td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p> </p> | ||
</td> | ||
<td> </td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<script> | ||
// Table Selection plugin doesn't work on IE < 11 so ignore test for that browsers. | ||
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) { | ||
bender.ignore(); | ||
} | ||
CKEDITOR.replace( 'editor', { height: 300 } ); | ||
</script> |
31 changes: 31 additions & 0 deletions
31
tests/plugins/tableselection/manual/integrations/image/nestedimage.md
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,31 @@ | ||
@bender-ui: collapsed | ||
@bender-tags: bug, 2235, 4.12.0 | ||
@bender-ckeditor-plugins: wysiwygarea, tableselection, image, undo | ||
|
||
## Context menu for image in table | ||
|
||
### Scenario 1: | ||
|
||
1. Open context menu for image by right-clicking it. | ||
2. Choose `Image properties`. | ||
|
||
**Expected result:** | ||
|
||
URL field should be filled and image should be visible in the preview. | ||
|
||
**Unexpected result:** | ||
|
||
URL field is empty or image isn't visible in the preview. | ||
|
||
### Scenario 2: | ||
|
||
1. Select first row of the outer table and delete it. | ||
2. Click on the image again. | ||
|
||
**Expected result:** | ||
|
||
Image is selected. | ||
|
||
**Unexpected result:** | ||
|
||
Image can't be selected. |