Open Bug 1590576 Opened 5 years ago Updated 2 years ago

Migrate xul:richlistitem to an html custom element

Categories

(Toolkit :: XUL Widgets, task)

task

Tracking

()

People

(Reporter: bgrins, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Bug 1580983 is looking for an easy first element to migrate. This bug is looking for a hard one in order to surface problems we'll see. Some of the complications:

One idea I had for supporting the [flex], [orient], etc attributes (instead of somehow exposing our emulated flex CSS properties at https://searchfox.org/mozilla-central/rev/8a63fc190b39ed6951abb4aef4a56487a43962bc/toolkit/content/xul.css#581-627) is to implement something like this on MozHTMLElement:

setFlexProperties() {
  if (this.hasAttribute("flex")) {
    this.style.MozBoxFlex = this.getAttribute("flex");
  }
  if (this.hasAttribute("ordinal")) {
    this.style.MozBoxOrdinalGroup = this.getAttribute("ordinal")
  }
  // Maybe also do orient, pack, etc, or maybe just expose the current "behind flexbox emulation pref" xul.css
  // rules that have a concrete set of values to all chrome HTML elements.
}
connectedCallback() {
  this.setFlexProperties();
}

setAttribute(name, val) {
  super.setAttribute(name, val);
  this.setFlexProperties();
}

removeAttribute(name) {
  super.removeAttribute(name);
  this.setFlexProperties();
}

If this worked (functionally and perf-wise), it could make parts of Bug 1493962 obsolete by expanding this feature to xul elements when emulated flex mode is enabled.

Depends on: 1592369
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: