From 788a8a0f75e06e92b82da5ba29ec2eae3d600288 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Tue, 4 Jul 2017 16:39:33 +0200
Subject: [PATCH 01/17] Manual test

---
 tests/plugins/font/manual/preservestyle.html |  7 +++++++
 tests/plugins/font/manual/preservestyle.md   | 13 +++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 tests/plugins/font/manual/preservestyle.html
 create mode 100644 tests/plugins/font/manual/preservestyle.md

diff --git a/tests/plugins/font/manual/preservestyle.html b/tests/plugins/font/manual/preservestyle.html
new file mode 100644
index 00000000000..bcb8886361e
--- /dev/null
+++ b/tests/plugins/font/manual/preservestyle.html
@@ -0,0 +1,7 @@
+<textarea name="ed" id="editor" cols="30" rows="10">
+	Hello world
+</textarea>
+
+<script>
+	CKEDITOR.replace( 'editor' );
+</script>
diff --git a/tests/plugins/font/manual/preservestyle.md b/tests/plugins/font/manual/preservestyle.md
new file mode 100644
index 00000000000..400442366c2
--- /dev/null
+++ b/tests/plugins/font/manual/preservestyle.md
@@ -0,0 +1,13 @@
+@bender-tags: 4.8.0, feature, tc
+@bender-ui: collapsed
+@bender-ckeditor-plugins: wysiwygarea, toolbar, font, elementspath
+
+1. Select text
+1. Change `font size`
+1. Select this same text, be sure that floating panel has selected previously chosen option
+1. Select this same option once again
+1. Repeat those steps for the `font name`.
+
+**Expected:** Font size/name will remain this same. It still will be marked on dropdown menu and applied to selected text.
+
+**Unexpected:** Font size/name will be deselct and style dissapear from the text.

From d562cdbd6566f0646f080667e3d639e22af682e2 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Tue, 4 Jul 2017 16:43:10 +0200
Subject: [PATCH 02/17] Sample raw solution. Proof of concept.

---
 plugins/font/plugin.js | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/plugins/font/plugin.js b/plugins/font/plugin.js
index a4d5cdbdea2..e9395cd1c1d 100644
--- a/plugins/font/plugin.js
+++ b/plugins/font/plugin.js
@@ -4,7 +4,7 @@
  */
 
 ( function() {
-	function addCombo( editor, comboName, styleType, lang, entries, defaultLabel, styleDefinition, order ) {
+	function addCombo( editor, comboName, styleType, lang, entries, defaultLabel, styleDefinition, order, twoStateList, clearFontAvailable ) {
 		var config = editor.config,
 			style = new CKEDITOR.style( styleDefinition );
 
@@ -89,9 +89,13 @@
 			init: function() {
 				this.startGroup( lang.panelTitle );
 
+				// Adding (clear) option to list.
+				if ( clearFontAvailable ) {
+					this.add( 'cke-clear', '<span>(clear)</span>', '(clear)' );
+				}
+
 				for ( var i = 0; i < names.length; i++ ) {
 					var name = names[ i ];
-
 					// Add the tag entry to the panel list.
 					this.add( name, styles[ name ].buildPreview(), name );
 				}
@@ -106,7 +110,7 @@
 
 				// When applying one style over another, first remove the previous one (http://dev.ckeditor.com/ticket/12403).
 				// NOTE: This is only a temporary fix. It will be moved to the styles system (http://dev.ckeditor.com/ticket/12687).
-				if ( previousValue && value != previousValue ) {
+				if ( previousValue && ( value != previousValue || value === 'cke-clear' ) ) {
 					var previousStyle = styles[ previousValue ],
 						range = editor.getSelection().getRanges()[ 0 ];
 
@@ -157,7 +161,9 @@
 					}
 				}
 
-				editor[ previousValue == value ? 'removeStyle' : 'applyStyle' ]( style );
+				if ( value !== 'cke-clear' ) {
+					editor[ twoStateList && previousValue == value ? 'removeStyle' : 'applyStyle' ]( style );
+				}
 
 				editor.fire( 'saveSnapshot' );
 			},
@@ -228,8 +234,8 @@
 		init: function( editor ) {
 			var config = editor.config;
 
-			addCombo( editor, 'Font', 'family', editor.lang.font, config.font_names, config.font_defaultLabel, config.font_style, 30 );
-			addCombo( editor, 'FontSize', 'size', editor.lang.font.fontSize, config.fontSize_sizes, config.fontSize_defaultLabel, config.fontSize_style, 40 );
+			addCombo( editor, 'Font', 'family', editor.lang.font, config.font_names, config.font_defaultLabel, config.font_style, 30, false, true );
+			addCombo( editor, 'FontSize', 'size', editor.lang.font.fontSize, config.fontSize_sizes, config.fontSize_defaultLabel, config.fontSize_style, 40, false, true );
 		}
 	} );
 } )();

From e40b8b49996e507d2b0cc25e69e7fe0af11b5218 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 11:03:12 +0200
Subject: [PATCH 03/17] Some minor changes to tests and fix.

---
 plugins/font/plugin.js                     | 59 +++++++++++++---------
 tests/plugins/font/manual/preservestyle.md |  2 +-
 2 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/plugins/font/plugin.js b/plugins/font/plugin.js
