8
0
Просмотр исходного кода

Fix output of undefined value for margin.

Maciej Gołaszewski 6 лет назад
Родитель
Сommit
d145d894da
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      packages/ckeditor5-engine/src/view/styles.js

+ 5 - 0
packages/ckeditor5-engine/src/view/styles.js

@@ -326,6 +326,11 @@ function outputShorthandableValue( styleObject, strict, styleShorthand ) {
 	const { top, right, bottom, left } = styleObject;
 	const { top, right, bottom, left } = styleObject;
 
 
 	if ( top === left && left === bottom && bottom === right ) {
 	if ( top === left && left === bottom && bottom === right ) {
+		// Might be not set.
+		if ( top === undefined ) {
+			return '';
+		}
+
 		return ( strict ? '' : styleShorthand + ':' ) + top;
 		return ( strict ? '' : styleShorthand + ':' ) + top;
 	} else if ( ![ top, right, left, bottom ].every( value => !!value ) ) {
 	} else if ( ![ top, right, left, bottom ].every( value => !!value ) ) {
 		return printSingleValues( { top, right, bottom, left }, 'margin' );
 		return printSingleValues( { top, right, bottom, left }, 'margin' );