From: <rb...@us...> - 2017-06-27 16:39:46
|
Revision: 14637 http://sourceforge.net/p/htmlunit/code/14637 Author: rbri Date: 2017-06-27 16:39:43 +0000 (Tue, 27 Jun 2017) Log Message: ----------- fix NPE from last commit Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-06-27 16:29:37 UTC (rev 14636) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-06-27 16:39:43 UTC (rev 14637) @@ -1621,13 +1621,15 @@ final Element e = (Element) element; String normalizedPseudo = pseudoElement; - if (normalizedPseudo != null && normalizedPseudo.startsWith("::")) { - normalizedPseudo = normalizedPseudo.substring(1); + if (normalizedPseudo != null) { + if (normalizedPseudo.startsWith("::")) { + normalizedPseudo = normalizedPseudo.substring(1); + } + else if (getBrowserVersion().hasFeature(JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_WITHOUT_COLON) + && !normalizedPseudo.startsWith(":")) { + normalizedPseudo = ":" + normalizedPseudo; + } } - if (getBrowserVersion().hasFeature(JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_WITHOUT_COLON) - && !normalizedPseudo.startsWith(":")) { - normalizedPseudo = ":" + normalizedPseudo; - } synchronized (computedStyles_) { final Map<String, CSS2Properties> elementMap = computedStyles_.get(e); |