Closed
Bug 1254070
Opened 8 years ago
Closed 8 years ago
markup-view: style attribute autocomplete works only when caret is at the end of the input
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(firefox44 wontfix, firefox45 wontfix, firefox46 wontfix, firefox47 wontfix, firefox48 wontfix, firefox49 wontfix, firefox50 fixed)
RESOLVED
FIXED
Firefox 50
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
(Keywords: regression, Whiteboard: [btpp-fix-later])
Attachments
(1 file, 1 obsolete file)
STRs: - open the markup view - add an attribute on any node - type `style="color: red;"` Expected: - should have autocompletion both for the property name and the property value Actual: - autocompletion is not working
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Comment 1•8 years ago
|
||
This regression was caused by Bug 913955 . The fix is quite simple, the test at https://dxr.mozilla.org/mozilla-central/source/devtools/client/shared/inplace-editor.js#1155 should change from: > input.selectionStart < input.value.length to > input.selectionStart < input.value.length - 1 pbro: This feature has been missing for 2 years and no one complained. Can you confirm we should resurrect it?
Flags: needinfo?(pbrosset)
Assignee | ||
Updated•8 years ago
|
Has STR: --- → yes
Keywords: regression
Assignee | ||
Comment 2•8 years ago
|
||
As discussed on IRC, the autocompletion only works if you are editing the last character of the attribute. If you are writing first `style=""` and then typing between the quotes, the autocompletion is not triggered. and input.selectionStart < input.value.length is actually a valid test, true only when the selection is after the last character of the input.
Flags: needinfo?(pbrosset)
Assignee | ||
Updated•8 years ago
|
No longer blocks: 916582
Summary: markup-view: style attribute autocomplete is not working → markup-view: style attribute autocomplete works only when caret is at the end of the input
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•8 years ago
|
||
Gabriel: The patch summary is a bit confusing, so I rephrase it here. The goal is to make the autocomplete of the style attribute a bit more flexible. Right now it works only when we are at the end of the input or if the next character is a space. I think you added the condition checking for end of input or space in Bug 913955, so I'd like your feedback here. This patch proposes to activate the autocompletion if the next character is not a "word" caracter or a dash. We could further restrict this behaviour to the MIXED_CONTENT type (ie. style attribute only) but I think it can be useful in the rule view as well.
Attachment #8728400 -
Flags: feedback?(gl)
Updated•8 years ago
|
Updated•8 years ago
|
status-firefox48:
--- → affected
status-firefox49:
--- → affected
Hello Julian, this bug was reviewed in the Platform triage meeting and it seems the wip patch got stuck somewhere along the way. Do you want to find another reviewer?
Flags: needinfo?(jdescottes)
Assignee | ||
Comment 7•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/55454/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/55454/
Attachment #8756866 -
Flags: review?(gl)
Assignee | ||
Comment 8•8 years ago
|
||
Comment on attachment 8728400 [details] [diff] [review] bug1254070.wip.patch Let's try with a mozreview request! Would really prefer :gl to have a look here. Try push for the rebased patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=dec28360df75
Attachment #8728400 -
Attachment is obsolete: true
Flags: needinfo?(scrapmachines)
Flags: needinfo?(jdescottes)
Attachment #8728400 -
Flags: feedback?(gl)
Assignee | ||
Comment 9•8 years ago
|
||
Comment on attachment 8756866 [details] Bug 1254070 - inspector: trigger autocomplete if nextchar is not a word character; Review request updated; see interdiff: https://reviewboard.mozilla.org/r/55454/diff/1-2/
Assignee | ||
Comment 10•8 years ago
|
||
Test needed updating after rebase. New try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2cd71e06b265
Comment 11•8 years ago
|
||
Comment on attachment 8756866 [details] Bug 1254070 - inspector: trigger autocomplete if nextchar is not a word character; https://reviewboard.mozilla.org/r/55454/#review52418 ::: devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js:51 (Diff revision 2) > + ["VK_RETURN", "style=\"color:beige;padding:0;\"", > + -1, -1, false] > +]; > + > +add_task(function* () { > + info("Opening the inspector on the test URL"); Remove this info() since it is repeating openInspectorForURL()
Attachment #8756866 -
Flags: review?(gl) → review+
Comment 12•8 years ago
|
||
https://reviewboard.mozilla.org/r/55454/#review54680 ::: devtools/client/shared/inplace-editor.js:1305 (Diff revision 2) > // If nothing is selected and there is a non-space character after the > // cursor, do not autocomplete. > if (input.selectionStart == input.selectionEnd && > - input.selectionStart < input.value.length && > - input.value.slice(input.selectionStart)[0] != " ") { > + input.selectionStart < input.value.length) { > + let nextChar = input.value.slice(input.selectionStart)[0]; > + // Check the next character if editing inside a word. Can we also add a bit more detail on this comment as well?
Assignee | ||
Comment 13•8 years ago
|
||
Comment on attachment 8756866 [details] Bug 1254070 - inspector: trigger autocomplete if nextchar is not a word character; Review request updated; see interdiff: https://reviewboard.mozilla.org/r/55454/diff/2-3/
Attachment #8756866 -
Attachment description: MozReview Request: Bug 1254070 - inspector: trigger autocomplete if nextchar is not a word character;r=gl → Bug 1254070 - inspector: trigger autocomplete if nextchar is not a word character;
Assignee | ||
Comment 14•8 years ago
|
||
https://reviewboard.mozilla.org/r/55454/#review52418 Thanks for the review! Try (https://treeherder.mozilla.org/#/jobs?repo=try&revision=2cd71e06b265) is green, landing. > Remove this info() since it is repeating openInspectorForURL() Done (also removed from the two similar test files browser_markup_css_completion_style_attribute_01 & 02)
Assignee | ||
Comment 15•8 years ago
|
||
https://reviewboard.mozilla.org/r/55454/#review54680 > Can we also add a bit more detail on this comment as well? Done
Comment 16•8 years ago
|
||
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/fx-team/rev/a48604c3b495 inspector: trigger autocomplete if nextchar is not a word character;r=gl
Comment 17•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a48604c3b495
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Comment 18•8 years ago
|
||
Julien, Gabriel, are you going to ask for an uplift to fix 48 and 49? Thanks
Flags: needinfo?(jdescottes)
Flags: needinfo?(gl)
Assignee | ||
Comment 19•8 years ago
|
||
No uplift will be requested, marking as wontfix for 48 and 49.
Flags: needinfo?(jdescottes)
Flags: needinfo?(gl)
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•