[HtmlUnit] SVN: [14727] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [14727] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit

HtmlUnit - Dev mailing list
Revision: 14727
          http://sourceforge.net/p/htmlunit/code/14727
Author:   rbri
Date:     2017-07-27 12:12:45 +0000 (Thu, 27 Jul 2017)
Log Message:
-----------
latest Chrome - bring our impl in sync (wip)

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-07-27 11:59:08 UTC (rev 14726)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-07-27 12:12:45 UTC (rev 14727)
@@ -959,7 +959,7 @@
      * Getting the width and height of an image tag without a source returns 18x20;
      * for invalid values returns 1.
      */
-    @BrowserFeature(FF)
+    @BrowserFeature(CHROME)
     JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0,
 
     /**
@@ -966,8 +966,8 @@
      * Getting the width and height of an image tag without a source returns 18x20;
      * for invalid values returns 1.
      */
-    @BrowserFeature(CHROME)
-    JS_IMAGE_WIDTH_HEIGHT_RETURNS_18x20_0x0,
+    @BrowserFeature(FF)
+    JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0,
 
     /**
      * Getting the width and height of an image tag without a source returns 28x30;

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java 2017-07-27 11:59:08 UTC (rev 14726)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java 2017-07-27 12:12:45 UTC (rev 14727)
@@ -15,8 +15,8 @@
 package com.gargoylesoftware.htmlunit.javascript.host.html;
 
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_ACCEPTS_ARBITRARY_VALUES;
+import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0;
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_18x20_0x0;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30;
 import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME;
 import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE;
@@ -28,7 +28,6 @@
 import java.util.Locale;
 import java.util.Map;
 
-import org.apache.commons.lang3.StringUtils;
 import org.xml.sax.helpers.AttributesImpl;
 
 import com.gargoylesoftware.htmlunit.BrowserVersion;
@@ -249,11 +248,8 @@
                 if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30)) {
                     return 28;
                 }
-                if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_18x20_0x0)) {
-                    if (StringUtils.isBlank(src)) {
-                        return 0;
-                    }
-                    return 20;
+                if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0)) {
+                    return 0;
                 }
                 return 24;
             }
@@ -263,8 +259,8 @@
         if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30)) {
             return 28;
         }
-        if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_18x20_0x0)
-                || browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0)) {
+        if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0)
+                || browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0)) {
             return 0;
         }
         return 24;
@@ -308,11 +304,8 @@
                 if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30)) {
                     return 30;
                 }
-                if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_18x20_0x0)) {
-                    if (StringUtils.isBlank(src)) {
-                        return 0;
-                    }
-                    return 20;
+                if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0)) {
+                    return 0;
                 }
                 return 24;
             }
@@ -322,8 +315,8 @@
         if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30)) {
             return 30;
         }
-        if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_18x20_0x0)
-                || browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0)) {
+        if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_0x0_0x0)
+                || browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0)) {
             return 0;
         }
         return 24;


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop