Closed
Bug 1503824
Opened 6 years ago
Closed 6 years ago
Migrate the treecols binding into a custom element
Categories
(Toolkit :: UI Widgets, task, P5)
Toolkit
UI Widgets
Tracking
()
RESOLVED
FIXED
mozilla65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: vporof, Assigned: vporof)
References
(Depends on 1 open bug, Regressed 1 open bug)
Details
Attachments
(1 file, 7 obsolete files)
3.98 KB,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Updated•6 years ago
|
Priority: -- → P5
Assignee | ||
Comment 1•6 years ago
|
||
Attachment #9024775 -
Flags: feedback?(bgrinstead)
Assignee | ||
Updated•6 years ago
|
Attachment #9024775 -
Attachment is obsolete: true
Attachment #9024775 -
Flags: feedback?(bgrinstead)
Assignee | ||
Comment 2•6 years ago
|
||
Hacky way to work around <children>.
Attachment #9025565 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 3•6 years ago
|
||
In addition to comment 2, looks like delayConnectedCallback makes the tree blank so I removed that.
Attachment #9025573 -
Flags: review?(bgrinstead)
Assignee | ||
Updated•6 years ago
|
Attachment #9025565 -
Attachment is obsolete: true
Attachment #9025565 -
Flags: review?(bgrinstead)
Comment 4•6 years ago
|
||
Comment on attachment 9025573 [details] [diff] [review] remove-treecols-2018-11-16-0950.diff Review of attachment 9025573 [details] [diff] [review]: ----------------------------------------------------------------- - The commit message says treerows but should be treecols - Do you know of an example where the columns are scrollable so I can test that locally?
Assignee | ||
Comment 6•6 years ago
|
||
I searched all our tree usage from the migration document and couldn't find any single instance where the three was horizontally scrollable. Updated commit message. Running through try now.
Attachment #9025573 -
Attachment is obsolete: true
Attachment #9025573 -
Flags: review?(bgrinstead)
Flags: needinfo?(vporof)
Attachment #9026314 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 7•6 years ago
|
||
In addition to comment 6, I've fixed an issue that I've found while working on bug 1507704: the "restore column order" from the column picker wasn't working properly anymore with the ordinal changes in this patch.
Attachment #9026314 -
Attachment is obsolete: true
Attachment #9026314 -
Flags: review?(bgrinstead)
Comment 8•6 years ago
|
||
Comment on attachment 9026329 [details] [diff] [review] remove-treecols-2018-11-20-1056.diff Review of attachment 9026329 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/content/widgets/tree.js @@ +411,5 @@ > > customElements.define("treecol", MozTreecol); > > + class MozTreecols extends MozElements.BaseControl { > + connectedCallback() { As with the other CEs, start this with: if (this.delayConnectedCallback()) { return; } @@ +412,5 @@ > customElements.define("treecol", MozTreecol); > > + class MozTreecols extends MozElements.BaseControl { > + connectedCallback() { > + this.textContent = ""; This doesn't seem right. We shouldn't wipe out the existing DOM here - the XBL version slots them into a box, and even if we don't need to do that we shouldn't be removing them. Just picking a random consumer from a search: https://searchfox.org/mozilla-central/rev/55895c49f55073d82d977cb74ec1d3a71ae4b25f/browser/base/content/pageinfo/pageInfo.xul#145, there are <treecol> and <splitter> children, and this line would remove those and replace them with just a treecolpicker. If this is intending to handle multiple connections then I guess we should do something like: if (!this.querySelector("treecolpicker")) { this.appendChild(MozXULElement.parseXULToFragment( .... )) } @@ +413,5 @@ > > + class MozTreecols extends MozElements.BaseControl { > + connectedCallback() { > + this.textContent = ""; > + this.appendChild(MozXULElement.parseXULToFragment(` Could you try attaching a shadow root with an `<html:slot>` inside of an <hbox class="tree-scrollable-columns">? I suspect there may be some bugs with that, but this would be a good potential consumer since the anonymous content is very lightly styled from the document side, and it would flag any platform issues that we can get on file ahead of the bigger <tree> migration. So it'd look like: #shadow-root <hbox.tree-scrollable-columns> <html:slot> </hbox> <treecolpicker.treecol-image /> @@ +414,5 @@ > + class MozTreecols extends MozElements.BaseControl { > + connectedCallback() { > + this.textContent = ""; > + this.appendChild(MozXULElement.parseXULToFragment(` > + <treecolpicker class="treecol-image" fixed="true" inherits="tooltiptext=pickertooltiptext"></treecolpicker> This [inherits] won't work. You'd need to get a reference to the treecolpicker and call this.inheritAttribute(treecolpicker, "tooltiptext=pickertooltiptext"). I don't think there's any need to wire this up to attributeChangedCallback, doing it here should be fine. ::: toolkit/content/widgets/tree.xml @@ -907,5 @@ > </handlers> > </binding> > > - <binding id="treecols"> > - <content orient="horizontal"> When there's an attr on `<xbl:content>` it copies that onto the host node. So in this case it means `<xul:treecols>` will turn into <xul:treecols orient="horizontal"> (which then sets `-moz-box-orient: horizontal` https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/orient. AFAICT -moz-box-orient:horizontal is the default value so this can safely be removed (without either copying this logic into the CE or changing xul.css to set -moz-box-orient explicitly).
Assignee | ||
Comment 9•6 years ago
|
||
Addressed comments. (In reply to Brian Grinstead [:bgrins] from comment #8) > Comment on attachment 9026329 [details] [diff] [review] > remove-treecols-2018-11-20-1056.diff > > Review of attachment 9026329 [details] [diff] [review]: > ----------------------------------------------------------------- > > @@ +413,5 @@ > > > > + class MozTreecols extends MozElements.BaseControl { > > + connectedCallback() { > > + this.textContent = ""; > > + this.appendChild(MozXULElement.parseXULToFragment(` > > Could you try attaching a shadow root with an `<html:slot>` inside of an > <hbox class="tree-scrollable-columns">? I suspect there may be some bugs > with that, but this would be a good potential consumer since the anonymous > content is very lightly styled from the document side, and it would flag any > platform issues that we can get on file ahead of the bigger <tree> migration. > I suggest we deal with this same thing more directly in bug 1503826 where it's clear that this is needed. As it stands, I think that if we can get away with not using shadow DOM or slots, with insignificant drive-by changes, we should do it. I don't feel strongly, though. Convince me it's better to use shadow DOM and slots in this case. > > ::: toolkit/content/widgets/tree.xml > @@ -907,5 @@ > > </handlers> > > </binding> > > > > - <binding id="treecols"> > > - <content orient="horizontal"> > > When there's an attr on `<xbl:content>` it copies that onto the host node. > So in this case it means `<xul:treecols>` will turn into <xul:treecols > orient="horizontal"> (which then sets `-moz-box-orient: horizontal` > https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/orient. > > AFAICT -moz-box-orient:horizontal is the default value so this can safely be > removed (without either copying this logic into the CE or changing xul.css > to set -moz-box-orient explicitly). It'd be good to add this to the XUL migration papercuts document!
Attachment #9026915 -
Flags: review?(bgrinstead)
Assignee | ||
Updated•6 years ago
|
Attachment #9026329 -
Attachment is obsolete: true
Comment 10•6 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #6) > Created attachment 9026314 [details] [diff] [review] > remove-treecols-2018-11-20-0922.diff > > I searched all our tree usage from the migration document and couldn't find > any single instance where the three was horizontally scrollable. Just a heads up that we are planning to remove the .tree-scrollable-columns wrapping hbox [0] so we can do the CE conversion on treecols without using Shadow DOM (and having to redo styles for treecolpicker). As far as we can tell, this feature isn't used in Firefox, but I do see one place in TB [1] where there are styles set on that element - presumably you are expecting horizontally scrollable columns in that case? If so, you could probably just move that wrapping hbox into the tree's light DOM around the <treecol> elements when it's used in the document. You'll also need to restore the CSS rule in xul.css for that element. [0]: https://searchfox.org/mozilla-central/rev/d35199ef15ffa57d190886e20d5df6471faf0870/toolkit/content/widgets/tree.xml#889 [1]: https://searchfox.org/comm-central/search?q=tree-scrollable&path=
Flags: needinfo?(jorgk)
Updated•6 years ago
|
Attachment #9026915 -
Flags: review?(bgrinstead) → review+
Assignee | ||
Comment 12•6 years ago
|
||
Fixed test as per https://bugzilla.mozilla.org/show_bug.cgi?id=1507704#c13
Attachment #9026915 -
Attachment is obsolete: true
Attachment #9027955 -
Flags: review+
Comment 13•6 years ago
|
||
Comment on attachment 9027955 [details] [diff] [review] remove-treecols-2018-11-27-1839.diff Review of attachment 9027955 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/generic/crashtests/crashtests.list @@ -115,4 @@ > load 382208-1.xhtml > load 382262-1.html > load 382396-1.xhtml > -asserts(1) load 382745-1.xhtml # Bug 758695 you can remove just the `asserts(1)` and keep "load 382745-1.xhtml"
Assignee | ||
Updated•6 years ago
|
Attachment #9027955 -
Attachment is obsolete: true
Attachment #9027955 -
Flags: review+
Assignee | ||
Comment 14•6 years ago
|
||
Attachment #9027962 -
Flags: review+
Assignee | ||
Comment 15•6 years ago
|
||
Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c5c85a06b41c9e54aa85826a27b9a5f053edf862
Comment 17•6 years ago
|
||
Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/4b9f8acdf5f7 Migrate the treecols binding into a custom element. r=bgrins
Keywords: checkin-needed
Comment 18•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4b9f8acdf5f7
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Updated•5 years ago
|
Blocks: deforestation
Updated•5 years ago
|
Type: enhancement → task
You need to log in
before you can comment on or make changes to this bug.
Description
•