Closed Bug 1188613 Opened 4 years ago Closed 4 years ago

Class attribute mutations sometimes missed

Categories

(DevTools :: Inspector, defect)

41 Branch
defect
Not set

Tracking

(firefox40 wontfix, firefox41 fixed, firefox42 fixed, firefox43 fixed)

RESOLVED FIXED
Firefox 43
Tracking Status
firefox40 --- wontfix
firefox41 --- fixed
firefox42 --- fixed
firefox43 --- fixed

People

(Reporter: cureo, Assigned: jryans)

References

Details

(Keywords: regression, Whiteboard: [polish-backlog])

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20150725004004

Steps to reproduce:

I'm trying to add class to element with jquery with clicking the button.
Clicking the button should add class to first div without class.


Actual results:

First click on my button do nothing in inspector (should show added class to first div)
Second click show added class to first and second div (what is ok)

So it looks like inpector "reaction" is not live.
Of course when I reopen inspector all classes are ok immediately.

Now I only report this problem with adding class. Other DOM manipulations are shown in inspector immediately.

So my example code is
$('someButton').on('click', function(){
    $('div:not(.myClass):first').addClass('myClass');
}

structure of divs is
<div id="wrapper">
     <div>lorem</div>
     <div>ipsum</div>
     <div>dolor</div>
</div>

after first click in inspector structure looks like
<div id="wrapper">
     <div>lorem</div>
     <div>ipsum</div>
     <div>dolor</div>
</div>

after second click
<div id="wrapper">
     <div class="myClass">lorem</div>
     <div class="myClass">ipsum</div>
     <div>dolor</div>
</div>
Component: Untriaged → Developer Tools: Inspector
Can you supply a test URL to ease reproducing the issue?
Flags: needinfo?(cureo)
I'm having this issue with website which is developed localy.
I add the host to my hosts and using it as URL but webserver is running localy on my laptop
Flags: needinfo?(cureo)
Can you create a demo page using a service like JS Bin[1] or similar?

Or, just create an HTML file with inline scripts / styles, and attach it to this bug.

[1]: http://jsbin.com/
Flags: needinfo?(cureo)
I just send You an email.
Flags: needinfo?(cureo) → needinfo?(jryans)
I've been able to reproduce this on the reporter's development site.

Some class attribute changes are missed, and the following exception is logged in the browser console:

TypeError: value is null
Stack trace:
ElementEditor.prototype._createAttribute/collapse@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/markupview/markup-view.js:2741:1
ElementEditor.prototype._createAttribute@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/markupview/markup-view.js:2751:49
ElementEditor.prototype.update@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/markupview/markup-view.js:2573:25
MarkupContainer.prototype.update@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/markupview/markup-view.js:2085:7
MarkupView.prototype._mutationObserver@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/markupview/markup-view.js:797:9
emitOnObject@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:112:9
emit@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:89:38
exports.WalkerFront<.getMutations</<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:3385:7
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:934:23
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:813:7
Promise*this.PromiseWalker.scheduleWalkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:744:11
this.PromiseWalker.schedulePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:776:7
this.PromiseWalker.completePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:711:7
Front<.onPacket/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1228:9
DevTools RDP*Front<.request@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1178:7
frontProto/</proto[name]@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1330:14
exports.WalkerFront<.getMutations<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:3267:12
exports.WalkerFront<.onMutations<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:3397:5
Front<.onPacket/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1201:36
Front<.onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1201:9
DebuggerClient.prototype.onPacket@resource://gre/modules/devtools/dbg-client.jsm:976:7
LocalDebuggerTransport.prototype.send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:569:11
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jryans)
Summary: Developers Tool Inspector no class added → Class attribute mutations sometimes missed
Whiteboard: [polish-backlog]
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Looking back at version control history suggests this was first caused by https://hg.mozilla.org/mozilla-central/rev/ff7083dc49b4 (bug 952511 / Firefox 29), but that's quite a long time ago.  I tried Firefox 29, and I couldn't reproduce the issue there.
Keywords: regression
It at least goes back to current release.
Bug 1188613 - Handle attribute mutations with null value. r=pbrosset
Attachment #8646934 - Flags: review?(pbrosset)
Comment on attachment 8646934 [details]
MozReview Request: Bug 1188613 - Handle attribute mutations with null value. r=pbrosset

The code changes look good to me.
(for some reason mozreview won't let me login today with my bugzilla credentials, that's why I'm R+'ing this from bugzilla instead).
Attachment #8646934 - Flags: review?(pbrosset) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/227e3bec8d13
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Blocks: 952511
Comment on attachment 8646934 [details]
MozReview Request: Bug 1188613 - Handle attribute mutations with null value. r=pbrosset

Approval Request Comment
[Feature/regressing bug #]: Bug 952511 perhaps, exact regression point unclear
[User impact if declined]: Some CSS class changes may go unnoticed by inspector, leading to developer confusion
[Describe test coverage new/current, TreeHerder]: On m-c
[Risks and why]: Low, change is simple, only affects DevTools
[String/UUID change made/needed]: None
Attachment #8646934 - Flags: approval-mozilla-beta?
Attachment #8646934 - Flags: approval-mozilla-aurora?
Comment on attachment 8646934 [details]
MozReview Request: Bug 1188613 - Handle attribute mutations with null value. r=pbrosset

The patch has been on m-c for 3-4 days and is a simple change, let's uplift to Aurora and Beta.
Attachment #8646934 - Flags: approval-mozilla-beta?
Attachment #8646934 - Flags: approval-mozilla-beta+
Attachment #8646934 - Flags: approval-mozilla-aurora?
Attachment #8646934 - Flags: approval-mozilla-aurora+
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.