Closed Bug 1743074 Opened 3 years ago Closed 3 years ago

user-select: none on html suppress selection even if redefined locally with user-select:text

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
97 Branch
Webcompat Priority P2
Tracking Status
firefox96 --- wontfix
firefox97 --- fixed

People

(Reporter: karlcow, Assigned: TYLin)

References

()

Details

Attachments

(3 files)

Steps to reproduce:

1.Type this in Firefox Android data:text/html,<!doctype html><html style="user-select:none;"><p style="font-size:4em;user-select:text;">try to select me with longpress</p></html>
2. Do a longpress to select the text

Expected:
Text is selected

Actual:
Nothing

Note:
Working on Chrome Canary.

Initially found on quora.com website.

Component: DOM: Selection → CSS Parsing and Computation

Regular text selection works fine so this is less of a CSS issue and more of a layout / caret one... Ting-yu, do you know where long-press is handled? AccessibleCaret I presume?

Component: CSS Parsing and Computation → Layout
Flags: needinfo?(aethanyc)
Attached file testcase 1

Attached a standalone testcase provided in comment 0.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)

Regular text selection works fine so this is less of a CSS issue and more of a layout / caret one... Ting-yu, do you know where long-press is handled? AccessibleCaret I presume?

Yes, the events including long-press are intercepted by AccessibleCaret in PresShell::MaybeHandleEventWithAccessibleCaret [1]. If the the event is a long-press, we will select a word here [2].

[1] https://searchfox.org/mozilla-central/rev/70b32246fce5ca1f53af573a21c1939df58cb969/layout/base/PresShell.cpp#7414-7419
[2] https://searchfox.org/mozilla-central/rev/70b32246fce5ca1f53af573a21c1939df58cb969/layout/base/AccessibleCaretManager.cpp#926-944

Flags: needinfo?(aethanyc)

Karl, could you double check the testcase? On Android, I can long-press and select the text just fine on either the word "select" or "longpress" in the sentence "try to select me with longpress".

Flags: needinfo?(kdubost)

The test case is indeed working now. Weird.
But this is still failing on https://www.quora.com/search?q=my%20duck%20has%20been%20sitting%20on%20some%20eggs
Hmmm back to the drawing board.
I'll dig again into it.

Flags: needinfo?(kdubost)

OK. I got a reduced testcase. I think this is a glitch when resolving the used value of user-select because for a inline parent with user-select: text , its inline child is selectable, but its block child is not.

This bug can also be reproduce on desktop. I'll take a look.

Assignee: nobody → aethanyc
Severity: -- → S3
Status: NEW → ASSIGNED
OS: Android → All
Hardware: Unspecified → All

user-select is a non-inheriting property. Add user-select: inherit to the UA
so that the -moz-block-inside-inline-wrapper blocks has the same style as their
inline siblings.

Pushed by tlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39740faae0b8 Inherit user-select style for -moz-block-inside-inline-wrapper. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/31866 for changes under testing/web-platform/tests

Backed out for causing wpt failures in /css/css-ui/user-select-001.html

Backout link: https://hg.mozilla.org/integration/autoland/rev/502a7657b94eb75969c9ad522b31609244ad9b8d

Push with failures

Failure log

 INFO - TEST-START | /css/css-ui/user-select-001.html
[task 2021-12-03T02:05:13.751Z] 02:05:13     INFO - Closing window 200946c3-db56-408c-99a0-8cd88d81be8d
[task 2021-12-03T02:05:54.133Z] 02:05:54     INFO - TEST-UNEXPECTED-TIMEOUT | /css/css-ui/user-select-001.html | expected OK
[task 2021-12-03T02:05:54.133Z] 02:05:54     INFO - TEST-INFO took 40392ms
[task 2021-12-03T02:05:54.461Z] 02:05:54     INFO - STDOUT: cleanup aborted: Unable to remount device
[task 2021-12-03T02:05:54.561Z] 02:05:54     INFO - STDOUT: cleanup aborted: Unable to remount device
[task 2021-12-03T02:05:54.563Z] 02:05:54     INFO - Closing logging queue
[task 2021-12-03T02:05:54.564Z] 02:05:54     INFO - queue closed
[task 2021-12-03T02:05:54.585Z] 02:05:54     INFO - Setting up ssl
[task 2021-12-03T02:05:54.600Z] 02:05:54     INFO - certutil | b''
[task 2021-12-03T02:05:54.617Z] 02:05:54     INFO - certutil | b''
[task 2021-12-03T02:05:54.635Z] 02:05:54     INFO - certutil | b'\nCertificate Nickname                                         Trust Attributes\n                                                             SSL,S/MIME,JAR/XPI\n\nweb-platform-tests                                           CT,, \n'
[task 2021-12-03T02:05:55.383Z] 02:05:55     INFO - adb Granting important runtime permissions to org.mozilla.geckoview.test_runner
[task 2021-12-03T02:05:56.684Z] 02:05:56     INFO - adb launch_application: am start -W -n org.mozilla.geckoview.test_runner/org.mozilla.geckoview.test_runner.TestRunnerActivity -a android.intent.action.MAIN --es env0 MOZ_CRASHREPORTER=1 --es env1 MOZ_CRASHREPORTER_NO_REPORT=1 --es env2 MOZ_CRASHREPORTER_SHUTDOWN=1 --es env3 MOZ_HIDE_RESULTS_TABLE=1 --es env4 MOZ_IN_AUTOMATION=1 --es env5 MOZ_LOG=signaling:3,mtransport:4,DataChannel:4,jsep:4 --es env6 R_LOG_LEVEL=6 --es env7 R_LOG_DESTINATION=stderr --es env8 R_LOG_VERBOSE=1 --es env9 MOZ_PROCESS_LOG=/tmp/tmp88n5yyv9pidlog --es env10 MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 --es env11 STYLO_THREADS=1 --es env12 MOZ_WEBRENDER=1 --es arg0 -no-remote --es arg1 -profile --es arg2 /data/local/tmp/test_root/profile --es arg3 --marionette --es arg4 about:blank --ez use_multiprocess True
[task 2021-12-03T02:05:57.638Z] 02:05:57     INFO - Starting runner
[task 2021-12-03T02:05:58.280Z] 02:05:58     INFO - TEST-START | /css/css-ui/webkit-appearance-parsing.html
Flags: needinfo?(aethanyc)
Upstream PR was closed without merging
Flags: needinfo?(aethanyc)
Pushed by tlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/59fb07970961 Inherit user-select style for -moz-block-inside-inline-wrapper. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
Upstream PR merged by moz-wptsync-bot
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: