gecko-dev/devtools/server/actors
Nicolas Chevobbe ac3a027268 Bug 1679043 - [devtools] Fix race condition in StyleEditor when editing style sheet. r=daisuke,ochameau,devtools-backward-compat-reviewers,bomsy.
When the user edits a stylesheet in the StyleEditor, an `_isUpdating` flag is toggled,
and a request is sent to the server to actually apply those changes to the stylesheet.
It then causes a style-applied event to be emitted (or the stylesheet resource
to be updated, if watcher support is enabled for stylesheet).
In the end, this triggers the onStyleApplied function in the StyleEditor, where
we check if the `_isUpdating` flag is true (to know if the event was caused
through editing in style editor), and if not, replace the stylesheet content.

Unfortunately there's a race condition when the user is typing (and sending
multiple requests to the server), as the state of the _isUpdating flag could
be wrong if a new request is sent before the first one is handled.
This is probably highlighted with the throttling we're doing in the Resource API.

To fix this issue, we add a new `cause` parameter to the StyleSheets.update method,
which we set to `styleeditor` when calling update within the StyleEditor.
This `cause` parameter is then sent back by the server to the client (via the
style-applied event, or the resource update if we have Watcher support for stylesheets).
This `cause` can be checked by the StyleEditor client, and replace the check
on `_isUpdating`.

However, we need to keep the `_isUpdating` property to handle backward compatibility.

