<?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>39286</bug_id>
          
          <creation_ts>2010-05-18 05:19:12 -0700</creation_ts>
          <short_desc>SVG DOM inside an embed isn&apos;t preserved when display:none is set</short_desc>
          <delta_ts>2026-04-01 19:21:37 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://195.137.123.15/chrome/test1.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>45049</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter>steve.horsley</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>A.Mueller</cc>
    
    <cc>ap</cc>
    
    <cc>eric</cc>
    
    <cc>karlcow</cc>
    
    <cc>mario.bensi</cc>
    
    <cc>mike.capp</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>227267</commentid>
    <comment_count>0</comment_count>
    <who name="">steve.horsley</who>
    <bug_when>2010-05-18 05:19:12 -0700</bug_when>
    <thetext>An SVG graph is drawn in the DOM by javascript. If the div is hidden and then restored(by setting Display to &quot;none&quot; and back to &quot;block&quot;), all the dynamic DOM elements have disappeared. Also, after hidihg and re-showing the graph, the non-dynamic SVG &lt;g&gt; element can no longer have dynamically generated children added to it.

The URL http://195.137.123.15/chrome/test1.html gives a small demo of the problem. I can hide the graph by setting the div visibility to &quot;hidden&quot; and the graph is still there after setting it visible again, but in this case it still occupies screen space which I don&apos;t want. So</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>227270</commentid>
    <comment_count>1</comment_count>
    <who name="">steve.horsley</who>
    <bug_when>2010-05-18 05:22:07 -0700</bug_when>
    <thetext>P.S.
I couldn&apos;t get the nightly build to run. The problem I&apos;m reporting is present on Google Chrome on XP version 4.1.249.1064 (45376) and also on Chromium on Linux version 5.0.342.9 (43360) Ubuntu.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>227468</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-18 13:26:58 -0700</bug_when>
    <thetext>This is almost the same as bug 27775, but with SVG instead of a plug-in. But in this case, there is an easy workaround - there is no need to use &lt;embed&gt; to display SVG, it can be inserted directly into HTML content, or into an iframe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>227470</commentid>
    <comment_count>3</comment_count>
      <attachid>56408</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-18 13:30:17 -0700</bug_when>
    <thetext>Created attachment 56408
reduced test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>231154</commentid>
    <comment_count>4</comment_count>
    <who name="">steve.horsley</who>
    <bug_when>2010-05-27 00:25:22 -0700</bug_when>
    <thetext>Yes, inlining the SVG into xhtml is a usable workround, thanks. Of course, that means serving different pages to different browsers (IE) which is a nuisance, but that&apos;s not Chromium&apos;s problem, and on the other hand it opens new possibilities for modern browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295472</commentid>
    <comment_count>5</comment_count>
    <who name="Mike Capp">mike.capp</who>
    <bug_when>2010-10-18 06:07:46 -0700</bug_when>
    <thetext>Confirming on Chrome 6.0.472.63 and Safari 5.0.2, both on Win2003.

Steve, have you tried combining visibility:hidden with position:absolute as a workaround? That ought to prevent it messing up layout.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295507</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-10-18 08:17:43 -0700</bug_when>
    <thetext>*** Bug 45389 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>296099</commentid>
    <comment_count>7</comment_count>
    <who name="">steve.horsley</who>
    <bug_when>2010-10-19 03:42:31 -0700</bug_when>
    <thetext>&quot;Steve, have you tried combining visibility:hidden with position:absolute as a workaround?&quot;

No, I went for XHTML in the end. I realised that if I serve XHTML, then Firefox users could save the whole active page as a file for later reference (right-click, save page as...), which is a useful thing for them to be able to do. 

It&apos;s a shame that doesn&apos;t work in Chromium too, but Chromium also saves the dynamic DOM content as static SVG so you get double-images when viewing the saved file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518614</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-12-09 16:02:56 -0800</bug_when>
    <thetext>The reduction can&apos;t work due to data: urls having unique origins (at least in Chrome):

Unsafe JavaScript attempt to access frame with URL data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;100%&quot; height=&quot;100%&quot; viewBox=&quot;0 0 1000 400&quot;&gt;&lt;g id=&quot;layer1&quot;/&gt;&lt;/svg&gt; from frame with URL https://bug-39286-attachments.webkit.org/attachment.cgi?id=56408. Domains, protocols and ports must match.
attachment.cgi:8Uncaught TypeError: Cannot call method &apos;getElementById&apos; of undefined</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2196112</commentid>
    <comment_count>9</comment_count>
      <attachid>478900</attachid>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-04-01 19:21:37 -0700</bug_when>
    <thetext>Created attachment 478900
