Closed Bug 378171 Opened 17 years ago Closed 17 years ago

Offscreen should always be true for hidden elements

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

References

Details

(Keywords: access)

Attachments

(2 files, 1 obsolete file)

It is not sensible to try to calculate offscreen for hidden elements.

In fact, the ATK code already explicitly sets it.
We should do that in cross-platform code.

In fact this is causing the recursion in bug 377936.
Attached patch Fix IsVisible()Splinter Review
Attachment #262245 - Flags: review?(surkov.alexander)
Comment on attachment 262245 [details] [diff] [review]
Fix IsVisible()

looks ok
Attachment #262245 - Flags: review?(surkov.alexander) → review+
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Aaron, it looks patch isn't correct totally.

Now we can have invisible=true and offscreen=false (because initial value of offscreen is false) and it means atk will have visible=false and showing=true, that is not correct.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch How does this look? (obsolete) — Splinter Review
Attachment #262276 - Flags: review?(surkov.alexander)
Comment on attachment 262276 [details] [diff] [review]
How does this look?


>+  if (rectVisibility == nsRectVisibility_kZeroAreaRect || !mDOMNode) {
>+    *aIsOffscreen = PR_TRUE; // Offscreen always set to true for hidden elements

You don't need to do *aIsOffscreen = PR_TRUE

>+    return PR_FALSE;
>+  }
>+  
>+  // Currently one of:
>+  // nsRectVisibility_kVisible, 
>+  // nsRectVisibility_kAboveViewport, 
>+  // nsRectVisibility_kBelowViewport, 
>+  // nsRectVisibility_kLeftOfViewport, 
>+  // nsRectVisibility_kRightOfViewport
>+  // This view says it is visible, but we need to check the parent view chain :(
>+  nsCOMPtr<nsIDOMDocument> domDoc;
>+  mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc));
>+  NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);

I would prefer to return PR_TRUE/PR_FALSE explicetly.

> 
>-    nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
>-    NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
>+  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
>+  NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);

here too
Attachment #262276 - Attachment is obsolete: true
Attachment #262495 - Flags: review?(surkov.alexander)
Attachment #262276 - Flags: review?(surkov.alexander)
Attachment #262495 - Flags: review?(surkov.alexander) → review+
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: