Allow theming the selection background and text
Categories
(WebExtensions :: Themes, defect, P3)
Tracking
(firefox67 verified)
| Tracking | Status | |
|---|---|---|
| firefox67 | --- | verified |
People
(Reporter: ntim, Assigned: edward.i.wu, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, good-first-bug)
Attachments
(3 files, 2 obsolete files)
| Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Updated•7 years ago
|
| Reporter | ||
Comment 2•7 years ago
|
||
Updated•7 years ago
|
| Reporter | ||
Comment 5•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
| Reporter | ||
Comment 7•7 years ago
|
||
| Reporter | ||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
| Comment hidden (duplicate) |
| Reporter | ||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
Updated•7 years ago
|
| Reporter | ||
Comment 19•7 years ago
|
||
Comment 20•7 years ago
|
||
| Reporter | ||
Comment 21•7 years ago
|
||
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
| Reporter | ||
Comment 24•7 years ago
|
||
Comment 25•7 years ago
|
||
| Reporter | ||
Comment 26•7 years ago
|
||
| Reporter | ||
Comment 27•7 years ago
|
||
Comment 28•7 years ago
|
||
| Reporter | ||
Comment 29•7 years ago
|
||
Comment 30•7 years ago
|
||
Comment 31•7 years ago
|
||
Comment 32•7 years ago
|
||
Comment 33•7 years ago
|
||
Comment 34•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
| Reporter | ||
Comment 35•7 years ago
|
||
Comment 36•7 years ago
|
||
Comment 37•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
| Reporter | ||
Comment 38•7 years ago
|
||
Comment 39•6 years ago
|
||
| Reporter | ||
Updated•6 years ago
|
| Assignee | ||
Comment 40•6 years ago
|
||
Comment 41•6 years ago
|
||
| Assignee | ||
Comment 42•6 years ago
|
||
| Assignee | ||
Comment 43•6 years ago
|
||
I think I've set up everything accord to the above but the .backgroundColor and .color properties window.getComputedElementByStyle(input), where input is:
let urlBar = document.querySelector("#urlbar");
let input = document.getAnonymousElementByAttribute(urlBar, "anonid", "input");
gives me rgba(0,0,0,0) for background and rgb(0,0,0)for color. Is the urlbar the right element? I thought
:root[lwt-selection] |::selection
finds an element with attribute 'lwt-selection' but I could not find any elements with lwt-selection using the Browser Toolbox.
| Assignee | ||
Comment 44•6 years ago
|
||
Bug 1450114 -Update browser themes to allow customization of selection background and text r=Jaws
Updated•6 years ago
|
| Assignee | ||
Comment 45•6 years ago
|
||
Bug 1450114 -Update browser themes to allow customization of selection background and text r=Jaws
| Assignee | ||
Comment 46•6 years ago
|
||
Hi Jared, sorry that my last comment was unclear, but the issue turned out to be I was checking the element color, not its ::selection color.
I've made the patch on phabricator, let me know what you think.
Updated•6 years ago
|
| Assignee | ||
Comment 47•6 years ago
|
||
I tried to add another test for the search bar in the latest patch, but how can I make it active for the browser tests? Is it a manifest option?
| Reporter | ||
Comment 48•6 years ago
|
||
(In reply to edward.i.wu from comment #47)
I tried to add another test for the search bar in the latest patch, but how can I make it active for the browser tests? Is it a manifest option?
Add this at the beginning of your test:
ChromeUtils.import("resource://testing-common/CustomizableUITestUtils.jsm", this);
let gCUITestUtils = new CustomizableUITestUtils(window);
add_task(async function setup() {
await gCUITestUtils.addSearchBar();
registerCleanupFunction(() => {
gCUITestUtils.removeSearchBar();
});
});
and then you can loop through the elements like this:
| Assignee | ||
Comment 49•6 years ago
|
||
Thanks Tim, I've added that code to the test
| Reporter | ||
Updated•6 years ago
|
| Reporter | ||
Comment 50•6 years ago
•
|
||
I've pushed this to the try server: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b66a3b2f7b4a3b42ec11a6fc9b9f4d7e2b128bcf
| Reporter | ||
Comment 51•6 years ago
|
||
Prior to landing this, I'd like to checkpoint on the property names. This bug introduces the "colors.toolbar_field_selection" property (styles the urlbar/searchbar text selection background color) and the "colors.toolbar_field_selection_color" property (styles the urlbar/searchbar text selection text color).
The convention we've been using has been using the "_text" suffix for text color properties, and no suffix for the background color properties. But here "text" is confusing since both properties affect the text selection. The color suffix sort of solves this, but IMO is a bit redundant since it's already in the "colors" group.
Dão or Mike, what do you think ?
Comment 52•6 years ago
|
||
I think we should wontfix this, actually. This bug started with the premise that the default selection color lacks contrast, but that was just a bug that has since been fixed. I see no meaningful demand here.
| Reporter | ||
Comment 53•6 years ago
|
||
I'll leave that decision to Mike, but I think there is demand for this for two reasons: the Windows/Linux default selection color is quite bright on dark themes for intentional reasons. The second one is that someone may just want the text selection background to match their theme's accent color.
Updated•6 years ago
|
Comment 54•6 years ago
|
||
I'd like to see this feature land.
For naming, we use "_text", "_highlight" and "_highlight_text" elsewhere and I think it would make sense to continue the pattern here. I would propose:
- toolbar_field_text - color of normal text in urlbar (this already exists)
- toolbar_field_highlight - background color of selected text in urlbar (new in this patch)
- toolbar_field_highlight_text - foreground color of selected text in urlbar (new in this patch)
This follows the pattern established for popup and sidebar.
| Reporter | ||
Comment 55•6 years ago
|
||
Mike, thanks for your input!
Edward, could you please rename the properties as Mike suggested ? The patch should be pretty good to go with that done.
| Assignee | ||
Comment 56•6 years ago
|
||
Sure, I've updated the patch with the name changes
Comment 57•6 years ago
|
||
Comment 58•6 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 59•6 years ago
|
||
This needs screenshots and browser-compat-data to be updated.
Comment 60•6 years ago
|
||
Verified in Win7x64, Ubuntu 14.0.4x32, MacOS 10.14.1 on FF67.0b5 (20190325125126)
I have created a test theme using the following proprieties (see the attachement):
- "toolbar_field_highlight_text": "#2bc7d8",
- "toolbar_field_highlight": "#ef0b9f"
and the issue is no longer reproducing. Marking bug as verified fixed.
Updated•6 years ago
|
Comment 61•6 years ago
|
||
Documentation has been updated for this.
- Updated the manifest.json page to include example and screenshots for the new
toolbar_field_highlightandtoolbar_field_heighlight_textcolor settings - Added the toolbar highlight color properties to BCD in PR 4139
Comment 62•6 years ago
|
||
Added the new manifest settings to the release notes.
Description
•