I started to work on a prototype for being able to dock panels onto a window, which might be used for the console panel. This would allow one to drag a panel around and snap it into a window so that it was no longer a separate piece of UI.
While looking for a good means to test what I’d implemented, I realized that the simplest was to allow the toolbar to be pulled out of the window.
Or, when dragged near the bottom of the window, the toolbar snaps onto the bottom:
Some highlights of things I have been working on over the last few weeks:
- A number of bugs related to focus and mouse behaviour with the tab modal dialogs: Bug 617872, bug 620145, bug 622663 and bug 615186.
- Arrow panel related issues: Bug 616502 and Bug 616607.
- Testing why there was a performance issue on Linux with resizers in bug 489303. In addition, bug 626997 where the resizer was allowing the window to be resized even when the window was maximized or in full screen mode.
- A new property of menus, openedWithKey, was added which returns true if the menu was opened with the keyboard instead of the mouse. This always returns false on Mac. This was implemented in bug 607224.
- In bug 618907, an workaround was added to resolve an issue where canceling a mousedown event doesn’t move the focus to the window frame that was clicked. A better fix may be implemented in the future.
- The patch to show resizers on Windows when the statusbar is hidden is causing a leak. See Bug 626956 if you want to help fix it.
Bugs worked on this week:
- Bug 606343 – almost finished with arrow panel alignment as the current patch in the bug seems to work on all platforms.
- Bug 610378 – fixed an issue where drops were not being allowed when the effectAllowed property was being set.
- Bug 607224 – added support to handle pressing F10 or the Alt key by itself to this bug which adds a flag to indicate if a menu is being used via the keyboard.
- Bug 611313 – created a patch which might fix some issues that cause various template tests to occasionally fail.
- Bug 511010 – worked on some display flickering when closing a menu from the bookmarks panel. I created a patch to not adjust window activation when closing a menu when clicking on a panel.
Four bugs occupied my time in the past week:
- Bug 489303 – more work on showing the resizer when the statusbar is disabled. This involved a number of adjustments to ensure the resizer and scrollbars appeared correctly using the right appearance.
- Bug 607224 – a new feature was requested to have certain menu items only visible when the keyboard is being used to activate them. This allows commands which are duplicated in the main interface to be hidden, reducing the total number of visible menu items for casual mouse-oriented usage.
- Bug 601182 – some extra focus related events are sent to a plugin on Mac. Some work here was done to have plugin focus a special case.
- Bug 606343 – some tweaks are needed to ensure that the arrow on an arrow panel points at what it should do. No patch yet, as I’m still investigating ways to implement this that would work for different types and sizes of anchor and in different themes on each platform.
When the statusbar is hidden, the resizer in the bottom of the window goes with it. In bug 489303, I added the resizer to the intersection where the page’s scrollbars appear. This is trickier than it sounds as it involves making the page’s resizer appear even though it resizes the window.
Arrow panels used for notifcations are almost complete. Only a few minor appearance related fixes are needed to get the border and shadows correct. These are shown in this image. I am currently testing these fixes.
I spent a lot of time working on bug 522956, trying to get it to work without causing tests to fail. Unfortunately, dealing with window handling on Linux is difficult due to issues handling asynchronous operations properly. I worked out a fix for the tests that were failing.
This is what I have been working on lately:
- Now that popups support titlebars, and the inspector window uses them, a bug was uncovered where tree selection wasn’t working. The solution was to just use more ordinary offset computations.
- Some discussion came up about focus behaviour on Mac. I added a preference to allow clicking form elements to focus them.
- After having the patch sit around for a long time, I finally finished off bug 383930 which more or less deprecates the use of document.popupNode and document.tooltipNode. Instead, the popup element itself has a triggerNode property that can be used.
- Other popup work involves improving the times when popups are laid out. This allows one to retrieve the likely position where a popup will appear during the popupshowing event. This will allow arrow panels to be possible. Arrow panels orient themselves automatically based on their location on screen. However, I’ll need some help finishing this off to get the appearance right on each platform.
- Dave Townsend was having a problem with the alignment of some add-on iconic buttons. Rather than fix that problem I just implemented what he really wanted which was xul images that scale and maintain their size ratio.
- Spent some time getting to know the workings of the Metacity window manager. Then, I spent some time wishing I hadn’t. This was an attempt to determine why the window focus gets confused and causes tests on Linux to fail randomly.
- Found an old bug where key modifiers were not being sent to menuitem command events when the menu was selected with the keyboard.
- I also looked into a few crash bugs.
Last week, I finished off the support for titlebars in popup panels. This will add three new attributes to the <panel> element:
label, as well as a new
floating value for the
-moz-resize property to make elements resizable has been changed to
resize to be compatible with Webkit.
- Bug 551434 – keypress and keyup events should fire at the same element as the keydown event.
- Bug 558072 – rework popup opening and layout so that the likely coordinates that the popup will open at are available within the popupshowing event.
- Bug 564277 – implement better focus ring behaviour for html elements.
I improved the waitForFocus function in bug 554873. This fixes problems with using waitForFocus when waiting for a new window to open. Instead, it waits for a non-blank page to load. If this is actually expected, a flag is available to alter this behaviour.
Other than that, I mostly worked on panel improvements again. I spent most of the week working on ensuring that the coordinates and position of panels are properly set when a titlebar is present.
Let’s say that you needed to write code that needs to store the position and size of two rectangles, and you wanted to store them in the most optimal way. But you didn’t want to optimize for space or for performance. Instead, you wanted to optimize for maximum confusion to someone reading your code eight years later. What would you do? The solution is obvious. Store only one rectangle but use the position of one rectangle and the size of the other. Or vice versa. And especially, mix and match the values at different times. Finally, have an aha moment when you realize it could be differently on each platform.
This is the way the window positioning and sizing code works. Luckily I discovered that I should be able to avoid having to deal with that confusion and handle things entirely in the popup code.
Now that that is mostly complete, I next plan to polish up the code and break it down into smaller patches to make it clearer as to which patch implements or fixes what popup feature.
Besides titlebars, a new floating panel will be available, by setting the level attribute on a panel to ‘floating’. This creates a panel suited for a floating panel such as a tool palette window on each platform. The exact behaviour will differ on each platform though due to available features of the underlying platform. Generally, the panel will appear on top of the parent window, can be moved independently of it, and on Mac, will hide when the application becomes inactive.