Possible bug, or missuage of the API?

84 views
Skip to first unread message

Alex Bennée

unread,
Nov 7, 2012, 9:07:57 AM11/7/12
to mutation-sum...@googlegroups.com
I'm trying to work out if I've triggered a bug or mis-understanding the API usage.

I've written a test page for my extension which simulates DOM manipulation to ensure I tag text areas correctly: 


One of the problems I have to deal with is over-exuberant DOM manipulations  copying the little edit-buttons I add to the page when they duplicate/clone areas of the page. So I've used the mutation-summary library thusly:

       var textarea_observer = new MutationSummary({
            callback: handleUpdatedElements,
            observeOwnChanges: false,
            queries: [
                {   // we don't want the source page accidently duplicating our tags
                    element: "img[class='ewe_edit_button']"
                },
                {
                    element: "textarea"
                },
                {
                    element: "div[contenteditable='true']"
                },
                {
                    element: "div[contenteditable='plain-text-only']"
                }
            ]
        });

However on the callback it only refers to one added element, the img (which will get removed). If I comment out the first query I do indeed get the new textarea reported. The two elements are next to each other but they don't contain each other. Have I triggered a bug?

Regards,

Alex.

Alex Bennée

unread,
Nov 10, 2012, 11:12:57 AM11/10/12
to mutation-sum...@googlegroups.com


On Wednesday, 7 November 2012 14:07:57 UTC, Alex Bennée wrote:
I'm trying to work out if I've triggered a bug or mis-understanding the API usage.


However on the callback it only refers to one added element, the img (which will get removed). If I comment out the first query I do indeed get the new textarea reported. The two elements are next to each other but they don't contain each other. Have I triggered a bug?

Ignore me, I'd misunderstood the API. There is an array of summaries, one per query.
 

Regards,

Alex.
Reply all
Reply to author
Forward
0 new messages