I decided to work on two bugs today. The first is bug 792296 to reduce the number of reflows that happen when calling various popup methods. The other is bug 621944 which causes wrapping around to the start of the message when finding text in Thunderbird to fail to function properly. Both bugs are completely unrelated and involved changing very different parts of code.
The first bug was simple. Just change a couple places where a flush is done so as to not flush and get the frames for the popup directly. Test and then submit to the tryserver.
While that is happening, investigate the review comments from the second bug which clued me in as to what was wrong. The simple fix here is that the wrong window was being used to start the text search; instead of using the focused child frame of the window to find in, the focused child frame of the active window was being used. Write a patch and local testing shows that it fixes the problem in Thunderbird, and also fixes a simple testcase.
Some tryserver results from the first bug are now available, showing that there are failures in some private browsing and network tests. Odd, those tests aren’t using popups and look unrelated. It fails on every machine so doesn’t look like an intermittent failure. No one else’s builds show the error, so this is strange.
Run the failing tests locally. They work fine. Scratch head. Run a larger batch of tests. They still work fine. Consider making Ehsan fix the problem. Nope, he’s eating lunch.
After a while I discover an amazing thing. I don’t get the test failures locally because they are fixed by the patch to the second bug! By sheer coincidence, the patches to two unrelated bugs come together to fix both bugs! And that’s not all! It looks like it’s intermittent orange bug 707599! Fixed! Fixed! Fixed!
Also today: bug 793157 which adds a moveToAnchor method to popups and panels to allow one to move an open popup to a particular anchor location.
This week I mainly did two things:
- Made a few minor changes to the patch to handle using popups as drag feedback, to simplify the code.
- Posted patches to store and read XBL bindings to the startup cache. This is a work in progress, but I spent this week getting the patches to the point where they don’t cause any test failures. There is still some work to be done: various warnings occur when reading the bindings, error handling needs to be improved, there may be a minor memory leak to investigate and, for whatever reason, the cache is only read the second time rather than the first time it is available. The latter is some remnant of the switch to using a startup cache, which stores the cached data in a zip file, rather than the specialized format fastload file.
This week I mostly finished off a patch to handle panels as drag feedback images. Currently, when dragging, a feedback image is created from the element being dragged, or a script may change the feedback image with the setDragImage function. However, the image is always a static image. With this patch, if you pass a <panel> element to the setDragImage function, the panel will be used directly as the drag feedback, allowing the feedback image to be changed while dragging.
This will allow you to not only change the content and appearance of the drag feedback image while the drag is occurring, but also the position and size. This should allow for some interesting drag effects.
The only other step besides using the setDragImage function, is to ensure that you set type=”drag” on the <panel> element. This ensures that the popup behaves as a drag feedback image. Otherwise, drag events will get fired on the panel itself, and you will likely want them to be ignored and instead fired on what you are dragging over underneath the panel.
See bug 533460 for more details. Some builds are also available with these feature.
Some other things I have done recently:
- Put up a some updated patches for clipboard event handling.
- Fixed some elements such as the datepicker and tree such that they cancel mouse scroll events and key events properly
- An issue where dropping on plugins was not allowed.
- Some cleanup of xul headers.
- Changed xml-datasource template generation so that the ids from the source document are used. This allows persistence to work properly.
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.