<?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>102441</bug_id>
          
          <creation_ts>2012-11-15 15:56:45 -0800</creation_ts>
          <short_desc>RenderGrid should have a function to resolve grid position</short_desc>
          <delta_ts>2012-11-16 05:32:56 -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>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>
          
          <blocked>60731</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Julien Chaffraix">jchaffraix</reporter>
          <assigned_to name="Julien Chaffraix">jchaffraix</assigned_to>
          <cc>eric</cc>
    
    <cc>ojan</cc>
    
    <cc>tony</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>xan.lopez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>768591</commentid>
    <comment_count>0</comment_count>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-11-15 15:56:45 -0800</bug_when>
    <thetext>Currently mapping grid-row or grid-column (grid-position-row and grid-position-col in the latest spec) to the actual position on the grid is done in an implicit way inside RenderGrid::findChildLogicalPosition.

In order to add support for grid areas, we need a way to get the grid items&apos; explicit position which is where this function would come in handy.

Patch forthcoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>768598</commentid>
    <comment_count>1</comment_count>
      <attachid>174539</attachid>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-11-15 16:07:23 -0800</bug_when>
    <thetext>Created attachment 174539
Proposed refactoring.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>768602</commentid>
    <comment_count>2</comment_count>
      <attachid>174539</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-11-15 16:11:03 -0800</bug_when>
    <thetext>Comment on attachment 174539
Proposed refactoring.

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

&gt; Source/WebCore/rendering/RenderGrid.cpp:178
&gt; +size_t RenderGrid::resolveGridPosition(const Length&amp; position) const

Isn&apos;t this the grid size? resolveGridExtent would be more consistent with what we call these in the rest of the codebase. Also, should this return a LayoutUnit?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>768626</commentid>
    <comment_count>3</comment_count>
      <attachid>174539</attachid>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-11-15 16:20:47 -0800</bug_when>
    <thetext>Comment on attachment 174539
Proposed refactoring.

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

&gt;&gt; Source/WebCore/rendering/RenderGrid.cpp:178
&gt;&gt; +size_t RenderGrid::resolveGridPosition(const Length&amp; position) const
&gt; 
&gt; Isn&apos;t this the grid size? resolveGridExtent would be more consistent with what we call these in the rest of the codebase. Also, should this return a LayoutUnit?

OK, here are the answers in order:
* No, the grid size is the max of the grid items&apos; grid-position-row and grid-position-column, including the spans.
* I don&apos;t think &apos;extend&apos; is the right word here as it&apos;s not a sizing function: it is meant to return the physical position on the 2D grid.
* Returning LayoutUnit makes no sense, we can&apos;t place an item at the (1/60, 1/60) position on the grid.

If you have some suggestion on how to better convey this idea, I would love to update the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>768645</commentid>
    <comment_count>4</comment_count>
      <attachid>174539</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-11-15 16:26:59 -0800</bug_when>
    <thetext>Comment on attachment 174539
Proposed refactoring.

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

&gt;&gt;&gt; Source/WebCore/rendering/RenderGrid.cpp:178
&gt;&gt;&gt; +size_t RenderGrid::resolveGridPosition(const Length&amp; position) const
&gt;&gt; 
&gt;&gt; Isn&apos;t this the grid size? resolveGridExtent would be more consistent with what we call these in the rest of the codebase. Also, should this return a LayoutUnit?
&gt; 
&gt; OK, here are the answers in order:
&gt; * No, the grid size is the max of the grid items&apos; grid-position-row and grid-position-column, including the spans.
&gt; * I don&apos;t think &apos;extend&apos; is the right word here as it&apos;s not a sizing function: it is meant to return the physical position on the 2D grid.
&gt; * Returning LayoutUnit makes no sense, we can&apos;t place an item at the (1/60, 1/60) position on the grid.
&gt; 
&gt; If you have some suggestion on how to better convey this idea, I would love to update the patch.

oic. It&apos;s confusing that we using Length to represent these. I think we need a new value type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>768662</commentid>
    <comment_count>5</comment_count>
      <attachid>174539</attachid>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-11-15 16:36:33 -0800</bug_when>
    <thetext>Comment on attachment 174539
Proposed refactoring.

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

&gt;&gt;&gt;&gt; Source/WebCore/rendering/RenderGrid.cpp:178
&gt;&gt;&gt;&gt; +size_t RenderGrid::resolveGridPosition(const Length&amp; position) const
&gt;&gt;&gt; 
&gt;&gt;&gt; Isn&apos;t this the grid size? resolveGridExtent would be more consistent with what we call these in the rest of the codebase. Also, should this return a LayoutUnit?
&gt;&gt; 
&gt;&gt; OK, here are the answers in order:
&gt;&gt; * No, the grid size is the max of the grid items&apos; grid-position-row and grid-position-column, including the spans.
&gt;&gt; * I don&apos;t think &apos;extend&apos; is the right word here as it&apos;s not a sizing function: it is meant to return the physical position on the 2D grid.
&gt;&gt; * Returning LayoutUnit makes no sense, we can&apos;t place an item at the (1/60, 1/60) position on the grid.
&gt;&gt; 
&gt;&gt; If you have some suggestion on how to better convey this idea, I would love to update the patch.
&gt; 
&gt; oic. It&apos;s confusing that we using Length to represent these. I think we need a new value type.

I agree: I used Length as a temporary type (as it supports &apos;auto&apos; and &lt;integer&gt;) until we actually get to the point where we require this new type. It is orthogonal to this refactoring though and I will be more than happy to clean this up in a follow-up bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769149</commentid>
    <comment_count>6</comment_count>
      <attachid>174539</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-11-16 05:32:53 -0800</bug_when>
    <thetext>Comment on attachment 174539
Proposed refactoring.

Clearing flags on attachment: 174539

Committed r134935: &lt;http://trac.webkit.org/changeset/134935&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769150</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-11-16 05:32:56 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>174539</attachid>
            <date>2012-11-15 16:07:23 -0800</date>
            <delta_ts>2012-11-16 05:32:53 -0800</delta_ts>
            <desc>Proposed refactoring.</desc>
            <filename>bug-102441-20121115160520.patch</filename>
            <type>text/plain</type>
            <size>4716</size>
            <attacher name="Julien Chaffraix">jchaffraix</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTM0Mjk1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggNjgyN2Y0ZGFkODk1MTNl
NTg3MDcyMDUxNGFlN2RlODA1ZDAyOGRjNi4uMjg4YmI5MjRlMTkyODAxNmVmMjdhMWVjNDA0MWJj
ZDg4Y2U3Y2ZiOSAxMDA2NDQ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