gecko-dev/dom/tests/mochitest
Olli Pettay abf54817b9 Bug 1428246 - The attributeChangedCallback is fired twice for the *first* style attribute change, r=peterv
The idea with this patch is that style code will first call
InlineStyleDeclarationWillChange before style declaration has changed, and SetInlineStyleDeclaration once it has changed.

In order to be able to report old attribute value, InlineStyleDeclarationWillChange reads the value and also calls AttributeWillChange (so that DOMMutationObserser can grab the old value). Later SetInlineStyleDeclaration passes the old value to
SetAttrAndNotify so that mutation events and attributeChanged callbacks are handled correctly.

Because of performance, declaration can't be cloned for reading the old value. And that is why the recently-added callback is used to detect when declaration is about to change (bug 1466963 and followup bug 1468665).

To keep the expected existing behavior, even if declaration isn't changed, but just a new declaration was created (since there wasn't any), we need to still run all these
willchange/set calls. That is when the code has 'if (created)' checks.

Since there are several declaration implementation and only nsDOMCSSAttributeDeclaration needs the about-to-change callback, GetPropertyChangeClosure is the one to initialize the callback closure, and the struct which is then passes as data to the closure.

Apparently we lost mutation event testing on style attribute when the pref was added, so test_style_attr_listener.html is modified to test both pref values.

--HG--
extra : rebase_source : 9e605d43f22e650ac3912fbfb41abb8d5a2a0c8f
2018-06-26 12:54:00 +03:00
..
ajax Bug 1435296 Address test failures caused by bumping timer precision to 2 ms r=baku 2018-02-12 11:39:41 -06:00
beacon Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
bugs Bug 1456035: Follow-up: Fix wrapper error in plain mochitest. r=bustage 2018-04-25 17:37:24 -07:00
chrome Bug 1465875 part 1. Eliminate pointless QIs to nsIDOMNSEditableElement. r=qdot 2018-06-01 22:35:22 -04:00
crypto
dom-level0 Bug 1380617 - Fix tests that expect unicode encoding of hostname r=smaug 2017-08-09 17:44:08 +02:00
dom-level1-core Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
dom-level2-core
dom-level2-html Bug 1279218 - Remove tests related to the applet tag; r=bz 2017-07-10 16:15:16 -07:00
fetch Bug 1465670 P7 Make the fetch mochitest reroute test framework use a unique scope. r=asuth 2018-06-05 10:49:12 -07:00
gamepad
general Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
geolocation Bug 1468030 - Geolocation test can sometimes fail with POSITION_UNAVAILABLE on Android. r=jdm 2018-06-09 11:05:49 -07:00
localstorage Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
orientation
pointerlock Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
script Bug 1386644 - Enable test for bug 1053321 on Android, r=bkelly 2018-01-11 07:19:00 +02:00
sessionstorage
storageevent Bug 1354730. Disable named property object (aka global scope polluter) behavior for all Xrays. r=kmag 2017-10-16 10:58:09 -04:00
webcomponents Bug 1428246 - The attributeChangedCallback is fired twice for the *first* style attribute change, r=peterv 2018-06-26 12:54:00 +03:00
whatwg Merge mozilla-inbound to mozilla-central. a=merge 2018-04-11 17:36:09 +03:00