Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2633

ClassCastException in ClientInfoEvent with zoomed view in Windows/Chrome

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.3
    • 6.5.7, 8.0.2
    • ZK Update Engine
    • Security Level: Jimmy
    • None
    • Chrome 40 on Windows 7
      Chrome 50 on Windows 10

    • ZK 8.0.3 S4

      Run this code, then start zooming the view to 110%, 125%, etc. You should see "java.lang.Double cannot be bast to java.lang.Integer".

      test.zul
      <window
        title="test"
        border="normal"
        width="10000px"
        height="10000px"
        onClientInfo=''
        >
      </window>
      

      My proposed patch:

      diff.patch
      diff --git a/zk/src/archive/web/js/zk/dom.js b/zk/src/archive/web/js/zk/dom.js
      index 2ed8be6..27ee447 100644
      --- a/zk/src/archive/web/js/zk/dom.js
      +++ b/zk/src/archive/web/js/zk/dom.js
      @@ -1829,31 +1829,31 @@ zk.copy(jq, {
       	 * @return int
       	 */
       	innerX: function () {
      -		return window.pageXOffset
      +		return Math.round(window.pageXOffset
       			|| document.documentElement.scrollLeft
      -			|| document.body.scrollLeft || 0;
      +			|| document.body.scrollLeft || 0);
       	},
       	/** Returns the Y coordination of the visible part of the browser window. 
       	 * @return int
       	 */
       	innerY: function () {
      -		return window.pageYOffset
      +		return Math.round(window.pageYOffset
       			|| document.documentElement.scrollTop
      -			|| document.body.scrollTop || 0;
      +			|| document.body.scrollTop || 0);
       	},
       	/** Returns the height of the viewport (visible part) of the browser window. 
       	 * It is the same as jq(window).width().
       	 * @return int
       	 */
       	innerWidth: function () {
      -		return jq(window).width();
      +		return Math.round(jq(window).width());
       	},
       	/** Returns the width of the viewport (visible part) of the browser window. 
       	 * It is the same as jq(window).height().
       	 * @return int
       	 */
       	innerHeight: function () {
      -		return jq(window).height();
      +		return Math.round(jq(window).height());
       	},
       
       	/** A map of the margin style names: {l: 'margin-left', t: 'margin-top'...}. 
      

            christopherszu christopherszu
            erlen erlen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h