[HtmlUnit] SVN: [15507] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript/host/Window.java

rbri--- via HtmlUnit-develop <[email protected]> Thu, 02 Aug 2018 17:53:14 +0000
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15507
          http://sourceforge.net/p/htmlunit/code/15507
Author:   rbri
Date:     2018-08-02 17:53:13 +0000 (Thu, 02 Aug 2018)
Log Message:
-----------
revert last change i have to think about this a bit more

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	2018-08-01 20:20:01 UTC (rev 15506)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java	2018-08-02 17:53:13 UTC (rev 15507)
@@ -168,10 +168,6 @@
     private static final class CSSPropertiesCache implements Serializable {
         private transient WeakHashMap<Element, Map<String, CSS2Properties>> computedStyles_ = new WeakHashMap<>();
 
-        // Dummy value to associate with an Object in the backing Map
-        private static final Object PRESENT = new Object();
-        private transient WeakHashMap<DomNode, Object> cleanedNodes_ = new WeakHashMap<>();
-
         public synchronized CSS2Properties get(final Element element, final String normalizedPseudo) {
             final Map<String, CSS2Properties> elementMap = computedStyles_.get(element);
             if (elementMap != null) {
@@ -185,18 +181,13 @@
             if (elementMap == null) {
                 elementMap = new WeakHashMap<>();
                 computedStyles_.put(element, elementMap);
-                cleanedNodes_.remove(element.getDomNodeOrDie());
             }
             elementMap.put(normalizedPseudo, style);
         }
 
         public synchronized void nodeChanged(final DomNode changed, final boolean clearParents) {
-            if (cleanedNodes_.containsKey(changed)) {
-                return;
-            }
-
-            for (final Iterator<Map.Entry<Element, Map<String, CSS2Properties>>> i
-                    = computedStyles_.entrySet().iterator(); i.hasNext();) {
+            final Iterator<Map.Entry<Element, Map<String, CSS2Properties>>> i = computedStyles_.entrySet().iterator();
+            while (i.hasNext()) {
                 final Map.Entry<Element, Map<String, CSS2Properties>> entry = i.next();
                 final DomNode node = entry.getKey().getDomNodeOrDie();
                 if (changed == node
@@ -203,7 +194,6 @@
                     || changed.getParentNode() == node.getParentNode()
                     || changed.isAncestorOf(node)
                     || clearParents && node.isAncestorOf(changed)) {
-                    cleanedNodes_.put(node, PRESENT);
                     i.remove();
                 }
             }


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot