Граф коммитов

22118 Коммитов

Автор SHA1 Сообщение Дата
Bogdan Tara 7e9fbe5a65 Backed out changeset 1c185d07d900 (bug 1602440) for browser_dbg-sources-querystring.js failures
DONTBUILD
2021-01-09 16:54:08 +02:00
Hubert Boma Manilla d8a1890e91 Bug 1602440 - [devtools] Use actor instead of url for worker targets r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D98074
2021-01-07 01:59:40 +00:00
Jon Bauman 7fed1dba96 Bug 1682995 - Enable AVIF support by default. r=aosmond,preferences-reviewers,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D99964
2021-01-08 20:16:58 +00:00
Paul Zuehlcke fd417d4f9f Bug 1628936 - [devtools] Use the correct storage principal for handling cookies. r=ladybenko
For iframes it's important that we use the correct storage principal when interacting with cookies.
With dFPI enabled the origin attributes of third party contexts are different from the top ones.
This led to situations where we didn't show any cookies for storage isolated third party frames.

Differential Revision: https://phabricator.services.mozilla.com/D99439
2021-01-08 16:33:36 +00:00
Nicolas Chevobbe cf1c89970f Bug 1439963 - [devtools] Handle evaluation result in a new task, after the evaluation is done. r=ochameau.
This way we ensure that any microtask created by the evaluated expression are
run, which can impact what we send to the client (e.g. `Promise.resolve().then(() => 246)`
will show a resolved promise instead of a pending one).
Some stubs and node tests are added to ensure this does fix the issue.

Differential Revision: https://phabricator.services.mozilla.com/D100979
2021-01-08 13:47:00 +00:00
Nicolas Chevobbe 0e62b64184 Bug 1685408 - Re-enable browser_jsonview_save_json.js on Fission. r=Honza.
The test was failing on the getFileContents, where the channel we're using here
would close for some reason.
In this patch, we no longer create a channel but use OS.File.read to retrieve the
content of the saved file.
We take this as an opportunity to slightly refactor the test so it's easier to read.

Differential Revision: https://phabricator.services.mozilla.com/D101147
2021-01-08 12:36:06 +00:00
Emilio Cobos Álvarez c2f1413e6b Bug 1685078 - Support full <image> syntax in list-style-image as per spec. r=jrmuizel,TYLin
This allows supporting image-set(), etc, and simplifies the bullet frame
code significantly, too thanks to two changes:

  * Instead of manually managing the image request, use the CSS image
    loader, with the `REQUEST_REQUIRES_REFLOW` flag, to handle image
    loads correctly. This didn't exist when this code was initially
    implemented, but we can nicely use it now.

  * Instead of re-implementing another WebRender command-builder thing,
    we can just reuse the nsImageRenderer code.

Differential Revision: https://phabricator.services.mozilla.com/D100774
2021-01-08 09:44:24 +00:00
Daisuke Akatsuka ec8a8ac1ac Bug 1685647: Update MDN compat data. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D101105
2021-01-08 09:23:35 +00:00
Alexandre Poirot dae4c7eb6f Bug 1682780 - [devtools] Used contants to define ThreadActor `state` attribute. r=jdescottes,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D100986
2021-01-07 13:36:11 +00:00
Alexandre Poirot 31c22e4866 Bug 1682780 - [devtools] Remove special hack around ThreadActor.attach from protocol.js internals. r=nchevobbe,jdescottes
This is no longer necessary as attach is no longer entering in a nested event loop.
And so we can have attach to complete and return its value as any other request.

Differential Revision: https://phabricator.services.mozilla.com/D100045
2021-01-07 13:32:41 +00:00
Alexandre Poirot 6fbec57619 Bug 1682780 - [devtools] Adapt tests and doc now that ThreadActor.attach no longer pause the thread. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D100022
2021-01-07 13:33:40 +00:00
Alexandre Poirot 3f9e98f591 Bug 1682780 - [devtools] Avoid pausing on thread actor's attach request. r=nchevobbe,jdescottes
We always used to pause when "attaching" the thread actor.
We ought to call ThreadActor's attach method first before using it.
And this method do various things:
  * Initialize the Debugger API, enable it, register various listeners, so that breakpoint can work,
  * Pause the current thread by starting a nested event loop
So that we also ought to resume the thread, by calling ThreadActor's resume right after attach.
Otherwise the page would be paused as soon as we open the DevTools.
Which sounds like something we might have wanted a very long time ago.
But sounds like pure legacy behavior from today's perspective.

