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.
Checked in and worked on some additional followup issues with how focus rings are displayed. The intent is to display focus outline rings only when the system wants us to. Most notably, on Windows, focus rings only get displayed when a system setting is used, or the keyboard is used to open or navigate within a dialog. On Mac, elements do not focus themselves any more when clicked.
The new :-moz-focusring property pseudoclass only matches when a focus ring should be displayed.
I implemented a patch which uses some custom images for resizers in bug 554810. This improves the appearance when the textbox background colour is changed, on certain platforms and with right-to-left textboxes.
I am getting back into implementing more popup and panel features. The first feature allows one to retrieve the likely coordinates of where a popup will appear from within a popupshowing event using the getBoundingClientRect method or other similar methods. This will create the popup content and lay it out, which means that the popup could be laid out twice, however the popup layout will only occur twice if you actually need the information beforehand. In most situations, you don’t.
I then used this feature to start work on a generic arrow style of panel which has an arrow which points to its target. The arrow position updates to point in the right direction and be in the right position even when the popup opens in a different direction or position than expected.
The functions of the nsDragAndDrop.js script are currently used in browser.js in a couple of places. Most uses have been converted to the new drag and drop API. In bug 545119 I remove the last usages of this script from Firefox. This script and any of its functionality will not be available in browser code any more, unless you include it yourself, which you wouldn’t do, right?
- In bug 554873 I worked on getting waitForFocus to work more as expected.
- Merged some popup layout code in bug 562740.