Closed Bug 1188613 Opened 4 years ago Closed 4 years ago

Class attribute mutations sometimes missed


(DevTools :: Inspector, defect)

41 Branch
Not set


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

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


(Reporter: cureo, Assigned: jryans)



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


(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(){

structure of divs is
<div id="wrapper">

after first click in inspector structure looks like
<div id="wrapper">

after second click
<div id="wrapper">
     <div class="myClass">lorem</div>
     <div class="myClass">ipsum</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.

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
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
Ever confirmed: true
Flags: needinfo?(jryans)
Summary: Developers Tool Inspector no class added → Class attribute mutations sometimes missed
Whiteboard: [polish-backlog]
Assignee: nobody → jryans
Looking back at version control history suggests this was first caused by (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
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.