We used to rely on different things to both display
the autocompletion text and accept an autocompletion.
This patches introduces new helper functions in order
to make the code more easy to reason about.
We also rollback our decision to show the popup when
there is only 1 item in the autocompletion list in
order to be more consistent with what Chrome does.
Differential Revision: https://phabricator.services.mozilla.com/D2824
--HG--
extra : moz-landing-system : lando
The JsTerm relies on the codeMirror "change" event to
display the autocomplete popup, and then queries the
DOM to get the cursor element which will serve as an
anchor to the autocomplete popup.
Unfortunately, the "change" event is fired by the editor
__before__ the end of an operation (i.e. the actual DOM
update). Which means that if we are fast enough to get
the autocomplete items from the server, the cursor element
was not changed in the dom, and the computation of the anchor
is erroneous.
We fix this by listening to the "changes" event, which
is fired after the actual DOM changes.
In order to do that, we pipe down the event from the code
mirror instance to the source editor.
Differential Revision: https://phabricator.services.mozilla.com/D2710
--HG--
extra : moz-landing-system : lando
This removes the border-radius from the autocomplete popup (and
its items) and refines the spacing.
Since we have more padding for the autocomplete items, we need
to adjust the xOffset when showing the popup.
The yOffset of the webconsole autocomplete is tweaked a bit so
we see its border; the xOffset of the markup search input is also
tweaked to consider the left padding we use to display the search
icon in the input.
MozReview-Commit-ID: JyLySLBUgGy
--HG--
extra : rebase_source : 04d0e1335447c576f7e23f4b8a2280337695ac46
Since we are dealing with 2 versions of this component, we
introduce new helpers that abtracts how we get or assert
some values.
MozReview-Commit-ID: 1XNPcmwwsBj
--HG--
extra : rebase_source : 5b916fe9ad953ce80c058be1ea2eb8894c625c8e
Create a separate function to measure the chevron width, and make
the function that measure the char width pure by only returning
the width.
The assignment to internal properties (_inputCharWidth, _chevronWidth),
is now done in componentDidMount which simplify reading this code.
MozReview-Commit-ID: FitY97Y03Sg
--HG--
extra : rebase_source : d35caaf19b14d9a5cfbddaf58d20bc6c7aeb4aaa
This functionnality is used in the webconsole to display to the user
what will be inserted if they hit Tab.
Since CodeMirror does not provide such feature, we take advantage of
markText to put the autocompletion text in a title attribute and
then display it using a CSS after pseudo element.
This way, we don't have to run any complex computation for positioning
nor styling.
MozReview-Commit-ID: 1tFdlR51418
--HG--
extra : rebase_source : aa728e3ee3254e2ef7eb1768e3f8621decca0535
Since the source editor already defines its own extraKeys.Tab,
anything the consumer set was ignored.
This patch now also runs consumer extraKeys.Tab if defined.
MozReview-Commit-ID: 5FeMXoystAb
--HG--
extra : rebase_source : 4d57be89965691948609c9037ef60d8850cea8af
This is only about adding an editor in the JsTerm and making
sure we can still execute input strings.
The styles should stay the same, except that now we don't have
to do the computation for the input height, since they're already
done in CodeMirror. In-line style, history navigation and
autocompletion will be handled in separate bugs.
The creation of the editor might be done outside of the JsTerm in
the future so we can re-use it to syntax highlight Evaluation input
in the output; but not in this bug since it would need to move
jsterm.execute as well.
MozReview-Commit-ID: 75TmF055mkp
--HG--
extra : rebase_source : ec7edb17ffb13c757ed51e03a1174399ea2bcbde
Changes and notes:
- Created `devtools/client/shared/test/telemetry-test-helpers.js`, which
contains test helpers to aid in creating and running telemetry tests.
- Removed any telemetry monkeypatching as it is not dependable and no longer
needed (there is some left in GCLI but the test is now disabled because
we are removing GCLI soon anyhow).
- Because `telemetry-test-helpers.js` is imported by `shared-head.js` I
have had to make it available everywhere that shared-head.js is used.
- All telemetry tests have been rewritten to use the new helper.
- shared-head.js cannot be imported by tests inside
`devtools/client/performance/test/` because perf have custom `once` and
`waitFor` implementations that act differently from the ones inside
`shared-head.js`. This means I had to import the telemetry helpers into
`devtools/client/performance/test/head.js`
- Created `devtools/client/shared/test/browser_telemetry_misc.js` to be sure
to catch `DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER` (we catch a few
others to be thorough).
- Disabled `browser_inspector_menu-02-copy-items.js`, which was failing to
test some expired scalars. I also corrected the way the scalars are logged
because it was completely wrong.
MozReview-Commit-ID: JjQEGM6hT61
--HG--
extra : rebase_source : cd1214d01bd11908f69167839975cd93ecb83421
This causes various changes to properties-db.js and also many devtools
tests get updated.
There are two changes affect multiple tests:
* `calc` gets removed from everywhere. We never have it listed in all
properties which deserve it, and doing so without much false positive
(i.e. properties don't deserve but get it) can be pretty tricky.
So they are just removed for now.
* The complete color keyword list is no longer included, and instead,
"COLOR" is prepended to the list directly. We can probably remove
the related code which replaces color keywords with "COLOR" from
devtools. Note that, with stylo enabled, the list is already unrelated
to what the parsing code uses. We should eventually re-enable the
disabled test here after we can get the color list from cssparser
in bug 1456715.
Other changes to properties-db.js seem to be valid, some of them also
affect tests:
* `{-webkit-,}align-{content,items,self}` get `first baseline`, `safe`,
`unsafe`, and lose `left` and `right`.
* `{-moz-,-webkit-,}{animation,transition}{,-timing-function}` has a
new `frame` keyword which is a function value in `<timing-function>`.
* `{background,{-webkit-,}mask}-position-x` lose `top` and `bottom`, and
correspondingly `{background,{-webkit-,}mask}-position-y` lose `left`
and `right`. They don't deserve those values.
* `{background,{-webkit-,}mask}{,-size}` get `auto`.
* `border` shorthand loses `<image>` values as well as other keyword
values for `border-image-*` subproperties, because they aren't parsed
on the shorthand.
* `{-moz-,}border-image{,-width}` get `auto`.
* `-moz-context-properties` gets `none`.
* `cursor` get some -moz-prefixed values as well as `url`.
* `fill` and `stroke` get the color keywords.
* `{-webkit-,}filter` get the keywords and function names.
* `font` shorthand loses values from many of `font-variant-*` properties
because they are not parsed there.
* `font-variant` and `font-variant-alternates` get function values of
the longhand.
* `font-variant-{east-asian,ligatures,numeric}` get `normal`, and
`font-variant-ligatures` in addition gets `none`.
`font-{feature,variation}-settings` also get `normal`.
* `grid` and `grid-template-{areas,columns,rows}` get `none`.
* `grid`, `grid-template`, and `grid-template-{columns,rows}` get
`auto`, `fit-content`, `minmax`, and `repeat`.
* `grid-auto-{columns,rows}` get `auto`, `fit-content` and `minmax`.
* `-moz-image-region` gets `auto` and `rect`.
* `{-webkit-,}justify-content` lose `baseline`, `last baseline`, and
get `safe` and `unsafe`.
* `{justify,place}-items` get `first baseline`, `legacy`, `safe`,
`unsafe` and lose `auto`.
* `{justify,place}-self` and `place-content` get `first baseline`,
`safe`, and `unsafe`.
* `outline{,-style}` get `hidden`.
* `scroll-snap-coordinate` gets `none`, and `scroll-snap-points-{x,y}`
gets `none` and `repeat`.
* `shape-outside`, `text-emphasis{,-style}` get all the keyword values
and function names they deserve.
* `stroke-dasharray` gets `none`.
* `text-combine-upright` drops `digits` which we never implemented.
* `{-moz-,-webkit-,}transform` and `-moz-window-transform` get their
transform function list. `accumulatematrix` and `interpolatematrix`
aren't real CSS value but they have `#[css(function)]` specified.
We should probably remove them at some point.
* `will-change` gets `auto`.
* All properties accept `<image>` value now gets -webkit-prefixed
gradient function names, including
* `background{,-image}`,
* `{-moz-,-webkit-,}border-image{,-source}`, and
* `{-webkit-,}mask{,-image}`.
MozReview-Commit-ID: E7Y0CFUFYgW
--HG--
extra : source : bab732c8c531cfca1bcd233f769c25bb2e373773
The shims that this rule tests for no longer exist.
MozReview-Commit-ID: DMgP7Hczavc
--HG--
extra : rebase_source : 765ddd5c62c9449c07ed050e44d86a3bd5c0ae64
extra : amend_source : 627a7694ac07182200f876901ded7a34721cd228
There are a few different reasons why tests needed updating (not an exhaustive list):
- Tests assume that successive operations take place at different times.
- Tests assume that an operation took a minimum amount of time.
- Tests hardcodes a specific delay.
In most cases we hardcode the preference off. In some cases this is the best approach,
in others, we would like to improve. The bug for tracking those improvements is Bug 1429648
An improvement that is present in some tests is to hardcode a specific precision reduction
that is acceptable based on the confides of the test. (Obviously this needs to be a fix for
the test framework and not a requirement on the feature being tested.)
In a few places, the test itself can be fixed, for example to no longer require the end
time of an operation to be strictly greater than the start time, and allows it to be equal
to it.
MozReview-Commit-ID: J59c7xQtZZJ
--HG--
extra : rebase_source : df8a03e76eaf9cdc9524dbb3eb9035af237e534b
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b