From 732c2f7fa598df5fdfd80122e21a14ed50ea7c40 Mon Sep 17 00:00:00 2001 From: "k.krzton" Date: Mon, 11 Apr 2016 12:42:57 +0200 Subject: [PATCH 1/4] Codestyle fix. --- core/editable.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/core/editable.js b/core/editable.js index b9b0270b144..a5d7e1446ba 100644 --- a/core/editable.js +++ b/core/editable.js @@ -4,6 +4,9 @@ */ ( function() { + var isNotWhitespace, isNotBookmark, isEmpty, isBogus, emptyParagraphRegexp, + insert, fixTableAfterContentsDeletion, getHtmlFromRangeHelpers, extractHtmlFromRangeHelpers; + /** * Editable class which provides all editing related activities by * the `contenteditable` element, dynamically get attached to editor instance. @@ -1291,12 +1294,12 @@ // // - var isNotWhitespace = CKEDITOR.dom.walker.whitespaces( true ), - isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true ), - isEmpty = CKEDITOR.dom.walker.empty(), - isBogus = CKEDITOR.dom.walker.bogus(), - // Matching an empty paragraph at the end of document. - emptyParagraphRegexp = /(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi; + isNotWhitespace = CKEDITOR.dom.walker.whitespaces( true ), + isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true ), + isEmpty = CKEDITOR.dom.walker.empty(), + isBogus = CKEDITOR.dom.walker.bogus(), + // Matching an empty paragraph at the end of document. + emptyParagraphRegexp = /(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi; // Auto-fixing block-less content by wrapping paragraph (#3190), prevent // non-exitable-block by padding extra br.(#3189) @@ -1523,7 +1526,7 @@ // // Functions related to insertXXX methods // - var insert = ( function() { + insert = ( function() { 'use strict'; var DTD = CKEDITOR.dtd; @@ -2232,7 +2235,7 @@ // 1. Fixes a range which is a result of deleteContents() and is placed in an intermediate element (see dtd.$intermediate), // inside a table. A goal is to find a closest or element and when this fails, recreate the structure of the table. // 2. Fixes empty cells by appending bogus
s or deleting empty text nodes in IE<=8 case. - var fixTableAfterContentsDeletion = ( function() { + fixTableAfterContentsDeletion = ( function() { // Creates an element walker which can only "go deeper". It won't // move out from any element. Therefore it can be used to find x in cases like: // ^... @@ -2473,7 +2476,7 @@ // // Helpers for editable.getHtmlFromRange. // - var getHtmlFromRangeHelpers = { + getHtmlFromRangeHelpers = { eol: { detect: function( that, editable ) { var range = that.range, @@ -2638,7 +2641,7 @@ // // Helpers for editable.extractHtmlFromRange. // - var extractHtmlFromRangeHelpers = ( function() { + extractHtmlFromRangeHelpers = ( function() { function optimizeBookmarkNode( node, toStart ) { var parent = node.getParent(); From 709c4407f91814733de315834d3b12c603f0f18d Mon Sep 17 00:00:00 2001 From: "k.krzton" Date: Mon, 11 Apr 2016 13:11:24 +0200 Subject: [PATCH 2/4] Update inline styles content if it changed. --- core/editable.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/editable.js b/core/editable.js index a5d7e1446ba..3c29e497424 100644 --- a/core/editable.js +++ b/core/editable.js @@ -905,12 +905,16 @@ // Create the content stylesheet for this document. var styles = CKEDITOR.getCss(); if ( styles ) { - var head = doc.getHead(); - if ( !head.getCustomData( 'stylesheet' ) ) { + var head = doc.getHead(), + stylesElement = head.getCustomData( 'stylesheet' ); + + if ( !stylesElement ) { var sheet = doc.appendStyleText( styles ); sheet = new CKEDITOR.dom.element( sheet.ownerNode || sheet.owningElement ); head.setCustomData( 'stylesheet', sheet ); sheet.data( 'cke-temp', 1 ); + } else if ( styles != stylesElement.getText() ) { + CKEDITOR.env.ie && CKEDITOR.env.version < 9 ? stylesElement.$.styleSheet.cssText = styles : stylesElement.setText( styles ); } } From feeed40b1b8db05a9283b8b83c225e5cd8d1c513 Mon Sep 17 00:00:00 2001 From: "k.krzton" Date: Mon, 11 Apr 2016 13:12:31 +0200 Subject: [PATCH 3/4] Tests: manual tests for #14573 - drag handler styling. --- .../tickets/14573/manual/widgetdraghandler.html | 16 ++++++++++++++++ tests/tickets/14573/manual/widgetdraghandler.md | 6 ++++++ 2 files changed, 22 insertions(+) create mode 100755 tests/tickets/14573/manual/widgetdraghandler.html create mode 100755 tests/tickets/14573/manual/widgetdraghandler.md diff --git a/tests/tickets/14573/manual/widgetdraghandler.html b/tests/tickets/14573/manual/widgetdraghandler.html new file mode 100755 index 00000000000..d4b836be734 --- /dev/null +++ b/tests/tickets/14573/manual/widgetdraghandler.html @@ -0,0 +1,16 @@ + +
+ + diff --git a/tests/tickets/14573/manual/widgetdraghandler.md b/tests/tickets/14573/manual/widgetdraghandler.md new file mode 100755 index 00000000000..31ed6019754 --- /dev/null +++ b/tests/tickets/14573/manual/widgetdraghandler.md @@ -0,0 +1,6 @@ +@bender-tags: 4.5.9, tc, 14573 +@bender-ui: collapsed + +1. Hover over CKEditor logo inside Editor 2. + +**Expected**: Drag handler should appear over the top left corner of the image. From 3c68743af03abbeaf260bbd7bb9c284f181f396c Mon Sep 17 00:00:00 2001 From: Tadeusz Piskozub Date: Mon, 9 May 2016 17:19:13 +0200 Subject: [PATCH 4/4] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 9bc5ca5d611..9adf3305d89 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ CKEditor 4 Changelog Fixed Issues: +* [#14573](https://dev.ckeditor.com/ticket/14573): Fixed: Missing [Widget](http://ckeditor.com/addon/widget) drag handler CSS when there are multiple editor instances. * [#14620](https://dev.ckeditor.com/ticket/14620): Fixed: Setting both the `min-height` style for the `` element and the `height` style for the `` element breaks [Auto Grow](http://ckeditor.com/addon/autogrow) plugin. * [#14538](http://dev.ckeditor.com/ticket/14538): Fixed: Keyboard focus goes into embedded iframe element. * [#14602](http://dev.ckeditor.com/ticket/14602): Fixed: [dom.element.removeAttribute()](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeAttribute) method does not remove all attributes if no parameter is given.
x