Closed
Bug 912754
Opened 12 years ago
Closed 12 years ago
Mutation observer not fired if <link>.disabled is changed
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: sunil, Unassigned)
Details
Attachments
(1 file)
|
1.68 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36
Steps to reproduce:
In the attached html, if you click on 'Increase Font Size' or 'Decrease Font Size', we mark certain elements as disabled and certain other elements as active.
We doe this by changing 'disabled' property to true or false.
Similarly if you click on 'Change class' it changes the 'class property' of an elem.
Actual results:
Mutations are generated when changing class property but not when changing disabled property.
Expected results:
Mutations events should have been generated for both kind of changes.
In Chrome mutations are generated for both kind of changes.
Updated•12 years ago
|
Attachment #799813 -
Attachment mime type: text/plain → text/html
Comment 1•12 years ago
|
||
> In Chrome mutations are generated for both kind of changes.
Well, then Chrome is buggy. From the spec at <http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#dom-link-disabled>:
The IDL attribute disabled only applies to style sheet links. When the link element
defines a style sheet link, then the disabled attribute behaves as defined for the
alternative style sheets DOM. For all other link elements it always return false and
does nothing on setting.
which links to http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#dom-linkstyle-disabled which says:
The disabled IDL attribute on link and style elements must return false and do nothing
on setting, if the sheet attribute of their LinkStyle interface is null. Otherwise, it
must return the value of the StyleSheet interface's disabled attribute on getting, and
forward the new value to that same attribute on setting.
So setting a.disabled when 'a'' is a <link> pointing to a stylesheet is the same as setting a.sheet.disabled. Which is not a change to the DOM and hence does not fire any MutationObservers (what the testcase tests) or mutation events (which the testcase doesn't test).
Please do report a bug to Blink on their broken .disabled setter?
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Summary: Mutation event not fired if elem.disabled is changed → Mutation observer not fired if <link>.disabled is changed
Updated•12 years ago
|
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Thanks for the clarification, will surely file a bug with Blink.
BTW, is there a list of 'property' changes similar to 'disabled' that won't generate mutation events that I can test against FF/Chrome/Safari and report appropriate bugs?
Comment 3•12 years ago
|
||
Any property not reflected into the DOM. Say .value on a textarea. Or .style on any HTML element. Or .noSuchPropertyThere on any element... There are probably others.
Interestingly changing '.style' on HTML element seems to be generating mutation event, so there isn't consistency.
And re-reading the following text :
'Otherwise, it
must return the value of the StyleSheet interface's disabled attribute on getting, and
forward the new value to that same attribute on setting.'
the word 'attribute' seems to be confusing. Does it mean, it should be forwarding to the StyleSheet interface?
Comment 5•12 years ago
|
||
Oh, right, changing .style will actually change the return value of getAttribute("style"). So that part of comment 3 was not right.
> Does it mean, it should be forwarding to the StyleSheet interface?
Yes.
You need to log in
before you can comment on or make changes to this bug.
Description
•