* Remove some legacy appearance aliases that other engines don't
implement.
* Allow to pass with unimplemented <compat-auto> values, since per the
spec the idea of these is to get them removed, see
https://github.com/w3c/csswg-drafts/issues/8506 for the ones we don't
implement.
* Also allow the `-moz-` prefix to be implemented, because we can't
quite get rid of it (people use it to remove the <input type=number>
buttons with -moz-appearance: textfield and so on), and the
alternative is to implement a bunch of non-standard ::-webkit-
pseudo-elements.
Differential Revision: https://phabricator.services.mozilla.com/D171243
- Replace `codeMirror.eachLine` with a simple for loop
- Change `fromEditorLine` signature so it takes a new parameter indicating
if the source is wasm. This allows us to only compute this information once
per file, and not for each line of a file.
Differential Revision: https://phabricator.services.mozilla.com/D171187
- Replace `codeMirror.eachLine` with a simple for loop
- Change `fromEditorLine` signature so it takes a new parameter indicating
if the source is wasm. This allows us to only compute this information once
per file, and not for each line of a file.
Differential Revision: https://phabricator.services.mozilla.com/D171187
Those message could be evaluated by WindowGlobal targets living in
parent process (e.g. about:robots).
A test case is added to ensure we don't regress this.
Differential Revision: https://phabricator.services.mozilla.com/D170864
Now it's on by default everywhere, so all this is not needed. No behavior
change effectively since the xul.css bits being removed effectively achieve the
same.
Differential Revision: https://phabricator.services.mozilla.com/D170944
In this patch
- Move search modifiers support into the SearchInput component, so that it can be shared across the Project Search, File Search and the Quick modal Search.
- Add on the actions, reducers and workers support for search modifiers to project search
Differential Revision: https://phabricator.services.mozilla.com/D168932
In this patch
- Move search modifiers support into the SearchInput component, so that it can be shared across the Project Search, File Search and the Quick modal Search.
- Add on the actions, reducers and workers support for search modifiers to project search
Differential Revision: https://phabricator.services.mozilla.com/D168932
We weren't trying to update the expression around any event related to navigation/reload!
I chose to update them with the latest possible event. navigate/DOCUMENT_EVENT's dom-complete,
which is equivalent to the "load" event.
If we want to update it earlier... we should probably update it more than once per navigation.
Also, I'm tweaking navigateTo test helper to ensure waiting for debugger's reloaded event.
It ensure that all navigate test helper will only resume after the navigated action resolves.
Differential Revision: https://phabricator.services.mozilla.com/D166421
We weren't waiting for "reloaded" event of the debugger and so potentialy resolving
before some async work completed during page navigation.
The main challenge here is that when the test pause the navigation,
`navigate` and `reload` test helpers will no longer resolve until the debugger resumes
execution.
I also had to tweak the DOCUMENT_EVENT support for WebExtension.
We still have to accept "frame switching" for WebExt (while keeping it off for the browser toolbox).
Otherwise the debugger doesn't update when reloading the addon or switching between addon documents.
Differential Revision: https://phabricator.services.mozilla.com/D169074
Breakable lines could easily be missed when reloading.
The very original issue is that SourceActor.getBreakableLines can't be called too early during the page load.
The SourceActor may not have received enough content of the HTML page and the HTML string may not
include the inline script sources itself.
This lead to wrong `_startLineColumnDisplacement` being set to zero and breakable lines
of the inline script are starting from the very first line of the HTML page, instead of where the <script> starts.
Then... the frontend somewhat worksaround that very implicitely and not correctly.
The key is to force fetching the breakable lines after the source text content is fetched.
Covering this isn't trivial as this is a race condition.
But I expanded the coverage in feature tests and tweaked browser_dbg-inline-script-offset.js
which could fail intermittently and no longer fail with this patch and the next one applied.
Differential Revision: https://phabricator.services.mozilla.com/D169073
* Remove the usage of PROMISE action, which isn't used
* Remove the memoizedAction as the reducer is already memoizing the breakableLines
All of this is only useful if we call setBreakableLines concurrently while
this is already in process of being loading.
This may still be theoriticaly possible between newSources and select actions.
But we should rather better coordinate when we pull breakable lines rather than
introduce such complexity. i.e. reduce the number of callsites requiring to load them.
Differential Revision: https://phabricator.services.mozilla.com/D169072
The Grid objects will be regenerated whenever the grid is reflowed, which
is nearly the same to the old check of comparing the contents of the
grid structure. This approach is prone to false positives, which is
explained in a new comment.
Differential Revision: https://phabricator.services.mozilla.com/D169725
The implementation of base-loader operates on stringly-typed URIs with path
methods. Refactoring this module to use paths and URIs is beyond the scope of
removing OS.File, so the methods from ospath_unix.jsm have been copied into the
module.
Differential Revision: https://phabricator.services.mozilla.com/D170107
The Grid objects will be regenerated whenever the grid is reflowed, which
is nearly the same to the old check of comparing the contents of the
grid structure. This approach is prone to false positives, which is
explained in a new comment.
Differential Revision: https://phabricator.services.mozilla.com/D169725
For now, the debugger frontend either directly query sourceMapLoader.getGeneratedLocation
or use the util's module helper.
We should unify before the utils module helper so that we can later append
the source object on the output of the sourceMapLoader.
Also simplified a bit various code passing both getState+sourceMapLoader
by handing over the thunkArgs.
The util's module helper requires state, so that this changes forces to
pass thunkArgs to some nested callsites of getGeneratedLocation.
Differential Revision: https://phabricator.services.mozilla.com/D169328
What devtools wants to do is ignoring the website-specific zoom.
It seems KDE 5.27 on X11 uses the text scale factor to implement scaling
of GTK apps completely (including Firefox), rather than the global
integer GTK scaling combined with it.
This makes this difference way more obvious than it otherwise would.
Differential Revision: https://phabricator.services.mozilla.com/D170195
For now, the debugger frontend either directly query sourceMapLoader.getGeneratedLocation
or use the util's module helper.
We should unify before the utils module helper so that we can later append
the source object on the output of the sourceMapLoader.
Also simplified a bit various code passing both getState+sourceMapLoader
by handing over the thunkArgs.
The util's module helper requires state, so that this changes forces to
pass thunkArgs to some nested callsites of getGeneratedLocation.
Differential Revision: https://phabricator.services.mozilla.com/D169328
What devtools wants to do is ignoring the website-specific zoom.
It seems KDE 5.27 on X11 uses the text scale factor to implement scaling
of GTK apps completely (including Firefox), rather than the global
integer GTK scaling combined with it.
This makes this difference way more obvious than it otherwise would.
Differential Revision: https://phabricator.services.mozilla.com/D170195
Adds the forced-color-adjust property and ForcedColorAdjust keywords.
Updates tweak_when_ignoring_colors to check for `none` value of that property when determining if a color adjustment in needed.
Adds a check for `none` when styling selections to make sure they can be styled in forced color modes.
Differential Revision: https://phabricator.services.mozilla.com/D169000
Most of the API exposed on Debugger panel object were actually related to view-source code.
The code related to getOriginalLocation could be greatly factorized with existing helpers
within the debugger.
Differential Revision: https://phabricator.services.mozilla.com/D169327
* remove prettyPrint.spec.js as it only contains trivial assertions mostly covered by mochitests.
Duplicated calls to toggle pretty print to the same source has been converted to a mochitest (browser_dbg-pretty-print-flow.js).
But we can't easily replicate the exact same assertion as the assert() from `togglePrettyPrint` only thows on Node...
I tweaked assert module to highlight how to try enabling it on mochitests via flags.testing.
Removing this jest test helps remove useless export of `createPrettyPrintSource`, better highlighting the external API of prettyPrint.js
About the mochitest, awaiting for togglePrettyPrint makes it useless to wait asynchronously for tabs opening.
* I removed a jest test from project-text-search.spec.js which started failing
and should already be covered by mochitests?
* about `selectPrettyLocation`, we do not need to pass the generatedLocation argument,
as this is always the currently selected location. Also we were selecting it once,
mostly to force the loading of the original/pretty source via `selectSource()`.
And then we were calling `selectSpecificLocation` a second time.
We could select the source only once, if we force loading the original source first.
We only need to populate the SourceMapLoader before trying to update the selection.
This change may slow down the display of pretty printed source, but should avoid intermittents
and unexpected changes of selected location.
* last but not least, `setSymbols` can be removed as this is done when calling `selectLocation`.
This was the main goal, so that we can revise `setSymbols` more easily in following patches.
Differential Revision: https://phabricator.services.mozilla.com/D168425
It used to return true only if `colorToRGBA` wasn't returning null.
We changed it to be an alias of `isValidCSSColor` but this had unintended effect
We need to consider a color valid if we can get the rgba tuples from it, as we
need them to run the different methods/operation in this module.
Differential Revision: https://phabricator.services.mozilla.com/D169592
Some actors weren't using any specification. They now have to pass a bare minimal spec object.
Unifying them to the regular Actor interface helps merging constructor with initialize
and instantiate all the actors without any code branch.
Differential Revision: https://phabricator.services.mozilla.com/D169359
Adds the forced-color-adjust property and ForcedColorAdjust keywords.
Updates tweak_when_ignoring_colors to check for `none` value of that property when determining if a color adjustment in needed.
Adds a check for `none` when styling selections to make sure they can be styled in forced color modes.
Differential Revision: https://phabricator.services.mozilla.com/D169000
I can see that after navigation, allowJavascript is correctly set for the browsing context, but it seems we need to call
RecomputeCanExecuteScripts() to force it to be applied to the new page. Not sure if doing this here makes sense or if it should be done earlier.
Also there are still other issues with this feature:
- closing the toolbox does not reload the page: meaning JavaScript remains disabled on the page
- similarly all pages which have been put in bfcache will retain the javascript disabled/enabled setting
For the first issue, I wonder if we should force a reload when closing the toolbox (iff javascript disabled was toggled).
And for the second issue, could we invalidate contexts put in bfcache for a given browsing context when we toggle allowJavaScript?
Olli: Does this change make sense at least to fix the basic issue?
Differential Revision: https://phabricator.services.mozilla.com/D169182
Instead of rendering the cropped URL, we split the URL in 3 parts, so the full
URL text will be in the DOM, but we visually hide the middle part and replace
it with an ellipsis.
This way copying the message will still put the full URL in the clipboard.
A test case is added to ensure this works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D165805
It might be misleading to allow interactions with HTML previews.
Links/forms may navigate to another URL without any way to navigate back.
But it sounds unlikely this will lead to major security issue,
while letting users copy and paste partial pieces of these previews.
Differential Revision: https://phabricator.services.mozilla.com/D169075
This code tries to add keys and menu items etc. to Firefox when browser-delayed-startup-finished is fired.
Since bug 1797760 Thunderbird fires this notification too, and we've been getting errors about the devtools trying and failing to add to Thunderbird's UI.
Differential Revision: https://phabricator.services.mozilla.com/D169392
It might be misleading to allow interactions with HTML previews.
Links/forms may navigate to another URL without any way to navigate back.
But it sounds unlikely this will lead to major security issue,
while letting users copy and paste partial pieces of these previews.
Differential Revision: https://phabricator.services.mozilla.com/D169075
preListStore used to be the async version of populateStoresForHosts.
But now we can simply make populateStoresForHosts async and have a unique initialization method.
populateStoresForHosts and populateStoresForHost are initialization method, so I moved them
first in the classes.
Differential Revision: https://phabricator.services.mozilla.com/D169050
* pendingResponse is a leftover
* this code always runs in the parent and should always register/unregister listeners
* observe method can be simplified.
Differential Revision: https://phabricator.services.mozilla.com/D169049
Remove the hard-coded blocking of searching in third-party scripts.
We are later going to add a feature to allow the users filter out these files themselves
Differential Revision: https://phabricator.services.mozilla.com/D168261
#### Highlights of this patch
- We are now tracking errors that show up later in the cycle.
- Errors related to 301 redirects are ignored as we show those as 301's in the netmonitor.
- Using `waitForLoad` in a couple of more places as when a domain is not found, we have `await`'s that do not resolve.
- `NS_IMAGELIB_ERROR_FAILURE` is now emitted for the stub network request in the console, which was not exposed previously.
Differential Revision: https://phabricator.services.mozilla.com/D166882
We used to get the mappings array from the pretty fast worker to the prettyPrint
action, and then pass this array to the sourceMap service (also a worker).
As the mapping can be quite large, and given it has a complex shape, passing it
to and from workers (via `postMessage`) was costly.
So here, instead of passing only the mapping, we directly generate the sourceMap
from the pretty fast worker, and pass it to the action which forwards it to
the sourceMap service.
This helps reduce the overhead we were seeing when not buffering the lines in
the pretty print worker, in the previous patch of this stack.
Differential Revision: https://phabricator.services.mozilla.com/D168384
Make the callsites call InspectorUtils.rgbToColorName instead.
Since it was throwing when passed a non-valid named color,
which wasn't the expected outcome in DevTools, modify the
c++ method so it return an empty string instead.
Add a dedicated test since there wasn't one.
Differential Revision: https://phabricator.services.mozilla.com/D168989
The main challenge of this patch is around the initial `docShell`.
We have to call inner methods of WebExtensionTargetActor to compute it,
but this is forbiden by ES Class constructor. You can't use `this` before calling `super()`.
Otherwise this is also some troubles on destruction.
CssChangesActor was emitting late RDP event and throwing when closing the browser toolbox.
Differential Revision: https://phabricator.services.mozilla.com/D168662
This wasn't so trivial to revisit tests, but at least we stop shipping test-only
features in RDP. And the cryptic echo implement now only exists in tests.
Differential Revision: https://phabricator.services.mozilla.com/D168360
A few classes weren't passing the conn object to Actor's constructor
and instead manually defining it.
Some others were having a duplicated `_conn` alias.
Differential Revision: https://phabricator.services.mozilla.com/D168351
Make the callsites call InspectorUtils.rgbToColorName instead.
Since it was throwing when passed a non-valid named color,
which wasn't the expected outcome in DevTools, modify the
c++ method so it return an empty string instead.
Add a dedicated test since there wasn't one.
Differential Revision: https://phabricator.services.mozilla.com/D168989
Add support for [Global] extended attribute and methods/getters on instances.
This retrieves the Xray getter function of the given eval global, so that even
if some configurable properties are modified by the web content, debugger
can see the original getters, and pass them to isSameNativeWithJitInfo.
Differential Revision: https://phabricator.services.mozilla.com/D168339
Also refactor the allowlist structure to represent static vs prototype and
methods vs getters clearly.
And also moved the pre-defined pure methods list into GenerateDataFromWebIdls.py
for simplicity.
Differential Revision: https://phabricator.services.mozilla.com/D168338
In order to add getters to allowlist, debugger should use isSameNativeWithJitInfo
instead of isSameNative, to distinguish 2 getters with shared native function.
Differential Revision: https://phabricator.services.mozilla.com/D168336
Also stop modifying source actor objects by putting breakable lines on it.
Ideally source actors should be immutable object. There is only sourceMapURL left.
And clarified the fact that we are having source actor IDs everywhere and never a Source ID.
Differential Revision: https://phabricator.services.mozilla.com/D168661
First, we set the max-width of the message location in percentage
instead of vw, as the console output inline-size can be different
than the viewport one (e.g. when it is in editor mode).
We then turn the media query we had to hide the timestamp into a
container query, again, to take into account editor mode.
Finally, we place the location on its own row when the output is
narrow so the message text itself can still be readable.
Differential Revision: https://phabricator.services.mozilla.com/D168778