WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
83218
[MutationObservers] implement takeRecords()
https://bugs.webkit.org/show_bug.cgi?id=83218
Summary
[MutationObservers] implement takeRecords()
Rafael Weinstein
Reported
2012-04-04 14:28:00 PDT
Per
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16606
, MutationObserver should expose a takeRecords() call which synchronously retrieves & clears any pending mutation records. If none are pending, it should return an empty array. It should not do anything else (in particular, it should not clear transient observers). Anne has committed to updating the spec by end of week.
Attachments
Patch
(7.63 KB, patch)
2012-04-04 14:31 PDT
,
Rafael Weinstein
no flags
Details
Formatted Diff
Diff
Patch
(7.62 KB, patch)
2012-04-04 15:55 PDT
,
Rafael Weinstein
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Rafael Weinstein
Comment 1
2012-04-04 14:31:12 PDT
Created
attachment 135685
[details]
Patch
Adam Klein
Comment 2
2012-04-04 14:40:22 PDT
Comment on
attachment 135685
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=135685&action=review
> Source/WebCore/dom/WebKitMutationObserver.h:36 > +#include "MutationCallback.h"
No need for this include...
> Source/WebCore/dom/WebKitMutationObserver.h:82 > + MutationRecordArray takeRecords();
...or this use of the MutationRecordArray typedef. That's only necessary to deal with the way Callbacks are handled by WebKit's IDL processing. I'd make this the same return type name as m_records, i.e., Vector<RefPtr<MutationRecord> >. Alternatively, I suppose you could use the typedef as the type of m_records as well, if you think that type name's too much to be repeating.
> Source/WebCore/dom/WebKitMutationObserver.idl:39 > + sequence<MutationRecord> takeRecords();
Awesome, no custom code?
> LayoutTests/fast/mutation/observe-subtree.html:59 > +function testTakeRecords() {
I'd rather see this test in its own file for clarity: it's testing the takeRecords method, not subtree observation.
Ojan Vafai
Comment 3
2012-04-04 15:01:42 PDT
Comment on
attachment 135685
[details]
Patch r=me once you address Adam's comments.
Build Bot
Comment 4
2012-04-04 15:10:11 PDT
Comment on
attachment 135685
[details]
Patch
Attachment 135685
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/12331064
Adam Klein
Comment 5
2012-04-04 15:12:03 PDT
(In reply to
comment #4
)
> (From update of
attachment 135685
[details]
) >
Attachment 135685
[details]
did not pass mac-ews (mac): > Output:
http://queues.webkit.org/results/12331064
As a bonus, not using the typedef (and thus the #include of MutationCallback.h) should make this error go away.
Rafael Weinstein
Comment 6
2012-04-04 15:55:02 PDT
Created
attachment 135705
[details]
Patch
WebKit Review Bot
Comment 7
2012-04-04 19:50:43 PDT
Comment on
attachment 135705
[details]
Patch Clearing flags on attachment: 135705 Committed
r113279
: <
http://trac.webkit.org/changeset/113279
>
WebKit Review Bot
Comment 8
2012-04-04 19:50:48 PDT
All reviewed patches have been landed. Closing bug.
Simon Fraser (smfr)
Comment 9
2012-04-05 11:02:28 PDT
This broke the window-properties.html test:
http://build.webkit.org/results/Lion%20Release%20(Tests)/r113279%20(7284)/fast/dom/Window/window-properties-pretty-diff.html
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug