Closed Bug 1311722 Opened 8 years ago Closed 8 years ago

The theme API should be able to support dynamic updates

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mattw, Assigned: mattw)

References

Details

(Whiteboard: triaged)

Attachments

(1 file)

The goal of this bug is to expose and test a function that can update a single property dynamically.
Attachment #8803416 - Flags: review?(mdeboer)
Comment on attachment 8803416 [details]
Bug 1311722 - Add support for dynamic theme updates

https://reviewboard.mozilla.org/r/87694/#review86690

Cool, I like the update function and think it is a nice way for now to batch the updates of the theme so they all apply at once.

::: browser/components/extensions/test/browser/browser_ext_theme_abouthomebackground.js:5
(Diff revision 1)
> -const kBackground = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
> +const kBackground1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
> +const kBackground2 = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg==";

Can you change this to an array of backgrounds?

const kBackgrounds = [
  "data:image/png; ...",
  "data:image/png; ..."
];
Attachment #8803416 - Flags: review?(jaws) → review+
Comment on attachment 8803416 [details]
Bug 1311722 - Add support for dynamic theme updates

https://reviewboard.mozilla.org/r/87694/#review86756

Just like I had hoped, nice! I don't see us winning much with using the fancy `class` syntax, but I must admit the legibility did improve somewhat ;)
Attachment #8803416 - Flags: review?(mdeboer) → review+
Comment on attachment 8803416 [details]
Bug 1311722 - Add support for dynamic theme updates

https://reviewboard.mozilla.org/r/87694/#review86690

> Can you change this to an array of backgrounds?
> 
> const kBackgrounds = [
>   "data:image/png; ...",
>   "data:image/png; ..."
> ];

Done :)
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: