Convert trees to custom elements
Categories
(Toolkit :: UI Widgets, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: vporof, Assigned: vporof)
References
(Depends on 1 open bug)
Details
Attachments
(13 files, 16 obsolete files)
1.15 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
27.62 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
702 bytes,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
4.20 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
3.62 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
96.00 KB,
patch
|
bgrins
:
review+
mak
:
review+
|
Details | Diff | Splinter Review |
2.60 KB,
patch
|
vporof
:
review+
standard8
:
review+
|
Details | Diff | Splinter Review |
1.98 KB,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
1006 bytes,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
3.78 KB,
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
7.45 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
968 bytes,
patch
|
bgrins
:
review+
standard8
:
review+
|
Details | Diff | Splinter Review |
132.28 KB,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•6 years ago
•
|
||
So this was an adventure.
There's a couple of things going on with this patch.
- The XBL binding code was left in place to prevent places-tree from blowing up when attempting to extend the XBL-version of tree.
- The XBL binding was noneified for the CE-version of the tree in CSS.
- Children elements were replaced with html:slots
- Treecols set their slot name when connected to get slotted in the intended place
However things still blow up. It looks like nothing is actually slotted in place. I tried an approach where I'm just using regular <children> nodes inside trees, and nothing is appended in that scenario either.
The immediately obvious consequences are:
- Trees are empty.
- The "focus" and "blur" events throw errors about "view" and "inputField" being null for the entire tree. This is probably caused by (1)
- The in-content preferences page throws an error about
engineList.inputField
being null for [0]. This looks an input for tree cells which are editable (via overriding theisEditable
method). This is likely the same problem as (2)
Quite stuck. Looking for feedback.
Comment 2•6 years ago
|
||
I didn't get a chance to apply this today - aiming for tomorrow. In the meantime, what happens if you take Shadow DOM out of the equation and manually "slot" the elements during connection using appendChild, etc? I know there's some downsides with that approach, but I'd be interested if it gets us past these current issues (as a way to narrow down if it's just Shadow DOM causing them).
Updated•6 years ago
|
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
I see errors like chrome://browser/content/aboutSessionRestore.js, line 110: TypeError: tabList.view is null
which I think is ultimately due to FindBodyElement returning null 0, which short circuits XULTreeElement::GetView 1. I'm not familiar with the different iterators, but it looks like the FlattenedChildIterator is intended to support XBL anonymous content, so we may need to update that to something like a ShadowIncludingTreeIterator. I'll push up a WIP with the various fixes I suggested on the patch, so we can ask someone who would know better how to handle this.
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Neil pointed out that we are getting the error in Comment 5 because treechildren had display: none from xul.css: https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/toolkit/content/xul.css#64
And this wasn't matching anymore: https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/toolkit/content/xul.css#441.
With the patch I've just pushed to phab I see working trees! Still need to implement attribute inheriting and do more testing, but looks like this should work.
Updated•6 years ago
|
Comment 8•6 years ago
|
||
Alright, newest version on phab is working much better. Did some manual testing on session restore and page info UIs.
I'm not sure if the change in XULTreeElement.cpp is necessary - the patch seems to work fine without it. Emilio, when I was chasing down an issue that turned out to be unrelated, I converted the FlattenedChildIterator to a ShadowIncludingTreeIterator because my impression was that FlattenedChildIterator was for XBL anonymous content. Now that I look closer, <treechildren> will be in the light DOM in either the XBL or CE+SD case, so maybe it doesn't matter which iterator we use. Could you have a look at the change in XULTreeElement.cpp at https://phabricator.services.mozilla.com/D18626 and see if it matters one way or another?
Comment 9•6 years ago
|
||
I don't understand, FlattenedTreeIterator handles shadow DOM already. ShadowIncludingTreeIterator is something fairly different, and will return, e.g., unassigned nodes. That's not what you want, so I'd revert that part of the patch.
Comment 10•6 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #9)
I don't understand, FlattenedTreeIterator handles shadow DOM already. ShadowIncludingTreeIterator is something fairly different, and will return, e.g., unassigned nodes. That's not what you want, so I'd revert that part of the patch.
Thanks for the heads up, I've reverted the change.
Comment 11•6 years ago
|
||
Let's see how orange it is: https://treeherder.mozilla.org/#/jobs?repo=try&revision=71e041349bd81671b09de099d44677fd16094a64.
Of course we need to migrate places-tree as well: https://github.com/bgrins/xbl-analysis/blob/gh-pages/elements/generated/PlacesTree.js. I'd be fine to dump that into tree.js (at least for now). You should be able to just extend MozTree and not worry about the mixin.
As for how to register and use it, this is an example of how <richlistitem is="autocomplete-richlistitem">
gets hooked up to a CE: https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/toolkit/content/widgets/autocomplete-richlistitem.js#1020-1022. So https://github.com/bgrins/xbl-analysis/blob/f570ba3af582473f9bc4ce2b1136b3d486623b83/elements/generated/PlacesTree.js#L782 would have to be adjusted. And we'd have to update <tree type="places"> (https://searchfox.org/mozilla-central/search?q=type%3D%22places%22&path=).
Assignee | ||
Comment 12•6 years ago
|
||
Looks like it's pretty orange.
Having a look now, and migrating places-tree to CE.
Comment 13•6 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #12)
Looks like it's pretty orange.
It's not as bad as I thought it would be - those "mda" failures are unrelated (they are perma orange in artifact builds).
As for the a11y failures ("Can't get accessible for 'tree'"), I wonder if there's some flag or a check in https://searchfox.org/mozilla-central/source/accessible/xul/XULTreeAccessible.cpp that's expecting XBL. Tim pointed out some changes needed for menuitem (changing a flag and setting role=none to children) at https://bugzilla.mozilla.org/show_bug.cgi?id=1519495#c2. Alex, could you help figure out what's going on with these (https://treeherder.mozilla.org/#/jobs?repo=try&revision=71e041349bd81671b09de099d44677fd16094a64&selectedJob=226392597)?
Comment 14•6 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #13)
(In reply to Victor Porof [:vporof][:vp] from comment #12)
Looks like it's pretty orange.
It's not as bad as I thought it would be - those "mda" failures are unrelated (they are perma orange in artifact builds).
As for the a11y failures ("Can't get accessible for 'tree'"), I wonder if there's some flag or a check in https://searchfox.org/mozilla-central/source/accessible/xul/XULTreeAccessible.cpp that's expecting XBL.
here's the logic where we decide if XUL:tree is accessible (https://searchfox.org/mozilla-central/source/accessible/base/XULMap.h#94). It expects treechildren element having nsTreeBodyFrame frame. Is this condition still true?
Assignee | ||
Comment 15•6 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #11)
Let's see how orange it is: https://treeherder.mozilla.org/#/jobs?repo=try&revision=71e041349bd81671b09de099d44677fd16094a64.
Of course we need to migrate places-tree as well: https://github.com/bgrins/xbl-analysis/blob/gh-pages/elements/generated/PlacesTree.js. I'd be fine to dump that into tree.js (at least for now). You should be able to just extend MozTree and not worry about the mixin.
As for how to register and use it, this is an example of how
<richlistitem is="autocomplete-richlistitem">
gets hooked up to a CE: https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/toolkit/content/widgets/autocomplete-richlistitem.js#1020-1022. So https://github.com/bgrins/xbl-analysis/blob/f570ba3af582473f9bc4ce2b1136b3d486623b83/elements/generated/PlacesTree.js#L782 would have to be adjusted. And we'd have to update <tree type="places"> (https://searchfox.org/mozilla-central/search?q=type%3D%22places%22&path=).
Just to be clear here, <tree type="places">
needs to become <places-tree>
?
Assignee | ||
Updated•6 years ago
|
Comment 16•6 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #15)
Just to be clear here,
<tree type="places">
needs to become<places-tree>
?
<tree type="places">
needs to become <tree is="places-tree">
. This will make it so the "places-tree" custom element gets attached to it, instead of "tree".
Updated•6 years ago
|
Comment 17•6 years ago
|
||
This patch isn't ready to land, but it's probably worth doing some early testing on TB to make sure it's working for you.
One thing that will probably look wrong is that we're trying to use Shadow DOM, and that means that the anonymous content like .tree-stack, .tree-rows, .tree-bodybox, .tree-input can't be styled from document sheets. Basically anything in here: https://searchfox.org/mozilla-central/source/toolkit/content/widgets/tree.xml#18-45. We need to do some more analysis to decide if we need that feature for m-c, last time I checked we barely touch those styles but I believe c-c does. There's a CSS feature called Shadow Parts that fixes this (tracked for chrome in https://bugzilla.mozilla.org/show_bug.cgi?id=1505489), but it won't land before this does. The alternative way to pass down styles would be to load a SD scoped stylesheet and set CSS variables on the element, then reference the variables in the sheet. Or moving styles onto other elements / dropping them if they aren't necessary.
Comment 18•6 years ago
|
||
I'm not 100% sure if we'll end up using Shadow DOM or light DOM and moving around child nodes. I'd prefer SD if it works.
Comment 19•6 years ago
|
||
Pushed up a new version to phab that fixed keydown navigation handlers to skip running the "shift" variations of unless if shift was pressed. Fixes at least accessible/tests/mochitest/events/test_tree.xul for me locally. Although the weird thing is I don't see that "Can't get accessible for 'tree'" error locally when running it - maybe it's not running the same checks on OSX.
Comment 20•6 years ago
|
||
Latest version looks much better: https://treeherder.mozilla.org/#/jobs?repo=try&revision=baa2f003bcfa62f5c15e16c1c1ecab43aceb0574
Comment 21•6 years ago
|
||
This will unblock removing XBL for tree.
Comment 22•6 years ago
|
||
Updated the patch to load tree.css in Shadow DOM (a bit redundant with the document sheet loading it, but that allows rules like https://searchfox.org/mozilla-central/rev/490ab7f9b84570573a49d7fa018673ce0d5ddf22/toolkit/themes/osx/global/tree.css#10-14 to apply to the now-anonymous content.
Comment 23•6 years ago
|
||
Try looks almost green here. We now need to get places-tree imported (directly into tree.js is fine for testing) and places consumers updated as per Comment 16.
Then before landing we should make a decision on where the places tree implementation should ultimately live and how it should be loaded. I'd be sort of OK to just leave it in tree.js, but most places stuff is in https://searchfox.org/mozilla-central/source/browser/components/places/content, so we could consider putting it there and then loading it explicitly from documents that load places.css: https://searchfox.org/mozilla-central/search?q=places.css&path=. We don't currently have any code running that's the analog of CustomElementsListener but for browser/. That is: a place we can use subscript loader for all documents, but only in browser/. Let's first get a green build and then figure this out then.
Comment 24•6 years ago
|
||
Comment on attachment 9042322 [details]
Bug 1523957 - Convert DevTools XBL test to use a test binding instead of a xul:tree;r=pbro
Revision D19087 was moved to bug 1526320. Setting attachment 9042322 [details] to obsolete.
Assignee | ||
Comment 25•6 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #23)
Try looks almost green here. We now need to get places-tree imported (directly into tree.js is fine for testing) and places consumers updated as per Comment 16.
Then before landing we should make a decision on where the places tree implementation should ultimately live and how it should be loaded. I'd be sort of OK to just leave it in tree.js, but most places stuff is in https://searchfox.org/mozilla-central/source/browser/components/places/content, so we could consider putting it there and then loading it explicitly from documents that load places.css: https://searchfox.org/mozilla-central/search?q=places.css&path=. We don't currently have any code running that's the analog of CustomElementsListener but for browser/. That is: a place we can use subscript loader for all documents, but only in browser/. Let's first get a green build and then figure this out then.
I also think it's ok landing places-tree inside toolkit/../tree.js for now. If we really need an artificial separation between the two, it should be straight forward.
Assignee | ||
Comment 26•6 years ago
|
||
There's also a few other small things left to do, but looking for some quick feedback.
Assignee | ||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #25)
I also think it's ok landing places-tree inside toolkit/../tree.js for now. If we really need an artificial separation between the two, it should be straight forward.
It's not totally artificial (any more than the browser and toolkit separation is). For instance, if we hg mv
to a places-tree.js inside of browser/components/places/content
it would remain next to the associated styles and JS. The trade off is we'd have to add a new mechanism for loading the script in nsBrowserGlue instead of relying on MainProcessSingleton / customElements.js to load it.
Comment 29•6 years ago
|
||
Comment 30•6 years ago
|
||
Comment 31•6 years ago
|
||
I thought about Comment 23 more, and I'm leaning towards doing hg mv browser/components/places/content/tree.xml browser/components/places/content/places-tree.js
, and then anywhere that places.css is loaded (https://searchfox.org/mozilla-central/search?q=places.css®exp=true&path=) going ahead and loading a script to chrome://browser/content/places/places-tree.js. Then instead of class MozPlacesTree extends MozTree
it would be class MozPlacesTree extends customElements.get("tree")
(which is the same class).
By explicitly loading scripts it will avoid us having to wire up some new auto-loading mechanism as per Comment 28. The other benefits I'm thinking in comparison vs loading it all in tree.js:
- Keep the source next to the rest of the places implementation (better for code ownership and organization)
- Keep hg history on the file
Assignee | ||
Comment 32•6 years ago
|
||
New try with the library window fixed: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1cf740f2677d806fe8ce648047eba8735bc9f7b9
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 33•6 years ago
|
||
Assignee | ||
Comment 34•6 years ago
|
||
Assignee | ||
Comment 35•6 years ago
|
||
Assignee | ||
Comment 36•6 years ago
|
||
I've split things up a bit for sanity, still mowing over failures.
Assignee | ||
Comment 37•6 years ago
|
||
Assignee | ||
Comment 38•6 years ago
|
||
Assignee | ||
Comment 39•6 years ago
|
||
Assignee | ||
Comment 40•6 years ago
|
||
Assignee | ||
Comment 41•6 years ago
|
||
Assignee | ||
Comment 42•6 years ago
|
||
Assignee | ||
Comment 43•6 years ago
•
|
||
Currently failing tests without the places-tree conversion:
1- browser/components/places/tests/browser/browser_bookmarkProperties_newFolder.js | Test timed out
2- toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js | Uncaught exception - Waiting for editing to stop
3a browser/base/content/test/performance/browser_startup.js | nsPlacesExpiration.js is not allowed before handling user events
3b browser/base/content/test/performance/browser_startup.js | PlacesUtils.jsm is not allowed before first paint
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ce5b43014e466b2453c086a0e7090f1f6576066c
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6e1afa625e224e79f94099ce1079065e5a6a7b2a
Looking to see how things look like with the places-tree conversion. Locally, it looks like (1) is fixed at least.
Assignee | ||
Comment 44•6 years ago
•
|
||
Currently failing tests with the places-there conversion:
2- toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js | Uncaught exception - Waiting for editing to stop
3a browser/base/content/test/performance/browser_startup.js | nsPlacesExpiration.js is not allowed before handling user events
3b browser/base/content/test/performance/browser_startup.js | PlacesUtils.jsm is not allowed before first paint
4- browser/components/places/tests/browser/browser_bookmarkProperties_no_user_actions.js | this._controller is undefined
5- browser/base/content/test/static/browser_all_files_referenced.js | there should be no unreferenced files
https://treeherder.mozilla.org/#/jobs?repo=try&revision=db1b2016289b6abd514eefa6f46da58a5734e365
So indeed, it looks like (1) was automagically fixed, and (4) and (5) newly introduced.
Comment 45•6 years ago
|
||
So (5) is probably just a matter of deleting toolkit/content/widgets/tree.xml from disk and any reference from toolkit/content/jar.mn.
Comment 46•6 years ago
|
||
My best guess on 3a and 3b is that since we have a places tree in the browser.xul markup, we are attaching the CE to it and loading some modules as a result. I actually tried last week a push to remove it and make it constructed lazily to avoid this problem: https://hg.mozilla.org/try/rev/1496a081f68a33a18a1daaa7957d6d0470f1a7a9. There was one bc test still failing, but maybe try applying that patch on top of yours and see if 3a and 3b go away.
Comment 47•6 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #46)
My best guess on 3a and 3b is that since we have a places tree in the browser.xul markup, we are attaching the CE to it and loading some modules as a result. I actually tried last week a push to remove it and make it constructed lazily to avoid this problem: https://hg.mozilla.org/try/rev/1496a081f68a33a18a1daaa7957d6d0470f1a7a9. There was one bc test still failing, but maybe try applying that patch on top of yours and see if 3a and 3b go away.
Presumably this line would have to change to the [is] syntax: https://hg.mozilla.org/try/rev/1496a081f68a33a18a1daaa7957d6d0470f1a7a9#l1.19. You can test locally if it's working by bookmarking a page and then expanding the folder area and make sure the tree shows up.
Assignee | ||
Comment 48•6 years ago
|
||
Assignee | ||
Comment 49•6 years ago
|
||
Assignee | ||
Comment 50•6 years ago
•
|
||
Removed for good measure, but this does't fix (5) locally.
New try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=be46f33db011856cbec5ae45c11f42efa6ea4ee9
Assignee | ||
Comment 51•6 years ago
|
||
Still failing with the new try:
2- toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js | Uncaught exception - Waiting for editing to stop
3a browser/base/content/test/performance/browser_startup.js | nsPlacesExpiration.js is not allowed before handling user events
3b browser/base/content/test/performance/browser_startup.js | PlacesUtils.jsm is not allowed before first paint
4- browser/components/places/tests/browser/browser_bookmarkProperties_no_user_actions.js | this._controller is undefined
So (5) was indeed fixed, it was just parma-orange locally.
Eslint issues are all also fixed (see "Part 2.2" which had to add a new mapping).
Assignee | ||
Comment 52•6 years ago
•
|
||
The patch in comment 46 does indeed fix (3).
Currently failing with all the patches in this bug as well as the patch in comment 46:
2- toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js | Uncaught exception - Waiting for editing to stop
4- browser/components/places/tests/browser/browser_bookmarkProperties_no_user_actions.js | this._controller is undefined
New try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=38edf968fc9f5cc14aec3d4c6a999e3a4d70fc21
Assignee | ||
Comment 53•6 years ago
•
|
||
This should fix (2). So there's just one more test failure remaining.
New try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ace548ef217487231b2bff9ec860c9ace803fb41
Assignee | ||
Comment 54•6 years ago
|
||
Assignee | ||
Comment 55•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 56•6 years ago
|
||
All failures should be fixed.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=665dd2ea26c8ca8a0dd94cc0498352001c99f854
For reviews, please follow the part numbers, they're the intended order for landing and review.
Comment 57•6 years ago
|
||
Comment 58•6 years ago
|
||
Magnus, Jorg, see Comment 17. Here's a rollup patch with the Custom Elementification for <xul:tree>. You probably want to do some preliminary testing before this lands to get a sense for what (if anything) will need to be ported.
Comment 59•6 years ago
|
||
Thanks, Magnus and team will take care of it.
Comment 60•6 years ago
|
||
Comment 61•6 years ago
|
||
I'm doing the port of bug 1527495 so Magnus could do this bug.
Comment 62•6 years ago
|
||
Comment 63•6 years ago
|
||
Comment 64•6 years ago
|
||
Comment 65•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 66•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 67•6 years ago
|
||
Comment 68•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 69•6 years ago
|
||
Addressed comments.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 70•6 years ago
|
||
Assignee | ||
Comment 71•6 years ago
|
||
Assignee | ||
Comment 72•6 years ago
|
||
Assignee | ||
Comment 73•6 years ago
|
||
Assignee | ||
Comment 74•6 years ago
|
||
Assignee | ||
Comment 75•6 years ago
•
|
||
(In reply to Brian Grinstead [:bgrins] from comment #66)
While we are here we may as well remove the anonid attribute from this
element andreturn this.shadowRoot.querySelector(".tree-input")
Sure.
::: toolkit/themes/shared/in-content/common.inc.css
@@ -385,4 @@padding-left: 8px;
}Could you do a bit of checking around to see if we ever render inputs in our
known in-content tree consumers, and if so if they look different
before/after this patch?
Will do. Everything else looks ok otherwise?
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 76•6 years ago
|
||
Assignee | ||
Comment 77•6 years ago
|
||
Assignee | ||
Comment 78•6 years ago
|
||
Comment 79•6 years ago
|
||
Comment 80•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 81•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 82•6 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #58)
Created attachment 9043961 [details] [diff] [review]
remove-tree-rollup.diffMagnus, Jorg, see Comment 17. Here's a rollup patch with the Custom Elementification for <xul:tree>. You probably want to do some preliminary testing before this lands to get a sense for what (if anything) will need to be ported.
I tried the rollup patch with TB and the 3-pane window looked like with the XBL-tree and I saw no to this related errors in the console. I wasn't able to try the calendar views as Lightning is actually broken but I think this works too.
This is very promising.
Assignee | ||
Comment 83•6 years ago
|
||
\o/
Comment 84•6 years ago
|
||
Comment 85•6 years ago
|
||
Comment 86•6 years ago
|
||
Comment 87•6 years ago
|
||
Updated•6 years ago
|
Comment 88•6 years ago
|
||
Comment 89•6 years ago
|
||
(In reply to Marco Bonardo [::mak] from comment #88)
Comment on attachment 9044173 [details] [diff] [review]
Part 2.1: Naively convert places-tree to a custom element, preserving
history, r=bgrins, makReview of attachment 9044173 [details] [diff] [review]:
Awesome, it seems to work as expected. There's a ton of simplifications and
fixes we can make by merging this and treeview.js (per bug 760974)
Yeah, once we get this into JS I expect there's a bunch of cleanup that can be done (we saw this with the tabbrowser XBL -> JS converstion as well).
I'd suggest an eslint check over this, since it seems to have some code
style misses.::: browser/components/places/content/places-tree.js
@@ +87,4 @@// If the row is not valid we try to insert inside the resultNode. orientation = Ci.nsITreeView.DROP_ON; } else if (PlacesUtils.nodeIsContainer(node) &&
eventY > rowHeight * 0.75) {
were some of the changes made automatically?
These if conditions reindentations around are not great... There are multiple
I think all of the lint issues are fixed in part 2.2, although stuff like whitespace alignment that passes eslint but looks wrong were probably an issue with my converter tool (https://github.com/bgrins/xbl-analysis/blob/gh-pages/scripts/custom-element-utils.js, which results in https://github.com/bgrins/xbl-analysis/blob/gh-pages/elements/generated/PlacesTree.js).
I wish our eslint configuration (or some other code beautifier) could define and autofix the correct alignment for this type of condition. The current alignment seems a bit off as well, although not as bad (https://searchfox.org/mozilla-central/rev/93905b660fc99a5d52b683690dd26471daca08c8/browser/components/places/content/tree.xml#755).
Updated•6 years ago
|
Comment 90•6 years ago
|
||
Comment 91•6 years ago
|
||
Assignee | ||
Comment 92•6 years ago
|
||
(In reply to Mark Banner (:standard8) (afk until Friday) from comment #86)
Comment on attachment 9044188 [details] [diff] [review]
Part 2.6: Add eslint globals to places-tree.js, r=bgrinsReview of attachment 9044188 [details] [diff] [review]:
::: browser/components/places/content/places-tree.js
@@ +2,4 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/* global PlacesController */
I think slightly nicer here would be to do:
/* import-globals-from controller.js */ /* import-globals-from treeView.js */
(and drop all the individual global definitions).
That gives people an indication that those two files are required alongside
this one (there's more, but they declare what they depend on as well).r=me with that fixed.
TIL. Very nice. Addressed in the rollup patch that I'll upload.
Assignee | ||
Comment 93•6 years ago
|
||
(In reply to Marco Bonardo [::mak] from comment #87)
Comment on attachment 9044178 [details] [diff] [review]
Part 2.5: Make the edit bookmark tree lazily constructed so there aren't any
trees left in the browser window markup, r=bgrinsReview of attachment 9044178 [details] [diff] [review]:
::: browser/components/places/content/editBookmark.js
@@ +1106,3 @@"locationField", "keywordField", "tagsField" ]) {
let eltScoped = elt;
while here, could you please remove eltScoped? It became unnecessary a
couple years ago, when JS was fixed to create a new scope per loop. We can
just use elt in the loop.
nit: The space at the end of the array before ] is also unnecessary.
Removing eltScoped
seems like a perfect followup bug, even a good-first-bug. I'll spinoff one.
Regarding this and all of the other nits, they were fixed in "Part 2.2: Lint for the lint gods in places-tree.js, r=bgrins", which I'll roll up with all of the other patches.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 94•6 years ago
|
||
And this is the rollup with all comments addressed.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 95•6 years ago
|
||
Here's a try with the rollup: https://treeherder.mozilla.org/#/jobs?repo=try&revision=25b9fc003d10189cc0c85212e50092f0303b2122
Here's a talos with the patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f0fe555fa22ed51ad4f557f6279b696f2eeaff5b
...and without: https://treeherder.mozilla.org/#/jobs?repo=try&revision=74ebc4b9eb766b51cc2b0393f1886c3199c6debc
Comment 96•6 years ago
|
||
Comment 97•6 years ago
|
||
Victor, just a heads up that I noticed during local testing that we aren't doing super.connectedCallback() in https://hg.mozilla.org/integration/mozilla-inbound/rev/a6606e852767#l7.802, which is resulting in the "hidehscroll" attribute not getting set on places trees, which leads to the horizontal scrollbar being visible even when there's no scroll needed. This should be a quick follow-up fix assuming the push to inbound sticks.
Comment 98•6 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #97)
Victor, just a heads up that I noticed during local testing that we aren't doing super.connectedCallback() in https://hg.mozilla.org/integration/mozilla-inbound/rev/a6606e852767#l7.802, which is resulting in the "hidehscroll" attribute not getting set on places trees, which leads to the horizontal scrollbar being visible even when there's no scroll needed. This should be a quick follow-up fix assuming the push to inbound sticks.
Let's see what try thinks of a fix for this: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5a4d5d3737a49566477715fa00c758205382d0fd.
Comment 99•6 years ago
|
||
Comment 100•6 years ago
|
||
Went ahead and pushed a fix for the horizontal scrollbar issue.
Assignee | ||
Comment 101•6 years ago
|
||
\o/
Comment 102•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a6606e852767
https://hg.mozilla.org/mozilla-central/rev/e70117d89f29
Updated•6 years ago
|
Updated•6 years ago
|
Description
•