[ozone/wayland] text-input-v3 Part 9: Set surrounding text [chromium/src : main]

0 views
Skip to first unread message

Orko Garai (Gerrit)

unread,
Jul 16, 2024, 11:24:15 AM (11 days ago) Jul 16
to Hidehiko Abe, Kramer Ge, Nick Yamane, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Hidehiko Abe and Kramer Ge

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Hidehiko Abe
  • Kramer Ge
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic411466bdcfc1ca9ea5892c1babcef4e28b6abde
Gerrit-Change-Number: 5714209
Gerrit-PatchSet: 1
Gerrit-Owner: Orko Garai <or...@igalia.com>
Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
Gerrit-CC: Nick Yamane <nick...@igalia.com>
Gerrit-Attention: Kramer Ge <fang...@chromium.org>
Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Jul 2024 15:24:07 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hidehiko Abe (Gerrit)

unread,
Jul 23, 2024, 3:50:35 AM (4 days ago) Jul 23
to Orko Garai, Kramer Ge, Nick Yamane, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Kramer Ge and Orko Garai

Hidehiko Abe added 5 comments

File ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc
Line 238, Patchset 5 (Latest): // Selection overlaps with preedit. Simply discard selection in that
// case and put cursor at preedit position.
Hidehiko Abe . unresolved

hmm... could you elaborate why this is reasonable? should't we just trim the overlapping part?

Line 240, Patchset 5 (Latest): data.cursor = preedit_range.start();
Hidehiko Abe . unresolved

end

Line 245, Patchset 5 (Latest): data.cursor = preedit_range.start();
Hidehiko Abe . unresolved

end

Line 230, Patchset 5 (Latest): if (selection_range.IsValid()) {
if (selection_range.end() <= preedit_range.start()) {
// Selection is unaffected because it is to the left of preedit.
} else if (selection_range.start() >= preedit_range.end()) {
// Selection is after preedit, so move selection back
data.cursor -= preedit_range.length();
data.anchor -= preedit_range.length();
} else {
// Selection overlaps with preedit. Simply discard selection in that
// case and put cursor at preedit position.
data.cursor = preedit_range.start();
data.anchor = preedit_range.start();
}
} else {
// Invalid selection range. Put cursor at preedit position.
data.cursor = preedit_range.start();
data.anchor = preedit_range.start();
}
Hidehiko Abe . unresolved

could you not assume start <= end ?

File ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3_unittest.cc
Line 291, Patchset 5 (Latest): constexpr gfx::Range kPreeditRange(11, 38);
constexpr gfx::Range kSelectionRange = {38, 38};
Hidehiko Abe . unresolved

style: coudl you keep using consistent style?

Open in Gerrit

Related details

