<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26775</bug_id>
          
          <creation_ts>2014-09-10 18:21:08 +0000</creation_ts>
          <short_desc>CSSOM-View extensions to Element and Window break backwards-compatibility</short_desc>
          <delta_ts>2014-09-12 12:09:27 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>CSSOM View</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kearwood &quot;Kip&quot; Gilbert">kgilbert</reporter>
          <assigned_to name="Simon Pieters">zcorpan</assigned_to>
          <cc>bzbarsky</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>111358</commentid>
    <comment_count>0</comment_count>
    <who name="Kearwood &quot;Kip&quot; Gilbert">kgilbert</who>
    <bug_when>2014-09-10 18:21:08 +0000</bug_when>
    <thetext>Existing web content may fail as it expects the coordinates
passed to CSSOM-View functions to treat non-finite numbers
(NaN, Infininity, and -Infinity) as 0.

WebIDL for these functions defines the x and y coordinates using the &quot;double&quot; data type:

http://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface
http://www.w3.org/TR/cssom-view/#extensions-to-the-element-interface

This affects all functions that accept a double value for
coordinates, including:

window.scroll
window.scrollTo
window.scrollBy
element.scrollTop;
element.scrollLeft

I propose that this could be solved by defining the
coordinates as &quot;unrestricted double&quot; so that these functions
can accept the non-finite values.  The function
implementations should then coerce any non-finite values to 0.

For example, window.scrollTo would be defined as:

void scrollTo(unrestricted double x, unrestricted double y, optional ScrollOptions options);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111359</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-09-10 18:27:12 +0000</bug_when>
    <thetext>Note that this not a theoretical concern.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1062406 and https://bugzilla.mozilla.org/show_bug.cgi?id=1064385 for two sites we&apos;ve already found that are broken by this API change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111393</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-09-11 17:33:15 +0000</bug_when>
    <thetext>Should I do this across the board?

window.moveTo
window.moveBy
window.resizeTo
window.resizeBy
window.moveTo
document.elementFromPoint
document.elementsFromPoint
document.caretPositionFromPoint
ScrollOptionsHorizontal#x
ScrollOptionsVertical#y

What about initMouseEvent()? MouseEventInit? (similar for touch events?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111396</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-09-11 18:03:08 +0000</bug_when>
    <thetext>&gt; Should I do this across the board?

Only for the things that used to take integers, I&apos;d say.  Things that have been taking doubles/floats all along are likely web-compatible, since browsers are already shipping those.

&gt; What about initMouseEvent()? MouseEventInit?

Those take integers in https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-MouseEvent and https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-def-MouseEventInit as far as I can tell.

No idea on touch events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111421</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-09-12 07:45:18 +0000</bug_when>
    <thetext>OK, that makes sense.

https://dvcs.w3.org/hg/csswg/rev/0bd322b87db6

CSSOM View defines MouseEvent as double. But I&apos;ve left that alone for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111434</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-09-12 12:09:27 +0000</bug_when>
    <thetext>&gt; CSSOM View defines MouseEvent as double.

Then it likely needs the same change.  Also, why are we defining the same thing in multiple specs?  :(</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>