Add an element with the same styles and content as the textarea to calculate the height of the textarea content.
420506
function(el) {
  var mirrorEl = document.createElement('div');
  mirrorEl.className = 'preview-code';
  mirrorEl.style.position = 'absolute';
  mirrorEl.style.left = '-9999px';
  bodyEl.appendChild(mirrorEl);
  var maxHeight = parseInt(
    window.getComputedStyle(el).getPropertyValue('max-height'),
    10);
  var codeDidChange = function(ev) {
    mirrorEl.textContent = this.value + '\n';
    var height = mirrorEl.offsetHeight + 2; // Account for borders.
    if (height >= maxHeight) {
      this.style.overflow = 'auto';
    } else {
      this.style.overflow = 'hidden';
    }
    this.style.height = (mirrorEl.offsetHeight + 2) + 'px';
  };
  el.addEventListener('keypress', codeDidChange);
  el.addEventListener('keyup', codeDidChange);
  codeDidChange.call(el);
}
586069
function () {
        var self = this, settings = self.settings, borderBox, layoutRect;
        var elm = self.getEl(), width, height, minWidth, minHeight, autoResize;
        var startMinWidth, startMinHeight, initialSize;

        // Measure the current element
        borderBox = self.borderBox = self.borderBox || BoxUtils.measureBox(elm, 'border');
        self.paddingBox = self.paddingBox || BoxUtils.measureBox(elm, 'padding');
        self.marginBox = self.marginBox || BoxUtils.measureBox(elm, 'margin');
        initialSize = DomUtils.getSize(elm);

        // Setup minWidth/minHeight and width/height
        startMinWidth = settings.minWidth;
        startMinHeight = settings.minHeight;
        minWidth = startMinWidth || initialSize.width;
        minHeight = startMinHeight || initialSize.height;
        width = settings.width;
        height = settings.height;
        autoResize = settings.autoResize;
        autoResize = typeof autoResize != "undefined" ? autoResize : !width && !height;

        width = width || minWidth;
        height = height || minHeight;

        var deltaW = borderBox.left + borderBox.right;
        var deltaH = borderBox.top + borderBox.bottom;

        var maxW = settings.maxWidth || 0xFFFF;
        var maxH = settings.maxHeight || 0xFFFF;

        // Setup initial layout rect
        self._layoutRect = layoutRect = {
          x: settings.x || 0,
          y: settings.y || 0,
          w: width,
          h: height,
          deltaW: deltaW,
          deltaH: deltaH,
          contentW: width - deltaW,
          contentH: height - deltaH,
          innerW: width - deltaW,
          innerH: height - deltaH,
          startMinWidth: startMinWidth || 0,
          startMinHeight: startMinHeight || 0,
          minW: Math.min(minWidth, maxW),
          minH: Math.min(minHeight, maxH),
          maxW: maxW,
          maxH: maxH,
          autoResize: autoResize,
          scrollW: 0
        };

        self._lastLayoutRect = {};

        return layoutRect;
      }
1359021
function(element) {
    if('TEXTAREA'===element.nodeName
      ||('INPUT'===element.nodeName&&element.hasAttribute('type')
        &&('text'===element.getAttribute('type')
          ||'number'===element.getAttribute('type'))
      )
    ) {
      return true;
    }
    return false;
  }
1180994
function( width, height ){

            if ( width === undefined && height === undefined ){
                width = this.container.offsetWidth;
                height = this.container.offsetHeight;
            }

            this.width = width || 0;
            this.height = height || 0;
            // should be implemented in renderers
        }
546785
function(value) {
			if (Lang.isNumber(value)) {
				value += 'px';
			}
			this.setStyle(HEIGHT,value);
			this._fixEdges();
			this.redraw();
		}
1147826
function(w, h) {
			if (w && h) {
				/* Reset apparent image size first so container grows */
				this.$content.css('width', '').css('height', '');
				/* Calculate the worst ratio so that dimensions fit */
				 /* Note: -1 to avoid rounding errors */
				var ratio = Math.max(
					w  / (this.$content.parent().width()-1),
					h / (this.$content.parent().height()-1));
				/* Resize content */
				if (ratio > 1) {
					ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */
					this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px');
				}
			}
		}
381687
def addElement(self, parent, tag, value):
        """"""
        elem = self.rss.createElement(tag)
        node = self.rss.createTextNode(value)
        return parent.appendChild(elem).appendChild(node)
