This change forces a reflow + repaint of the Rule View before checking its
contents. Ideally, this will remove the intermittent behavior of this test.
Differential Revision: https://phabricator.services.mozilla.com/D66671
Depends on D80059
removeActorPool is only called from one spot, which always passes the second optional argument as true.
Differential Revision: https://phabricator.services.mozilla.com/D80060
This is done by getting the value of the `devtools.testing.enableServerWatcherSupport`
preference on the WatcherActor, and using its result to enable the traits or not.
On the browser_resources_* test that have both legacy and server listener, we
run the tests twice, without and with the pref to have some decent coverage.
Differential Revision: https://phabricator.services.mozilla.com/D79983
Previously, the list clone was completely replaced every time aria-activedescendant was set.
This caused screen readers to extraneously report this as a new list every time the user cursored to a different item, even if the items hadn't changed.
Differential Revision: https://phabricator.services.mozilla.com/D79941
This patch removes the browsingContextID getter in favor of creating a property
on the instance in the constructor.
The getter was an attempt to handle the fact that we can have multiple browsing
context over time, but it wasn't working that well, so we'll tackle that as
part of Bug 1625027.
Differential Revision: https://phabricator.services.mozilla.com/D80151
This is done by getting the value of the `devtools.testing.enableServerWatcherSupport`
preference on the WatcherActor, and using its result to enable the traits or not.
On the browser_resources_* test that have both legacy and server listener, we
run the tests twice, without and with the pref to have some decent coverage.
Differential Revision: https://phabricator.services.mozilla.com/D79983
No idea if that is the real reason why the Browser Toolbox failed opening.
It isn't clear how WorkerTarget detach is implied in toolbox opening?
Differential Revision: https://phabricator.services.mozilla.com/D79159
The issue was that we were having a ResizeObserver only on the console output
node. When the output only has a few node, its height is impacted when an
element is expanded.
We fix this by observing the output parent node, which contains both the input
and the output, which prevents the issue.
In editor mode though, we still need to observe only the output element, as
the editor is on the right side.
So when the console changes from editor mode to inline, or the other way around,
we change the observed element.
A test case is added to make sure the issue is fixed. Sadly, this also means
we have to remove a test case (typing a multiline expression in input mode
won't keep the output scroll to the bottom), but it's a tradeoff I'm willing
to make as the issue isn't as annoying as the one we're fixing here.
Differential Revision: https://phabricator.services.mozilla.com/D79961
We're converting to nscoord in some places unnecessarily, reducing the
precision of the computed value we return.
This makes some tests unnecessarily fail if we change the base of
nscoord.
Differential Revision: https://phabricator.services.mozilla.com/D79996
This patch adds title attributes on the different Reps, alongside with a new `shouldRenderTooltip` prop.
The props is only used from the ExpressionPanel in the debugger so far.
Tests are added to ensure this works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D72900
This patch does the following:
1. Adds a semantic document role to the computed styles pane. This causes screen readers to treat it as something they can use their reading commands on for better navigation and efficiency.
2. Gives the expansion twisties a button role and a label. I am reusing the labels introduced in an earlier patch.
3. Turns the name portion of each property into a heading so screen reader users can quickly skip between them, regardless of their expanded status or not.
4. Explicitly displays the status for each rule match with visually hidden text because screen readers do not pick up text from titles on simple span elements.
5. Adjusts the visually-hidden class to be more modern and less intrusive.
Differential Revision: https://phabricator.services.mozilla.com/D79673
In order to handle parentProcessTargetActor in the WatcherActor, we modify
TargetActorRegistry.getTargetActor to return the parent process target when
the passed browsing context id is null.
The comment explaining why we need to call getTargetActor in
WatcherActor#watchResources is modified to better summarize the situation.
We also take this as an opportunity to handle those targets in unwatchResources.
Differential Revision: https://phabricator.services.mozilla.com/D79424
Added browser test for CompatibilityActor to check consistency and
correctness.
Thse test include:
* Test for no issue
* Test for simple issue
* Test for invalid CSS rule
* Test for aliases
* Test for browser specific issues
* Test for multiple issues for same element
Differential Revision: https://phabricator.services.mozilla.com/D78956
This patch adds a `CompatibilityActor` that calls the MDNCompatibility
library from the devtool server.
This patch exposes `_declarations` from the `StyleRuleActor` and the
a new function `formDeclaration` responsible for populating the
declarations property.
As a check for correctness, the patch replaces the `pageStyle.getApplied`
call in the Compatibility Panel on the client with `compatibility.getNodeCssIssues`
fetching the array of compatibility issues directly and removing the
dependency on MDNCompatibility library for client side computation of
compatibility issues.
Differential Revision: https://phabricator.services.mozilla.com/D77060
In a nutshell, this rule says that if a push only modifies files under "/devtools" then
only run builds and tests that are tagged with "linux", "macosx" or "windows" and skip
all others (which is just "android").
Note it may still be possible to see Android builds and tests as not all tasks use
the 'skip-unless-schedules' optimization, but this should avoid most of them.
Differential Revision: https://phabricator.services.mozilla.com/D79470
While cleaning up and restructuring client-side code to manage highlighters, I discovered that FlexItemHighlighter is not implemented / landed ([Bug 1477614](https://bugzilla.mozilla.org/show_bug.cgi?id=1477614)).
To ease clean-up and review of incoming changes, I am removing this orphaned code. It will be available with this revision if we need to revert it later.
Differential Revision: https://phabricator.services.mozilla.com/D79517
This patch does the following:
1. Adds a semantic document role to the computed styles pane. This causes screen readers to treat it as something they can use their reading commands on for better navigation and efficiency.
2. Gives the expansion twisties a button role and a label. I am reusing the labels introduced in an earlier patch.
3. Turns the name portion of each property into a heading so screen reader users can quickly skip between them, regardless of their expanded status or not.
4. Explicitly displays the status for each rule match with visually hidden text because screen readers do not pick up text from titles on simple span elements.
Differential Revision: https://phabricator.services.mozilla.com/D79673
There's no good reason for the message to be duplicated, and it turns out that
this test was actually asserting a bug that occured with CSP violation messages
(see Bug 1645745).
We change the test so it only waits for a single message, which should fix the
intermittent on windows7 (the message wasn't "repeated" but duplicated).
Differential Revision: https://phabricator.services.mozilla.com/D79651
The 'asyncStack' flag on JS execution contexts is used as a general switch
to enable async stack capture across all locations in SpiderMonkey, but
this causes problems because it can at times be too much of a performance
burden to general and track all of these stacks.
Since the introduction of this option, we have only enabled it on Nightly
and DevEdition for non-mobile builds, which has left a lot of users unable
to take advantage of this data while debugging.
This patch enables async stack traces across all of Firefox, but introduces
a new pref to toggle the scope of the actual expensive part of async stacks,
which is _capturing_ them and keeping them alive in memory. The new pref
limits the capturing of async stack traces to only debuggees, unless an
explicit pref is flipped to capture async traces for all cases.
This means that while async stacks are technically enabled, and code could
manually capture a stack and pass it back to SpiderMonkey and see that stack
reflected in later captured stacks, SpiderMonkey itself and related async
DOM APIs, among others, will not capture stacks or pass them to SpiderMonkey,
so there should be no general change in performance by enabling the broader
feature itself, unless the user is actively debugging the page.
One effect of this patch is that if you have the debugger open and then close
it, objects that have async stacks associated with them will retain those
stacks and they will continue to show up in stack traces, no _new_ stacks
will be captured. jorendorff and I have decided that this is okay because
the expectation that the debugger fully revert every possible effect that it
could have on a page is a nice goal but not a strict requirement.
Differential Revision: https://phabricator.services.mozilla.com/D68503
This patch does the following:
1. Both the flex-direction and flex-wrap badges are being treated as illustrations, not generic containers, so screen readers immediately pick up the full meaning from the title.
2. Turns the flex item list sub heading into an actual heading for screen readers. It is level 3 because the accordeon headings are all level 2.
Differential Revision: https://phabricator.services.mozilla.com/D79129
It used to take an object with only 1 property, a function. The way it was
called in the webconsole actor made it harder to follow than it actually need.
We take that as an opportunity to convert the function to a class.
Differential Revision: https://phabricator.services.mozilla.com/D79294
It used to take an object with only 1 property, a function. The way it was
called in the webconsole actor made it harder to follow than it actually need.
We take that as an opportunity to convert the function to a class.
Differential Revision: https://phabricator.services.mozilla.com/D79252
It used to take an object with only 1 property, a function. The way it was
called in the webconsole actor made it harder to follow than it actually need.
We take that as an opportunity to convert the function to a class.
Differential Revision: https://phabricator.services.mozilla.com/D79249
This patch adds IDs to all the box divs so they can be referenced by ARIA attributes. The actual legend spans also act as region landmarks with an associated level so the nesting is relayed.
In addition, each of those boxes gets the buttons for its dimensions rendered in-place so for assistive technologies, this all follows a logical flow. aria-owns changes the accessibility tree so the nesting and associated properties are grouped together.
The actual buttons also receive a localizable aria-label that is a combination of the button text and title, so screen reader users not only hear "0 button" without knowing immediately what that button actually belongs to. Title is secondary information.
Differential Revision: https://phabricator.services.mozilla.com/D78953
This patch turns the info that holds the dimensions and position info into a region. Because the visual representation is without explanatory text, an aria-label is constructed for that region to hold a more explicit version of the displayed information.
Differential Revision: https://phabricator.services.mozilla.com/D78952
1. Fix the twisty so it has a role and name that reflects the action the button will take when clicked (show or hide).
2. Give the section itself a heading so it can easily be found. Make it a level 3 so it is clear that this is a sub section of the box model view.
3. Order the properties themselves in a table with rows for each property, and cells for the name and value.
4. Make the property names and values, which are not editable, not clickable.
Differential Revision: https://phabricator.services.mozilla.com/D78951
The 'asyncStack' flag on JS execution contexts is used as a general switch
to enable async stack capture across all locations in SpiderMonkey, but
this causes problems because it can at times be too much of a performance
burden to general and track all of these stacks.
Since the introduction of this option, we have only enabled it on Nightly
and DevEdition for non-mobile builds, which has left a lot of users unable
to take advantage of this data while debugging.
This patch enables async stack traces across all of Firefox, but introduces
a new pref to toggle the scope of the actual expensive part of async stacks,
which is _capturing_ them and keeping them alive in memory. The new pref
limits the capturing of async stack traces to only debuggees, unless an
explicit pref is flipped to capture async traces for all cases.
This means that while async stacks are technically enabled, and code could
manually capture a stack and pass it back to SpiderMonkey and see that stack
reflected in later captured stacks, SpiderMonkey itself and related async
DOM APIs, among others, will not capture stacks or pass them to SpiderMonkey,
so there should be no general change in performance by enabling the broader
feature itself, unless the user is actively debugging the page.
One affect of this patch is that if you have the debugger open and then close
it, objects that have async stacks associated with them will retain those
stacks and they will continue to show up in stack traces, no _new_ stacks
will be captured. jorendorff and I have decided that this is okay because
the expectation that the debugger fully revert every possible effect that it
could have on a page is a nice goal but not a strict requirement.
Differential Revision: https://phabricator.services.mozilla.com/D68503
Moved info icon from after text to before text.
Matched the spacing between the icon and text to the spacing between the icon and text in the Console.
Updated relevant WhyPaused snapshot tests.
Differential Revision: https://phabricator.services.mozilla.com/D78601
Removes the instance of `WhyPaused` in `debugger/src/components/App.js` as the mark up that it returns does not contain useful information and is never visible to the user.
Differential Revision: https://phabricator.services.mozilla.com/D79144
When the autoclose bracket addon is enabled, quotes and ] are automatically
inserted, but that wasn't taken into account in the function that is in charge
of setting the input value when the user accept the autocompletion.
This patch should fix this, and add a few tests to makes sure we don't regress.
Differential Revision: https://phabricator.services.mozilla.com/D79126
The console editor uses the codeMirror autoclose bracket addon,
which when the user types a closing bracket and the next char
in the input is the same char, won't insert a new char, but will
only move the cursor.
In such case, the JsTerm code wasn't capturing this key event, and
it could happen that the autocomplete would still be displayed,
which would then lead to some weirdness when the user hits Enter.
In order to fix that, we listen for the keyHandled event, which
is fired one a keypress was handled, and that appear that be fired
for the case I exposed, and isn't triggered when the character is
simply inserted.
A test case is added in one of our test to make sure this works as
expected.
Differential Revision: https://phabricator.services.mozilla.com/D78935
My patch from bug 1599160 changed timing in a way that makes this bug a
perma fail and I'd rather not get it backed out :)
Differential Revision: https://phabricator.services.mozilla.com/D79316
This patch adds a ResizeObserver to the input node, which when triggered
refreshes the codeMirror instance.
This is needed because codeMirror draws specific elements, like the cursor
and selection blocks, and they need to be re-computed if the editor size
changed (the line might have wrapped, and the cursor need to be in a new
position now).
Depends on D78649
Differential Revision: https://phabricator.services.mozilla.com/D78661
CodeMirror does not have an option to automatically remove
the selection when the editor is blurred, which means there
can be a kind-of weird visual glitch when there was a selection
and the user does another selection.
This patch listen for the blur event on the editor, and if there
was a selection, removes it.
The blur event need to be piped down from the sourceeditor.
A test is added to ensure this works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D78649
Support for `goForward()` and `goBack()` has been removed for `mozbrowser` elements, which were methods that old-RDM used to handle backward/forward navigation. Since the custom implementation of the webNavigation object for old-RDM uses the `WebNavigation` actor as a fallback for APIs that are not supported by `mozbrowser`, we can also do the same for `goForward()` and `goBack()`.
Differential Revision: https://phabricator.services.mozilla.com/D78835
This broke when the main developer tools window was converted from XUL to XHTML. By adding the application role, the window is once again a window, not a document for the accessibility engine.
In addition, while I was here, I fixed the role of the focusable vbox because it is the first thing the user lands on when tabbing, to make it a semantic group, not an "unknown". Since this is probably supposed to be focusable for keyboard users, it is better to have an appropriate role.
Differential Revision: https://phabricator.services.mozilla.com/D79038
Support for `goForward()` and `goBack()` has been removed for `mozbrowser` elements, which were methods that old-RDM used to handle backward/forward navigation. Since the custom implementation of the webNavigation object for old-RDM uses the `WebNavigation` actor as a fallback for APIs that are not supported by `mozbrowser`, we can also do the same for `goForward()` and `goBack()`.
Differential Revision: https://phabricator.services.mozilla.com/D78835
This attribute can only be toggled on top level BrowsingContext.
These are the top level window's, or tab's BrowsingContext.
From DevTools point of view, it should only be toggled by the
Parent Process or Tab target.
Differential Revision: https://phabricator.services.mozilla.com/D78860
To give the whole rules view more structure:
1. Make the container a document so screen readers invoke their reading mode.
2. Give the different section headers a proper heading role.
3. Make each separate item an article so screen readers can navigate them more easily.
4. Give the expander twisty for the pseudo classes a proper label that adjusts depending on whether pseudo classes are expanded or collapsed. Also make it a button for screen readers.
This patch does not attempt to simulate any advanced navigation via the keyboard.
Differential Revision: https://phabricator.services.mozilla.com/D78674
Now that network requests can be displayed as error (for 4XX and 5XX),
this test could get one of those and think we were getting an actual
js error, which makes the test fail.
Excluding network messages from the messages we are checking should
fix the intermittent.
Differential Revision: https://phabricator.services.mozilla.com/D78493
The lack of specificity for script intro type has lead the debugger to need
to make use of 'source.introductionType' and 'source.element' in order to
determine whether a given script was injected, or inline or fetched, which
is entirely unnecessary of the loader itself clearly tells us what type
of script we are working with. It also allows us to cleanly handle the case
of XUL, which previously was "scriptElement" but has no ".element" passed
in, so we were unable to know whether a given source was inline or not.
Differential Revision: https://phabricator.services.mozilla.com/D78435
On Windows, the IDL files were being read with the "charmap" codec, but quotes like “ were causing errors.
By specifying "utf8" instead, the read() succeeds.
Differential Revision: https://phabricator.services.mozilla.com/D77971
We were getting duplicated nsIScriptError in the Browser Toolbox console and the Browser Console
when the multiprocess pref is enabled, because error from content processes are forwarded to
the main process.
The previous patch of this queue added a isForwardedFromContentProcess flag to nsIScriptError,
that we use in this patch to _not_ handle forwarded messages in multiprocess browser console
and browser toolbox console.
Differential Revision: https://phabricator.services.mozilla.com/D78231
We were getting duplicated nsIScriptError in the Browser Toolbox console and the Browser Console
when the multiprocess pref is enabled, because error from content processes are forwarded to
the main process.
The previous patch of this queue added a isForwardedFromContentProcess flag to nsIScriptError,
that we use in this patch to _not_ handle forwarded messages in multiprocess browser console
and browser toolbox console.
Differential Revision: https://phabricator.services.mozilla.com/D78231
According to SVG Accessibility API Mappings, an SVG element which has title or desc element must be exposed.
https://w3c.github.io/svg-aam/#include_elements
Previously, we didn't expose <g> elements at all even if they had a title/desc, and we unconditionally exposed some other SVG elements even when they didn't.
This removes the Dev Tools A11y Panel code which explicitly allowed unlabelled descendants of role="img" <svg> elements, since we don't create descendants if they don't have a label now anyway.
The associated tests had to be tweaked as well, since now we don't create unlabelled descendants.
Original patch by Takeshi Kurosawa.
Differential Revision: https://phabricator.services.mozilla.com/D77763
Underlines the expression that throws the exception and highlights the whole line in red.
Adds exception tooltip while hovering over the underlined token.
Differential Revision: https://phabricator.services.mozilla.com/D71337
We can get two calls to enterResponsiveMode() for a tab, via the two
callsites in devtools/client/responsive/ui.js.
Calling enterResponsiveMode() is not idempotent after bug 1634621, as
the second call will lose the zoom information. Prevent this from
happening by making the call a no-op if we're already in responsive
mode.
Do the same in leaveResponsiveMode() for consistency.
Differential Revision: https://phabricator.services.mozilla.com/D78294
Removed UI references to blacklist, replaced with ignore. Also updated the shortcut key to 'I' instead of 'D' since it's no longer Blacklist. Lastly updated tests to fix failing snapshot tests and jest tests.
Differential Revision: https://phabricator.services.mozilla.com/D78071
OuterWindow ID is deprecated in a Fission world and we should rather use Browsing Context ID.
The outer window ID will change when navigating to another origin, loaded in a distinct process,
whereas Browsing Context ID will stay the same.
Differential Revision: https://phabricator.services.mozilla.com/D78253
This patch adds a mochitest that will be responsible to
generate and update platform messages stubs, which is what
we already have for all the other type of resources we handle
in the console.
This means the mocha test asserting the rendering of platform
messages can use those stubs instead of hand-written stubs we
have at the moment.
This patch also adds a `getCurrentTestFilePath` function in shared-head.js,
which we then use in the different stub generators.
We also use CHROME_URL_ROOT to require the stub-generator-helpers file.
Differential Revision: https://phabricator.services.mozilla.com/D77216
Fixes incorrect 'expression' strings getting from the parse causing overwriting of values when hovering.
If an 'expression' string is in the form of `"foo = value"`, when hovering over 'foo', that 'expression' string is sent to 'evaluateJSAsync()' in 'webConsoleActor' which overwrites any previously set values to 'foo'.
Differential Revision: https://phabricator.services.mozilla.com/D77266