index e9395cd1c1d..5b5854731b5 100644
--- a/plugins/font/plugin.js
+++ b/plugins/font/plugin.js
@@ -4,7 +4,8 @@
  */
 
 ( function() {
-	function addCombo( editor, comboName, styleType, lang, entries, defaultLabel, styleDefinition, order, twoStateList, clearFontAvailable ) {
+	function addCombo( editor, comboName, styleType, lang, entries, defaultLabel, styleDefinition, order ) {
+		// debugger;
 		var config = editor.config,
 			style = new CKEDITOR.style( styleDefinition );
 
@@ -87,15 +88,17 @@
 			},
 
 			init: function() {
+				var name,
+					defaultValue = 'cke-default',
+					defaultText = '(' + lang.optionDefault + ')';
+
 				this.startGroup( lang.panelTitle );
 
-				// Adding (clear) option to list.
-				if ( clearFontAvailable ) {
-					this.add( 'cke-clear', '<span>(clear)</span>', '(clear)' );
-				}
+				// Add (default) option as first element on the list.
+				this.add( defaultValue, defaultText, defaultText );
 
 				for ( var i = 0; i < names.length; i++ ) {
-					var name = names[ i ];
+					name = names[ i ];
 					// Add the tag entry to the panel list.
 					this.add( name, styles[ name ].buildPreview(), name );
 				}
@@ -106,27 +109,34 @@
 				editor.fire( 'saveSnapshot' );
 
 				var previousValue = this.getValue(),
-					style = styles[ value ];
+					style = styles[ value ],
+					previousStyle,
+					range,
+					path,
+					matching,
+					startBoundary,
+					endBoundary,
+					node,
+					bm;
 
 				// When applying one style over another, first remove the previous one (http://dev.ckeditor.com/ticket/12403).
 				// NOTE: This is only a temporary fix. It will be moved to the styles system (http://dev.ckeditor.com/ticket/12687).
-				if ( previousValue && ( value != previousValue || value === 'cke-clear' ) ) {
-					var previousStyle = styles[ previousValue ],
-						range = editor.getSelection().getRanges()[ 0 ];
+				if ( previousValue && value != previousValue ) {
+					previousStyle = styles[ previousValue ];
+					range = editor.getSelection().getRanges()[ 0 ];
 
 					// If the range is collapsed we can't simply use the editor.removeStyle method
 					// because it will remove the entire element and we want to split it instead.
 					if ( range.collapsed ) {
-						var path = editor.elementPath(),
-							// Find the style element.
-							matching = path.contains( function( el ) {
-								return previousStyle.checkElementRemovable( el );
-							} );
+						path = editor.elementPath();
+						// Find the style element.
+						matching = path.contains( function( el ) {
+							return previousStyle.checkElementRemovable( el );
+						} );
 
 						if ( matching ) {
-							var startBoundary = range.checkBoundaryOfElement( matching, CKEDITOR.START ),
-								endBoundary = range.checkBoundaryOfElement( matching, CKEDITOR.END ),
-								node, bm;
+							startBoundary = range.checkBoundaryOfElement( matching, CKEDITOR.START );
+							endBoundary = range.checkBoundaryOfElement( matching, CKEDITOR.END );
 
 							// If we are at both boundaries it means that the element is empty.
 							// Remove it but in a way that we won't lose other empty inline elements inside it.
@@ -160,11 +170,14 @@
 						editor.removeStyle( previousStyle );
 					}
 				}
-
-				if ( value !== 'cke-clear' ) {
-					editor[ twoStateList && previousValue == value ? 'removeStyle' : 'applyStyle' ]( style );
+				if ( value === 'cke-default' && previousStyle ) {
+					editor.removeStyle( previousStyle );
+				} else if ( value !== 'cke-default' ) {
+					editor.applyStyle( style );
 				}
 
+				// editor[ previousValue == value ? 'removeStyle' : 'applyStyle' ]( style );
+
 				editor.fire( 'saveSnapshot' );
 			},
 
@@ -234,8 +247,8 @@
 		init: function( editor ) {
 			var config = editor.config;
 
-			addCombo( editor, 'Font', 'family', editor.lang.font, config.font_names, config.font_defaultLabel, config.font_style, 30, false, true );
-			addCombo( editor, 'FontSize', 'size', editor.lang.font.fontSize, config.fontSize_sizes, config.fontSize_defaultLabel, config.fontSize_style, 40, false, true );
+			addCombo( editor, 'Font', 'family', editor.lang.font, config.font_names, config.font_defaultLabel, config.font_style, 30 );
+			addCombo( editor, 'FontSize', 'size', editor.lang.font.fontSize, config.fontSize_sizes, config.fontSize_defaultLabel, config.fontSize_style, 40 );
 		}
 	} );
 } )();
diff --git a/tests/plugins/font/manual/preservestyle.md b/tests/plugins/font/manual/preservestyle.md
index 400442366c2..75da39de6be 100644
--- a/tests/plugins/font/manual/preservestyle.md
+++ b/tests/plugins/font/manual/preservestyle.md
@@ -1,6 +1,6 @@
 @bender-tags: 4.8.0, feature, tc
 @bender-ui: collapsed
-@bender-ckeditor-plugins: wysiwygarea, toolbar, font, elementspath
+@bender-ckeditor-plugins: wysiwygarea, toolbar, font, elementspath, sourcearea
 
 1. Select text
 1. Change `font size`

From 90fbf7b037d822a322bb59b0fbed6089e6c2bb16 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 11:26:16 +0200
Subject: [PATCH 04/17] Improvement to fix - change statement check

---
 plugins/font/plugin.js | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/plugins/font/plugin.js b/plugins/font/plugin.js
index 5b5854731b5..7a5d253ee55 100644
--- a/plugins/font/plugin.js
+++ b/plugins/font/plugin.js
@@ -117,7 +117,8 @@
 					startBoundary,
 					endBoundary,
 					node,
-					bm;
+					bm,
+					defaultValue = 'cke-default';
 
 				// When applying one style over another, first remove the previous one (http://dev.ckeditor.com/ticket/12403).
 				// NOTE: This is only a temporary fix. It will be moved to the styles system (http://dev.ckeditor.com/ticket/12687).
@@ -170,14 +171,15 @@
 						editor.removeStyle( previousStyle );
 					}
 				}
-				if ( value === 'cke-default' && previousStyle ) {
-					editor.removeStyle( previousStyle );
-				} else if ( value !== 'cke-default' ) {
+
+				if ( value === defaultValue ) {
+					if ( previousStyle ) {
+						editor.removeStyle( previousStyle );
+					}
+				} else if ( value !== previousValue ) {
 					editor.applyStyle( style );
 				}
 
-				// editor[ previousValue == value ? 'removeStyle' : 'applyStyle' ]( style );
-
 				editor.fire( 'saveSnapshot' );
 			},
 

From 311b25c528aa96b572d2cf1946a543008db3b6e5 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 12:10:27 +0200
Subject: [PATCH 05/17] Fix failing font unit test.

---
 tests/plugins/font/font.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/plugins/font/font.js b/tests/plugins/font/font.js
