From: <rb...@us...> - 2018-04-22 18:18:52
|
Revision: 15255 http://sourceforge.net/p/htmlunit/code/15255 Author: rbri Date: 2018-04-22 18:16:57 +0000 (Sun, 22 Apr 2018) Log Message: ----------- try to make calculation faster Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java 2018-04-22 16:05:38 UTC (rev 15254) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java 2018-04-22 18:16:57 UTC (rev 15255) @@ -1169,22 +1169,18 @@ return height_.intValue(); } - final int elementHeight = getEmptyHeight(); - if (elementHeight == 0) { - height_ = Integer.valueOf(elementHeight); - return elementHeight; + int height = getEmptyHeight(); + if (height == 0) { + height_ = Integer.valueOf(0); + return 0; } - final int contentHeight = getContentHeight(); - final boolean explicitHeightSpecified = !super.getHeight().isEmpty(); - - final int height; - if (contentHeight > 0 && !explicitHeightSpecified) { - height = contentHeight; + if (super.getHeight().isEmpty()) { + final int contentHeight = getContentHeight(); + if (contentHeight > 0) { + height = contentHeight; + } } - else { - height = elementHeight; - } height_ = Integer.valueOf(height); return height; |