Closed Bug 2000479 Opened 10 months ago Closed 10 months ago

`ContentCacheInParent::HandleQueryContentEvent` should not return error when there is a selection and queried with relative offset from current selection

Categories

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

defect

Tracking

()

VERIFIED FIXED
147 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- verified
firefox145 --- verified
firefox146 --- verified
firefox147 --- verified

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(4 files)

https://searchfox.org/firefox-main/rev/dada95df62357a983cc45284133b92de35609dd2/widget/ContentCache.cpp#829

    } else if (NS_WARN_IF(mSelection->mHasRange)) {
      MOZ_LOG(sContentCacheLog, LogLevel::Error,
              ("0x%p HandleQueryContentEvent(), FAILED due to there is no "
               "selection range, but the query requested with relative offset "
               "from selection",
               this));
      return false;

Obviously, the check should be NS_WARN_IF(!mSelection->mHasRange)!

This is just the typo of the condition, but this have made a lot of
queries failed when there is no IME selections. This could be one of
the cause of bug 1824143.

Set release status flags based on info from the regressing bug 1746104

firefox-beta Uplift Approval Request

  • User impact if declined: Chinese users might see the crash of bug 1824143 because this bug caused us returning unexpected error to TSF when TSF/IME queries character rect or text content around selection.

(And this may fix bug 1859125 because we failed to reply queries due to this bug.)

  • Code covered by automated testing: yes
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Just fix the mistake.
  • String changes made/needed: no
  • Is Android affected?: no
Attachment #9527348 - Flags: approval-mozilla-beta?

This is just the typo of the condition, but this have made a lot of
queries failed when there is no IME selections. This could be one of
the cause of bug 1824143.

Original Revision: https://phabricator.services.mozilla.com/D272821

Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4d64217665ac https://hg.mozilla.org/mozilla-central/rev/3f13262a0a2e Make `ContentCacheInParent::HandleQueryContentEvent` not stop handling the query when the offset is relative and there is selection r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
Flags: in-testsuite+
Attachment #9527348 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

firefox-release Uplift Approval Request

  • User impact if declined: Chinese users cannot use Baidu's search form due to the crash (which may be caused by returning error to TSF caused by bug 1824143, bug 2000479 and bug 1992288) or our TextEditor bug (bug 1992288).

As far as using moz-phab patch on the release branch, these patches can be applied cleanly and the new tests work.
https://treeherder.mozilla.org/jobs?repo=try&revision=cd466c731c4fd16f201ca5f3b6f42ff6ef88aef6
(The bustage of Bp-nu is in media's code...)

  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: 1. Install Sogou IME from https://pinyin.sogou.com/index.php and use it
  1. Run debug build on Windows
  2. Load https://www.baidu.com/
  3. Type "nihao" into the search form at center of the page

Then, you should be able to type text after the form is moved to top of the page and you shouldn't see a lot of warnings in the terminal:

WARNING: 'queryTextRectEvent.Failed()', file D:/firefox2/widget/windows/TSFTextStore.cpp:2020

(The line number may become different after applying the last patch.)

  • Risk associated with taking this patch: low
  • Explanation of risk level: The first one is just adding the logger of TextEditor creation, etc. So, it does not affect to the behavior.

The second one is covered by the automated test.

The third one makes TSFTextStore stop notifying TSF of "layout available notifiecation" immediately after dispatching composition events. This can be checked by the manual QE testing.

The last one fixes the simple mistake of the content cache in the parent process.

(About "Is Android affected": Only the second bug fix and the last bug fix are cross-platform bugs. Therefore, they are "yes", but the 3rd patch is "no".)

  • String changes made/needed: no
  • Is Android affected?: yes
Attachment #9527616 - Flags: approval-mozilla-release?
Flags: qe-verify+

This is just the typo of the condition, but this have made a lot of
queries failed when there is no IME selections. This could be one of
the cause of bug 1824143.

Original Revision: https://phabricator.services.mozilla.com/D272821

QA Whiteboard: [uplift] [qa-ver-needed-c147/b146]

This is just the typo of the condition, but this have made a lot of
queries failed when there is no IME selections. This could be one of
the cause of bug 1824143.

Original Revision: https://phabricator.services.mozilla.com/D272821

Attachment #9527634 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined: Chinese users cannot use Baidu's search form due to the crash (which may be caused by returning error to TSF caused by bug 1824143, bug 2000479 and bug 1992288) or our TextEditor bug (bug 1992288).
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: 1. Install Sogou IME from https://pinyin.sogou.com/index.php and use it
  1. Run debug build on Windows
  2. Load https://www.baidu.com/
  3. Type "nihao" into the search form at center of the page

Then, you should be able to type text after the form is moved to top of the page and you shouldn't see a lot of warnings in the terminal:

WARNING: 'queryTextRectEvent.Failed()', file D:/firefox2/widget/windows/TSFTextStore.cpp:2020

(The line number may become different after applying the last patch.)

  • Risk associated with taking this patch: low
  • Explanation of risk level: The first one and the last one are covered by the automated test.

The second one makes TSFTextStore stop notifying TSF of "layout available notifiecation" immediately after dispatching composition events. This can be checked by the manual QE testing.

Note that this does not contain the patch for bug 1824143 because it only adds the logger of TextEditor creation, destruction and focus/blur. However, it's not required to fix the bug but it requires the new logging helper methods which were added in bug 1983375 in 144.

(About "Is Android affected": Only the second bug fix and the last bug fix are cross-platform bugs. Therefore, they are "yes", but the 3rd patch is "no".)

  • String changes made/needed: no
  • Is Android affected?: yes

Reproduced the issue described in comment 8 using an old Nightly debug build from 2025-11-17, lots of Warnings with queryTextRectEvent.Failed are displayed.
Verified that using the latest Nightly 147.0a1 debug and Firefox Beta 146 debug build on Windows 11, no more errors appear in the console while typing in baidu.com.
Not closing the bug as verified just yet, waiting for the esr140 uplift.

Attachment #9527616 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9527634 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+

This is also verified as fixed on debug builds, Firefox 145.0.2 and 140.6.0esr on Win 11.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift] [qa-ver-needed-c147/b146] → [uplift] [qa-ver-done-c147/b146]
Flags: qe-verify+
QA Contact: cgeorgiu
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: