Kaynağa Gözat

Fix output of undefined value for margin.

Maciej Gołaszewski 6 yıl önce
ebeveyn
işleme
d145d894da
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  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;
 
 	if ( top === left && left === bottom && bottom === right ) {
+		// Might be not set.
+		if ( top === undefined ) {
+			return '';
+		}
+
 		return ( strict ? '' : styleShorthand + ':' ) + top;
 	} else if ( ![ top, right, left, bottom ].every( value => !!value ) ) {
 		return printSingleValues( { top, right, bottom, left }, 'margin' );