Closed Bug 1140895 Opened 7 years ago Closed 7 years ago

IPC Proxy for get/set/add/remove Selection

Categories

(Core :: Disability Access APIs, defect)

36 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: smaug, Assigned: smaug)

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Attached patch v1 (obsolete) — Splinter Review
https://tbpl.mozilla.org/?tree=Try&rev=38cf620a65b8
Assignee: nobody → bugs
Attachment #8574442 - Flags: review?(tbsaunde+mozbugs)
Comment on attachment 8574442 [details] [diff] [review]
v1

>+  int32_t startOffset = 0, endOffset = 0;
>+  if (accWrap) {
>+    HyperTextAccessible* text = accWrap->AsHyperText();
>+    if (!text || !text->IsTextRole()) {
>+      return nullptr;
>+    }
>+
>+    text->SelectionBoundsAt(aSelectionNum, &startOffset, &endOffset);
>+  } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
>+    proxy->SelectionBoundsAt(aSelectionNum, &startOffset, &endOffset);
>+  } else {
>     return nullptr;
>+  }
> 
>-  HyperTextAccessible* text = accWrap->AsHyperText();
>-  if (!text || !text->IsTextRole())
>-    return nullptr;
>+  *aStartOffset = startOffset;
>+  *aEndOffset = endOffset;
> 
>-  int32_t startOffset = 0, endOffset = 0;
>-  text->SelectionBoundsAt(aSelectionNum, &startOffset, &endOffset);
>-
>-    *aStartOffset = startOffset;
>-    *aEndOffset = endOffset;
>-
>-    return getTextCB(aText, *aStartOffset, *aEndOffset);
>+  return getTextCB(aText, *aStartOffset, *aEndOffset);

isn't two ipc calls racy? since the text can change between them?
Yeah, I was wondering about that.
I guess I need to change procy::SelectionBoundsAt a bit.
(In reply to Olli Pettay [:smaug] from comment #3)
> Yeah, I was wondering about that.
> I guess I need to change procy::SelectionBoundsAt a bit.

makes sense
Attached patch v2Splinter Review
Attachment #8574442 - Attachment is obsolete: true
Attachment #8574442 - Flags: review?(tbsaunde+mozbugs)
Attachment #8574808 - Flags: review?(tbsaunde+mozbugs)
Other platforms may need a bit different kinds of SelectionBoundsAt, but better to implement
those when needed.
Attachment #8574808 - Flags: review?(tbsaunde+mozbugs) → review+
https://hg.mozilla.org/mozilla-central/rev/d11e756b726f
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.