Closed
Bug 827990
Opened 11 years ago
Closed 11 years ago
inspector tests use DOM MutationObserver API incorrectly
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 21
People
(Reporter: froydnj, Assigned: paul)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
2.84 KB,
patch
|
jwalker
:
review+
froydnj
:
feedback+
|
Details | Diff | Splinter Review |
I'm debugging some issues with page event queues (bug 715376) and am running into an error with browser_inspector_markup_edit.js. The below log is from Linux64, but the error occurs on all platforms: https://tbpl.mozilla.org/php/getParsedLog.php?id=18584189&tree=Try#error1 As near as I can tell, what happens is this: 1. We start a test from inside a function called from the event loop (on a clean tree, the function is injected directly into the event loop; in the above tree, the function is called via setTimeout) The call to executeSoon with this handler function is here: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/markupview/test/browser_inspector_markup_edit.js#353 which is going to trigger the handler for a new-node event here: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/markupview/test/browser_inspector_markup_edit.js#347 which is going to call the functions below. 2. We select a node of interest: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/markupview/test/browser_inspector_markup_edit.js#248 This code causes a MutationObserver to be set up on the node in question. 3. Perform various things to trigger the mutation observer: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/markupview/test/browser_inspector_markup_edit.js#258 4. And finally, check various things, some of which should have been set by the mutation observer: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/markupview/test/browser_inspector_markup_edit.js#269 Notice that this is all done in the context of the handler function. Which means--assuming I understand smaug's explanation of the MutationObserver API--that the changes we expect to see in step 4 don't actually happen until the handler stops running. At least, that's what seems to be happening in my tree. I don't understand why this same issue doesn't show up in an unpatched tree. The fix is simple enough. But I wanted to file this bug to see if somebody had an opinion on my analysis.
Reporter | ||
Comment 1•11 years ago
|
||
This is the easy fix. Note that this matches what we already do in the undoRedo() function a few lines later.
Assignee | ||
Comment 2•11 years ago
|
||
See also modifications of this test in bug 814889 (to land soon), which, more or less, do the same thing but for another part of the test.
Reporter | ||
Comment 3•11 years ago
|
||
Ah, thanks for pointing that out! If that's going to land soon (and it looks like it is), it's a much better solution.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Nathan Froyd (:froydnj) from comment #3) > Ah, thanks for pointing that out! If that's going to land soon (and it > looks like it is), it's a much better solution. > > *** This bug has been marked as a duplicate of bug 814889 *** Does 814889's patch covers what is addressed in your patch?
Reporter | ||
Comment 5•11 years ago
|
||
(In reply to Paul Rouget [:paul] from comment #4) > (In reply to Nathan Froyd (:froydnj) from comment #3) > > Ah, thanks for pointing that out! If that's going to land soon (and it > > looks like it is), it's a much better solution. > > > > *** This bug has been marked as a duplicate of bug 814889 *** > > Does 814889's patch covers what is addressed in your patch? Whoops! No, they don't.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Assignee | ||
Comment 6•11 years ago
|
||
I'll do the same modifications for testAsyncSetup.
Assignee: nobody → paul
Assignee | ||
Comment 7•11 years ago
|
||
Nathan, can you tell me if this works for you?
Attachment #699390 -
Attachment is obsolete: true
Attachment #699634 -
Flags: feedback?(nfroyd)
Reporter | ||
Comment 8•11 years ago
|
||
Comment on attachment 699634 [details] [diff] [review] v1 Yup, that seems to fix the bug for me! Thanks!
Attachment #699634 -
Flags: feedback?(nfroyd) → feedback+
Assignee | ||
Updated•11 years ago
|
Attachment #699634 -
Flags: review?(jwalker)
Updated•11 years ago
|
Attachment #699634 -
Flags: review?(jwalker) → review+
Assignee | ||
Updated•11 years ago
|
Whiteboard: [land-in-fx-team]
Comment 9•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/19bbc804d676
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Comment 10•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/19bbc804d676
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 21
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•