This change makes use of the toolbox's textBox menu in all of the
inspector's text fields.
Previously, right-clicking in a text field in the inspector would give
various results: either the tool's context menu would open, or nothing
would happen, or the usual copy/paste/cut menu would open.
Now, right-clicking in any text field in the inspector always shows the
copy/paste/cut menu.
MozReview-Commit-ID: DwkhBqY7Qzj
Modify the devtools autocomplete-popup to rely on a HTMLTooltip instance
instead of a XUL panel.
Other than the straightforward migration to HTML, the main difference with
the new implementation is that the richlistbox has now been replace with a
simple HTML list element. The former XUL widget used to be able to take the
focus from the input it was linked to.
This is no longer the case. Most autocomplete users were always keeping the
focus in the input, except for the inspector-search, which was moving the
focus back and forth between the input and the autocomplete's richlistbox.
Now the focus is always in the input. A practical example to illustrate how
this changes the UX: before when the user had the focus on the first element
of the list, pressing "DOWN" would keep the element selected but visually move
the focus in the input. Now the selection simply cycles to the next item.
Even though this introduces a difference in behaviour compared to the previous
implementation, it makes the inspector search UX consistent with the other
autocomplete widgets used in devtools.
Another difference is about the display for the inspector-search. The position
of the autocomplete popup used to be above the input. This is now impossible to
achieve because the search input is at the top of the toolbox and the HTML tooltip
can not exceed the limits of the toolbox.
For this #2 issue, either we manage to use XUL panel wrappers, in which case, the
autocomplete will be displayed as it used to. Or we can invert the order in which
items are inserted and explicitly ask for the autocomplete to be displayed below the
input. I prefered not to change this here in order to make the code change easier to
understand, but it should be addressed in a follow-up.
MozReview-Commit-ID: jH9aXm9Jvz
Fixed regression from Bug 1168246 and added a unit test to loosely check that
the autocomplete popup moves along with autocompleted query.
MozReview-Commit-ID: H7t5WjkwBE4
For the style attribute CSS autocompletion, suggestions will now be provided
when the character after the caret is a non-word character. As opposed to the
current behavior where suggestions would only be displayed if the next character
was the end of the input or a space.
This allows to show suggestions when the user's caret is next to ";" or '"', which
can frequently happen when editing style attributes.
MozReview-Commit-ID: Bvz6koikbqR
In order to keep testing indexes & total number of displayed suggestions,
added two tests relying on mocked suggetions list.
The inplace-editor API has been modified to allow mocking the suggestions.
Helper methods in devtools/client/shared/test have been moved to a new
test helper helper_inplace_editor.js, loaded by all inplace-editor
tests of this test suite.
CLOSED TREE
MozReview-Commit-ID: LuXelKF0kY
For simple rules like function spacing, we can auto-fix these across the code
base so they are followed in a consistent way.
To generate this patch, I ran:
./mach eslint devtools --no-ignore --fix
After this, I reverted any changes to third party files that we really do want
to ignore.
MozReview-Commit-ID: 6Q8BApkAW20
Add support for both syntax in CssColor
Add support in value increment
Edit several tests to make sure we handle these syntaxes all across the inspector (display swatch,
color increment, unit switching, …).
MozReview-Commit-ID: FLw9va3i8H0
Usability changes to the ruleview autocomplete:
- max suggestions is now capped to 500 to make sure as many suggestions as possible
as possible are displayed
- vendor-prefixed properties are moved to the end of the list
- !important is no longer the first suggested item
MozReview-Commit-ID: AOfHyqS3n8s
cssPropertyIsValid was used only to find a compatible css unit when a number
was being incremented/decremented.
Because units are unlikely to be different between debuggees, a local DOM
node was used to validate the tested unit by applying and getting style on
the DOM node.
MozReview-Commit-ID: K0ldOgNRalg
Check if the CSS inplace editor is currently using several lines
to display its value. When using several lines, prevent increment,
decrement and autocomplete features.
The autocomplete can still be triggered by typing a value at the end
of the input (or before a space). When the autocomplete popup is
opened, UP/DOWN still allow to cycle through the suggestions.
MozReview-Commit-ID: DapCdhjx444
Only text styles should be copied between the replaced element and the input.
Other styles are still copied between the input and the measurement element.
MozReview-Commit-ID: 7YSWtjLgH2z
The default inplace-editor autocomplete behavior is not userfriendly
when combined with a multiline inplace-editor. Navigating up/down might
trigger an autocomplete suggestion.
Also, the autocomplete popup is not displayed at the correct position and
should take the multiline into account.
MozReview-Commit-ID: JTiCQ3HK5bn
The inplaceEditor now supports a maxWidth configuration option which can either
be a number or a method returning a number. This maxWidth will be applied to the
hidden element used in order to autosize the input.
MozReview-Commit-ID: JTiCQ3HK5bn
Based on the original patch from danemacmillan.
* suggestion-picker.js
Add a new shared util to find the most popular css property in an array.
The list of popular css properties is extracted from chrome devtools code.
* autocomplete-popup.js
Can specify selected item index when opening the popup or setting items.
* inplace-editor.js
Use the suggestion-picker to select a default property.
MozReview-Commit-ID: JuWZzbBSBqX
This patch forces the increment step to 0 when the type of the inplace-editor is
PLAIN_TEXT.
This type is used by:
- markup view for editing text and comment nodes
- rule-view to edit selectors
- projecteditor resource tree to create or rename a file
All other inplace editors will still benefit from the increment/decrement feature.
MozReview-Commit-ID: 8tZiFMwmWM3
When editing the style attribute, do not trigger autocomplete suggestions if the style attribute
was already closed by a set of matching double or single quotes.
Added a new test and moved common test functions to a dedicated helper.
MozReview-Commit-ID: 5AfkNXWvqTA
When using the inplace editor, clicking on an autocomplete suggestion
no longer triggers apply() and no longer calls the done() callback.
This way the inplace editor behavas similarly when using the keyboard
and when using the mouse.
In a following patch, all DevTools moz.build files will use DevToolsModules to
install JS modules at a path that corresponds directly to their source tree
location. Here we rewrite all require and import calls to match the new
location that these files are installed to.
Move major DevTools files to new directories using the following steps:
hg mv browser/devtools devtools/client
hg mv toolkit/devtools/server devtools/server
hg mv toolkit/devtools devtools/shared
No other changes are made.