Bug 98438 - MutationRecord attributeName should be null for non attribute changes
Summary: MutationRecord attributeName should be null for non attribute changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adam Klein
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2012-10-04 12:26 PDT by Erik Arvidsson
Modified: 2012-10-05 13:13 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.96 KB, patch)
2012-10-04 14:57 PDT, Adam Klein
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2012-10-04 12:26:59 PDT
We return '' instead of null for atributeName when the type is characterData (I didn't try childNodes but I assume we have the same issue there and other places).

Steps to reproduce

var text = document.createTextNode('abc');
var observer = new WebKitMutationObserver(function() {});
observer.observe(text, {
  characterData: true
});
text.data = 'def';

var records = observer.takeRecords();
shouldBeNull('record[0].attributeName');
Comment 1 Erik Arvidsson 2012-10-04 12:50:19 PDT
Also see bug 98439 which is about oldValue not being null when expected
Comment 2 Adam Klein 2012-10-04 13:50:59 PDT
I'll take both this and 98439 (will fix them in the same patch).
Comment 3 Adam Klein 2012-10-04 14:57:56 PDT
Created attachment 167181 [details]
Patch
Comment 4 WebKit Review Bot 2012-10-04 18:02:20 PDT
Comment on attachment 167181 [details]
Patch

Clearing flags on attachment: 167181

Committed r130442: <http://trac.webkit.org/changeset/130442>
Comment 5 WebKit Review Bot 2012-10-04 18:02:25 PDT
All reviewed patches have been landed.  Closing bug.