Closed Bug 417124 Opened 17 years ago Closed 17 years ago

[10.4] Aqua focus ring is cut off after form autocomplete goes away

Categories

(Core :: Widget: Cocoa, defect, P2)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: jaas)

References

()

Details

(Keywords: regression, top100)

Attachments

(2 files, 3 obsolete files)

Attached image screenshot
Steps to reproduce: 1. Load http://www.google.com/ 2. Type "fooooooo" (one letter at a time) (When you type 'f', a form autocomplete menu should appear. Once you type enough 'o's for there to be no more matches, it should disappear.) Result: When it disappears, some of the aqua focus ring (the part that was below the autocomplete menu?) is missing. Seems like a painting invalidation bug. Nominating because this bug is pretty visible, and wasn't a problem before bug 415466 was fixed a few days ago.
Flags: blocking1.9?
See also bug 416929, which also seems to be about poor painting invalidation/repainting with a text widget.
I cannot reproduce this. The focus ring remains intact when the autocomplete dialog disappears on account of no more matches. Jesse - is this always reproducible for you?
Almost always. I noticed that it doesn't happen if the autocomplete menu goes away due to pressing Esc, fwiw.
Can anyone else besides Jesse reproduce this?
I am not able to reproduce this using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b4pre) Gecko/2008021404 Minefield/3.0b4pre.
Jesse - are you on 10.4 or 10.5?
I can reproduce it on 10.4, at least 95% of the time.
I'm on 10.4.
That seems to be the key - adding [10.4] to the summary.
Flags: blocking1.9? → blocking1.9+
Summary: Aqua focus ring is cut off after form autocomplete goes away → [10.4] Aqua focus ring is cut off after form autocomplete goes away
Priority: -- → P2
Attached patch fix v1.0 (obsolete) — Splinter Review
Not awesome, but looks like that is what we're up against here. See comment in the patch.
Attachment #303389 - Flags: review?(smichaud)
Comment on attachment 303389 [details] [diff] [review] fix v1.0 This is overkill (possibly causing two windows to be completely repainted). But I doubt very much that it will ever cause any noticeable delay (popup windows don't get repeatedly and quickly shown and hidden). And it certainly has the virtue of simplicity. I haven't tested this ... but that didn't seem necessary.
Attachment #303389 - Flags: review?(smichaud) → review+
(By the way, I also see this problem on Tiger but not on Leopard.)
Attachment #303389 - Flags: superreview?(roc)
Attachment #303389 - Flags: superreview?(roc) → superreview+
landed on trunk
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Ack, cure vastly worse than the disease. I don't know to what extent dialup (or the equivalent, download a couple of ISOs while letting a Bittorrent app saturate your connection) is required, but for me, loading a bug page with this patch in flashes the entire window between five and ten times - as a first guess, a <select> would be one of the things that hides a popup.
So... several issues here. The code structure is: 517 if (bState && !mBounds.IsEmpty()) { ... 606 else { // roll up stuff 711 } Obvious issues: * Treating bState && mBounds.IsEmpty() as equivalent to !bState is weird. Shouldn't we just bail out early if bState && mBounds.IsEmpty() instead? * If bState matches out current state, this method should be a no-op. It most certainly is not. This might be the case we're hitting here, but I doubt it. * If !bState and mBounds.IsEmpty(), it doesn't make any sense to force the repaint. I bet that's the case we're hitting here. We have various places that assume that Show() with the existing boolean is a reasonably fast operation, and that hiding something we never really showed is pretty fast. This code is violating both assumptions.
The entire browser chrome now flashes the first time I use awesomecomplete in a window.
Josh, you'd better back this out.
Strange that I never saw that in my testing, backed out. I'll probably have a new patch soon.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Boris comment 15 reminded me of bug 392813 which is trivial to fix, and this might be the right time to do it, see below. The method is |nsCocoaWindow::Show(PRBool aShow)| which is called on us to show/hide a window. Now, this method is often (always, I think) called multiple times in sequence with aShow set to the same value. This, one could argue, is a bug... Anyway, the problem with our code is that all the initialization code is re-executed every time, even though we're already showing the window or it is already hidden! This is potentially harmful as it is likely to get us (or Cocoa) into an inconsistent state, and may have been what was causing Phil Ringnalda's window to flash multiple times in comment 14? Just a hunch.
Attached patch fix v2.0 (obsolete) — Splinter Review
This basically includes hwaara's fix for bug 392813. Works fine for me, I tested with some complex sheet test cases among other things. I was able to reproduce the page flashing reported in the bug and this gets rid of it for me.
Attachment #303389 - Attachment is obsolete: true
Attachment #303928 - Flags: review?(hwaara)
Comment on attachment 303928 [details] [diff] [review] fix v2.0 Wanna remove mWindow as well while you're at it? (Suggestion from the same bug and smichaud seemed to agree.) Basically we can use [mWindow isVisible] instead of this cached value in all places. It's just a possible source for error. I think bState is a stupid non-descriptive argument name, wanna rename it to aShow or so?
Attachment #303928 - Flags: review?(hwaara) → review+
Sorry, of course I meant "Wanna remove mVisible", and not mWindow :-)
Comment on attachment 303928 [details] [diff] [review] fix v2.0 Right now I want to be as conservative as possible, so I don't want to make any more changes than are already in this patch.
Attachment #303928 - Flags: superreview?(roc)
Attachment #303928 - Flags: superreview?(roc) → superreview+
landed on trunk
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
backed out chrome://mochikit/content/browser/toolkit/components/places/tests/browser/browser_bug413985-httprefresh.js FAIL - Visit count is what we expect - Got 2, expected 1 - chrome://mochikit/content/browser/toolkit/components/places/tests/browser/browser_bug413985-httprefresh.js
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Bah, that is the test that started failing for me when I checked in the patch for bug 392322... Think it's a fragile test.
Håkan - iirc, one reason we can't get rid of mVisible is that sibling sheets that are hidden because only one can show at a time should be considered visible. The OS call would say that they are not visible. I do agree we could simplify that logic some time though.
(In reply to comment #27) > Håkan - iirc, one reason we can't get rid of mVisible is that sibling sheets > that are hidden because only one can show at a time should be considered > visible. The OS call would say that they are not visible. I do agree we could > simplify that logic some time though. Then we could use it in only that place for sheets (and use [mWindow isVisible] in all other places), and rename it to mIsSheetVisible to make the usage more explicit?
That is basically what I meant by simplify the logic sometime.
Sounds good to me. Let me know if you need a quick r+ for such changes.
Attached patch fix v3.0 (obsolete) — Splinter Review
This includes logic cleanup, things should be much more clear now. The mochitest still fails, I can repro locally, working on that now.
Attachment #303928 - Attachment is obsolete: true
Attachment #304236 - Flags: review?(hwaara)
Word on the street is that the failing test has nasty timing issues and it will be disabled today.
Comment on attachment 304236 [details] [diff] [review] fix v3.0 Wanna change bState to aShow while you're at it?
Attachment #304236 - Flags: review?(hwaara) → review+
Attachment #304236 - Flags: superreview?(roc)
Comment on attachment 304236 [details] [diff] [review] fix v3.0 [mWindow setAcceptsMouseMovedEvents:NO]; - + Don't add trailing whitespace (happens twice)
Attachment #304236 - Flags: superreview?(roc) → superreview+
Attached patch fix v3.1Splinter Review
This is what I checked in. Just whitespace changes.
Attachment #304236 - Attachment is obsolete: true
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Depends on: 418699
Depends on: 419338
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: