Closed
Bug 1004499
Opened 11 years ago
Closed 11 years ago
drawFocusIfNeeded draws unconditionally
Categories
(Core :: Graphics: Canvas2D, defect)
Core
Graphics: Canvas2D
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: enndeakin, Assigned: cabanier)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
The spec says to only draw the focus ring when one should be drawn on the element passed in. Yet, the current code only checks if it is focused.
The check should also be checking if nsPIDOMWindow::ShouldShowFocusRing() returns true.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → cabanier
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #8415979 -
Flags: review?(enndeakin)
Assignee | ||
Comment 2•11 years ago
|
||
I'm trying to push a try build but the servers are stuck again.
Reporter | ||
Comment 3•11 years ago
|
||
Comment on attachment 8415979 [details] [diff] [review]
Added code to check if the window should draw a focus ring.
> nsIFocusManager* fm = nsFocusManager::GetFocusManager();
>- if (fm) {
>+ if (fm && mCanvasElement) {
> // check that the element i focused
> nsCOMPtr<nsIDOMElement> focusedElement;
> fm->GetFocusedElement(getter_AddRefs(focusedElement));
> if (SameCOMIdentity(aElement.AsDOMNode(), focusedElement)) {
>- return true;
>+ nsPIDOMWindow *window = mCanvasElement->OwnerDoc()->GetWindow();
>+ if (window) {
>+ return window->ShouldShowFocusRing();
>+ }
I know that you've checked that aElement is a descendant of the canvas, but it would be clearer if you used aElement->OwnerDoc()->GetWindow() here, and remove the null check earlier.
You may find that some tests will now fail as the ring is no longer being shown unconditionally. You can simulate a keypress if needed.
Attachment #8415979 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8415979 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 6•11 years ago
|
||
Keywords: checkin-needed
Comment 7•11 years ago
|
||
sorry had to backout this change for causing bustage like https://tbpl.mozilla.org/php/getParsedLog.php?id=38923460&tree=Mozilla-Inbound
Comment 8•11 years ago
|
||
mozilla::dom::Element& aElement. Probably should be aElement.OwnerDoc()?
Assignee | ||
Comment 9•11 years ago
|
||
Attachment #8416018 -
Attachment is obsolete: true
Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Nochum Sossonko [:Natch] from comment #8)
> mozilla::dom::Element& aElement. Probably should be aElement.OwnerDoc()?
yes. sorry about that! Was trying to be too quick
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 11•11 years ago
|
||
Keywords: checkin-needed
Comment 12•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•