<?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>93784</bug_id>
          
          <creation_ts>2012-08-12 13:27:16 -0700</creation_ts>
          <short_desc>SVG textNode.getNumberOfChars reports 0 when it hasn&apos;t been attached to the document</short_desc>
          <delta_ts>2022-07-13 13:17:24 -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>RESOLVED</bug_status>
          <resolution>WORKSFORME</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>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Jon">jonnew</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>rniwa</cc>
    
    <cc>zalan</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>693312</commentid>
    <comment_count>0</comment_count>
      <attachid>157908</attachid>
    <who name="Jon">jonnew</who>
    <bug_when>2012-08-12 13:27:16 -0700</bug_when>
    <thetext>Created attachment 157908
Demonstrates incorrect value for textNode.getNumberOfChars()

To reproduce:
1. Dynamically create an SVG node, an SVG text node, and a text element
2. Add the text &quot;hello&quot; to the text element, and append the text element to the text node, and the text node to the svg node.
3. On the text node call getNumberOfChars()

What is the expected result?
5, the number of characters in &quot;hello&quot;

What happens instead?
0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882977</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-13 04:47:49 -0700</bug_when>
    <thetext>First the attached test case is in Quirks mode (although downloading and adding DOCTYPE also have same result across all browsers) and I am getting following in console across browsers:

*** Safari 15.5 on macOS 12.4 ****

Unappended Node. Expecting 5, but is actually: 0
Appended Node. Expecting 5, but is actually: 5

*** Chrome Canary 105 ****

Unappended Node. Expecting 5, but is actually: 0
Appended Node. Expecting 5, but is actually: 5

*** Firefox Nightly 104 ****

Unappended Node. Expecting 5, but is actually: 0
Appended Node. Expecting 5, but is actually: 5

Since it is consistent across all browsers, I think this can be considered as &quot;RESOLVED WONTFIX&quot; or &quot;RESOLVED INVALID&quot;. Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>157908</attachid>
            <date>2012-08-12 13:27:16 -0700</date>
            <delta_ts>2012-08-12 13:27:16 -0700</delta_ts>
            <desc>Demonstrates incorrect value for textNode.getNumberOfChars()</desc>
            <filename>svgBug1.html</filename>
            <type>text/html</type>
            <size>1217</size>
            <attacher name="Jon">jonnew</attacher>
            
              <data encoding="base64">PGh0bWw+DQo8aGVhZD4NCjwvaGVhZD4NCjxib2R5Pg0KCTxkaXYgaWQ9ImhvbGRlciI+PC9kaXY+
DQo8c2NyaXB0Pg0KIHdpbmRvdy5vbmxvYWQgPSBmdW5jdGlvbigpew0KIA0KCXZhciBuYW1lc3Bh
Y2UgPSAiaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciOw0KCQ0KCS8vc2V0dGluZyB1cCBzdmcg
bm9kZQ0KCXZhciBzdmdOb2RlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKG5hbWVzcGFjZSwg
InN2ZyIpOw0KCXN2Z05vZGUuc2V0QXR0c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