Differential Revision: https://phabricator.services.mozilla.com/D99919
2021-01-07 15:02:11 +00:00
Alexandre Poirot 8440986b83 Bug 1682780 - [devtools] Remove unused callback arguments from xpshell debugger test helpers. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D99918
2021-01-07 13:08:13 +00:00
Nicolas Chevobbe d72cf4ca31 Bug 1684965 - [devtools] Manage a reference to the parent in Pool. r=ochameau.
At the moment, the `getParent` method was using the connection `poolFor` method
to retrieve the pool that was managing it. This is quite costly as `poolFor`
loops through all the pools of the connection.
This patch adds a `parentPool` property to the Pool that is set in `manage` and
reset in `unmanage`, and used in the `getParent` method.
This speeds up getParent as well as the methods that call it (`manage` when the
actor was already managed, and `destroy`).

Differential Revision: https://phabricator.services.mozilla.com/D100981
2021-01-07 15:35:50 +00:00
Nicolas Chevobbe 3815a47abb Bug 1685294 - [devtools] Add metric test for Pool. r=jdescottes.
The test creates a lot of nested pools and then stresses a few methods:
- manage
- manage, but with Pools that were already managed by another Pool
- unmanage
- destroy (through the connection disconnection)

Differential Revision: https://phabricator.services.mozilla.com/D100905
2021-01-07 15:35:06 +00:00
Nicolas Chevobbe 58d4daa45c Bug 1109362 - [devtools] Show number of errors in Toolbox toolbar. r=jdescottes,Honza.
This patch displays an error icon matching the number
of errors handled in the console.
An error can be:
- a nsIScriptError that is not a warning
- a console.error call
- a console.assert call
- a 4xx or 5xx network call

The counter is handled via the resourceWatcher of the toolbox,
where we listen for the different resources we need.
Clearing the console from the UI or via console.clear resets
the error count.
Clicking on the icon opens the split console if it wasn't already.
Navigating clears the error count, except if the persist log
option is enabled in the console.

A test is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D100668
2021-01-07 09:19:08 +00:00
Kartik Gautam 7ae6aea145 Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D100484
2021-01-07 08:53:08 +00:00
Gabriel Luong a3d95331df Bug 1684463 - [devtools] Part 3: Split making the attribute editable logic out into _setupAttributeEditor. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D100528
2021-01-06 10:53:42 +00:00
Gabriel Luong 1dfbef470d Bug 1684463 - [devtools] Part 2: Split the appending attribute value logic out into _appendAttributeValue. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D100527
2021-01-06 10:49:54 +00:00
Gabriel Luong c1419e6729 Bug 1684463 - [devtools] Part 1: Shorten the _createAttribute function by refactoring the collapse function. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D100525
2021-01-06 10:41:20 +00:00
Abhishek Sharma 7281b04a6b Bug 1681890 - [devtools] Remove defer import in devtools/client/shared/components/test/chrome/head.js r=ntim
Differential Revision: https://phabricator.services.mozilla.com/D100886
2021-01-06 12:43:45 +00:00
Mihai Alexandru Michis b4e3622ffe Backed out changeset c17d361450d3 (bug 1681893) for causing eslint failures in test_nesting-<01/02>.js
CLOSED TREE
2021-01-06 12:40:55 +02:00
pedrofonsecadev 3a0474b856 Bug 1681893 -[devtools] Remove defer usage in devtools/server/tests/xpcshell/head_dbg.js r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D100880
2021-01-06 10:06:31 +00:00
Hubert Boma Manilla bf8708542a Bug 1685262 - [devtools] Add blockRequest/unblockRequest commands support r=ochameau,devtools-backward-compat-reviewers,nchevobbe
Fixes browser_jsterm_block_commands.js test

Differential Revision: https://phabricator.services.mozilla.com/D99622
2021-01-06 09:46:43 +00:00
Rahul Yedida 398a8d1051 Bug 1678298 - [devtools] Use decodeURIComponent instead of decodeURI r=bomsy
Depends on D98294

Differential Revision: https://phabricator.services.mozilla.com/D98388
2021-01-06 09:13:08 +00:00
nchevobbe 1624b5bc35 Bug 1683882 - Parse console.trace for custom styling. r=baku.
Differential Revision: https://phabricator.services.mozilla.com/D100669
2021-01-06 06:03:49 +00:00
Daniel Holbert ac4480af11 Bug 1685231: Fix the typo "ot" in various code-comments (to "to", "of", or "not"). r=mccr8
DONTBUILD because this is a comment-only change and hence doesn't affect
behavior at all.

