Closed Bug 279378 Opened 20 years ago Closed 19 years ago

OBJECT should not be IsFocusable() when replaced by alternate content

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

()

Details

(Keywords: testcase)

Attachments

(6 files, 3 obsolete files)

OBJECT should not be IsFocusable() when replaced by alternate content. STEPS TO REPRODUCE: 1. Load URL 2. type ALT-g ACTUAL RESULTS: The <object> receives focus - TAB once to get to "Font size". EXPECTED RESULTS: "Font size" <select> element should receive focus on ALT-g. (Note that the URL depends on bug 81481 being fixed - testcase coming up that does not have that dependency).
Attached file Testcase (obsolete) —
Instructions: <alt>+g should (expected results) transfer focus to the next focusable element in the subtree which is the select Actual results in Mozilla 1.8b build 2005012005: Focus is captured by an <object>
Note that if the <object> is being shown (eg if it's a plugin), it _should_ get focus.
Attachment #172105 - Attachment is obsolete: true
Assignee: aaronleventhal → mats.palmgren
Attached patch Patch rev. 1 (obsolete) — Splinter Review
Something like this perhaps...
Does anyone know of a URL using Flash that actually have a textfield (or something that receives focus) inside the Flash content?
(In reply to comment #7) > Does anyone know of a URL using Flash that actually have a textfield (or > something that receives focus) inside the Flash content? Yes, here's a very cool example: http://marketrac.nyse.com/mt/
(In reply to comment #8) > Yes, here's a very cool example: http://marketrac.nyse.com/mt/ Very cool, but it only works in IE on Windows unfortunately. Even playing around with UA strings etc won't get past their "browser detection": http://marketrac.nyse.com/mt/detector/detector.js Any simpler example? any kind of "form control" inside a Flash object will do, I just want to verify that I didn't break keyboard navigation into the plugin.
Mats, bug 257488 and its dups and dependencies should have some testcases.
Thanks Boris, it seems this is already broken and the attached patch doesn't make a difference in this respect. I tried http://www.macromedia.com/ - try tabbing to the search field at the top of the page, the focus is transfered to the plugin (and get stuck there) but the items inside it never receives focus. After clicking anyware on the plugin I can tab around inside it. I also tried the testcase https://bugzilla.mozilla.org/attachment.cgi?id=171966 click Play, then wait for the animation to stop, now select the text "Object" on the page and then TAB - again the plugin receives focus but not any item inside it. This seems to be a separate problem (I'm expecting that when the plugin receives focus it should transfer it to the first focusable item inside it).
Blocks: 284610
(The stuck focus on plugins is bug 93149.)
Attachment #172150 - Attachment is obsolete: true
Attachment #176344 - Flags: superreview?(bzbarsky)
Attachment #176344 - Flags: review?(bzbarsky)
Comment on attachment 176344 [details] [diff] [review] Patch rev. 2 (also fixes bug 284610) This really needs review from aaronlev, I think... >Index: content/html/content/src/nsHTMLAppletElement.cpp >+ // <applet> is not focusable if it was replaced by alternative content. Even if it has explicit tabindex set? Wouldn't we allow a div to be focusable in that case, say? Why not an applet? When there is no plugin it should act _exactly_ like div, imo. >Index: content/html/content/src/nsHTMLObjectElement.cpp >+ // If the frame isn't a nsIObjectFrame then it's a container frame for >+ // alternative content and it is not focusable. Again, why does this behavior differ from that for <div>? >Index: content/html/content/src/nsHTMLSharedElement.cpp Same issue here. >Index: layout/generic/nsIObjectFrame.h >+ NS_IMETHOD IsContentFocusable(PRBool* aResult) = 0; Documentation? >Index: layout/generic/nsObjectFrame.cpp >+nsObjectFrame::IsContentFocusable(PRBool* aResult) >+{ >+ NS_ENSURE_ARG_POINTER(aResult); Feel free to assert this, but please don't ensure it. People shouldn't be passing null here. >+ *aResult = mIsSupportedImage ? PR_FALSE : >+ mIsSupportedDocument ? PR_TRUE : >+ mInstanceOwner != nsnull; How about: nsIFrame* child = mFrames.FirstChild(); *aResult = (firstChild && firstChild->GetType() != nsLayoutAtoms::imageFrame) || mInstanceOwner; ? No need to store the booleans, then... Also, what's the behavior we want when our child is the div created for the "broken plugin" case? If we don't want that focusable, then perhaps: *aResult = (firstChild && firstChild->GetType() == nsLayoutAtoms::subDocumentFrame) || mInstanceOwner;
Attachment #176344 - Flags: review?(bzbarsky) → review?(aaronleventhal)
Comment on attachment 176344 [details] [diff] [review] Patch rev. 2 (also fixes bug 284610) > Even if it has explicit tabindex set? > When there is no plugin it should act _exactly_ like div, imo. I agree.
Attachment #176344 - Attachment is obsolete: true
Attachment #176344 - Flags: superreview?(bzbarsky)
Attachment #176344 - Flags: review?(aaronleventhal)
Bug 310626 will hopefully fix this ;-)
Depends on: 310626
I tried all 5 testcases with Seamonkey 1.5a rv:1.9a1 build 2005111109 and Firefox 1.5 rv:1.8 build 20051111 and, as far as I can see, except for attachment 176338 [details] which is not loaded in Firefox 1.5, this bug is FIXED.
In the tescases from bug 114641, e.g attachment 90614 [details], a focus outline is displayed when you click on the alternate content.
Severity: normal → minor
Yes. Good point!
Attached patch Fix for thatSplinter Review
With all the fixing, backing out, etc, that happened, this never really got fixed for <applet> somehow...
Attachment #202943 - Flags: superreview?(bryner)
Attachment #202943 - Flags: review?(aaronleventhal)
Attachment #202943 - Flags: superreview?(bryner) → superreview+
Attachment #202943 - Flags: review?(aaronleventhal) → review+
Checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: