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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>102817</bug_id>
          
          <creation_ts>2012-11-20 09:09:42 -0800</creation_ts>
          <short_desc>Reset the slider thumb location before every layout of the slider container</short_desc>
          <delta_ts>2012-11-21 10:16:04 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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>
          
          <blocked>102352</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mifenton</cc>
    
    <cc>ojan</cc>
    
    <cc>tkent</cc>
    
    <cc>tony</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>771911</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-11-20 09:09:42 -0800</bug_when>
    <thetext>The location of the slider thumb is set by the slider container assuming the render slider has been laid out. When this happens, the location of the slider thumb is reset during the layout ignoring any previous location set. If the slider thumb is not laid out, the previous value is added to the new one by the slider container.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771914</commentid>
    <comment_count>1</comment_count>
      <attachid>175231</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-11-20 09:14:28 -0800</bug_when>
    <thetext>Created attachment 175231
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771967</commentid>
    <comment_count>2</comment_count>
      <attachid>175231</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2012-11-20 10:17:33 -0800</bug_when>
    <thetext>Comment on attachment 175231
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=175231&amp;action=review

&gt; Source/WebCore/html/shadow/SliderThumbElement.cpp:185
&gt; +    if (input-&gt;sliderThumbElement() &amp;&amp; input-&gt;sliderThumbElement()-&gt;renderer()) {
&gt; +        thumb = toRenderBox(input-&gt;sliderThumbElement()-&gt;renderer());
&gt; +        // Reset the thumb location before layout.
&gt; +        thumb-&gt;setLocation(LayoutPoint());
&gt; +    }

When we call thumbLocation.setX, can we set the position to offset rather than adding in the old position?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771989</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-11-20 10:35:53 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 175231 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=175231&amp;action=review

Thanks for reviewing.
 
&gt; &gt; Source/WebCore/html/shadow/SliderThumbElement.cpp:185
&gt; &gt; +    if (input-&gt;sliderThumbElement() &amp;&amp; input-&gt;sliderThumbElement()-&gt;renderer()) {
&gt; &gt; +        thumb = toRenderBox(input-&gt;sliderThumbElement()-&gt;renderer());
&gt; &gt; +        // Reset the thumb location before layout.
&gt; &gt; +        thumb-&gt;setLocation(LayoutPoint());
&gt; &gt; +    }
&gt; 
&gt; When we call thumbLocation.setX, can we set the position to offset rather than adding in the old position?

Yes, I think so, I&apos;ll try</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>772083</commentid>
    <comment_count>4</comment_count>
      <attachid>175231</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-11-20 12:21:11 -0800</bug_when>
    <thetext>Comment on attachment 175231
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=175231&amp;action=review

&gt; Source/WebCore/ChangeLog:13
&gt; +        ignoring any previous location set. If the slider thumb is not
&gt; +        laid out, the previous value is added to the new one by the slider
&gt; +        container.

This sounds like it should be observable testable. Is it not?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>772123</commentid>
    <comment_count>5</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-11-20 13:37:05 -0800</bug_when>
    <thetext>It will be observable once https://bugs.webkit.org/show_bug.cgi?id=102352 is fixed. It&apos;s already covered by existing tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>772667</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-11-21 02:14:49 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (From update of attachment 175231 [details] [details])
&gt; &gt; View in context: https://bugs.webkit.org/attachment.cgi?id=175231&amp;action=review
&gt; 
&gt; Thanks for reviewing.
&gt; 
&gt; &gt; &gt; Source/WebCore/html/shadow/SliderThumbElement.cpp:185
&gt; &gt; &gt; +    if (input-&gt;sliderThumbElement() &amp;&amp; input-&gt;sliderThumbElement()-&gt;renderer()) {
&gt; &gt; &gt; +        thumb = toRenderBox(input-&gt;sliderThumbElement()-&gt;renderer());
&gt; &gt; &gt; +        // Reset the thumb location before layout.
&gt; &gt; &gt; +        thumb-&gt;setLocation(LayoutPoint());
&gt; &gt; &gt; +    }
&gt; &gt; 
&gt; &gt; When we call thumbLocation.setX, can we set the position to offset rather than adding in the old position?
&gt; 
&gt; Yes, I think so, I&apos;ll try

