Get the desired width for the container element.  This is
derived first from option `width` passed to select2, then
the inline 'style' on the original element, and finally
falls back to the jQuery calculated element width.
 abstract
518200
function () {
            function resolveContainerWidth() {
                var style, attrs, matches, i, l;

                if (this.opts.width === "off") {
                    return null;
                } else if (this.opts.width === "element"){
                    return this.opts.element.outerWidth() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px';
                } else if (this.opts.width === "copy" || this.opts.width === "resolve") {
                    // check if there is inline style on the element that contains width
                    style = this.opts.element.attr('style');
                    if (style !== undefined) {
                        attrs = style.split(';');
                        for (i = 0, l = attrs.length; i < l; i = i + 1) {
                            matches = attrs[i].replace(/\s/g, '')
                                .match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);
                            if (matches !== null && matches.length >= 1)
                                return matches[1];
                        }
                    }

                    if (this.opts.width === "resolve") {
                        // next check if css('width') can resolve a width that is percent based, this is sometimes possible
                        // when attached to input type=hidden or elements hidden via css
                        style = this.opts.element.css('width');
                        if (style.indexOf("%") > 0) return style;

                        // finally, fallback on the calculated width of the element
                        return (this.opts.element.outerWidth() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px');
                    }

                    return null;
                } else if ($.isFunction(this.opts.width)) {
                    return this.opts.width();
                } else {
                    return this.opts.width;
               }
            };

            var width = resolveContainerWidth.call(this);
            if (width !== null) {
                this.container.attr("style", "width: "+width);
            }
        }
282803
function(element) {
        if(!element) return;

        var children = element.children();
        if(children.length <= 0) return;

        var totalWidth = 0;
        for(var i = 0; i < children.length; i++) {
            totalWidth += $(children[i]).width();
        }

        element.width(totalWidth);
    }
770414
function recalculateWidths(tableGrid, widths) {
        var allCells = tableGrid.getAllCells();
        return Tools.map(allCells, function (cell) {
          var width = total(cell.colIndex, cell.colIndex + cell.colspan, widths);
          return {
            element: cell.element,
            width: width,
            colspan: cell.colspan
          };
        });
      }
679132
def get_col_width(self, col, tab):
        """"""

        try:
            return self.col_widths[(col, tab)]

        except KeyError:
            return config["default_col_width"]
998961
function() {
		//this.el.content_item = document.getElementById(this._el.content_item.id);
		this._el.content_item.style.height = TL.Util.ratio.r16_9({w:this.options.width}) + "px";
		this._el.content_item.style.width = this.options.width + "px";
	}
332019
def _get_fld2col_widths(self, **kws):
        """"""
        fld2col_widths = self._init_fld2col_widths()
        if 'fld2col_widths' not in kws:
            return fld2col_widths
        for fld, val in kws['fld2col_widths'].items():
            fld2col_widths[fld] = val
        return fld2col_widths
1230893
def _size_columns(self, container):
        
        def calculate_column_widths(max_cell_width):
            """Calculate required column widths given a maximum cell width"""
            def cell_content_width(cell):
                buffer = VirtualContainer(container, width=max_cell_width)
                width, _, _ = cell.flow(buffer, None)
                return float(width)

            widths = [0] * self.body.num_columns
            for row in chain(self.head or [], self.body):
                for cell in (cell for cell in row if cell.colspan == 1):
                    col = int(cell.column_index)
                    widths[col] = max(widths[col], cell_content_width(cell))
            for row in chain(self.head or [], self.body):
                for cell in (cell for cell in row if cell.colspan > 1):
                    c = int(cell.column_index)
                    c_end = c + cell.colspan
                    padding = cell_content_width(cell) - sum(widths[c:c_end])
                    if padding > 0:
                        per_column_padding = padding / cell.colspan
                        for i in range(cell.colspan):
                            widths[c + i] += per_column_padding
            return widths

        width = self._width(container)
        try:
            fixed_width = width.to_points(container.width)
        except AttributeError:
            fixed_width = width or FlowableWidth.AUTO
        min_column_widths = calculate_column_widths(0)
        max_column_widths = calculate_column_widths(float('+inf'))

        # calculate relative column widths for auto-sized columns
        auto_rel_colwidths = [sqrt(minimum * maximum) for minimum, maximum
                              in zip(min_column_widths, max_column_widths)]
        column_widths = self.column_widths or [None for _ in max_column_widths]
        try:          # TODO: max() instead of min()?
            relative_factor = min(auto_relative_width / width
                                  for width, auto_relative_width
                                  in zip(column_widths, auto_rel_colwidths)
                                  if width and not isinstance(width, DimBase))
        except ValueError:
            relative_factor = 1
        column_widths = [auto_relative_width * relative_factor
                         if width is None else width
                         for width, auto_relative_width
                         in zip(column_widths, auto_rel_colwidths)]

        # set min = max for columns with a fixed width
        total_fixed_cols_width = 0
        total_portions = 0
        for i, column_width in enumerate(column_widths):
            if isinstance(column_width, DimBase):
                width_in_pt = column_width.to_points(container.width)
                min_column_widths[i] = max_column_widths[i] = width_in_pt
                total_fixed_cols_width += width_in_pt
            else:
                total_portions += column_width

        # does the table fit within the available width without wrapping?
        if sum(max_column_widths) <= container.width:
            return max_column_widths

        # determine table width
        if fixed_width != FlowableWidth.AUTO:
            table_width = fixed_width
        elif total_portions:
            max_factor = max(maximum / width for width, maximum,
                             in zip(column_widths, max_column_widths)
                             if not isinstance(width, DimBase))
            no_wrap_rel_cols_width = total_portions * max_factor
            table_width = min(total_fixed_cols_width + no_wrap_rel_cols_width,
                              float(container.width))
        else:
            table_width = total_fixed_cols_width

        # TODO: warn when a column's fixed width < min width

        # determine absolute width of columns with relative widths
        if total_portions:
            total_relative_cols_width = table_width - total_fixed_cols_width
            portion_width = total_relative_cols_width / total_portions
            auto_widths = [width if isinstance(width, DimBase)
                           else width * portion_width
                           for width in column_widths]
            extra = [0 if isinstance(width, DimBase)
                     else auto_width - min_column_widths[index]
                     for index, auto_width in enumerate(auto_widths)]
            excess = [0 if isinstance(width, DimBase)
                      else auto_width - max_column_widths[index]
                      for index, auto_width in enumerate(auto_widths)]
            excess_pos = sum(x for x in excess if x > 0)
            extra_neg = sum(x for x in extra if x <= 0) + excess_pos
            extra_pos = (sum(x for x, c in zip(extra, excess)
                             if x > 0 and c <= 0))
            if extra_pos + extra_neg < 0:
                self.warn('Table contents are too wide to fit within the '
                          'available width', container)
                return [width.to_points(container.width)
                        if isinstance(width, DimBase) else width
                        for width in auto_widths]

            def final_column_width(index, width):
                if isinstance(width, DimBase):
                    return width.to_points(container.width)
                elif excess[index] > 0:
                    return max_column_widths[index]
                elif extra[index] <= 0:
                    return min_column_widths[index]
                else:
                    return width + (extra_neg * extra[index] / extra_pos)

            return [final_column_width(i, width)
                    for i, width in enumerate(auto_widths)]
        else:
            return [width.to_points(container.width)
                    for width in column_widths]
