qooxdoo / qooxdoo

qooxdoo - Universal JavaScript Framework
http://qooxdoo.org
Other
769 stars 262 forks source link

Wrong computation of embedded widget's width. #9858

Open ertmnv opened 4 years ago

ertmnv commented 4 years ago

When we try to embed widget on site which contains something like this:

body * { font-family: "SomeFont" !important; } we get incorrect width for qx.ui.basic.Label.

it is caused by following snippet from qooxdoo/framework/source/class/qx/bom/Label.js:

__measureSize : function(element, styles)
{
  // sync styles
  var keys = this.__styles;

  if (!styles) {
    styles = {};
  }

  for (var key in keys) {
    element.style[key] = styles[key] || "";
  }

  // detect size
  var size = qx.bom.element.Dimension.getSize(element);

  // all modern browser are needing one more pixel for width
  size.width++;

  return size;
}

when we set style for element in snippet specified above, we don't specify value which is being set as important. So specified properties can be override.

goldim commented 1 year ago

@ertmnv Is it still actual for you? Could you submit a PR for the problem?