<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 - Div inside SVG foreignObject loses its position and not visible in MAC Chrome browser and mobile view."
   href="https://bugs.webkit.org/show_bug.cgi?id=165516">165516</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Div inside SVG foreignObject loses its position and not visible in MAC Chrome browser and mobile view.
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>iPhone / iPad
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>macOS 10.12
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>Critical
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>SVG
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sinish&#64;amt.in
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>zimmermann&#64;kde.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I tried to run this HTML5 SVG code in MAC chrome (54.0.2840.98 (64-bit)); but the DIV inside the become invisible (or seems to be losing its position/jumping out from the SVG) when content in the DIV Overflows or scrollbar comes. However it works perfectly in MAC Firefox and all browsers in Windows (except Mobile views).


Is it any issue regarding

viewport metadata?
div inside ForeignObject?
MAC chrome bug?
CSS? How can we solve this?. Your help is much appreciated.

What I tried

Test html file <a href="https://www.dropbox.com/s/ygz6x0mu6sfhkes/testsvg.html?dl=0">https://www.dropbox.com/s/ygz6x0mu6sfhkes/testsvg.html?dl=0</a>

Found a similar bug in webkit forum

<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Layer content inside HTML in SVG foreignObject renders in the wrong place"
   href="show_bug.cgi?id=23113">https://bugs.webkit.org/show_bug.cgi?id=23113</a>


/////////////-HEAD-///////////

&lt;meta content=&quot;width=device-width, initial-scale=1&quot; name=&quot;viewport&quot; /&gt;

////////////-BODY-////////////

 &lt;svg xmlns=&quot;<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>&quot;  viewBox=&quot;0 0 1600 1200&quot;&gt;
    &lt;rect class=&quot;cls-a&quot; x=&quot;568.13&quot; y=&quot;103.99&quot; width=&quot;409.76&quot; height=&quot;350.53&quot;  /&gt;
    &lt;rect class=&quot;cls-b&quot; x=&quot;602.86&quot; y=&quot;159.55&quot; width=&quot;340.31&quot; height=&quot;350.28&quot; rx=&quot;13.35&quot; ry=&quot;13.35&quot;/&gt;
    &lt;foreignObject class=&quot;chat-outer&quot; x=&quot;602.86&quot; y=&quot;159.55&quot; width=&quot;340.31&quot; height=&quot;300.28&quot; rx=&quot;13.35&quot; ry=&quot;13.35&quot;&gt;
      &lt;div xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot;&gt;      
        &lt;div class=&quot;list-wrap&quot; &gt;        
         &lt;div&gt;
          &lt;div class=&quot;list-content&quot;&gt;
           &lt;div class=&quot;list-row&quot;&gt;
            &lt;p  &gt;Hi&lt;/p&gt;
           &lt;/div&gt;
           &lt;div class=&quot;list-row&quot;&gt;
            &lt;p  &gt;Hello&lt;/p&gt;
           &lt;/div&gt;
           &lt;div class=&quot;list-row&quot;&gt;
            &lt;p &gt;how are you?&lt;/p&gt;
           &lt;/div&gt;
          &lt;/div&gt;
         &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
     &lt;/foreignObject&gt;   
 &lt;/svg&gt;

////////////////-CSS-//////////////

.list-content {
            height: 280px;
            padding: 0px 25px;
            background: #ffccbc;
            overflow: hidden;
            overflow-y: auto;
}</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>