Add Google Chrome toolbar color properties

RESOLVED FIXED in Firefox 57

Status

defect
RESOLVED FIXED
2 years ago
11 months ago

People

(Reporter: mikedeboer, Assigned: ntim)

Tracking

(Blocks 1 bug, {dev-doc-complete})

unspecified
mozilla57
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox57 fixed)

Details

(Whiteboard: triaged [vivaldifox-blockers])

Attachments

(1 attachment, 1 obsolete attachment)

Reporter

Description

2 years ago
See (again) https://docs.google.com/spreadsheets/d/1YScpOVL5WdNDhQY2Nngh4YkK0bOpkfwJvpRjpMSxMWo/edit#gid=0

Constant as defined in https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/themes/theme_properties.h is:
 * COLOR_TOOLBAR ('toolbar' in the 'colors' section)

I think that the name will be the same in Firefox jargon.
Reporter

Updated

2 years ago
Blocks: 1347184
Reporter

Updated

2 years ago
Assignee: nobody → mdeboer
Status: NEW → ASSIGNED
Comment hidden (mozreview-request)
Comment on attachment 8877969 [details]
Backed out changeset f26ae19477f5 (bug 1347182) due to too many regressions.

https://reviewboard.mozilla.org/r/149372/#review154064

r=me with the following two issues resolved.

::: toolkit/components/extensions/test/browser/browser_ext_themes_toolbars.js:32
(Diff revision 1)
> +  await extension.startup();
> +
> +  let dwu = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
> +  let toolbars = [...document.getElementsByTagName("toolbar")].filter(toolbar => {

Please also open the findbar since your code sets styling for the findbar and then include the findbar in the list of toolbars that get checked.

::: toolkit/components/extensions/test/browser/browser_ext_themes_toolbars.js:37
(Diff revision 1)
> +  await extension.startup();
> +
> +  let dwu = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
> +  let toolbars = [...document.getElementsByTagName("toolbar")].filter(toolbar => {
> +    let bounds = dwu.getBoundsWithoutFlushing(toolbar);
> +    return bounds.width > 0 && !!bounds.height > 0;

!!bounds.height > 0 will become true > 0 or false > 0, which will become 1 > 0 or 0 > 0, respectively.

Why can't you just use bounds.height > 0?

Also, why do we need to use getBoundsWithoutFlushing since this is only being run inside of a test? Flushing layout here will let us avoid erroneous 0 values for height or width.
Attachment #8877969 - Flags: review?(jaws) → review+
Comment hidden (mozreview-request)
Reporter

Comment 4

2 years ago
(In reply to Jared Wein [:jaws] (please needinfo? me) from comment #2)
> Please also open the findbar since your code sets styling for the findbar
> and then include the findbar in the list of toolbars that get checked.

Good point! Done.

> !!bounds.height > 0 will become true > 0 or false > 0, which will become 1 >
> 0 or 0 > 0, respectively.
> 
> Why can't you just use bounds.height > 0?

That's something that was left-over from a previous iteration... whoops!
 
> Also, why do we need to use getBoundsWithoutFlushing since this is only
> being run inside of a test? Flushing layout here will let us avoid erroneous
> 0 values for height or width.

Now using `getBoundingClientRect()` instead. Good point.

Comment 5

2 years ago
mozreview-review
Comment on attachment 8877969 [details]
Backed out changeset f26ae19477f5 (bug 1347182) due to too many regressions.

https://reviewboard.mozilla.org/r/149372/#review155294

::: toolkit/components/extensions/ext-theme.js:68
(Diff revision 2)
> +      this.logger.warn("Your theme doesn't include one of the following required " +
> +        "properties: 'headerURL', 'accentcolor' or 'textcolor'");

Thanks for adding this :)
Attachment #8877969 - Flags: review?(mwein) → review+

Comment 6

2 years ago
Pushed by mdeboer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f26ae19477f5
Add support for setting the background color of all toolbars using a WebExtension theme. r=jaws,mattw

Updated

2 years ago
Depends on: 1374533

Comment 7

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f26ae19477f5
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Comment on attachment 8877969 [details]
Backed out changeset f26ae19477f5 (bug 1347182) due to too many regressions.

https://reviewboard.mozilla.org/r/149372/#review155628

::: browser/base/content/browser.css:31
(Diff revision 2)
>    background-repeat: var(--lwt-background-tiling) !important;
>  }
>  
> +#navigator-toolbox > toolbar,
> +findbar {
> +  background: var(--lwt-toolbar-color) !important;

Shouldn't this be `background-color` and not `background`? Maybe that will fix some of the regression issues.
Comment hidden (mozreview-request)
Reporter

Updated

2 years ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Depends on: 1374683
No longer depends on: 1374683
Duplicate of this bug: 1374703
This doesn't belong in browser/base/content/browser.css. Can you please also ask me for review on the updated patch? Thanks.
Reporter

Updated

2 years ago
Status: REOPENED → ASSIGNED
Keywords: leave-open
Merged backout https://hg.mozilla.org/mozilla-central/rev/c235434fbd34
Target Milestone: mozilla56 → ---
Assignee

Comment 14

2 years ago
I'm going to pick this up.
Assignee: mdeboer → ntim.bugs
Comment hidden (mozreview-request)
Assignee

Updated

2 years ago
Attachment #8877969 - Attachment is obsolete: true
Comment hidden (mozreview-request)
Comment on attachment 8893500 [details]
Bug 1347182 - Add support for setting the background color of all toolbars using a WebExtension theme.

https://reviewboard.mozilla.org/r/164594/#review169908

Looks good, thanks!

::: toolkit/components/extensions/test/browser/browser_ext_themes_toolbars.js:33
(Diff revision 1)
> +      "image1.png": BACKGROUND,
> +    },
> +  });
> +
> +  await extension.startup();
> +  

these blank spaces will fail when run through eslint.
Attachment #8893500 - Flags: review?(jaws) → review+

Comment 18

2 years ago
Pushed by ntim.bugs@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/395b4c460551
Add support for setting the background color of all toolbars using a WebExtension theme. r=jaws
Assignee

Updated

2 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Assignee

Updated

2 years ago
Keywords: leave-open
Reporter

Comment 20

2 years ago
Sweet, thanks Tim!
Assignee

Updated

2 years ago
Whiteboard: triaged → triaged [vivaldifox-blockers]

Comment 21

2 years ago
Is manual testing required on this bug? If Yes, please provide some STR and the proper webextension(if required), if No set the “qe-verify-“ flag.
Flags: needinfo?(ntim.bugs)
Assignee

Updated

a year ago
Flags: needinfo?(ntim.bugs) → qe-verify-

Updated

11 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.