<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Factor out the &quot;paint item&quot; logic in RenderListBox into a helper."
   href="https://bugs.webkit.org/show_bug.cgi?id=157117">157117</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Factor out the &quot;paint item&quot; logic in RenderListBox into a helper.
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Local Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Layout and Rendering
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tonikitoo&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>darin&#64;apple.com, dbates&#64;webkit.org, simon.fraser&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>156590
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code appears almost identical twice in ::paintObject.

As per the review comments in <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - &lt;select multiple&gt; padding should react when scrolling"
   href="show_bug.cgi?id=156590">bug 156590</a> (<a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - &lt;select multiple&gt; padding should react when scrolling"
   href="show_bug.cgi?id=156590#c16">https://bugs.webkit.org/show_bug.cgi?id=156590#c16</a> and <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - &lt;select multiple&gt; padding should react when scrolling"
   href="show_bug.cgi?id=156590#c14">https://bugs.webkit.org/show_bug.cgi?id=156590#c14</a>),
it might be nice to factor out this block to avoid duplication.

void RenderListBox::paintObject(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset)
{
    if (style().visibility() != VISIBLE)
        return;

    (...)
    if (paintInfo.phase == PaintPhaseForeground) {{
        int index = m_indexOffset;
        while (index &lt; listItemsSize &amp;&amp; index &lt;= m_indexOffset + numVisibleItems()) {
            paintItemForeground(paintInfo, paintOffset, index);
            index++;
        }
    }

    (...)
    case PaintPhaseChildBlockBackground:
    case PaintPhaseChildBlockBackgrounds: {
        int index = m_indexOffset;
        while (index &lt; listItemsSize &amp;&amp; index &lt;= m_indexOffset + numVisibleItems()) {
            paintItemBackground(paintInfo, paintOffset, index);
            index++;
        }
    }
    (...)
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>