Attention is currently required from:
  • Kramer Ge
  • Orko Garai
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic411466bdcfc1ca9ea5892c1babcef4e28b6abde
    Gerrit-Change-Number: 5714209
    Gerrit-PatchSet: 5
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-CC: Nick Yamane <nick...@igalia.com>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Attention: Orko Garai <or...@igalia.com>
    Gerrit-Comment-Date: Tue, 23 Jul 2024 07:50:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Orko Garai (Gerrit)

    unread,
    Jul 23, 2024, 10:35:57 AM (4 days ago) Jul 23
    to Hidehiko Abe, Kramer Ge, Nick Yamane, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
    Attention needed from Hidehiko Abe and Kramer Ge

    Orko Garai added 3 comments

    File ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc
    Line 238, Patchset 5 (Latest): // Selection overlaps with preedit. Simply discard selection in that
    // case and put cursor at preedit position.
    Hidehiko Abe . unresolved

    hmm... could you elaborate why this is reasonable? should't we just trim the overlapping part?

    Orko Garai

    We could do that as well if that is preferred. Was not sure if this was indeed something that could actually occur and so defaulted to this type of fallback.

    Line 240, Patchset 5 (Latest): data.cursor = preedit_range.start();
    Hidehiko Abe . unresolved

    end

    Orko Garai

    Can't be end because the preedit is not included in surrounding text that is sent. It's as if the entire preedit is collapsed at the cursor position.

    File ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3_unittest.cc
    Line 291, Patchset 5 (Latest): constexpr gfx::Range kPreeditRange(11, 38);
    constexpr gfx::Range kSelectionRange = {38, 38};
    Hidehiko Abe . unresolved

    style: coudl you keep using consistent style?

    Orko Garai

    yup, missed this after copying from another test and renaming from regular variable to constexpr for this test

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    • Kramer Ge
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic411466bdcfc1ca9ea5892c1babcef4e28b6abde
    Gerrit-Change-Number: 5714209
    Gerrit-PatchSet: 5
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-CC: Nick Yamane <nick...@igalia.com>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Jul 2024 14:35:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hidehiko Abe <hide...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Orko Garai (Gerrit)

    unread,
    Jul 24, 2024, 3:57:22 PM (3 days ago) Jul 24
    to Hidehiko Abe, Kramer Ge, Nick Yamane, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
    Attention needed from Hidehiko Abe and Kramer Ge

    Orko Garai added 4 comments

    File ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc
    Line 238, Patchset 5: // Selection overlaps with preedit. Simply discard selection in that

    // case and put cursor at preedit position.
    Hidehiko Abe . resolved

    hmm... could you elaborate why this is reasonable? should't we just trim the overlapping part?

    Orko Garai

    We could do that as well if that is preferred. Was not sure if this was indeed something that could actually occur and so defaulted to this type of fallback.

    Orko Garai

    Done

    Line 240, Patchset 5: data.cursor = preedit_range.start();
    Hidehiko Abe . unresolved

    end

    Orko Garai

    Can't be end because the preedit is not included in surrounding text that is sent. It's as if the entire preedit is collapsed at the cursor position.

    Orko Garai

    please see latest patch with additional comments.

    Line 230, Patchset 5: if (selection_range.IsValid()) {

    if (selection_range.end() <= preedit_range.start()) {
    // Selection is unaffected because it is to the left of preedit.
    } else if (selection_range.start() >= preedit_range.end()) {
    // Selection is after preedit, so move selection back
    data.cursor -= preedit_range.length();
    data.anchor -= preedit_range.length();
    } else {
    // Selection overlaps with preedit. Simply discard selection in that
    // case and put cursor at preedit position.
    data.cursor = preedit_range.start();
    data.anchor = preedit_range.start();
    }
    } else {
    // Invalid selection range. Put cursor at preedit position.
    data.cursor = preedit_range.start();
    data.anchor = preedit_range.start();
    }
    Hidehiko Abe . unresolved

    could you not assume start <= end ?

    Orko Garai

    see latest patch. For selection start > end is possible.

    File ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3_unittest.cc
    Line 291, Patchset 5: constexpr gfx::Range kPreeditRange(11, 38);

    constexpr gfx::Range kSelectionRange = {38, 38};
    Hidehiko Abe . resolved

    style: coudl you keep using consistent style?

    Orko Garai

    yup, missed this after copying from another test and renaming from regular variable to constexpr for this test

    Orko Garai

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    • Kramer Ge
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic411466bdcfc1ca9ea5892c1babcef4e28b6abde
    Gerrit-Change-Number: 5714209
    Gerrit-PatchSet: 7
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-CC: Nick Yamane <nick...@igalia.com>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Jul 2024 19:57:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hidehiko Abe <hide...@chromium.org>
    Comment-In-Reply-To: Orko Garai <or...@igalia.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Orko Garai (Gerrit)

    unread,
    Jul 26, 2024, 11:31:58 AM (21 hours ago) Jul 26
    to Hidehiko Abe, Kramer Ge, Nick Yamane, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
    Attention needed from Hidehiko Abe and Kramer Ge

    Orko Garai added 1 comment

    Patchset-level comments
    File-level comment, Patchset 8:
    Orko Garai . resolved

    @hide...@chromium.org please review again when you get a chance

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    • Kramer Ge
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic411466bdcfc1ca9ea5892c1babcef4e28b6abde
    Gerrit-Change-Number: 5714209
    Gerrit-PatchSet: 9
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-CC: Nick Yamane <nick...@igalia.com>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Jul 2024 15:31:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages