Преглед изворни кода

Fix output of undefined value for margin.

Maciej Gołaszewski пре 6 година
родитељ
комит
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;
 
 	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' );