Closed
Bug 159998
Opened 22 years ago
Closed 21 years ago
typing named anchor into address bar makes address bar appear to keep focus
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: aaronlev)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 1 obsolete file)
4.09 KB,
patch
|
bryner
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Steps to reproduce: 1. Type http://www.squarefree.com/bookmarklets/pagelinks.html#search_links into the address bar. 2. Press enter and wait for the page to load. 3. Select the address. 4. Press enter again. Result: the page scrolls to the anchor again, but the location bar *appears* not to lose focus. The selection is still dark blue, but hitting tab goes to the first item after the named anchor and Ctrl+C doesn't copy. If you replace step 3 with "place the caret after the address", a similar bug occurs: the address bar still has a blinking insertion point but no longer has focus. This bug happens in 1.0 and 2002 072908 (~1.1b) but not in 0.9.9. This bug may have been caused by the fix for bug 130447, "Clicking on anchor goes to top of page, entering the URL directly doesn't".
Reporter | ||
Updated•22 years ago
|
Blocks: 55416, focusblink
Comment 1•22 years ago
|
||
I am not sure this bug belongs to me. I think its better if Aaron first took a look at this.
Assignee: radha → aaron
Assignee | ||
Updated•22 years ago
|
Assignee | ||
Comment 2•22 years ago
|
||
-> Hewitt, who owns location bar focus issues meta bug
Assignee: aaron → hewitt
Reporter | ||
Updated•22 years ago
|
Summary: typing named anchor into address bar make address bar appear to keep focus → typing named anchor into address bar makes address bar appear to keep focus
Assignee | ||
Comment 3•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #127245 -
Flags: review?(bryner)
Comment 4•21 years ago
|
||
That's correct that mCurrentFocus should be null when the document doesn't have focus, but how is it getting set to something non-null to start with?
Assignee | ||
Comment 5•21 years ago
|
||
Brian, I´m cancelling out the side effect of SendFocusBlur(). Should I patch that routine instead not to cause the side effect, or find another way to write this method? I´m not completely confident about how to do the latter.
Assignee | ||
Comment 6•21 years ago
|
||
Brian, I tried to do this by having SendFocusBlur() not change mCurrentFocus. However, that created a problem because the focus outline doesn't then appear at the right time (for example if a link gets selected when you do a in page dialog find). It turns out that SetContentState() needs to use mCurrentFocus. To me, it seems easier to use this fix than to change both SendFocusBlur() and SetContentState() not to use mCurrentFocus. Or would you prefer me to make those respond to some kind of flag? It's easy with SendFocusBlur(), but SetContentState() would need to take a new boolean argument or use a global flag or new member variable.
Comment 7•21 years ago
|
||
Comment on attachment 127245 [details] [diff] [review] Null out mCurrent focus in FocusElementButNotDocument() when we're updating the focus appearance of a non-focused document. Otherwise the next blur event to this doc isn't fired. Hm. This entire method seems more complicated than I'd think it could be. Why can't we just update the focus controller's focused element without ever calling SendFocusBlur()?
Assignee | ||
Comment 8•21 years ago
|
||
Unfortunately, we have to make sure mCurrentFocus is set and then reset back to null. Otherwise, esm::GetContentState() doesn't tell layout to use :focus style rules for the element, and it won't get dotted out line.
Attachment #127245 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #128684 -
Flags: review?(bryner)
Comment 9•21 years ago
|
||
Comment on attachment 128684 [details] [diff] [review] As simple as I can make it, without changing esm::GetContentState() Thanks, that's a _lot_ clearer. Hopefully it doesn't regress anything :^/
Attachment #128684 -
Flags: review?(bryner) → review+
Comment 10•21 years ago
|
||
Comment on attachment 127245 [details] [diff] [review] Null out mCurrent focus in FocusElementButNotDocument() when we're updating the focus appearance of a non-focused document. Otherwise the next blur event to this doc isn't fired. -'ing this one since I hope we can go with the simplification patch.
Attachment #127245 -
Flags: review?(bryner) → review-
Assignee | ||
Updated•21 years ago
|
Attachment #128684 -
Flags: superreview?(jst)
Comment 11•21 years ago
|
||
Comment on attachment 128684 [details] [diff] [review] As simple as I can make it, without changing esm::GetContentState() + if (!focusController || !aContent) + return; ... + if (aContent) + mDocument->ContentStatesChanged(oldFocusedContent, aContent, NS_EVENT_STATE_FOCUS); You return early if !aContent, so you know it's not null here. No need for that if check. - FlushPendingEvents(mPresContext); Are you sure this isn't needed any more? Do pending events get flushed by some of the calls you make here, or does it not matter? sr=jst if you look into those issues.
Attachment #128684 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 12•21 years ago
|
||
I don't think FlushPendingEvents() was ever needed. I put it in there originally because I was making it look like some other code. However, the way this method is used, it will always come after a keypress, and then there will be a pause for the layout system to catch up, unless the user does a find again or leaves the form, in either case that's okay. I can put it back it to be on the safe side, if you think that's wise.
Assignee: hewitt → aaronl
Assignee | ||
Comment 13•21 years ago
|
||
checked into trunk
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 14•21 years ago
|
||
I'm fine leaving it out, if you did (I didn't check), please keep your eyes open for any possible regressions caused by the omission of that call.
Component: History: Session → Document Navigation
QA Contact: claudius → docshell
You need to log in
before you can comment on or make changes to this bug.
Description
•