1322300
function() {
					
                    // Prepare the clone:
                    clone.height(0).val($(this).val()).scrollTop(10000);
					
                    // Find the height of text:
                    var scrollTop = Math.max(clone.scrollTop(), origHeight) + settings.extraSpace,
                        toChange = $(this).add(clone);
						
                    // Don't do anything if scrollTip hasen't changed:
                    if (lastScrollTop === scrollTop) { return; }
                    lastScrollTop = scrollTop;
					
                    // Check for limit:
                    if ( scrollTop >= settings.limit ) {
                        $(this).css('overflow-y','');
                        return;
                    }
                    // Fire off callback:
                    settings.onResize.call(this);
					
                    // Either animate or directly apply height:
                    settings.animate && textarea.css('display') === 'block' ?
                        toChange.stop().animate({height:scrollTop}, settings.animateDuration, settings.animateCallback)
                        : toChange.height(scrollTop);
                }
1366397
function updateResizeLimits() {
        var editorAreaHeight = $editorHolder.height();

        $editorHolder.siblings().each(function (i, elem) {
            var $elem = $(elem);
            if ($elem.css("display") === "none") {
                $elem.data("maxsize", editorAreaHeight);
            } else {
                $elem.data("maxsize", editorAreaHeight + $elem.outerHeight());
            }
        });
    }
175069
function( element ) {
		element = element || this.element;

		var offset = element.offset(),
			width = element.width(),
			height = element.height();

		return {
			x1: offset.left,
			y1: offset.top,
			x2: offset.left + width,
			y2: offset.top + height,
			surface: width * height,
			contentItem: this
		};
	}
997319
function() {
        var style = this._element.style,
            coord = this.__coord || [0, 0, 0, 0],
            co = {
                x: coord[0],
                y: coord[1],
                w: coord[2],
                h: coord[3]
            },
            prefix = Crafty.support.prefix,
            trans = [];

        if (this._cssStyles.visibility !== this._visible) {
            this._cssStyles.visibility = this._visible;
            if (!this._visible) {
                style.visibility = "hidden";
            } else {
                style.visibility = "visible";
            }
        }

        //utilize CSS3 if supported
        if (Crafty.support.css3dtransform && !this.avoidCss3dTransforms) {
            trans.push(
                "translate3d(" + ~~this._x + "px," + ~~this._y + "px,0)"
            );
        } else {
            if (this._cssStyles.left !== this._x) {
                this._cssStyles.left = this._x;
                style.left = ~~this._x + "px";
            }
            if (this._cssStyles.top !== this._y) {
                this._cssStyles.top = this._y;
                style.top = ~~this._y + "px";
            }
        }

        if (this._cssStyles.width !== this._w) {
            this._cssStyles.width = this._w;
            style.width = ~~this._w + "px";
        }
        if (this._cssStyles.height !== this._h) {
            this._cssStyles.height = this._h;
            style.height = ~~this._h + "px";
        }
        if (this._cssStyles.zIndex !== this._z) {
            this._cssStyles.zIndex = this._z;
            style.zIndex = this._z;
        }

        if (this._cssStyles.opacity !== this._alpha) {
            this._cssStyles.opacity = this._alpha;
            style.opacity = this._alpha;
            style[prefix + "Opacity"] = this._alpha;
        }

        if (this._mbr) {
            var origin = this._origin.x + "px " + this._origin.y + "px";
            style.transformOrigin = origin;
            style[prefix + "TransformOrigin"] = origin;
            if (Crafty.support.css3dtransform)
                trans.push("rotateZ(" + this._rotation + "deg)");
            else trans.push("rotate(" + this._rotation + "deg)");
        }

        if (this._flipX) {
            trans.push("scaleX(-1)");
        }

        if (this._flipY) {
            trans.push("scaleY(-1)");
        }

        if (this._cssStyles.transform !== trans.join(" ")) {
            this._cssStyles.transform = trans.join(" ");
            style.transform = this._cssStyles.transform;
            style[prefix + "Transform"] = this._cssStyles.transform;
        }

        this.trigger("Draw", {
            style: style,
            type: "DOM",
            co: co
        });

        return this;
    }
