Closed Bug 1471893 Opened 6 years ago Closed 6 years ago

Font editor: disabling CSS properties in the Rule view should disable corresponding editing capabilities

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(firefox63 verified, firefox64 verified)

VERIFIED FIXED
Firefox 63
Tracking Status
firefox63 --- verified
firefox64 --- verified

People

(Reporter: rcaliman, Assigned: rcaliman)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

Steps:
- Go to https://v-fonts.com/
- Inspect the element for the first font preview
- Open the Font Editor
- Change the font size by with the Size slider
- Switch to the Rule view and uncheck the 'font-size' property of the inline style
- Switch back to the Font Editor and continue editing with the Size slider

Expected:
- The Size slider is disabled because changes won't have any effect.

Actual:
- The Size slider shows the fallback value that applies when the font-size from the inline style is disabled (correct). Dragging on the slider changes the value of the disabled font-style property, but no results show on the page (correct). After a brief moment, the slider jumps back to the actual font-size (confusing)


Take care about values that can be written either to `font-variation-settings` or `font-*` properties. Ex: Value of WGHT axis should be written to `font-weight` if `font-variation-settings` is disabled and vice-versa.
Blocks: 1280059
No longer blocks: 1441576
I don't think disabling sliders is the best solution.

Instead, I suggest that our editor creates a new property instead of writing to the disabled one.
Comment on attachment 8993676 [details]
Bug 1471893 - Write to a new property if the one we're trying is disabled

this seems to do the trick, but I'm not certain whether this will work in all cases. 
Razvan, what are your thoughts on this?
Also, I most probably won't have the time to push this to completion (especially writing a test) since I'm going to be off end of next week.
So feel free to pick it up if you have time.
Attachment #8993676 - Flags: feedback?(rcaliman)
Attached video property-overwrite.mp4
Your attached solution is nice and elegant. I like it!

It works for most cases. The check needs to be updated to ensure the property isn't overwritten either, else the wrong TextProperty is still selected as shown in the attached video.

.find(prop => prop.name === name && prop.enabled);

needs to become:

.find(prop => prop.name === name && prop.enabled && !prop.overridden);
Attachment #8993676 - Flags: feedback?(rcaliman)
Comment on attachment 8994215 [details]
Bug 1471893 - Write to a new property if the one we're trying is disabled or overwritten.

https://reviewboard.mozilla.org/r/258830/#review265770
Attachment #8994215 - Flags: review?(pbrosset) → review+
Attachment #8993676 - Attachment is obsolete: true
Pushed by rcaliman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/500fb6bfc871
Write to a new property if the one we're trying is disabled or overwritten. r=pbro
https://hg.mozilla.org/mozilla-central/rev/500fb6bfc871
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Assignee: nobody → rcaliman
Flags: qe-verify+
QA Contact: catalin.sasca
I successfully reproduced the issue on Firefox Nightly 63.0a1 (2018-06-28) under Windows 10 (x64) using the STR from Comment 0.
The issue is no longer reproducible on Firefox Beta 63.0b13 and latest Nightly 64.0a1 (2018-10-08). Tests were performed under Windows 10 (x64), macOS 10.13, and Ubuntu 16.04 (x64).
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Component: Inspector: Fonts → Inspector
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: