<?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>20506</bug_id>
          
          <creation_ts>2008-08-25 00:21:58 -0700</creation_ts>
          <short_desc>WRONG_DOCUMENT_ERR: DOM Exception 4 with JavaScript&apos;s &apos;document&apos; object and XHTML-inline SVG</short_desc>
          <delta_ts>2019-02-06 09:03:18 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://pastie.org/259289</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="elliottcable">bugs.webkit.org</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>cdumez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>89253</commentid>
    <comment_count>0</comment_count>
    <who name="elliottcable">bugs.webkit.org</who>
    <bug_when>2008-08-25 00:21:58 -0700</bug_when>
    <thetext>Error: WRONG_DOCUMENT_ERR: DOM Exception 4

http://pastie.org/259289 (line 59)

I could be wrong (I&apos;m a noob to this stuff), but I believe this has something to do with trying to refer to the &apos;document&apos; object in JavaScript with embedded SVG within an XHTML document (true XHTML, with proper markup and served as application/xhtml+xml).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89257</commentid>
    <comment_count>1</comment_count>
    <who name="elliottcable">bugs.webkit.org</who>
    <bug_when>2008-08-25 01:22:39 -0700</bug_when>
    <thetext>After some more debugging, I find that the line causing the error is in fact line 59 of this slightly modified test case:

http://pastie.org/259289

So it has something to do with appendChild, though I&apos;m still not sure exactly what.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89264</commentid>
    <comment_count>2</comment_count>
      <attachid>22976</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-08-25 03:26:55 -0700</bug_when>
    <thetext>Created attachment 22976
test case

Attaching the same test as an attachment.

It is not immediately obvious whether this is a bug or just a difference with Firefox. In any case, you can probably work around this by using importNode to ensure that the nodes are in the same document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89292</commentid>
    <comment_count>3</comment_count>
    <who name="elliottcable">bugs.webkit.org</who>
    <bug_when>2008-08-25 09:53:20 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; It is not immediately obvious whether this is a bug or just a difference with
&gt; Firefox. In any case, you can probably work around this by using importNode to
&gt; ensure that the nodes are in the same document.

Not sure about that - trying to debug the same original code in FireFox as well, right now, causes other, even weirder errors there (&quot;[Exception... &quot;Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLDocument.importNode]&quot; nsresult: &quot;0x80070057 (NS_ERROR_ILLEGAL_VALUE)&quot; location: &quot;JS frame :: http://geoffrey.elliottcable.name/board/4/game_board_4.xhtml :: writeSVG :: line 355&quot; data: no]&quot;? What does that even _mean_?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89293</commentid>
    <comment_count>4</comment_count>
    <who name="elliottcable">bugs.webkit.org</who>
    <bug_when>2008-08-25 09:57:44 -0700</bug_when>
    <thetext>Another thing worth pointing out is that FireFox chokes up on the use of ( new DOMParser() ).parseFromString(svgSource, &quot;text/xml&quot;) when the source is SVG - it returns XML objects, not the SVG objects that it actually uses internally for SVG elements. Thus there&apos;s problems with XML/SVG documents and using that - perhaps there&apos;s a similar problem going on under the hood here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502944</commentid>
    <comment_count>5</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:03:18 -0800</bug_when>
    <thetext>Mass moving XML DOM bugs to the &quot;DOM&quot; Component.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>22976</attachid>
            <date>2008-08-25 03:26:55 -0700</date>
            <delta_ts>2008-08-25 03:26:55 -0700</delta_ts>
            <desc>test case</desc>
            <filename>pastie-259289.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>2609</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnIHN0YW5kYWxvbmU9J25vJz8+Cjwh
RE9DVFlQRSBodG1sIFBVQkxJQyAnLS8vVzNDLy9EVEQgWEhUTUwgMS4xIHBsdXMgTWF0aE1MIDIu
MCBwbHVzIFNWRyAxLjEvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvMjAwMi8wNC94aHRtbC1tYXRo
LXN2Zy94aHRtbC1tYXRoLXN2Zy5kdGQnPgo8aHRtbCB4bWxucz0naHR0cDovL3d3dy53My5vcmcv
MTk5OS94aHRtbCcgeG1sOmxhbmc9J2VuJyBkZWJ1Zz0ndHJ1ZSc+CiAgPGhlYWQgcHJvZmlsZT0n
aHR0cDovL2dtcGcub3JnL3hmbi8xMSc+CiAgICA8bWV0YSBodHRwLWVxdWl2PSdDb250ZW50LVR5
cGUnIGNvbnRlbnQ9J2FwcGxpY2F0aW9uL3hodG1sK3htbDtjaGFyc2V0PXV0Zi04Jy8+CiAgICA8
dGl0bGU+ZGVidWdnaW5nIGZpbGU8L3RpdGxlPgogICAgPGxpbmsgcmVsPSdjb3B5cmlnaHQnIGhy
ZWY9J2h0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC8nIHR5
cGU9J3RleHQvaHRtbDtjaGFyc2V0PXV0Zi04JyAvPgogICAgPHN0eWxlIHR5bGU9InRleHQvY3Nz
IiBpZD0iaGFyZGNvZGVkIj4KICAgICAgPCFbQ0RBVEFbCiAgICAgICAgKiB7CiAgICAgICAgICBt
YXJnaW46IDA7CiAgICAgICAgICBwYWRkaW5nOiAwOwogICAgICAgIH0KICAgICAgICBodG1sLCBi
b2R5IHsKICAgICAgICAgIGhlaWdodDogMTAwJTsKICAgICAgICB9CiAgICAgICAgaHRtbCB7CiAg
ICAgICAgICBiYWNrZ3JvdW5kOiAjMDAwMDAwOwogICAgICAgICAgY29sb3I6ICNGRkZGRkY7CiAg
ICAgICAgfQogICAgICAgIGJvZHkgewogICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAg
ICAgICAgZGlzcGxheTogdGFibGU7CiAgICAgICAgICAgbWFyZ2luOiAwIGF1dG87CiAgICAgICAg
ICAgdmVydGljYWwtYWxpZ246IG1pZGRsZTsKICAgICAgICB9CiAgICAgICAgI2V2ZXJ5dGhpbmcg
ewogICAgICAgICAgd2lkdGg6IDUwZW07CiAgICAgICAgICBkaXNwbGF5OiB0YWJsZS1jZWxsOwog
ICAgICAgICAgdmVydGljYWwtYWxpZ246IG1pZGRsZTsKICAgICAgICB9CiAgICAgICAgCiAgICAg
ICAgI2JvYXJkIHsKICAgICAgICAgIG1hcmdpbi1sZWZ0OiBhdXRvOwogICAgICAgICAgbWFyZ2lu
LXJpZ2h0OiBhdXRvOwogICAgICAgIH0KCiAgICAgICAgLnRpbGUgewogICAgICAgICAgc3Ryb2tl
OiAjNDc0NzQ3OwogICAgICAgICAgc3Ryb2tlLXdpZHRoOiAuMjU7CiAgICAgICAgfQogICAgICAg
IAogICAgICAgIC50aWxlIC5iYWNrZ3JvdW5kIHsKICAgICAgICAgIGZpbGw6ICMwMDk5MDA7CiAg
ICAgICAgfQ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