284094
function textareaUpdate() {
                    if (_isSleeping)
                        return;

                    var wrapAttrOff = !_textareaAutoWrappingCache;
                    var minWidth = _viewportSize.w /* - (!_isBorderBox && !_paddingAbsoluteCache && _widthAutoCache ? _paddingY + _borderY : 0) */;
                    var minHeight = _viewportSize.h /* - (!_isBorderBox && !_paddingAbsoluteCache && _heightAutoCache ? _paddingY + _borderY : 0) */;
                    var css = { };
                    var doMeasure = _widthAutoCache || wrapAttrOff;
                    var origWidth;
                    var width;
                    var origHeight;
                    var height;

                    //reset min size
                    css[_strMinMinus + _strWidth] = _strEmpty;
                    css[_strMinMinus + _strHeight] = _strEmpty;

                    //set width auto
                    css[_strWidth] = _strAuto;
                    _targetElement.css(css);

                    //measure width
                    origWidth = _targetElementNative[LEXICON.oW];
                    width = doMeasure ? MATH.max(origWidth, _targetElementNative[LEXICON.sW] - 1) : 1;
                    /*width += (_widthAutoCache ? _marginX + (!_isBorderBox ? wrapAttrOff ? 0 : _paddingX + _borderX : 0) : 0);*/

                    //set measured width
                    css[_strWidth] = _widthAutoCache ? _strAuto /*width*/ : _strHundredPercent;
                    css[_strMinMinus + _strWidth] = _strHundredPercent;

                    //set height auto
                    css[_strHeight] = _strAuto;
                    _targetElement.css(css);

                    //measure height
                    origHeight = _targetElementNative[LEXICON.oH];
                    height = MATH.max(origHeight, _targetElementNative[LEXICON.sH] - 1);

                    //append correct size values
                    css[_strWidth] = width;
                    css[_strHeight] = height;
                    _textareaCoverElement.css(css);

                    //apply min width / min height to prevent textarea collapsing
                    css[_strMinMinus + _strWidth] = minWidth /*+ (!_isBorderBox && _widthAutoCache ? _paddingX + _borderX : 0)*/;
                    css[_strMinMinus + _strHeight] = minHeight /*+ (!_isBorderBox && _heightAutoCache ? _paddingY + _borderY : 0)*/;
                    _targetElement.css(css);

                    return {
                        _originalWidth: origWidth,
                        _originalHeight: origHeight,
                        _dynamicWidth: width,
                        _dynamicHeight: height
                    };
                }
1223366
function setMinimumHeight(element) {
  const copyContainer = element.$.copyContainer;
  const outerHeight = copyContainer.getBoundingClientRect().height;
  const style = getComputedStyle(copyContainer);
  const paddingTop = parseFloat(style.paddingTop);
  const paddingBottom = parseFloat(style.paddingBottom);
  const innerHeight = copyContainer.clientHeight - paddingTop - paddingBottom;
  const bordersPlusPadding = outerHeight - innerHeight;
  let minHeight = (element.minimumRows * element[lineHeightSymbol]) + bordersPlusPadding;
  minHeight = Math.ceil(minHeight);
  copyContainer.style.minHeight = minHeight + 'px';
}
125643
private function AddAreasField()
    {
        $name = 'Areas';
        $field = Input::Text($name, join(', ' , $this->areaNames));
        $this->AddField($field);
        if ($this->layout->Exists())
        {
            $field->SetHtmlAttribute('readonly', 'readonly');
        }
        else
        {
            $this->SetTransAttribute($name, 'placeholder');
            $this->SetRequired($name);
        }
    }
1343819
function text(el, contents) {
  if (el.textContent) {
    el.textContent = contents;
  } else {
    el.innerText = contents;
  }
}
440668
public function initializeContentAreas()
    {
        $content = $this->_getContent();

        foreach ($content as $contentAreaDefintion)
        {
            $contentArea = new ContentArea($contentAreaDefintion);

            $this->_contentAreas[$contentArea->id] = $contentArea;
        }
    }
1238898
function () {

            var me = this;
            me.fireEvent('destroy');
            var container = me.container.parentNode;
            var textarea = me.textarea;
            if (!textarea) {
                textarea = document.createElement('textarea');
                container.parentNode.insertBefore(textarea, container);
            } else {
                textarea.style.display = ''
            }

            textarea.style.width = me.iframe.offsetWidth + 'px';
            textarea.style.height = me.iframe.offsetHeight + 'px';
            textarea.value = me.getContent();
            textarea.id = me.key;
            container.innerHTML = '';
            domUtils.remove(container);
            var key = me.key;
            //trace:2004
            for (var p in me) {
                if (me.hasOwnProperty(p)) {
                    delete this[p];
                }
            }
            UE.delEditor(key);
        }