From e2132c39a37c23307c3b850292e4f011446d9fc4 Mon Sep 17 00:00:00 2001 From: chrisgui Date: Thu, 18 Feb 2016 17:29:26 +0000 Subject: [PATCH 1/5] Fix for context menus cut off in MS Edge #13756 --- plugins/floatpanel/plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/floatpanel/plugin.js b/plugins/floatpanel/plugin.js index 2d0234743ac..b3490bfc0a7 100644 --- a/plugins/floatpanel/plugin.js +++ b/plugins/floatpanel/plugin.js @@ -271,12 +271,12 @@ CKEDITOR.plugins.add( 'floatpanel', { if ( block.autoSize ) { var panelDoc = block.element.getDocument(); - var width = ( CKEDITOR.env.webkit ? block.element : panelDoc.getBody() ).$.scrollWidth; - + var width = ( (CKEDITOR.env.webkit || CKEDITOR.env.edge) ? block.element : panelDoc.getBody() ).$.scrollWidth; + // Account for extra height needed due to IE quirks box model bug: // http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug // (#3426) - if ( CKEDITOR.env.ie && CKEDITOR.env.quirks && width > 0 ) + if ( !CKEDITOR.env.edge && CKEDITOR.env.ie && CKEDITOR.env.quirks && width > 0 ) width += ( target.$.offsetWidth || 0 ) - ( target.$.clientWidth || 0 ) + 3; // Add some extra pixels to improve the appearance. From abe7cc2b6a730deffb7931e9f5a92b4902eede91 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Tue, 1 Mar 2016 10:20:22 +0100 Subject: [PATCH 2/5] Code style adjusted. --- plugins/floatpanel/plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/floatpanel/plugin.js b/plugins/floatpanel/plugin.js index b3490bfc0a7..9bf6d2e7c34 100644 --- a/plugins/floatpanel/plugin.js +++ b/plugins/floatpanel/plugin.js @@ -270,9 +270,9 @@ CKEDITOR.plugins.add( 'floatpanel', { target.removeStyle( 'width' ); if ( block.autoSize ) { - var panelDoc = block.element.getDocument(); - var width = ( (CKEDITOR.env.webkit || CKEDITOR.env.edge) ? block.element : panelDoc.getBody() ).$.scrollWidth; - + var panelDoc = block.element.getDocument(), + width = ( ( CKEDITOR.env.webkit || CKEDITOR.env.edge ) ? block.element : panelDoc.getBody() ).$.scrollWidth; + // Account for extra height needed due to IE quirks box model bug: // http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug // (#3426) From f7a008c79f39a7613e7d7791c599e1c0a63efe43 Mon Sep 17 00:00:00 2001 From: "m.lewandowski" Date: Wed, 2 Mar 2016 16:15:29 +0100 Subject: [PATCH 3/5] Added manual test. --- tests/plugins/floatpanel/manual/rendering.html | 12 ++++++++++++ tests/plugins/floatpanel/manual/rendering.md | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/plugins/floatpanel/manual/rendering.html create mode 100644 tests/plugins/floatpanel/manual/rendering.md diff --git a/tests/plugins/floatpanel/manual/rendering.html b/tests/plugins/floatpanel/manual/rendering.html new file mode 100644 index 00000000000..541976e812f --- /dev/null +++ b/tests/plugins/floatpanel/manual/rendering.html @@ -0,0 +1,12 @@ + + + + diff --git a/tests/plugins/floatpanel/manual/rendering.md b/tests/plugins/floatpanel/manual/rendering.md new file mode 100644 index 00000000000..7f2b5f8dde6 --- /dev/null +++ b/tests/plugins/floatpanel/manual/rendering.md @@ -0,0 +1,14 @@ +@bender-tags: tc, 4.5.8, 13756 +@bender-ui: collapsed +@bender-ckeditor-plugins: wysiwygarea,toolbar,elementspath,list,liststyle,basicstyles,contextmenu + +1. Open context menu inside any of list items (e.g. with a right mouse click). + +### Expected + +The panel layout is correct. + +### Unexpected + +Panel is cropped. + From d8759cc1fa2f268abe2bb00424673c639229c368 Mon Sep 17 00:00:00 2001 From: "m.lewandowski" Date: Wed, 2 Mar 2016 16:41:22 +0100 Subject: [PATCH 4/5] There's no need to worry about QM in Edge. --- plugins/floatpanel/plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/floatpanel/plugin.js b/plugins/floatpanel/plugin.js index 9bf6d2e7c34..66fa3de6bb5 100644 --- a/plugins/floatpanel/plugin.js +++ b/plugins/floatpanel/plugin.js @@ -276,7 +276,7 @@ CKEDITOR.plugins.add( 'floatpanel', { // Account for extra height needed due to IE quirks box model bug: // http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug // (#3426) - if ( !CKEDITOR.env.edge && CKEDITOR.env.ie && CKEDITOR.env.quirks && width > 0 ) + if ( CKEDITOR.env.ie && CKEDITOR.env.quirks && width > 0 ) width += ( target.$.offsetWidth || 0 ) - ( target.$.clientWidth || 0 ) + 3; // Add some extra pixels to improve the appearance. From 64b9f6eab6f2752b7172b4edb1bc94882b3ab337 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Mon, 14 Mar 2016 17:03:09 +0100 Subject: [PATCH 5/5] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index e6a2530eb1d..f1a523030f2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ CKEditor 4 Changelog Other Changes: +* [#13756](http://dev.ckeditor.com/ticket/13756): Fixed: Context menus are cut-off in Microsoft Edge. * [#12707](http://dev.ckeditor.com/ticket/12707): Fixed: The order of table elements does not meet the HTML specification. ## CKEditor 4.5.7