Closed Bug 1347182 Opened 4 years ago Closed 3 years ago

Add Google Chrome toolbar color properties

Categories

(WebExtensions :: Frontend, defect)

defect
Not set
normal

Tracking

(firefox57 fixed)

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: mikedeboer, Assigned: ntim)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: triaged [vivaldifox-blockers])

Attachments

(1 file, 1 obsolete file)

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.
Blocks: 1347184
Assignee: nobody → mdeboer
Status: NEW → ASSIGNED
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+
(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 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+
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
Depends on: 1374533
https://hg.mozilla.org/mozilla-central/rev/f26ae19477f5
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Blocks: 1374646
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.
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.
Status: REOPENED → ASSIGNED
Keywords: leave-open
I'm going to pick this up.
Assignee: mdeboer → ntim.bugs
Attachment #8877969 - Attachment is obsolete: true
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+
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
Status: ASSIGNED → RESOLVED
Closed: 4 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Keywords: leave-open
Sweet, thanks Tim!
Whiteboard: triaged → triaged [vivaldifox-blockers]
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)
Flags: needinfo?(ntim.bugs) → qe-verify-
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.