<?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>29394</bug_id>
          
          <creation_ts>2016-01-26 18:49:21 +0000</creation_ts>
          <short_desc>Specify (or at least recommend) options for scrollIntoView call</short_desc>
          <delta_ts>2016-09-19 16:39:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Browser Test/Tools WG</product>
          <component>WebDriver</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          
          <blocked>20860</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Marc Fisher">fisherii</reporter>
          <assigned_to name="Browser Testing and Tools WG">public-browser-tools-testing</assigned_to>
          <cc>ato</cc>
    
    <cc>johnjan</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="Browser Testing and Tools WG">public-browser-tools-testing</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>124719</commentid>
    <comment_count>0</comment_count>
    <who name="Marc Fisher">fisherii</who>
    <bug_when>2016-01-26 18:49:21 +0000</bug_when>
    <thetext>In https://w3c.github.io/webdriver/webdriver-spec.html#elements it says:
&quot;An element is scrolled into view by calling scrollIntoView().&quot;

However scrollIntoView can take options (https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface).

Current implementations handle this differently:
chromedriver and marionette appear to use &quot;nearest&quot;
Selenium firefoxdriver appears to use &quot;start&quot;
not sure about any other implementations

These differences lead to reduced portability of tests, particularly in the presence of absolute positioned (or similar) elements on the page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124722</commentid>
    <comment_count>1</comment_count>
    <who name="Andreas Tolfsen">ato</who>
    <bug_when>2016-01-27 13:48:38 +0000</bug_when>
    <thetext>Marionette appears to use the ScrollLogicalPositions &quot;end&quot; and &quot;nearest&quot; for block- and inline elements, respectively.  These are the defaults when you pass false as the only argument to scrollIntoView, if I’m reading the CSSOM spec you linked correctly.

I definitely think we should call out explicitly what scrollIntoView should be called with though.

What is a reasonable default here?  I’m happy to go with {block: &quot;end&quot;, inline: &quot;nearest&quot;} that Blink and Gecko appear to be using.

---

As an aside I looked at how the scrollIntoView _atom_ is implemented: https://github.com/SeleniumHQ/selenium/blob/9e39b5619b2cbad5bfcf71d9ab57d17d762ec7af/javascript/atoms/action.js#L670

It appears to support passing a rectangle to scroll to, and support scrolling to nodes that don’t implement scrollIntoView.  What nodes are these?  Is this something we should take into account?  It also does not scroll if the element is already in view.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127417</commentid>
    <comment_count>2</comment_count>
    <who name="John Jansen">johnjan</who>
    <bug_when>2016-09-19 16:39:25 +0000</bug_when>
    <thetext>*** Bug 28935 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>