Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5068)

Unified Diff: chrome/renderer/resources/extensions/tag_watcher.js

Issue 14222005: Fix TagWatcher when a text node is added. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/tag_watcher.js
diff --git a/chrome/renderer/resources/extensions/tag_watcher.js b/chrome/renderer/resources/extensions/tag_watcher.js
index 815eb604b7e7f90e8b1687b6fe4cbc37c0e775fd..1f5aaa7c651a20482e215373e1932f3ca7244606 100644
--- a/chrome/renderer/resources/extensions/tag_watcher.js
+++ b/chrome/renderer/resources/extensions/tag_watcher.js
@@ -21,10 +21,11 @@ function watchForTag(tagName, cb) {
var documentObserver = new WebKitMutationObserver(function(mutations) {
forEach(mutations, function(i, mutation) {
forEach(mutation.addedNodes, function(i, addedNode) {
- if (addedNode.tagName == tagName) {
- cb(addedNode);
+ if (addedNode.nodeType == Node.ELEMENT_NODE) {
+ if (addedNode.tagName == tagName)
+ cb(addedNode);
+ findChildTags(addedNode);
}
- findChildTags(addedNode);
});
});
});
@@ -32,4 +33,3 @@ function watchForTag(tagName, cb) {
}
exports.watchForTag = watchForTag;
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698