I ran across this typo in nsPageFrame.cpp, and figured I might as well grep for
it and fix it more comprehensively. And while I'm at it, I also fixed some
neighboring instances of a duplicated word around a linebreak, in
nsXMLContentSerializer.h.

Differential Revision: https://phabricator.services.mozilla.com/D100852
2021-01-06 04:54:51 +00:00
Markus Stange 5cd8830a74 Bug 1683723 - Replace deprecated Cocoa enum constants with their modern replacements. r=spohl
I ran the following command:

```
rg -l 'NSAlphaShiftKeyMask' . | xargs sed -i '' -e 's/NSAlphaShiftKeyMask/NSEventModifierFlagCapsLock/g'
rg -l 'NSAlternateKeyMask' . | xargs sed -i '' -e 's/NSAlternateKeyMask/NSEventModifierFlagOption/g'
rg -l 'NSAnyEventMask' . | xargs sed -i '' -e 's/NSAnyEventMask/NSEventMaskAny/g'
rg -l 'NSApplicationDefined' . | xargs sed -i '' -e 's/NSApplicationDefined/NSEventTypeApplicationDefined/g'
rg -l 'NSBorderlessWindowMask' . | xargs sed -i '' -e 's/NSBorderlessWindowMask/NSWindowStyleMaskBorderless/g'
rg -l 'NSCenterTextAlignment' . | xargs sed -i '' -e 's/NSCenterTextAlignment/NSTextAlignmentCenter/g'
rg -l 'NSClosableWindowMask' . | xargs sed -i '' -e 's/NSClosableWindowMask/NSWindowStyleMaskClosable/g'
rg -l 'NSCommandKeyMask' . | xargs sed -i '' -e 's/NSCommandKeyMask/NSEventModifierFlagCommand/g'
rg -l 'NSCompositeCopy' . | xargs sed -i '' -e 's/NSCompositeCopy/NSCompositingOperationCopy/g'
rg -l 'NSControlKeyMask' . | xargs sed -i '' -e 's/NSControlKeyMask/NSEventModifierFlagControl/g'
rg -l 'NSDeviceIndependentModifierFlagsMask' . | xargs sed -i '' -e 's/NSDeviceIndependentModifierFlagsMask/NSEventModifierFlagDeviceIndependentFlagsMask/g'
rg -l 'NSFlagsChanged' . | xargs sed -i '' -e 's/NSFlagsChanged/NSEventTypeFlagsChanged/g'
rg -l 'NSFullScreenWindowMask' . | xargs sed -i '' -e 's/NSFullScreenWindowMask/NSWindowStyleMaskFullScreen/g'
rg -l 'NSFullSizeContentViewWindowMask' . | xargs sed -i '' -e 's/NSFullSizeContentViewWindowMask/NSWindowStyleMaskFullSizeContentView/g'
rg -l 'NSFunctionKeyMask' . | xargs sed -i '' -e 's/NSFunctionKeyMask/NSEventModifierFlagFunction/g'
rg -l 'NSHelpKeyMask' . | xargs sed -i '' -e 's/NSHelpKeyMask/NSEventModifierFlagHelp/g'
rg -l 'NSKeyDown' . | xargs sed -i '' -e 's/NSKeyDown/NSEventTypeKeyDown/g'
rg -l 'NSKeyUp' . | xargs sed -i '' -e 's/NSKeyUp/NSEventTypeKeyUp/g'
rg -l 'NSLeftMouseDownMask' . | xargs sed -i '' -e 's/NSLeftMouseDownMask/NSEventMaskLeftMouseDown/g'
rg -l 'NSLeftMouseDown' . | xargs sed -i '' -e 's/NSLeftMouseDown/NSEventTypeLeftMouseDown/g'
rg -l 'NSLeftMouseDragged' . | xargs sed -i '' -e 's/NSLeftMouseDragged/NSEventTypeLeftMouseDragged/g'
rg -l 'NSLeftMouseUp' . | xargs sed -i '' -e 's/NSLeftMouseUp/NSEventTypeLeftMouseUp/g'
rg -l 'NSMiniaturizableWindowMask' . | xargs sed -i '' -e 's/NSMiniaturizableWindowMask/NSWindowStyleMaskMiniaturizable/g'
rg -l 'NSMiniControlSize' . | xargs sed -i '' -e 's/NSMiniControlSize/NSControlSizeMini/g'
rg -l 'NSMouseEntered' . | xargs sed -i '' -e 's/NSMouseEntered/NSEventTypeMouseEntered/g'
rg -l 'NSMouseExited' . | xargs sed -i '' -e 's/NSMouseExited/NSEventTypeMouseExited/g'
rg -l 'NSMouseMoved' . | xargs sed -i '' -e 's/NSMouseMoved/NSEventTypeMouseMoved/g'
rg -l 'NSNumericPadKeyMask' . | xargs sed -i '' -e 's/NSNumericPadKeyMask/NSEventModifierFlagNumericPad/g'
rg -l 'NSOtherMouseDownMask' . | xargs sed -i '' -e 's/NSOtherMouseDownMask/NSEventMaskOtherMouseDown/g'
rg -l 'NSOtherMouseDown' . | xargs sed -i '' -e 's/NSOtherMouseDown/NSEventTypeOtherMouseDown/g'
rg -l 'NSOtherMouseDragged' . | xargs sed -i '' -e 's/NSOtherMouseDragged/NSEventTypeOtherMouseDragged/g'
rg -l 'NSOtherMouseUp' . | xargs sed -i '' -e 's/NSOtherMouseUp/NSEventTypeOtherMouseUp/g'
rg -l 'NSRegularControlSize' . | xargs sed -i '' -e 's/NSRegularControlSize/NSControlSizeRegular/g'
rg -l 'NSResizableWindowMask' . | xargs sed -i '' -e 's/NSResizableWindowMask/NSWindowStyleMaskResizable/g'
rg -l 'NSRightMouseDown' . | xargs sed -i '' -e 's/NSRightMouseDown/NSEventTypeRightMouseDown/g'
rg -l 'NSRightMouseDragged' . | xargs sed -i '' -e 's/NSRightMouseDragged/NSEventTypeRightMouseDragged/g'
rg -l 'NSRightMouseUp' . | xargs sed -i '' -e 's/NSRightMouseUp/NSEventTypeRightMouseUp/g'
rg -l 'NSRightTextAlignment' . | xargs sed -i '' -e 's/NSRightTextAlignment/NSTextAlignmentRight/g'
rg -l 'NSScrollWheelMask' . | xargs sed -i '' -e 's/NSScrollWheelMask/NSEventMaskScrollWheel/g'
rg -l 'NSScrollWheel' . | xargs sed -i '' -e 's/NSScrollWheel/NSEventTypeScrollWheel/g'
rg -l 'NSShiftKeyMask' . | xargs sed -i '' -e 's/NSShiftKeyMask/NSEventModifierFlagShift/g'
rg -l 'NSSmallControlSize' . | xargs sed -i '' -e 's/NSSmallControlSize/NSControlSizeSmall/g'
rg -l 'NSTabletPointEventSubtype' . | xargs sed -i '' -e 's/NSTabletPointEventSubtype/NSEventSubtypeTabletPoint/g'
rg -l 'NSTitledWindowMask' . | xargs sed -i '' -e 's/NSTitledWindowMask/NSWindowStyleMaskTitled/g'
```

