Disabling browser_net_block-csp.js as it fails with fission enabled.
Bug 1682153 details the issue, and the test would be enabled when this
bug is fixed.
Differential Revision: https://phabricator.services.mozilla.com/D99626
When pausing in a content process script in the Browser Toolbox (e.g. somewhere
in devtools/server), we tried to display the PausedDebuggerOverlay, which was
causing an error to be displayed in the CanvasFrameAnonymousContentHelper, as
we didn't have access to a documentElement property it needed.
This happens because the _canShowOverlay method in the thread actor was only
checking for the presence of a window property on the target actor.
Unfortunately, the ContentProcessTargetActor does expose a window getter, which
is a Sandbox, and thus doesn't have a document.
This patch modifies the _canShowOverlay function to check that we do have access
to a documentElement.
Differential Revision: https://phabricator.services.mozilla.com/D99899
We used to set the `mousemove` event listener on the document once the drag
started, so we could track mouse movement outside of the drag element.
This can now be done another way, using `setPointerCapture`, so we can have the
event listener directly on the element, and not on the document anymore.
A few tests that were dispatching mousemove events from the document are updated.
Differential Revision: https://phabricator.services.mozilla.com/D99863
This fix pretty-printing of async functions in console. A test case is added
to make sure we don't regress.
We used to copy the library tests and run them in xpcshell. The tests changed
a lot, and I don't think we get much value running tests that are already ran on
the project CI (we do have a few tests that checks that we get the output we want)
, so this patch remove the xpcshell test and the associated files.
The upgrade documentation is updated to remove some unecessary steps:
- no need to rename the exported module for each file
- no need to replace the acorn module, since what's in the file is just a subset
of the library (~100 lines)
- no need to update the test file, which doesn't seem to exist anymore
Differential Revision: https://phabricator.services.mozilla.com/D99320
Depends on D96730
This patch refactors slightly the way flexbox highlighters are restored when the page is refreshed while a highlighter is active.
To account for Fission, we store the `browsingContextID` of the target in addition to the node's unique selector, in order to match again the node after refresh and show a flexbox highlighter for it.
The events emitted are renamed to more generic versions "highlighter-restored" and "highlighter-discarded". They contain the highlighter type in the event data payload. Tests are updated accordingly.
Also made slight changes to the grid highlighter restore logic and corresponding tests in order to use the new generic events and test helpers. The bulk of the refactoring for grid highlighters will happen in [Bug 1572652](https://bugzilla.mozilla.org/show_bug.cgi?id=1572652)
Differential Revision: https://phabricator.services.mozilla.com/D97660
Depends on D96449
Introduced two generic callbacks to `HighlightersOverlay`:
- `_afterShowHighlighterTypeForNode()` called after a highlighter is shown, but before emitting the "highlighter-shown" event that listeners react to
- `_beforeHideHighlighterType()` - called before an existing highlighter is hidden.
This allows us to move the telemetry logging methods for the Flexbox highlighter into these generic callbacks. The Grid highlighter will benefit from this too since it uses similar telemetry logging.
In an upcoming patch I will also move the logic to save metadata about the highlighter state in order to be able to restore it after page refresh.
Differential Revision: https://phabricator.services.mozilla.com/D96730
Depends on D96081
This patch builds upon the generalization in D96080 to update the Flexbox sidebar panel from the Inspector Layout panel to:
- listen to the generic highlighter events, "highlighter-shown" and "highlighter-hidden" and check for the flexbox highlighter type;
- use generic getter to get the node highlighted by the flexbox highlighter.
The corresponding tests are updated to use the generic highlighter events and test helpers.
Differential Revision: https://phabricator.services.mozilla.com/D96449
Depends on D96225
This patch removes event listeners for flexbox and grid highlighter events from individual nodes in the Markup view in favor of a delegated event handler at the panel level. It is similar to the approach introduced in D90247 for the selector highlighter in the Rules view (which will also be leveraged for the flexbox highlighter swatches in the Rule view).
This removes substantial duplication and a bit of ping-pong to enable/disable event listeners. It can also have a mild positive performance impact on documents with many flexbox & grid badges.
I updated both flex and grid badges in this patch for clarity and uniformity. To do that, I had to introduce emitting generic highlighter events for the grid highlighter as well. The bulk of the work for the grid highlighter will happen in [Bug 1572652](https://bugzilla.mozilla.org/show_bug.cgi?id=1572652).
Differential Revision: https://phabricator.services.mozilla.com/D96081
Depends on D96080
This patch leverages work done in D90247 for the `SelectorHighlighter`. Here, we delegate event handling of clicks on flexbox swatches next to "flex" and "inline-flex" CSS properties up to the Rules view. This will toggle the Flexbox highlighter from a single place in the Rules view.
When the Flexbox highlighter is shown/hidden, the swatches are marked "active" accordingly. We don't differentiate which swatch to mark if there are multiple "flex" properties. Only properties matching the selected node are shown. `display` is not an inheritable property so there will be only one winning `display: flex` declaration for the selected node. Even if there are duplicates, they will be marked overwritten. Swatches are hidden for overwritten properties. This eases the work when toggling some of the duplicates, the winning one will already show an "active" swatch.
This patch looks more scary than it is. The changes in tests are mass-renames to a new CSS class name and to use the same helpers.
It's easier if you start reviewing `highlighters-overlay.js`, then `text-property-editor.js`, then `rules.js`.
Differential Revision: https://phabricator.services.mozilla.com/D96225
Depends on D96079
This patch begins the work to make invoking the Flexbox highlighter process-agnostic. It replaces the direct-access methods that use the top-level inspector front with methods to show/hide highlighters corresponding to the nodes' respective inspector fronts.
There are other patches in this series which incrementally refactor the logic.
Known broken here, but updated in patches down the line:
- restoring active flexbox highlighters on refresh
- hiding highlighters when their target node or display type changes in remoted frames use cases
Differential Revision: https://phabricator.services.mozilla.com/D96080
Depends on D96078
Following the technique introduced in [Bug 1623906](https://bugzilla.mozilla.org/show_bug.cgi?id=1623906), remove the prop-drilled method to toggle the flexbox highlighter with a thunk dispatched from a deeply nested React component.
In a follow-up bug, I will also migrate the `onSetFlexboxOverlayColor` method and remove the awkward indirection in this flow: `flexbox.js` -> `layout.js` -> `LayoutApp` -> `Flexbox`.
Differential Revision: https://phabricator.services.mozilla.com/D96079
When selecting something in the rule view, if the user
moused up right onto the enable/disable rule checkbox,
and then tried to copy the selection, the clipboard was empty.
This is due to copySelection checking the target of the copy
event and doing something special if it is an input or a textarea.
To fix this, we add an extra check to test if the input isn't
a checkbox.
A test case, failing without the fix, is added to ensure we don't
regress this.
Differential Revision: https://phabricator.services.mozilla.com/D99425
And have it mirror in the parent process more automatically.
The docShellIsActive setter in the browser-custom-element side needs to
be there rather than in the usual DidSet() calls because the
AsyncTabSwitcher code relies on getting an exact amount of notifications
as response to that specific setter. Not pretty, but...
BrowserChild no longer sets IsActive() on the docshell itself for OOP
iframes. This fixes bug 1679521. PresShell activeness is used to
throttle rAF as well, which handles OOP iframes nicely as well.
Differential Revision: https://phabricator.services.mozilla.com/D96072
The watcher trait might not be set on other descriptors, so
we want to keep them until we can get rid of the generic client
code that is handling them. This can probably be done as part of Bug 1680280.
Differential Revision: https://phabricator.services.mozilla.com/D98737
Those methods are used in the client, so we don't want to remove them.
The original comment was only here to indicate when it was added.
Differential Revision: https://phabricator.services.mozilla.com/D98733
The code might still be used in the future for the storage inspector, so we can
remove the backward compat comment, and add more context around those lines.
Differential Revision: https://phabricator.services.mozilla.com/D98732
Older server didn't have the `completed` property, and we needed to rely on the
`progress` one. `completed` was added in 79, so we'll always have access to it now.
Differential Revision: https://phabricator.services.mozilla.com/D98731
Older message had a _type property and a different shape,
so we needed to transform them.
We shouldn't get those anymore since 78, so we can remove that code.
Differential Revision: https://phabricator.services.mozilla.com/D98729
The trait was added in 76, so we can safely remove it.
This allows us to cleanup retrieveAsyncFormData, that
we rename to retrieveFavicon to better represents what it does.
Differential Revision: https://phabricator.services.mozilla.com/D98728
The trait was added in 72, so it's safe to remove it now.
With the trait removed, the onDeclarationUpdated method in rule.js
was no longer called, so we can remove it as well.
Differential Revision: https://phabricator.services.mozilla.com/D98723
Since we now always have a contentDomReference in grips, we
don't need to fallback on gripToNodeFront.
And since gripToNodeFront was only used from getNodeFrontFromNodeGrip,
we can remove it, as well as the walker actor method getNodeActorFromObjectActor.
We also had to get a content reference from a rendered Reps in the console, for
the "Reveal in inspector" context menu entry, so we stringigy it in a data attribute.
Differential Revision: https://phabricator.services.mozilla.com/D98720
When evaluating an expression containing console api calls,
it might happen that the result message is handled by the
client before the console api messages.
This is due to the fact that those messages are handled by
the resource watcher, which throttles resources, whereas
the result message is directly added from the webconsole
frontend.
In the console reducer we already have code handling out-of-order
messages, but it is only triggered for messages with different
timestamps; in our case, the timestamp of the result message
might be the same as the one of the console api messages.
To fix this issue, we simply add an extra millisecond on the
evaluation result packet, which will ensure it will have a
distinct timestamp from the console api messages it might
have triggered, with minimal risk of side effects.
The existing test for ordering is enhanced by logging multiple
messages, and it is failing quite frequently without the fix.
Differential Revision: https://phabricator.services.mozilla.com/D99205
The trait were added in 81 and 82, so we can safely remove them now.
We take this opportunity to bail early in setDefaultpreferencesIfNeeded
when there's no default preferences to set.
Differential Revision: https://phabricator.services.mozilla.com/D98498
Those methods were only kept for backward compatibility in the spec file, so we
can remove them from here.
`getText` is still used from the `StyleSheetFront#guessIndentation`, so we remove
the backward compat comment, and add more information on it.
The methods on the actor can't be removed as they're still called from the StyleSheetsActor
to support servers that don't use the resource watcher for stylesheets.
A test that was using those methods was updated.
Differential Revision: https://phabricator.services.mozilla.com/D98494
The trait were added in 81 and 82, so we can safely remove them now.
We take this opportunity to bail early in setDefaultpreferencesIfNeeded
when there's no default preferences to set.
Differential Revision: https://phabricator.services.mozilla.com/D98498
Those methods were only kept for backward compatibility in the spec file, so we
can remove them from here.
The methods on the actor can't be removed as they're still called from the StyleSheetsActor
to support servers that don't use the resource watcher for stylesheets.
A test that was using those methods was updated.
Differential Revision: https://phabricator.services.mozilla.com/D98494
The analyzeInputString function tried to handle escape characters in strings,
by having a dedicated ESCAPE state.
Unfortunately, when in ESCAPE state, the code will always re-assign the NORMAL state.
So if at some point the string was terminated, the code would assume we were entering
a string state again.
In the end, this would cause the autocomplete to fail, because the JSPropertyProvider
would think that it was passed an unterminated string literal.
This is fixed by introducing quote-specific escape state, so we know which state to get
back in once the escape character is consumed.
A few test cases are added to ensure this works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D98754
Not doing that, makes the browser_resources_sources.js test to fail because
of pending SW's target which comes with unexpected sources.
Differential Revision: https://phabricator.services.mozilla.com/D98460
This helps cover the workaround put in ResourceWatcher in order to trigger
the SOURCE legacy listener for targets that we don't yet support in the Watcher actor.
Differential Revision: https://phabricator.services.mozilla.com/D98438
This patch adds a script which is similar to the one that was written in the README.md file.
This goes along with a simple package.json that let's us have a simple command
to execute the update script.
The README file is updated as well to reflect this new script.
Differential Revision: https://phabricator.services.mozilla.com/D98912
My editor formats this file automatically when I need to change something here,
and it's annoying to exclude these when I need to change something in this
file. I guess it doesn't hurt to format it so we won't have to do that again.
Differential Revision: https://phabricator.services.mozilla.com/D91266
The changes should be trivial.
The third_party changes are up for review in
https://github.com/servo/rust-cssparser/pull/277 (and of course I'll
land with a bump to 0.28 rather than the override after that gets r+'d).
The basic idea is that with this we have the actual start offset of the
rule, so we wouldn't include html comments or other invalid stuff we
discard during sanitization in bug 1680084. But that's a separate
change.
Differential Revision: https://phabricator.services.mozilla.com/D98677
We weren't handling the error exception object in the Error previewer for
some error classes, and as a result we'd show an undefined grip in the console,
instead of a proper error message.
A test is added to check that we do print wasm errors as expected.
Differential Revision: https://phabricator.services.mozilla.com/D98469
My editor formats this file automatically when I need to change something here,
and it's annoying to exclude these when I need to change something in this
file. I guess it doesn't hurt to format it so we won't have to do that again.
Differential Revision: https://phabricator.services.mozilla.com/D91266
Those traits are going to be removed in Bug 1680280,
and not through the regular backward-compatibility cleanup routine.
Differential Revision: https://phabricator.services.mozilla.com/D98483
The function was taking care of removing old addons.
It landed 2 years ago, so we can assume that we don't
need that anymore.
Differential Revision: https://phabricator.services.mozilla.com/D98465