1013444
public int getRequiredWidth() {

        Element clone = CmsDomUtil.clone(getElement());
        clone.getStyle().setPosition(Position.ABSOLUTE);
        RootPanel.getBodyElement().appendChild(clone);
        int result = clone.getOffsetWidth();
        clone.removeFromParent();
        return result;
    }
285733
function () {
            var chart = this,
              optionsChart = chart.options.chart,
              widthOption = optionsChart.width,
              heightOption = optionsChart.height,
              renderTo = chart.renderToClone || chart.renderTo;

            // get inner width and height from jQuery (#824)
            if (!defined(widthOption)) {
                chart.containerWidth = adapterRun(renderTo, 'width');
            }
            if (!defined(heightOption)) {
                chart.containerHeight = adapterRun(renderTo, 'height');
            }

            chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460
            chart.chartHeight = mathMax(0, pick(heightOption,
              // the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7:
              chart.containerHeight > 19 ? chart.containerHeight : 400));
        }
1357313
function(width) {
    document.cookie = 'preview-width=' + width;
    forEach(resizeableEls, function(el) {
      if (width === 'auto') width = el.parentNode.offsetWidth;
      el.style.width = width + 'px';
      // TODO: Add CSS transitions and update height after `transitionend` event
      postMessage(el.getElementsByTagName('iframe')[0], 'getHeight');
    });
  }
349149
public function get_margin_width()
    {
        $style = $this->_style;

        return (float)$style->length_in_pt(array(
            $style->width,
            $style->margin_left,
            $style->margin_right,
            $style->border_left_width,
            $style->border_right_width,
            $style->padding_left,
            $style->padding_right
        ), $this->_containing_block["w"]);
    }
1359335
private void setSelectWidth(int width) {

        m_markerStyle.setWidth(width, Unit.PX);

        m_overlayTopStyle.setWidth(width, Unit.PX);
        m_overlayBottomStyle.setWidth(width, Unit.PX);
        m_overlayRightStyle.setWidth(m_elementWidth - m_currentSelection.getLeft() - width, Unit.PX);

        m_currentSelection.setWidth(width);
    }
187096
function get_outline_width()
    {
        $style = $this->__get("outline_style");
        return $style !== "none" && $style !== "hidden" ? $this->length_in_pt($this->_props["outline_width"]) : 0;
    }
387266
function widthOfList($this) {
        var itemsWidth = 0;
        $this.find(Selector.LI).each(function () {
            var itemWidth = $(this)[0].getBoundingClientRect().width;
            itemsWidth += itemWidth;
        });
        return itemsWidth;
    }
900546
def get_width(self):
        

        return self.__margin + \
               self.__editor.fontMetrics().width(foundations.strings.to_string(max(1, self.__editor.blockCount())))
1195951
def toggleWidth(self, width):
        ''
        if self.width != width:
            self.width = width
        else:
            self.width = int(options.default_width)
223028
def _get_menu_width(self, max_width, complete_state):
        
        return min(max_width, max(self.MIN_WIDTH, max(get_cwidth(c.display)
                   for c in complete_state.current_completions) + 2))