Then I removed changes to third-party webrtc code, removed a comment in accessible/mac/mozAccessible.mm,
and performed some manual replacements in native_mouse_mac_window.xhtml.

Differential Revision: https://phabricator.services.mozilla.com/D100260
2021-01-05 21:17:11 +00:00
Gabriel Luong 1939c31e93 Bug 1671802 - [devtools] Break up the logic in buildMarkup() into separate functions. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D100516
2021-01-05 07:15:42 +00:00
Mark Banner 14da69d10f Bug 1684905 - Fully enable globalThis for ESLint. r=Gijs,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D100697
2021-01-04 20:32:57 +00:00
Gerald Squelart 484485975e Bug 1679930 - Add ActivePS experimental feature "CPU Utilization" - r=canaltinova
This patch adds "CPU Utilization" ("cpu" for short) as a new feature that will control the upcoming still-experimental CPU measurements.

Differential Revision: https://phabricator.services.mozilla.com/D99054
2021-01-04 07:17:38 +00:00
Emilio Cobos Álvarez 1903289616 Bug 1684689 - Fix usage of createImageData in devtools. r=jdescottes
This fixes the DAMP failures and effectively preserves behavior.

Differential Revision: https://phabricator.services.mozilla.com/D100623
2021-01-04 17:27:24 +00:00
Sebastian Hengst 6af01df508 Bug 1682533 - update bugzilla components after component reorganization in Bug 1682260: remove linebreak at end of file. a=lint-fix CLOSED TREE 2021-01-04 16:42:38 +01:00
Sebastian Hengst 447823eecf Bug 1682533 - update bugzilla components after component reorganization in bug 1682260. r=Honza DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D99770
2021-01-04 11:20:11 +00:00
Julian Descottes d8c21acf2f Bug 1678550 - [devtools] Load damp.js using the main DevTools Loader r=perftest-reviewers,nchevobbe,ochameau
Depends on D97626