zip of testcase

unzip 
cd to the directory
python3 -m http.server
http://127.0.0.1:8000/test-embed-display-none.html
1. Draw pink circle
2. Hide
3. Show
4. Check DOM
5. Run automated test

In Safari after the hide. the show button doesn&apos;t reveal the drawing.
In Firefox/Chrome, it does.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>56408</attachid>
            <date>2010-05-18 13:30:17 -0700</date>
            <delta_ts>2010-05-18 13:30:17 -0700</delta_ts>
            <desc>reduced test case</desc>
            <filename>test1.html</filename>
            <type>text/html</type>
            <size>1139</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5IG9ubG9hZD0iaW5pdCgpIj4KPHNjcmlwdD4KZnVuY3Rpb24gaW5pdCgpIHsK
ICAgIERpdkdyYXBoID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImRpdkdyYXBoIik7CiAgICBT
aG93Z3JhcGggPSB0cnVlOwogICAgc3ZnZG9jID0gZG9jdW1lbnQuZGl2R3JhcGhzdmcuZ2V0U1ZH
RG9jdW1lbnQoKTsKICAgIExheWVyMSA9IHN2Z2RvYy5nZXRFbGVtZW50QnlJZCgibGF5ZXIxIik7
CiAgICAKICAgIGJveCA9IHN2Z2RvYy5jcmVhdGVFbGVtZW50TlMoImh0dHA6Ly93d3cudzMub3Jn
LzIwMDAvc3ZnIiwgInJlY3QiKTsKICAgIGJveC5zZXRBdHRyaWJ1dGUoIngiLCAiMTAwIik7CiAg
ICBib3guc2V0QXR0cmlidXRlKCJ5IiwgIjEwMCIpOwogICAgYm94LnNldEF0dHJpYnV0ZSgid2lk
dGgiLCAiNTAwIik7CiAgICBib3guc2V0QXR0cmlidXRlKCJoZWlnaHQiLCAiMjUwIik7CiAgICBi
b3guc2V0QXR0cmlidXRlKCJmaWxsIiwgInllbGxvdyIpOwogICAgYm94LnNldEF0dHJpYnV0ZSgi
c3Ryb2tlIiwgImJsdWUiKTsKICAgIGJveC5zZXRBdHRyaWJ1dGUoInN0cm9rZS13aWR0aCIsICI1
Iik7CiAgICBMYXllcjEuYXBwZW5kQ2hpbGQoYm94KTsKfQoKZnVuY3Rpb24gdG9nZ2xlKCkgewog
ICAgaWYoU2hvd2dyYXBoKSB7CiAgICAgICAgU2hvd2dyYXBoID0gZmFsc2U7CiAgICAgICAgRGl2
R3JhcGguc3R5bGUuZGlzcGxheSA9ICJub25lIjsKICAgIH0gZWxzZSB7CiAgICAgICAgU2hvd2dy
YXBoID0gdHJ1ZTsKICAgICAgICBEaXZHcmFwaC5zdHlsZS5kaXNwbGF5ID0gImJsb2NrIjsKICAg
IH0KfQo8L3NjcmlwdD4KCjxidXR0b24gb25jbGljaz0ndG9nZ2xlKCknPlRvZ2dsZSBib3g8L2J1
dHRvbj4KCjxkaXYgaWQ9ImRpdkdyYXBoIj4KPGVtYmVkIHNyYz0nZGF0YTppbWFnZS9zdmcreG1s
LDxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVp
Z2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTAwMCA0MDAiPjxnIGlkPSJsYXllcjEiLz48L3N2Zz4n
IHdpZHRoPSI4MDBweCIgaGVpZ2h0PSIyNjdweCIgdHlwZT0iaW1hZ2Uvc3ZnK3htbCIgbmFtZT0i
ZGl2R3JhcGhzdmciIGlkPSJkaXZHcmFwaHN2ZyI+CjwvZGl2PgoKCjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>478900</attachid>
            <date>2026-04-01 19:21:37 -0700</date>
            <delta_ts>2026-04-01 19:21:37 -0700</delta_ts>
            <desc>zip of testcase</desc>
            <filename>testcase.zip</filename>
            <type>application/zip</type>
            <size>2341</size>
            <attacher name="Karl Dubost">karlcow</attacher>
            
              <data encoding="base64">UEsDBBQACAAIAK1ZglwAAAAAAAAAAAAAAAAQACAAZW1iZWQtdGFyZ2V0LnN2Z3V4CwABBPUBAAAE
FAAAAFVUDQAHxtDNaW7RzWnK0M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