<?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>93787</bug_id>
          
          <creation_ts>2012-08-12 14:05:04 -0700</creation_ts>
          <short_desc>DOMCharacterDataModified incorrectly firing for innerHTML changes</short_desc>
          <delta_ts>2022-08-02 09:03:14 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>18169</dup_id>
          
          <bug_file_loc>http://jsfiddle.net/newtang/kysTm/15/</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>abarth</cc>
    
    <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>jeffrey+webkit</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>693316</commentid>
    <comment_count>0</comment_count>
    <who name="Jon">jonnew</who>
    <bug_when>2012-08-12 14:05:04 -0700</bug_when>
    <thetext>To reproduce:
1. Have a node that contains only text.  Add a DOMCharacterDataModified event listener
2. Change the node&apos;s contents using innerHTML

What is the expected result?
DOMCharacterDataModified does not fire.  The W3 spec (http://www.w3.org/TR/DOM-Level-2-Events/events.html) says, &quot;Fired after CharacterData within a node has been modified but the node itself has not been inserted or deleted.&quot;  I didn&apos;t think innerHTML would adjust the existing textNode; I thought it would replace it with a completely different node.

What happens instead?
DOMCharacterDataModified does fire.

I made this jsFiddle to demonstrate: http://jsfiddle.net/newtang/kysTm/15/

and created this StackOverflow question:
http://stackoverflow.com/questions/6528511/domcharacterdatamodified-not-firing-consistently-across-firefox-and-chrome-who-i

It appears that Firefox is handling this situation correctly, but ultimately, I&apos;m more interested in consistency across the browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503183</commentid>
    <comment_count>1</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:18:31 -0800</bug_when>
    <thetext>Mass move bugs into the DOM component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888372</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-02 06:18:35 -0700</bug_when>
    <thetext>Following is output of all browsers:

*** Safari 15.6 on macOS 12.5 ***

DOMSubtreeModified
DOMNodeInserted
DOMSubtreeModified

*** Chrome Canary 106 ***

DOMSubtreeModified
DOMNodeInserted
DOMSubtreeModified

*** Firefox Nightly 105 ***

DOMNodeInserted

_________

I am not clear on web-spec but this is output across all browsers, please mark this bug according. If it is bug and Firefox behavior is aligned with web-spec then it can be changed to &quot;New&quot; status but if Safari is correct then it can be marked as &quot;RESOLVED CONFIGURATION CHANGED&quot; or something. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888373</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-02 06:20:08 -0700</bug_when>
    <thetext>Further the test case from StackOverflow:

Link - https://jsfiddle.net/doktormolle/yQu8v/

It shows same across all browsers:

DOMCharacterDataModified
DOMSubtreeModified</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888405</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-08-02 09:03:14 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 18169 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>