Differential Revision: https://phabricator.services.mozilla.com/D97727
2021-01-04 13:07:08 +00:00
Kaique da Silva 74dde45aea Bug 1681897 - [devtools] Implemented the defer on test r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D100588
2021-01-04 11:17:18 +00:00
bfmags 4368aa9486 Bug 1681889 - Remove unused `defer` require from devtools/client/memory/test/xpcshell/head.js. r=ntim
Differential Revision: https://phabricator.services.mozilla.com/D100498
2020-12-28 16:12:23 +00:00
bfmags 3584270b01 Bug 1681894 - Remove unused `defer` require from devtools/shared/protocol/tests/xpcshell/head.js. r=ntim
Differential Revision: https://phabricator.services.mozilla.com/D100500
2020-12-28 16:10:08 +00:00
Cosmin Sabou 2978aa00a3 Backed out changeset dbed1cdf588f (bug 1684173) for mochitest plain and devtools failures. a=backout DONTBUILD 2020-12-28 00:43:51 +02:00
Kartik Gautam 775cdec032 Bug 1684173 - Add newline character at end of files when missing r=sylvestre
Depends on D100443

Differential Revision: https://phabricator.services.mozilla.com/D100484
2020-12-27 11:43:41 +00:00
Sonia Singla 7ea3ae701b Bug 1681896 - Remove defer usage in devtools/shared/transport/tests/xpcshell/head_dbg.js. r=ntim
Differential Revision: https://phabricator.services.mozilla.com/D100473
2020-12-26 23:34:32 +00:00
Kartik Gautam 5d5093a494 Bug 1679452 - Replace :not(X):not(Y) with :not(X, Y) r=ntim
Differential Revision: https://phabricator.services.mozilla.com/D100147
2020-12-19 11:24:13 +00:00
Nicolas Chevobbe 7dda7cfb80 Bug 1683264 - [devtools] Remove assets/dictionnary.txt . r=bomsy.
The file doesn't seem to be used anywhere, so it's probably safe to remove it.

Differential Revision: https://phabricator.services.mozilla.com/D100083
2020-12-18 13:45:31 +00:00
Razvan Caliman 38dd364312 Bug 1572652 - [devtools] Replace GridInspector.onShowGridOutlineHighlight() with thunk in Layout panel and update tests. r=nchevobbe
Depends on D99610