index 79b627a142e..2904d7b485f 100644
--- a/tests/plugins/font/font.js
+++ b/tests/plugins/font/font.js
@@ -35,8 +35,10 @@
 
 				this.wait( function() {
 					// Click again to exit the style.
+					// Since 4.8.0 2nd click into this same menu item do not unselect it.
+					// It is required to click into '(Default)' option to reset style (#584).
 					bot.combo( 'FontSize', function( combo ) {
-						combo.onClick( 48 );
+						combo.onClick( 'cke-default' );
 						this.wait( function() {
 							editor.insertText( 'bar' );
 							assert.isInnerHtmlMatching( '<p><span style="font-size:48px">foo</span>bar@</p>',

From 8b397f2156899312207b3c9045f60e5e733ea63b Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 12:52:22 +0200
Subject: [PATCH 06/17] Extend test case with new options.

---
 tests/plugins/font/font.js | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/plugins/font/font.js b/tests/plugins/font/font.js
index 2904d7b485f..edf7d9b741d 100644
--- a/tests/plugins/font/font.js
+++ b/tests/plugins/font/font.js
@@ -172,6 +172,43 @@
 				'<p>x<span style="font-size:12px"><em>foo</em></span><em><span style="font-size:24px">bar</span></em>x@</p>' );
 		},
 
+		// #584
+		'test remove font size from text': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p><span style="font-size:12px">[foo]</span></p>' );
+			this.assertCombo( 'FontSize', 'cke-default', false, bot, '<p>foo@</p>' );
+		},
+
+		'test remove font family from text': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p><span style="' + ffArial + '">[foo]</span></p>' );
+			this.assertCombo( 'Font', 'cke-default', false, bot, '<p>foo@</p>' );
+		},
+
+		'test remove font size partialy from text': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p><span style="font-size:24px">[foo ]bar</span></p>' );
+			this.assertCombo( 'FontSize', 'cke-default', false, bot, '<p>foo <span style="font-size:24px">bar</span>@</p>' );
+		},
+
+		'test remove font family partially from text': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p><span style="' + ffArial + '">[foo ]bar</span></p>' );
+			this.assertCombo( 'Font', 'cke-default', false, bot, '<p>foo <span style="' + ffArial + '">bar</span>@</p>' );
+		},
+
+		'test remove font size from unstyled text': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p>[foo]</p>' );
+			this.assertCombo( 'FontSize', 'cke-default', false, bot, '<p>foo@</p>' );
+		},
+
+		'test remove font family from unstyled text': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p>[foo]</p>' );
+			this.assertCombo( 'Font', 'cke-default', false, bot, '<p>foo@</p>' );
+		},
+
 		assertCombo: function( comboName, comboValue, collapsed, bot, resultHtml, callback ) {
 			bot.combo( comboName, function( combo ) {
 				combo.onClick( comboValue );

From c05ffc379bf8a03f51eeead19596d1fc09bd4eae Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 13:10:10 +0200
Subject: [PATCH 07/17] Improvement in description to manual tests.

---
 tests/plugins/font/manual/preservestyle.md | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tests/plugins/font/manual/preservestyle.md b/tests/plugins/font/manual/preservestyle.md
index 75da39de6be..de2ed1ddabf 100644
--- a/tests/plugins/font/manual/preservestyle.md
+++ b/tests/plugins/font/manual/preservestyle.md
@@ -1,13 +1,16 @@
-@bender-tags: 4.8.0, feature, tc
+@bender-tags: 4.8.0, feature, 584
 @bender-ui: collapsed
 @bender-ckeditor-plugins: wysiwygarea, toolbar, font, elementspath, sourcearea
 
 1. Select text
-1. Change `font size`
-1. Select this same text, be sure that floating panel has selected previously chosen option
-1. Select this same option once again
-1. Repeat those steps for the `font name`.
+1. Change `font size`, (e.g. `24`)
+1. Select this same text. So size on list has selected proper option.
+1. Select this same size once again (e.g. `24`)
+1. Text should preserve proper font size.
+1. Now select option `(Default)` to reset font size.
+1. Font size should reset to default one and `<span>` with font size style should disappear.
+1. Repeat those same steps for the `font name`.
 
-**Expected:** Font size/name will remain this same. It still will be marked on dropdown menu and applied to selected text.
+**Expected:** Choosen font size/name will remain this same, after click into it. It still will be marked on dropdown menu and text preserve chosen style after reapplying it multiple times.
 
-**Unexpected:** Font size/name will be deselct and style dissapear from the text.
+**Unexpected:** Font size/name will be deselct and style dissapear from the text when clicked 2nd time.

From eb881a25ae30f5137bd9a5e2575f2061799f5eaa Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 13:28:03 +0200
Subject: [PATCH 08/17] Add  to common lang file.

---
 lang/af.js      | 4 +++-
 lang/ar.js      | 4 +++-
 lang/az.js      | 4 +++-
 lang/bg.js      | 4 +++-
 lang/bn.js      | 4 +++-
 lang/bs.js      | 4 +++-
 lang/ca.js      | 4 +++-
 lang/cs.js      | 4 +++-
 lang/cy.js      | 4 +++-
 lang/da.js      | 4 +++-
 lang/de-ch.js   | 4 +++-
 lang/de.js      | 4 +++-
 lang/el.js      | 4 +++-
 lang/en-au.js   | 4 +++-
 lang/en-ca.js   | 4 +++-
 lang/en-gb.js   | 4 +++-
 lang/en.js      | 4 +++-
 lang/eo.js      | 4 +++-
 lang/es-mx.js   | 8 ++++++--
 lang/es.js      | 4 +++-
 lang/et.js      | 4 +++-
 lang/eu.js      | 4 +++-
 lang/fa.js      | 4 +++-
 lang/fi.js      | 4 +++-
 lang/fo.js      | 4 +++-
 lang/fr-ca.js   | 4 +++-
 lang/fr.js      | 4 +++-
 lang/gl.js      | 4 +++-
 lang/gu.js      | 4 +++-
 lang/he.js      | 4 +++-
 lang/hi.js      | 4 +++-
 lang/hr.js      | 4 +++-
 lang/hu.js      | 4 +++-
 lang/id.js      | 4 +++-
 lang/is.js      | 4 +++-
 lang/it.js      | 4 +++-
 lang/ja.js      | 4 +++-
 lang/ka.js      | 4 +++-
 lang/km.js      | 4 +++-
 lang/ko.js      | 4 +++-
 lang/ku.js      | 4 +++-
 lang/lt.js      | 4 +++-
 lang/lv.js      | 4 +++-
 lang/mk.js      | 4 +++-
 lang/mn.js      | 4 +++-
 lang/ms.js      | 4 +++-
 lang/nb.js      | 4 +++-
 lang/nl.js      | 4 +++-
 lang/no.js      | 4 +++-
 lang/oc.js      | 4 +++-
 lang/pl.js      | 4 +++-
 lang/pt-br.js   | 4 +++-
 lang/pt.js      | 4 +++-
 lang/ro.js      | 4 +++-
 lang/ru.js      | 4 +++-
 lang/si.js      | 4 +++-
 lang/sk.js      | 4 +++-
 lang/sl.js      | 4 +++-
 lang/sq.js      | 4 +++-
 lang/sr-latn.js | 4 +++-
 lang/sr.js      | 4 +++-
 lang/sv.js      | 4 +++-
 lang/th.js      | 4 +++-
 lang/tr.js      | 4 +++-
 lang/tt.js      | 4 +++-
 lang/ug.js      | 4 +++-
 lang/uk.js      | 4 +++-
 lang/vi.js      | 4 +++-
 lang/zh-cn.js   | 4 +++-
 lang/zh.js      | 4 +++-
 70 files changed, 213 insertions(+), 71 deletions(-)

diff --git a/lang/af.js b/lang/af.js
index ea941be8251..877e78065d5 100644
--- a/lang/af.js
+++ b/lang/af.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'af' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Sleutel kombenasie'
+		keyboardShortcut: 'Sleutel kombenasie',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ar.js b/lang/ar.js
index 1412f228da0..6569670b5f5 100644
--- a/lang/ar.js
+++ b/lang/ar.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ar' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/az.js b/lang/az.js
index 796fec797e5..3192c1b0fed 100644
--- a/lang/az.js
+++ b/lang/az.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'az' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Qısayol düymələri'
+		keyboardShortcut: 'Qısayol düymələri',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/bg.js b/lang/bg.js
index 84a1d55afaa..0919d0f484f 100644
--- a/lang/bg.js
+++ b/lang/bg.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'bg' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/bn.js b/lang/bn.js
index 9c6e69b7a32..6d8b0c2086c 100644
--- a/lang/bn.js
+++ b/lang/bn.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'bn' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/bs.js b/lang/bs.js
index f214df8b2f8..74a7ff1ce79 100644
--- a/lang/bs.js
+++ b/lang/bs.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'bs' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ca.js b/lang/ca.js
index 5ca9450abb4..f68fc4cecc4 100644
--- a/lang/ca.js
+++ b/lang/ca.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ca' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/cs.js b/lang/cs.js
index b5cf2269097..64aa7d5874f 100644
--- a/lang/cs.js
+++ b/lang/cs.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'cs' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Klávesová zkratka'
+		keyboardShortcut: 'Klávesová zkratka',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/cy.js b/lang/cy.js
index 3f075aa0c64..c5a323de3aa 100644
--- a/lang/cy.js
+++ b/lang/cy.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'cy' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/da.js b/lang/da.js
index 9b0a63d8860..421715b4985 100644
--- a/lang/da.js
+++ b/lang/da.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'da' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Tastatur genvej'
+		keyboardShortcut: 'Tastatur genvej',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/de-ch.js b/lang/de-ch.js
index 8f9c1963602..17b65b032b1 100644
--- a/lang/de-ch.js
+++ b/lang/de-ch.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'de-ch' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/de.js b/lang/de.js
index 441179acd18..d76d5dcc9de 100644
--- a/lang/de.js
+++ b/lang/de.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'de' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Tastaturkürzel'
+		keyboardShortcut: 'Tastaturkürzel',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/el.js b/lang/el.js
index 635ce36b2e4..5fc81a51f9f 100644
--- a/lang/el.js
+++ b/lang/el.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'el' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Συντόμευση πληκτρολογίου'
+		keyboardShortcut: 'Συντόμευση πληκτρολογίου',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/en-au.js b/lang/en-au.js
index 4fc57f08054..bb91a76c659 100644
--- a/lang/en-au.js
+++ b/lang/en-au.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'en-au' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/en-ca.js b/lang/en-ca.js
index 42d1aff495f..60c59e9006e 100644
--- a/lang/en-ca.js
+++ b/lang/en-ca.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'en-ca' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/en-gb.js b/lang/en-gb.js
index 04cc61dff6a..cdfe636d305 100644
--- a/lang/en-gb.js
+++ b/lang/en-gb.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'en-gb' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/en.js b/lang/en.js
index aa509fee386..c5cccdf8f33 100644
--- a/lang/en.js
+++ b/lang/en.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'en' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut'
+		keyboardShortcut: 'Keyboard shortcut',
+
+		optionDefault: 'Default'
 	}
 };
diff --git a/lang/eo.js b/lang/eo.js
index 4ea1b8491a8..471337e984e 100644
--- a/lang/eo.js
+++ b/lang/eo.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'eo' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Fulmoklavo'
+		keyboardShortcut: 'Fulmoklavo',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/es-mx.js b/lang/es-mx.js
index 3036d9b04bf..5dfeb3aa524 100644
--- a/lang/es-mx.js
+++ b/lang/es-mx.js
@@ -3,7 +3,9 @@
  * For licensing, see LICENSE.md or http://ckeditor.com/license
  */
 
- // MISSING
+/**
+* @fileOverview 
+*/
 
 /**#@+
    @type String
@@ -109,6 +111,8 @@ CKEDITOR.lang[ 'es-mx' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Atajo de teclado'
+		keyboardShortcut: 'Atajo de teclado',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/es.js b/lang/es.js
index 40d9ae08ba6..9878a357792 100644
--- a/lang/es.js
+++ b/lang/es.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'es' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/et.js b/lang/et.js
index c98ea811df4..6810f3df5ea 100644
--- a/lang/et.js
+++ b/lang/et.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'et' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/eu.js b/lang/eu.js
index 98b92ef012d..3b664e9aa9c 100644
--- a/lang/eu.js
+++ b/lang/eu.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'eu' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/fa.js b/lang/fa.js
index 354051095de..a2690ea1363 100644
--- a/lang/fa.js
+++ b/lang/fa.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'fa' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/fi.js b/lang/fi.js
index d10adabbfcf..e55eb6ca117 100644
--- a/lang/fi.js
+++ b/lang/fi.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'fi' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/fo.js b/lang/fo.js
index 205b20f4e66..303827456a8 100644
--- a/lang/fo.js
+++ b/lang/fo.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'fo' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/fr-ca.js b/lang/fr-ca.js
index 2702f0c2124..37f6f48243c 100644
--- a/lang/fr-ca.js
+++ b/lang/fr-ca.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'fr-ca' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/fr.js b/lang/fr.js
index 5cd39b063ad..0cf78526282 100644
--- a/lang/fr.js
+++ b/lang/fr.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'fr' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Raccourci clavier'
+		keyboardShortcut: 'Raccourci clavier',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/gl.js b/lang/gl.js
index 092db98e9fe..592b593299b 100644
--- a/lang/gl.js
+++ b/lang/gl.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'gl' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Atallo de teclado'
+		keyboardShortcut: 'Atallo de teclado',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/gu.js b/lang/gu.js
index 17862d0d26f..67a2385a71b 100644
--- a/lang/gu.js
+++ b/lang/gu.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'gu' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/he.js b/lang/he.js
index 27b57bd4bc6..69c9ae124f9 100644
--- a/lang/he.js
+++ b/lang/he.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'he' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/hi.js b/lang/hi.js
index e0b29a30bf9..94888f768b6 100644
--- a/lang/hi.js
+++ b/lang/hi.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'hi' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/hr.js b/lang/hr.js
index 7bf089e2955..e1c267b4388 100644
--- a/lang/hr.js
+++ b/lang/hr.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'hr' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Prečica na tipkovnici'
+		keyboardShortcut: 'Prečica na tipkovnici',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/hu.js b/lang/hu.js
index 6f6e91eb42d..e16d84064c6 100644
--- a/lang/hu.js
+++ b/lang/hu.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'hu' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Gyorsbillentyű'
+		keyboardShortcut: 'Gyorsbillentyű',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/id.js b/lang/id.js
index 86e70760d61..8a2a3b93948 100644
--- a/lang/id.js
+++ b/lang/id.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'id' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Pintasan Keyboard'
+		keyboardShortcut: 'Pintasan Keyboard',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/is.js b/lang/is.js
index 256b6678843..ecde5db2a08 100644
--- a/lang/is.js
+++ b/lang/is.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'is' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/it.js b/lang/it.js
index 8229aad6d32..df07d3c2ce7 100644
--- a/lang/it.js
+++ b/lang/it.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'it' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Scorciatoia da tastiera'
+		keyboardShortcut: 'Scorciatoia da tastiera',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ja.js b/lang/ja.js
index 17dcefc8d18..4f83bbf05d8 100644
--- a/lang/ja.js
+++ b/lang/ja.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ja' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'キーボードショートカット'
+		keyboardShortcut: 'キーボードショートカット',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ka.js b/lang/ka.js
index 999132ee202..233eb2e5d85 100644
--- a/lang/ka.js
+++ b/lang/ka.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ka' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/km.js b/lang/km.js
index b9908d98614..7f7fc2815ff 100644
--- a/lang/km.js
+++ b/lang/km.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'km' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ko.js b/lang/ko.js
index fe575d98daa..59a51501566 100644
--- a/lang/ko.js
+++ b/lang/ko.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ko' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: '키보드 단축키'
+		keyboardShortcut: '키보드 단축키',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ku.js b/lang/ku.js
index 171059b995f..ea8efa69d81 100644
--- a/lang/ku.js
+++ b/lang/ku.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'ku' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'کورتبڕی تەختەکلیل'
+		keyboardShortcut: 'کورتبڕی تەختەکلیل',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/lt.js b/lang/lt.js
index e6d9d7fe356..61016974b3a 100644
--- a/lang/lt.js
+++ b/lang/lt.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'lt' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/lv.js b/lang/lv.js
index 1759e6c05fa..4e184aa0866 100644
--- a/lang/lv.js
+++ b/lang/lv.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'lv' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/mk.js b/lang/mk.js
index 750da116f52..93913d1d0ce 100644
--- a/lang/mk.js
+++ b/lang/mk.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'mk' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/mn.js b/lang/mn.js
index c5854a19fbd..b50677db210 100644
--- a/lang/mn.js
+++ b/lang/mn.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'mn' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ms.js b/lang/ms.js
index 764e92f692d..1a0fe8173c2 100644
--- a/lang/ms.js
+++ b/lang/ms.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ms' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/nb.js b/lang/nb.js
index e27c5820470..a02559c6509 100644
--- a/lang/nb.js
+++ b/lang/nb.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'nb' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Tastatursnarvei'
+		keyboardShortcut: 'Tastatursnarvei',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/nl.js b/lang/nl.js
index 5f1f251f2d3..482c1a3aff0 100644
--- a/lang/nl.js
+++ b/lang/nl.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'nl' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Sneltoets'
+		keyboardShortcut: 'Sneltoets',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/no.js b/lang/no.js
index 87691f9712c..3c83bc1a3aa 100644
--- a/lang/no.js
+++ b/lang/no.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'no' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/oc.js b/lang/oc.js
index a78420f3601..a387c56942d 100644
--- a/lang/oc.js
+++ b/lang/oc.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'oc' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Acorchi de clavièr'
+		keyboardShortcut: 'Acorchi de clavièr',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/pl.js b/lang/pl.js
index 3290a6b3480..d6083ae6b1c 100644
--- a/lang/pl.js
+++ b/lang/pl.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'pl' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Skrót klawiszowy'
+		keyboardShortcut: 'Skrót klawiszowy',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/pt-br.js b/lang/pt-br.js
index a6bc34fe4c4..5c941548249 100644
--- a/lang/pt-br.js
+++ b/lang/pt-br.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'pt-br' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Atalho do teclado'
+		keyboardShortcut: 'Atalho do teclado',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/pt.js b/lang/pt.js
index cfc1ced1395..b7fec75ca3d 100644
--- a/lang/pt.js
+++ b/lang/pt.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'pt' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ro.js b/lang/ro.js
index d118abaebd5..6e565c8afe6 100644
--- a/lang/ro.js
+++ b/lang/ro.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ro' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ru.js b/lang/ru.js
index 1ccc052a329..df0f5aeadb7 100644
--- a/lang/ru.js
+++ b/lang/ru.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'ru' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Комбинация клавиш'
+		keyboardShortcut: 'Комбинация клавиш',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/si.js b/lang/si.js
index df0d73457d2..7351a350418 100644
--- a/lang/si.js
+++ b/lang/si.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'si' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/sk.js b/lang/sk.js
index e473cc672e1..8d3f6c351df 100644
--- a/lang/sk.js
+++ b/lang/sk.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'sk' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Klávesová skratka'
+		keyboardShortcut: 'Klávesová skratka',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/sl.js b/lang/sl.js
index bbaa5ea3730..df75676ee6e 100644
--- a/lang/sl.js
+++ b/lang/sl.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'sl' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/sq.js b/lang/sq.js
index d5812ea5492..ad1d632bd9b 100644
--- a/lang/sq.js
+++ b/lang/sq.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'sq' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/sr-latn.js b/lang/sr-latn.js
index 9994a0ac630..03e2b8e3ce4 100644
--- a/lang/sr-latn.js
+++ b/lang/sr-latn.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'sr-latn' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/sr.js b/lang/sr.js
index 341bf7a3117..d4434ccdd41 100644
--- a/lang/sr.js
+++ b/lang/sr.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'sr' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/sv.js b/lang/sv.js
index 3074d46031b..da7c75c6e6f 100644
--- a/lang/sv.js
+++ b/lang/sv.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'sv' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Kortkommando'
+		keyboardShortcut: 'Kortkommando',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/th.js b/lang/th.js
index 6dc918ead9e..a2cb1334935 100644
--- a/lang/th.js
+++ b/lang/th.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'th' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/tr.js b/lang/tr.js
index 0cbd57cc500..83ab0279b44 100644
--- a/lang/tr.js
+++ b/lang/tr.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'tr' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Klavye Kısayolu'
+		keyboardShortcut: 'Klavye Kısayolu',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/tt.js b/lang/tt.js
index c63170bb09b..ed4b210dc62 100644
--- a/lang/tt.js
+++ b/lang/tt.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'tt' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/ug.js b/lang/ug.js
index 13a256d1d60..156efb504ff 100644
--- a/lang/ug.js
+++ b/lang/ug.js
@@ -111,6 +111,8 @@ CKEDITOR.lang[ 'ug' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/uk.js b/lang/uk.js
index 3fbc52d2d8a..179afd6c351 100644
--- a/lang/uk.js
+++ b/lang/uk.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'uk' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/vi.js b/lang/vi.js
index 45d3d30510a..0c16dfb500b 100644
--- a/lang/vi.js
+++ b/lang/vi.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'vi' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: 'Keyboard shortcut' // MISSING
+		keyboardShortcut: 'Keyboard shortcut', // MISSING
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/zh-cn.js b/lang/zh-cn.js
index b89c0c9fe8b..e81e9010288 100644
--- a/lang/zh-cn.js
+++ b/lang/zh-cn.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'zh-cn' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: '快捷键'
+		keyboardShortcut: '快捷键',
+
+		optionDefault: 'Default' // MISSING
 	}
 };
diff --git a/lang/zh.js b/lang/zh.js
index c8a0548f89c..f6ae7fe5115 100644
--- a/lang/zh.js
+++ b/lang/zh.js
@@ -112,6 +112,8 @@ CKEDITOR.lang[ 'zh' ] = {
 		},
 
 		// Prepended to ARIA labels with shortcuts.
-		keyboardShortcut: '鍵盤快捷鍵'
+		keyboardShortcut: '鍵盤快捷鍵',
+
+		optionDefault: 'Default' // MISSING
 	}
 };

From 31e1237f2b57e892483a062a07d0d3f6d160f092 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 13:33:10 +0200
Subject: [PATCH 09/17] Change fix to use common lang file.

---
 plugins/font/plugin.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/font/plugin.js b/plugins/font/plugin.js
index 7a5d253ee55..c34c87e70ae 100644
--- a/plugins/font/plugin.js
+++ b/plugins/font/plugin.js
@@ -90,7 +90,7 @@
 			init: function() {
 				var name,
 					defaultValue = 'cke-default',
-					defaultText = '(' + lang.optionDefault + ')';
+					defaultText = '(' + editor.lang.common.optionDefault + ')';
 
 				this.startGroup( lang.panelTitle );
 

From 53933d2c51dea9edafbaf8279cc149a92a2b2418 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 14:54:44 +0200
Subject: [PATCH 10/17] Fix for paragraph format.

---
 plugins/format/plugin.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/format/plugin.js b/plugins/format/plugin.js
index c0e5bd9b5f0..3d22e3dce75 100644
--- a/plugins/format/plugin.js
+++ b/plugins/format/plugin.js
@@ -64,10 +64,10 @@ CKEDITOR.plugins.add( 'format', {
 				editor.focus();
 				editor.fire( 'saveSnapshot' );
 
-				var style = styles[ value ],
-					elementPath = editor.elementPath();
+				var style = styles[ value ];
 
-				editor[ style.checkActive( elementPath, editor ) ? 'removeStyle' : 'applyStyle' ]( style );
+				// Always aply style, do not allow on toggle it by clicking on list item (#584).
+				editor.applyStyle( style );
 
 				// Save the undo snapshot after all changes are affected. (http://dev.ckeditor.com/ticket/4899)
 				setTimeout( function() {

From 28e5575cf3758eb626472a79c13c983ec0cd71d4 Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 15:20:10 +0200
Subject: [PATCH 11/17] Add unit and manual tests to format menu.

---
 .../manual/preserveformatafterclick.html      |  7 +++++
 .../format/manual/preserveformatafterclick.md | 10 +++++++
 tests/plugins/format/plugin.js                | 26 ++++++++++++++++++-
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 tests/plugins/format/manual/preserveformatafterclick.html
 create mode 100644 tests/plugins/format/manual/preserveformatafterclick.md

diff --git a/tests/plugins/format/manual/preserveformatafterclick.html b/tests/plugins/format/manual/preserveformatafterclick.html
new file mode 100644
index 00000000000..bcb8886361e
--- /dev/null
+++ b/tests/plugins/format/manual/preserveformatafterclick.html
@@ -0,0 +1,7 @@
+<textarea name="ed" id="editor" cols="30" rows="10">
+	Hello world
+</textarea>
+
+<script>
+	CKEDITOR.replace( 'editor' );
+</script>
diff --git a/tests/plugins/format/manual/preserveformatafterclick.md b/tests/plugins/format/manual/preserveformatafterclick.md
new file mode 100644
index 00000000000..d9036b8f167
--- /dev/null
+++ b/tests/plugins/format/manual/preserveformatafterclick.md
@@ -0,0 +1,10 @@
+@bender-tags: 4.8.0, feature, 584
+@bender-ui: collapsed
+@bender-ckeditor-plugins: wysiwygarea, toolbar, format, elementspath, sourcearea
+
+1. Select text
+1. Try to apply multiple times this same format to one selection (different than normal).
+
+**Expected:** Choosen format should remain this same all the time.
+
+**Unexpected:** Text format toggle between styled and unstyled (Normal) one.
diff --git a/tests/plugins/format/plugin.js b/tests/plugins/format/plugin.js
index 1c02918ff8e..0755054b717 100644
--- a/tests/plugins/format/plugin.js
+++ b/tests/plugins/format/plugin.js
@@ -25,5 +25,29 @@ bender.test( {
 		bot.setHtmlWithSelection( '<fieldset><legend>^foo</legend><form>bar</form></fieldset>' );
 		var name = 'Format', combo = ed.ui.get( name );
 		assert.areSame( CKEDITOR.TRISTATE_DISABLED, combo._.state, 'check state disabled when not in context' );
+	},
+
+	// Drop down format menu should not have possibility to toggle option (#584).
+	'test apply format style twice': function() {
+		var bot = this.editorBot,
+			editor = this.editor,
+			name = 'Format',
+			combo = editor.ui.get( name );
+
+		bot.setHtmlWithSelection( '<p>^foo</p>' );
+		// apply format 1st time
+		assert.areSame( CKEDITOR.TRISTATE_OFF, combo._.state, 'check state OFF' );
+		bot.combo( name, function( combo ) {
+			assert.areSame( CKEDITOR.TRISTATE_ON, combo._.state, 'check state ON when opened' );
+			combo.onClick( 'h1' );
+			assert.areSame( '<h1>^foo</h1>', bot.htmlWithSelection(), 'applied h1 block style' );
+			// apply format 2nd time
+			bot.combo( name, function( combo ) {
+				assert.areSame( CKEDITOR.TRISTATE_ON, combo._.state, 'check state ON when opened' );
+				combo.onClick( 'h1' );
+				assert.areSame( '<h1>^foo</h1>', bot.htmlWithSelection(), 'applied h1 block style' );
+			} );
+		} );
 	}
-} );
\ No newline at end of file
+
+} );

From cdf19ac2337af0c75f0f412744ed9270b076c69b Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 6 Jul 2017 15:26:33 +0200
Subject: [PATCH 12/17] Little cosmetic change with removing unecessary
 comments.

---
 plugins/font/plugin.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/plugins/font/plugin.js b/plugins/font/plugin.js
index c34c87e70ae..e177bd4b125 100644
--- a/plugins/font/plugin.js
+++ b/plugins/font/plugin.js
@@ -5,7 +5,6 @@
 
 ( function() {
 	function addCombo( editor, comboName, styleType, lang, entries, defaultLabel, styleDefinition, order ) {
-		// debugger;
 		var config = editor.config,
 			style = new CKEDITOR.style( styleDefinition );
 
@@ -94,7 +93,7 @@
 
 				this.startGroup( lang.panelTitle );
 
-				// Add (default) option as first element on the list.
+				// Add `(Default)` item as first element on the drop down list.
 				this.add( defaultValue, defaultText, defaultText );
 
 				for ( var i = 0; i < names.length; i++ ) {

From 65cc8f676032c4f2593a66e2bedb5e061916750d Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Thu, 13 Jul 2017 11:55:28 +0200
Subject: [PATCH 13/17] Fixings after review.

---
 dev/langtool/meta/ckeditor.core/meta.txt   |  1 +
 plugins/font/plugin.js                     | 11 +++---
 plugins/format/plugin.js                   |  9 +++--
 tests/plugins/font/font.js                 | 46 ++++++++++++++++++----
 tests/plugins/font/manual/preservestyle.md |  6 +--
 5 files changed, 54 insertions(+), 19 deletions(-)

diff --git a/dev/langtool/meta/ckeditor.core/meta.txt b/dev/langtool/meta/ckeditor.core/meta.txt
index 8781f771a31..e336992f697 100644
--- a/dev/langtool/meta/ckeditor.core/meta.txt
+++ b/dev/langtool/meta/ckeditor.core/meta.txt
@@ -81,3 +81,4 @@ common.keyboard.36 = Label for the "Home" key.
 common.keyboard.46 = Label for the "Delete" key.
 common.keyboard.224 = Label for the "Command" key.
 common.keyboardShortcut = ARIA message for keyboard shortcuts.
+common.optionDefault = "(Default)" option for drop-down menues of text styling, which removes specific style.
diff --git a/plugins/font/plugin.js b/plugins/font/plugin.js
index e177bd4b125..7738d310fb5 100644
--- a/plugins/font/plugin.js
+++ b/plugins/font/plugin.js
@@ -36,6 +36,7 @@
 			label: lang.label,
 			title: lang.panelTitle,
 			toolbar: 'styles,' + order,
+			defaultValue: 'cke-default',
 			allowedContent: style,
 			requiredContent: style,
 			contentTransformations: [
@@ -88,13 +89,12 @@
 
 			init: function() {
 				var name,
-					defaultValue = 'cke-default',
 					defaultText = '(' + editor.lang.common.optionDefault + ')';
 
 				this.startGroup( lang.panelTitle );
 
-				// Add `(Default)` item as first element on the drop down list.
-				this.add( defaultValue, defaultText, defaultText );
+				// Add `(Default)` item as a first element on the drop down list.
+				this.add( this.defaultValue, defaultText, defaultText );
 
 				for ( var i = 0; i < names.length; i++ ) {
 					name = names[ i ];
@@ -116,8 +116,7 @@
 					startBoundary,
 					endBoundary,
 					node,
-					bm,
-					defaultValue = 'cke-default';
+					bm;
 
 				// When applying one style over another, first remove the previous one (http://dev.ckeditor.com/ticket/12403).
 				// NOTE: This is only a temporary fix. It will be moved to the styles system (http://dev.ckeditor.com/ticket/12687).
@@ -171,7 +170,7 @@
 					}
 				}
 
-				if ( value === defaultValue ) {
+				if ( value === this.defaultValue ) {
 					if ( previousStyle ) {
 						editor.removeStyle( previousStyle );
 					}
diff --git a/plugins/format/plugin.js b/plugins/format/plugin.js
index 3d22e3dce75..56b7de93be1 100644
--- a/plugins/format/plugin.js
+++ b/plugins/format/plugin.js
@@ -64,10 +64,13 @@ CKEDITOR.plugins.add( 'format', {
 				editor.focus();
 				editor.fire( 'saveSnapshot' );
 
-				var style = styles[ value ];
+				var style = styles[ value ],
+					elementPath = editor.elementPath();
 
-				// Always aply style, do not allow on toggle it by clicking on list item (#584).
-				editor.applyStyle( style );
+				// Always apply style, do not allow on toggle it by clicking on list item (#584).
+				if ( !style.checkActive( elementPath, editor ) ) {
+					editor.applyStyle( style );
+				}
 
 				// Save the undo snapshot after all changes are affected. (http://dev.ckeditor.com/ticket/4899)
 				setTimeout( function() {
diff --git a/tests/plugins/font/font.js b/tests/plugins/font/font.js
index edf7d9b741d..6835d2883f8 100644
--- a/tests/plugins/font/font.js
+++ b/tests/plugins/font/font.js
@@ -23,6 +23,19 @@
 			}
 		},
 
+		assertCombo: function( comboName, comboValue, collapsed, bot, resultHtml, callback ) {
+			bot.combo( comboName, function( combo ) {
+				combo.onClick( comboValue );
+
+				this.wait( function() {
+					// The empty span from collapsed selection is lost on FF and IE8, insert something to prevent that.
+					collapsed && bot.editor.insertText( 'bar' );
+					assert.isInnerHtmlMatching( resultHtml, bot.editor.editable().getHtml(), htmlMatchingOpts );
+					callback && callback( bot );
+				}, 0 );
+			} );
+		},
+
 		'test apply font size (collapsed selection)': function() {
 			var bot = this.editorBot,
 				editor = this.editor;
@@ -209,17 +222,36 @@
 			this.assertCombo( 'Font', 'cke-default', false, bot, '<p>foo@</p>' );
 		},
 
-		assertCombo: function( comboName, comboValue, collapsed, bot, resultHtml, callback ) {
-			bot.combo( comboName, function( combo ) {
-				combo.onClick( comboValue );
+		'test reaaply this same font size twice': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p>[foo]</p>' );
 
+			bot.combo( 'FontSize', function( combo ) {
+				combo.onClick( 24 );
 				this.wait( function() {
-					// The empty span from collapsed selection is lost on FF and IE8, insert something to prevent that.
-					collapsed && bot.editor.insertText( 'bar' );
-					assert.isInnerHtmlMatching( resultHtml, bot.editor.editable().getHtml(), htmlMatchingOpts );
-					callback && callback( bot );
+					combo.onClick( 24 );
+					this.wait( function() {
+						assert.isInnerHtmlMatching( '<p><span style="font-size:24px">foo</span>@</p>', bot.editor.editable().getHtml(), htmlMatchingOpts );
+					}, 0 );
+				}, 0 );
+			} );
+
+		},
+
+		'test reaaply this same font family twice': function() {
+			var bot = this.editorBot;
+			bender.tools.selection.setWithHtml( bot.editor, '<p>[foo]</p>' );
+
+			bot.combo( 'Font', function( combo ) {
+				combo.onClick( 'Arial' );
+				this.wait( function() {
+					combo.onClick( 'Arial' );
+					this.wait( function() {
+						assert.isInnerHtmlMatching( '<p><span style="' + ffArial + '">foo</span>@</p>', bot.editor.editable().getHtml(), htmlMatchingOpts );
+					}, 0 );
 				}, 0 );
 			} );
 		}
+
 	} );
 } )();
diff --git a/tests/plugins/font/manual/preservestyle.md b/tests/plugins/font/manual/preservestyle.md
index de2ed1ddabf..74a064147da 100644
--- a/tests/plugins/font/manual/preservestyle.md
+++ b/tests/plugins/font/manual/preservestyle.md
@@ -2,10 +2,10 @@
 @bender-ui: collapsed
 @bender-ckeditor-plugins: wysiwygarea, toolbar, font, elementspath, sourcearea
 
-1. Select text
-1. Change `font size`, (e.g. `24`)
+1. Select some text.
+1. Change `font size`, (e.g. `24`).
 1. Select this same text. So size on list has selected proper option.
-1. Select this same size once again (e.g. `24`)
+1. Select this same size once again (e.g. `24`).
 1. Text should preserve proper font size.
 1. Now select option `(Default)` to reset font size.
 1. Font size should reset to default one and `<span>` with font size style should disappear.

From 5f8f47dd036192fc4144a5a9af43e3e6bbfcb8dd Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Wed, 26 Jul 2017 09:58:41 +0200
Subject: [PATCH 14/17] Another review fix pack

---
 dev/langtool/meta/ckeditor.core/meta.txt      |  2 +-
 plugins/font/plugin.js                        |  2 +-
 tests/plugins/font/font.js                    |  4 ++--
 tests/plugins/font/manual/preservestyle.md    | 19 +++++++++--------
 .../format/manual/preserveformatafterclick.md |  8 +++----
 tests/plugins/format/plugin.js                | 21 +++++++------------
 6 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/dev/langtool/meta/ckeditor.core/meta.txt b/dev/langtool/meta/ckeditor.core/meta.txt
index e336992f697..19f6b3e01ea 100644
--- a/dev/langtool/meta/ckeditor.core/meta.txt
+++ b/dev/langtool/meta/ckeditor.core/meta.txt
@@ -81,4 +81,4 @@ common.keyboard.36 = Label for the "Home" key.
 common.keyboard.46 = Label for the "Delete" key.
 common.keyboard.224 = Label for the "Command" key.
 common.keyboardShortcut = ARIA message for keyboard shortcuts.
-common.optionDefault = "(Default)" option for drop-down menues of text styling, which removes specific style.
+common.optionDefault = Label for "(Default)" option in drop-down text-styling menus. Using such option restores default styling.
diff --git a/plugins/font/plugin.js b/plugins/font/plugin.js
index 7738d310fb5..9bd745ffc2c 100644
--- a/plugins/font/plugin.js
+++ b/plugins/font/plugin.js
@@ -93,7 +93,7 @@
 
 				this.startGroup( lang.panelTitle );
 
-				// Add `(Default)` item as a first element on the drop down list.
+				// Add `(Default)` item as a first element on the drop-down list.
 				this.add( this.defaultValue, defaultText, defaultText );
 
 				for ( var i = 0; i < names.length; i++ ) {
diff --git a/tests/plugins/font/font.js b/tests/plugins/font/font.js
index 6835d2883f8..0327858caac 100644
--- a/tests/plugins/font/font.js
+++ b/tests/plugins/font/font.js
@@ -222,7 +222,7 @@
 			this.assertCombo( 'Font', 'cke-default', false, bot, '<p>foo@</p>' );
 		},
 
-		'test reaaply this same font size twice': function() {
+		'test reapply this same font size twice': function() {
 			var bot = this.editorBot;
 			bender.tools.selection.setWithHtml( bot.editor, '<p>[foo]</p>' );
 
@@ -238,7 +238,7 @@
 
 		},
 
-		'test reaaply this same font family twice': function() {
+		'test reapply this same font family twice': function() {
 			var bot = this.editorBot;
 			bender.tools.selection.setWithHtml( bot.editor, '<p>[foo]</p>' );
 
diff --git a/tests/plugins/font/manual/preservestyle.md b/tests/plugins/font/manual/preservestyle.md
index 74a064147da..29e884d5915 100644
--- a/tests/plugins/font/manual/preservestyle.md
+++ b/tests/plugins/font/manual/preservestyle.md
@@ -2,15 +2,16 @@
 @bender-ui: collapsed
 @bender-ckeditor-plugins: wysiwygarea, toolbar, font, elementspath, sourcearea
 
+Note: Perform below scenario for both `Font size` and `Font family` drop-downs.
+----
+
 1. Select some text.
-1. Change `font size`, (e.g. `24`).
-1. Select this same text. So size on list has selected proper option.
+1. Change `Font size` (e.g. `24`).
+1. Select this same text.
+  * `Font size` drop-down shows size selected in a previous step.
 1. Select this same size once again (e.g. `24`).
-1. Text should preserve proper font size.
-1. Now select option `(Default)` to reset font size.
-1. Font size should reset to default one and `<span>` with font size style should disappear.
-1. Repeat those same steps for the `font name`.
-
-**Expected:** Choosen font size/name will remain this same, after click into it. It still will be marked on dropdown menu and text preserve chosen style after reapplying it multiple times.
+  * Selected text should preserve its font size.
+1. Select option `(Default)` to reset the `Font size`.
+  * `Font size` should reset to default one and `<span>` element with `Font size` style should disappear.
 
-**Unexpected:** Font size/name will be deselct and style dissapear from the text when clicked 2nd time.
+**Expected:** Choosen font size/name will remain the same, after click on its corresponding item in the drop-down menu. The item will remain marked as active. Selected text preserves chosen style after reapplying it multiple times.
diff --git a/tests/plugins/format/manual/preserveformatafterclick.md b/tests/plugins/format/manual/preserveformatafterclick.md
index d9036b8f167..2649c884127 100644
--- a/tests/plugins/format/manual/preserveformatafterclick.md
+++ b/tests/plugins/format/manual/preserveformatafterclick.md
@@ -2,9 +2,9 @@
 @bender-ui: collapsed
 @bender-ckeditor-plugins: wysiwygarea, toolbar, format, elementspath, sourcearea
 
-1. Select text
-1. Try to apply multiple times this same format to one selection (different than normal).
+1. Select text.
+1. Try to apply same format (other than Normal) multiple times.
 
-**Expected:** Choosen format should remain this same all the time.
+**Expected:** Choosen format should remain the same all the time.
 
-**Unexpected:** Text format toggle between styled and unstyled (Normal) one.
+**Unexpected:** Text format toggles between styled and unstyled (Normal) one.
diff --git a/tests/plugins/format/plugin.js b/tests/plugins/format/plugin.js
index 0755054b717..ee7ed9da386 100644
--- a/tests/plugins/format/plugin.js
+++ b/tests/plugins/format/plugin.js
@@ -27,26 +27,21 @@ bender.test( {
 		assert.areSame( CKEDITOR.TRISTATE_DISABLED, combo._.state, 'check state disabled when not in context' );
 	},
 
-	// Drop down format menu should not have possibility to toggle option (#584).
-	'test apply format style twice': function() {
+	// Drop-down format menu should not be toggleable (#584).
+	'test apply format style to preformated text': function() {
 		var bot = this.editorBot,
 			editor = this.editor,
 			name = 'Format',
 			combo = editor.ui.get( name );
 
-		bot.setHtmlWithSelection( '<p>^foo</p>' );
-		// apply format 1st time
-		assert.areSame( CKEDITOR.TRISTATE_OFF, combo._.state, 'check state OFF' );
+		bot.setHtmlWithSelection( '<h1>f^oo</h1>' );
+
+		// Apply the same style format to element already styled.
+		assert.areSame( CKEDITOR.TRISTATE_OFF, combo.getState(), 'check state OFF' );
 		bot.combo( name, function( combo ) {
-			assert.areSame( CKEDITOR.TRISTATE_ON, combo._.state, 'check state ON when opened' );
+			assert.areSame( CKEDITOR.TRISTATE_ON, combo.getState(), 'check state ON when opened' );
 			combo.onClick( 'h1' );
-			assert.areSame( '<h1>^foo</h1>', bot.htmlWithSelection(), 'applied h1 block style' );
-			// apply format 2nd time
-			bot.combo( name, function( combo ) {
-				assert.areSame( CKEDITOR.TRISTATE_ON, combo._.state, 'check state ON when opened' );
-				combo.onClick( 'h1' );
-				assert.areSame( '<h1>^foo</h1>', bot.htmlWithSelection(), 'applied h1 block style' );
-			} );
+			assert.areSame( '<h1>f^oo</h1>', bot.htmlWithSelection(), 'applied h1 block style' );
 		} );
 	}
 

From ef160fa672a1fe04d416c6c731c1c77c3d3db54e Mon Sep 17 00:00:00 2001
From: Mateusz Samsel <m.samsel@cksource.com>
Date: Fri, 28 Jul 2017 11:53:47 +0200
Subject: [PATCH 15/17] Review fixes

---
 plugins/format/plugin.js       |  2 +-
 tests/plugins/font/font.js     |  4 ++--
 tests/plugins/format/plugin.js | 13 ++++---------
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/plugins/format/plugin.js b/plugins/format/plugin.js
index 56b7de93be1..c1fcb6155a2 100644
--- a/plugins/format/plugin.js
+++ b/plugins/format/plugin.js
@@ -67,7 +67,7 @@ CKEDITOR.plugins.add( 'format', {
 				var style = styles[ value ],
 					elementPath = editor.elementPath();
 
-				// Always apply style, do not allow on toggle it by clicking on list item (#584).
+				// Always apply style, do not allow to toggle it by clicking on corresponding list item (#584).
 				if ( !style.checkActive( elementPath, editor ) ) {
 					editor.applyStyle( style );
 				}
diff --git a/tests/plugins/font/font.js b/tests/plugins/font/font.js
index 0327858caac..1f03a08ec94 100644
--- a/tests/plugins/font/font.js
+++ b/tests/plugins/font/font.js
@@ -48,8 +48,8 @@
 
 				this.wait( function() {
 					// Click again to exit the style.
-					// Since 4.8.0 2nd click into this same menu item do not unselect it.
-					// It is required to click into '(Default)' option to reset style (#584).
+					// Since 4.8.0, 2nd click on the same menu item does not unselect it.
+					// It is required to click on the '(Default)' option to reset style (#584).
 					bot.combo( 'FontSize', function( combo ) {
 						combo.onClick( 'cke-default' );
 						this.wait( function() {
diff --git a/tests/plugins/format/plugin.js b/tests/plugins/format/plugin.js
index ee7ed9da386..8898bc7173b 100644
--- a/tests/plugins/format/plugin.js
+++ b/tests/plugins/format/plugin.js
@@ -29,19 +29,14 @@ bender.test( {
 
 	// Drop-down format menu should not be toggleable (#584).
 	'test apply format style to preformated text': function() {
-		var bot = this.editorBot,
-			editor = this.editor,
-			name = 'Format',
-			combo = editor.ui.get( name );
+		var bot = this.editorBot;
 
 		bot.setHtmlWithSelection( '<h1>f^oo</h1>' );
 
-		// Apply the same style format to element already styled.
-		assert.areSame( CKEDITOR.TRISTATE_OFF, combo.getState(), 'check state OFF' );
-		bot.combo( name, function( combo ) {
-			assert.areSame( CKEDITOR.TRISTATE_ON, combo.getState(), 'check state ON when opened' );
+		// Preserved h1 block style.
+		bot.combo( 'Format', function( combo ) {
 			combo.onClick( 'h1' );
-			assert.areSame( '<h1>f^oo</h1>', bot.htmlWithSelection(), 'applied h1 block style' );
+			assert.areSame( '<h1>f^oo</h1>', bot.htmlWithSelection() );
 		} );
 	}
 

From 7d08d09751514f5d93c8293b8f24f2f4df8c3237 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krzysztof=20Krzto=C5=84?= <k.krzton@cksource.com>
Date: Mon, 31 Jul 2017 08:24:41 +0200
Subject: [PATCH 16/17] Fix spacing.

---
 tests/plugins/font/manual/preservestyle.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/plugins/font/manual/preservestyle.md b/tests/plugins/font/manual/preservestyle.md
index 29e884d5915..64c72984175 100644
--- a/tests/plugins/font/manual/preservestyle.md
+++ b/tests/plugins/font/manual/preservestyle.md
@@ -3,6 +3,7 @@
 @bender-ckeditor-plugins: wysiwygarea, toolbar, font, elementspath, sourcearea
 
 Note: Perform below scenario for both `Font size` and `Font family` drop-downs.
+
 ----
 
 1. Select some text.

From 18cb9266b74bbfe153cb01b7ce8e2127b29b9e20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krzysztof=20Krzto=C5=84?= <k.krzton@cksource.com>
Date: Mon, 31 Jul 2017 09:47:45 +0200
Subject: [PATCH 17/17] Changelog entry. [skip ci]

---
 CHANGES.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGES.md b/CHANGES.md
index 4d217c543fa..e74996fea59 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,6 +6,7 @@
 New Features:
 
 * [#607](https://github.com/ckeditor/ckeditor-dev/issues/607): Manually inserted hex color is prefixed with hash tag if needed. It ensures a valid hex color is used when setting table cell border or background color via [Color Dialog](http://ckeditor.com/addon/colordialog) window.
+* [#584](https://github.com/ckeditor/ckeditor-dev/issues/584): [Font size and Family](http://ckeditor.com/addon/font) and [Format](http://ckeditor.com/addon/format) drop-downs are not toggleable anymore. Default option to reset styles added.
 
 ## CKEditor 4.7.1