Differential Revision: https://phabricator.services.mozilla.com/D99862
2020-12-18 06:07:32 +00:00
..
accessibility Bug 1677942 - [devtools] Use new syntax for backward compatibility comments. r=jdescottes,devtools-backward-compat-reviewers. 2020-12-01 10:27:47 +00:00
addon Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
compatibility Bug 1677660 - Remove backwards-compat methods from Compatibility front. r=jdescottes,daisuke,devtools-backward-compat-reviewers 2020-11-18 16:29:31 +00:00
descriptors Bug 1680440 - [devtools] Remove backward compatibility comments for descriptor watcher traits. r=jdescottes. 2020-12-11 14:20:16 +00:00
emulation Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers 2020-11-10 15:57:30 +00:00
highlighters Bug 1680440 - [devtools] Remove backward compatibility comment in paused debugger overlay. r=ladybenko. 2020-12-11 13:53:22 +00:00
inspector Bug 1680440 - [devtools] Remove backward compatibility code in getNodeFrontFromNodeGrip. r=ladybenko,devtools-backward-compat-reviewers. 2020-12-11 13:53:14 +00:00
network-monitor Bug 1674653 - [devtools] Resend requests with fission r=ochameau,devtools-backward-compat-reviewers 2020-12-12 16:01:44 +00:00
object Bug 1678757 - [devtools] Add missing errors in Error previewer. r=bomsy. 2020-12-03 17:16:25 +00:00
resources Bug 1679043 - [devtools] Fix race condition in StyleEditor when editing style sheet. r=daisuke,ochameau,devtools-backward-compat-reviewers,bomsy. 2020-12-18 06:07:32 +00:00
targets Bug 1573327 - [devtools] Pass breakpoints via the Watcher actor. r=jdescottes,devtools-backward-compat-reviewers,nchevobbe 2020-12-14 08:54:25 +00:00
utils Bug 1677546 - [devtools] Rename network actors to parent and content actors r=ochameau,devtools-backward-compat-reviewers 2020-11-17 23:21:26 +00:00
watcher Bug 1573327 - [devtools] Pass breakpoints via the Watcher actor. r=jdescottes,devtools-backward-compat-reviewers,nchevobbe 2020-12-14 08:54:25 +00:00
webconsole Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
worker Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
animation-type-longhand.js Bug 1667118 - Rename -moz-math-script-level to math-depth. r=emilio 2020-09-26 03:04:56 +00:00
animation.js
array-buffer.js Bug 1658888 - Remove old backward compat code for ArrayBuffer marshalling r=ochameau,devtools-backward-compat-reviewers 2020-08-17 18:35:18 +00:00
breakpoint-list.js Bug 1573327 - [devtools] Pass breakpoints via the Watcher actor. r=jdescottes,devtools-backward-compat-reviewers,nchevobbe 2020-12-14 08:54:25 +00:00
breakpoint.js Bug 1673328 - [devtools] Rename TabSources to SourcesManager. r=nchevobbe 2020-10-29 19:00:26 +00:00
changes.js
common.js Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau 2020-11-13 09:49:53 +00:00
css-properties.js Bug 1658566 - Remove all unecessary typeName. r=jdescottes 2020-08-12 16:57:05 +00:00
device.js
environment.js Bug 1663847 part 2 - Change Debugger.Environment.callee getter to calleeScript getter. r=tcampbell,jdescottes 2020-09-11 09:24:34 +00:00
errordocs.js Bug 1677379 - [devtools] Fix Learn more link on CORS warning message. r=ckerschb. 2020-11-19 10:41:35 +00:00
frame.js Bug 1673328 - [devtools] Rename TabSources to SourcesManager. r=nchevobbe 2020-10-29 19:00:26 +00:00
framerate.js
heap-snapshot-file.js
highlighters.css Bug 1654956 - adding NodeTabbingOrderHighlighter highlighter to highlight nodes that are in the tabbing order for a particular target. r=jdescottes,rcaliman 2020-11-03 15:32:53 +00:00
highlighters.js Bug 1673932 - [devtools] - Combine register calls in highlighters. r=jdescottes 2020-11-12 08:38:59 +00:00
layout.js
manifest.js
media-rule.js Bug 1674405 - [devtools] Extract StyleSheet, StyleSheets and MediaRule specs to individual files r=daisuke,devtools-backward-compat-reviewers 2020-11-03 15:56:12 +00:00
memory.js
moz.build Bug 1573327 - [devtools] Pass breakpoints via the Watcher actor. r=jdescottes,devtools-backward-compat-reviewers,nchevobbe 2020-12-14 08:54:25 +00:00
object.js Bug 1680207 - [devtools] Remove unnecessary backward compatibility comment in ObjectActor. r=bomsy. 2020-12-03 09:18:56 +00:00
page-style.js Bug 1680218 - [devtools] Remove getAttributesInOwnerDocument trait. r=rcaliman. 2020-12-09 13:16:56 +00:00
pause-scoped.js Bug 1658566 - Remove all unecessary typeName. r=jdescottes 2020-08-12 16:57:05 +00:00
perf.js Bug 1680440 - [devtools] Remove backward compatibility comment for getSupportedFeatures. r=ladybenko,devtools-backward-compat-reviewers. 2020-12-11 13:53:30 +00:00
performance-recording.js
performance.js
preference.js Bug 1680218 - [devtools] Remove PreferenceActor traits. r=jdescottes. 2020-12-09 13:18:17 +00:00
process.js
reflow.js
root.js Bug 1680202 - [devtools] Remove unused watchpoint trait on Root actor. r=ochameau. 2020-12-08 10:56:12 +00:00
screenshot.js
source.js Bug 1675332 - Make --headless --jsdebugger launch a headed Browser Toolbox. r=emalysz 2020-11-06 04:53:24 +00:00
storage.js Bug 1676629 - Remove defer usage in devtools/server/actors/storage.js r=Honza,ladybenko 2020-11-26 14:35:28 +00:00
string.js
style-rule.js Bug 1680440 - [devtools] Remove emitsRuleUpdatedEvent trait on the StyleRuleActor. r=ladybenko. 2020-12-11 13:53:37 +00:00
style-sheet.js Bug 1679043 - [devtools] Fix race condition in StyleEditor when editing style sheet. r=daisuke,ochameau,devtools-backward-compat-reviewers,bomsy. 2020-12-18 06:07:32 +00:00
style-sheets.js Bug 1679043 - [devtools] Fix race condition in StyleEditor when editing style sheet. r=daisuke,ochameau,devtools-backward-compat-reviewers,bomsy. 2020-12-18 06:07:32 +00:00
thread.js Bug 1682848 - [devtools] Fix error when pausing in a content process script in the Browser Toolbox. r=bomsy. 2020-12-17 08:02:40 +00:00
watcher.js Bug 1573327 - [devtools] Pass breakpoints via the Watcher actor. r=jdescottes,devtools-backward-compat-reviewers,nchevobbe 2020-12-14 08:54:25 +00:00
webbrowser.js Bug 1573779 - [devtools] Rename WorkerTargetActorList to WorkerDescriptorActorList. r=jdescottes. 2020-09-29 14:31:10 +00:00
webconsole.js Bug 1681448 - [devtools] Fix evaluation result message ordering. r=bomsy. 2020-12-11 10:20:39 +00:00