This patch uses the thunk approach introduced in [Bug 1623906](https://bugzilla.mozilla.org/show_bug.cgi?id=1623906) to replace the `GridInspector.onShowGridOutlineHighlight()` method which is prop-drilled through React components. `onShowGridOutlineHighlight()` is just an alias for `HighlightersOverlay.showGridHighlighter()` without any special handling, so we drop the indirection altogether.

The method  is replaced by a new thunk, `showGridHighlighter()` introduced in a new file `client/inspector/grids/actions/grid-highlighter.js`. This thunk is dispatched with options to show a grid highlighter with outlines for the given cell / area, or just the default grid highlighter when no options are given.

The corresponding tests are updated to use the generic events emitted by `HighlightersOverlay` introduced with [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) and the test helpers added in D85858.

Differential Revision: https://phabricator.services.mozilla.com/D99674
2020-12-16 09:59:33 +00:00
Razvan Caliman 79649b82c6 Bug 1572652 - [devtools] Consolidate telemetry logging for grid and flexbox highlighters. r=nchevobbe
Depends on D99609

This patch consolidates logging telemetry in response to the highlighter show/hide lifecycle using the approach introduced for Flexbox highlighter in D96730

`_afterShowHighlighterTypeForNode()` and `_beforeHighlighterTypeForNode()` are generic methods to call in the lifecycle of the highlighter. We use them to run non-critical operations related to showing/hiding highlighters, like logging telemetry. The operations are grouped within by highlighter type.

Differential Revision: https://phabricator.services.mozilla.com/D99610
2020-12-16 10:00:26 +00:00
Razvan Caliman 017bbccb6b Bug 1572652 - [devtools] Destroy grid highlighters when nodes stop being grid containers. r=ochameau
Depends on D99591

Differential Revision: https://phabricator.services.mozilla.com/D99609
2020-12-17 17:21:45 +00:00
Razvan Caliman 2110082a7c Bug 1572652 - [devtools] Refactor methods to show/hide CSS Grid highlighters for grids and subgrids. r=ochameau
Depends on D99606

This patch refactors the logic to show/hide CSS Grid highlighters.

It doesn't use the generic highlighter methods introduced with [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) for other highlighters because the special cases for CSS Grid added too much complexity. I decided to keep a parallel implementation which does reuse some of the generic helpers (see other patches in this series).

CSS Grid highlighters are special for a few reasons:
- multiple instances can be visible at the same time (default 3) vs single instance for all other highlighter types; the limit is arbitrary but used as a rudimentary way to guard against performance degradation because each highlighter instantiates a [large canvas](https://searchfox.org/mozilla-central/rev/95cf843de977805a3951f9137f5ff1930599d94e/devtools/server/actors/highlighters/utils/canvas.js#25-43) that hogs the GPU. A smart mitigation was investigated once, but never followed-through [Bug 1232491](https://bugzilla.mozilla.org/show_bug.cgi?id=1232491)
- it is possible to highlight nodes which are not selected in the Inspector
- there is a parent-child relationship between grid and subgrid highlighters (see detailed explanation added in JSDoc for `HighlightersOverlay.showGridHighlighter()`); when one is shown, it influences whether and how the other is shown
- there can be multiple subgrids with the same grid parent

NOTE: Unless otherwise stated inline, please treat the following methods as completely rewritten:

- showGridHighlighter()
- hideGridHighlighter()
- showParentGridHighlighter()
- hideParentGridHighlighter()

In summary, the changes in this patch are:
- refactored `showGridHighlighter()`,  `hideGridHighlighter()`, `showParentGridHighlighter()` and `hideParentGridHighlighter()` to use the data from `gridHighlighters` map;
- modified `_getHighlighterTypeForNode()` to return multiple instances for Grid highlighters;
- destroy, not just hide, grid highlighter instances when unused.

Further clean-up and integration with existing generic helpers follows in the next patches in this series.

Differential Revision: https://phabricator.services.mozilla.com/D99591
2020-12-17 17:40:18 +00:00
Razvan Caliman 4142f8c0ce Bug 1572652 - [devtools] Remove CSS Grid highlighter management logic. r=ochameau
This patch removes the old grid highlighter management logic. Some of it is gradually replaced by commits later in this series.

The diff with changes made in D99591 turned out very hairy and difficult to follow. To ease review, I completely removed some methods here and reintroduced them in D99591.
Unless otherwise stated, the contents of `showGridHighlighter()`,  `hideGridHighlighter()`, `showParentGridHighlighter()` and `hideParentGridHighlighter()` may be considered completely rewritten.
If it helps, you may view the patches side-by-side to observe the difference (the diff view [looked very confusing](https://phabricator.services.mozilla.com/D99591?vs=on&id=378317#toc)).

In summary, the changes in this patch are:
- removed the separate parent grid highlighters map (`parentGridHighlighters`) and subgrid-to-parent mapping (`subgridToParentMap`); this information will be contained in the values of the `gridHighlighters` map which holds all instances of active grid highlighters (added in D99591)
- removed the cache pool for unused highlighters (`extraGridHighlighterPool`); with multi-process separation, this became unnecessarily complex
- removed `_getGridHighlighter()`; replaced with generic highlighter getter in D99591
- removed `destroyGridHighlighters()` reliant on the obsolete maps; replaced with consolidated highlighter destroy approach in D99591

Differential Revision: https://phabricator.services.mozilla.com/D99606
2020-12-15 15:16:04 +00:00
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
Hubert Boma Manilla ed78ad3373 Bug 1683152 - [devtools] Handle netmonitor pause/resume on the client r=ochameau
Fixes browser_net_pause.js

Differential Revision: https://phabricator.services.mozilla.com/D99621
2020-12-17 17:38:19 +00:00