The initial position of the thumb slider is set by the parent container in RenderBlock::layoutBlockChild() and it depends on the padding, border and margin. I don&apos;t know if the thumb can be affected by those, because after the layoutBlockChild() the thumb position is always 0. In case of being greater than 0 I guess it makes sense to add the offset, but I guess we should also use the current thumb position when the container is not laid out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>772837</commentid>
    <comment_count>7</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-11-21 05:42:30 -0800</bug_when>
    <thetext>Committed r135388: &lt;http://trac.webkit.org/changeset/135388&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>772840</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-11-21 05:45:11 -0800</bug_when>
    <thetext>I landed the patch without any modification in the end to be extra sure it doesn&apos;t break anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>773080</commentid>
    <comment_count>9</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2012-11-21 10:16:04 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; The initial position of the thumb slider is set by the parent container in RenderBlock::layoutBlockChild() and it depends on the padding, border and margin. I don&apos;t know if the thumb can be affected by those, because after the layoutBlockChild() the thumb position is always 0. In case of being greater than 0 I guess it makes sense to add the offset, but I guess we should also use the current thumb position when the container is not laid out.

If there was a padding/border/margin on the thumb, after bug 102352 lands, we&apos;re no longer going to be applying them on a relayout since we will reset the location to 0, 0 then not call layout on the thumb.

I would probably call thumbLocation.setX directly on the new position since it&apos;s less code, but it doesn&apos;t really matter.  Conceptually, I don&apos;t think it makes sense for web authors to be able to use CSS to control the position of the thumb.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>175231</attachid>
            <date>2012-11-20 09:14:28 -0800</date>
            <delta_ts>2012-11-20 12:21:11 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>wk-slider-thumb.diff</filename>
            <type>text/plain</type>
            <size>2240</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1N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gUmVz
ZXQgdGhlIHRodW1iIGxvY2F0aW9uIGJlZm9yZSBsYXlvdXQuCisgICAgICAgIHRodW1iLT5zZXRM
b2NhdGlvbihMYXlvdXRQb2ludCgpKTsKKyAgICB9CisKICAgICBSZW5kZXJGbGV4aWJsZUJveDo6
bGF5b3V0KCk7CiAKICAgICBzdHlsZSgpLT5zZXREaXJlY3Rpb24ob2xkVGV4dERpcmVjdGlvbik7
CiAgICAgLy8gVGhlc2Ugc2hvdWxkIGFsd2F5cyBleGlzdCwgdW5sZXNzIHNvbWVvbmUgbXV0YXRl
cyB0aGUgc2hhZG93IERPTSAoZS5nLiwgaW4gdGhlIGluc3BlY3RvcikuCi0gICAgaWYgKCFpbnB1
dC0+c2xpZGVyVGh1bWJFbGVtZW50KCkgfHwgIWlucHV0LT5zbGlkZXJUaHVtYkVsZW1lbnQoKS0+
cmVuZGVyZXIoKSkKKyAgICBpZiAoIXRodW1iKQogICAgICAgICByZXR1cm47Ci0gICAgUmVuZGVy
Qm94KiB0aHVtYiA9IHRvUmVuZGVyQm94KGlucHV0LT5zbGlkZXJUaHVtYkVsZW1lbnQoKS0+cmVu
ZGVyZXIoKSk7CiAgICAgUmVuZGVyQm94KiB0cmFjayA9IHRvUmVuZGVyQm94KHRodW1iLT5wYXJl
bnQoKSk7CiAKICAgICBkb3VibGUgcGVyY2VudGFnZU9mZnNldCA9IHNsaWRlclBvc2l0aW9uKGlu
cHV0KS50b0RvdWJsZSgpOwo=
</data>
<flag name="review"
          id="190614"
          type_id="1"
          status="+"
          setter="tony"
    />
          </attachment>
      

    </bug>

</bugzilla>