<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>242006</bug_id>
          
          <creation_ts>2022-06-25 13:35:31 -0700</creation_ts>
          <short_desc>-webkit-user-select: all should not affect editability</short_desc>
          <delta_ts>2025-10-24 09:48:00 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=242366</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>208677</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Wenson Hsieh">wenson_hsieh</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>emilio</cc>
    
    <cc>jarek</cc>
    
    <cc>karlcow</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>ntim</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1878382</commentid>
    <comment_count>0</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2022-06-25 13:35:31 -0700</bug_when>
    <thetext>rdar://94619119

Steps:
1. Go to outlook.live.com on iOS 16.
2. Click (+) to compose a new email
3. Try to focus the body field to begin typing.

Expected: the user should be able to compose an email.
Observed: the body field isn&apos;t editable.

Regressed after unprefixing `user-select: all;`. The contenteditable div representing the body field has these CSS properties:

```
-webkit-user-select: auto;
user-select: all;
```

Before unprefixing `user-select`, we were using the `auto` behavior specified via `-webkit-user-select`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878384</commentid>
    <comment_count>1</comment_count>
      <attachid>460492</attachid>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2022-06-25 13:39:20 -0700</bug_when>
    <thetext>Created attachment 460492
Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878386</commentid>
    <comment_count>2</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2022-06-25 13:42:00 -0700</bug_when>
    <thetext>We could attempt to default to `UserSelectAllIsAlwaysNonEditable` in more places, but that still comes with compat risk for native apps that embed web views, as well as Safari-UA-specific content. This could be partially mitigated with a LoA check, but it still seems risky, due to how widely used this property is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878387</commentid>
    <comment_count>3</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2022-06-25 13:42:35 -0700</bug_when>
    <thetext>(In reply to Wenson Hsieh from comment #2)
&gt; We could attempt to default to `UserSelectAllIsAlwaysNonEditable` in more

..I meant to write `UserSelectAllDoesNotAffectEditability`, of course :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878388</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-06-25 13:57:18 -0700</bug_when>
    <thetext>So the current user-select: all behavior was specifically designed to be used in Mail and other applications which want to treat an attachment file as one non-editable thing that can be selected on its own.

It seems like `user-select: all` needs a different behavior but I agree with you that making this change is quite risky in terms of backwards compatibility. We may need to add SDK check or preserve the old behavior just in `-webkit-user-select`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878396</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-06-25 14:33:49 -0700</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #4)
&gt; So the current user-select: all behavior was specifically designed to be
&gt; used in Mail and other applications which want to treat an attachment file
&gt; as one non-editable thing that can be selected on its own.
&gt; 
&gt; It seems like `user-select: all` needs a different behavior but I agree with
&gt; you that making this change is quite risky in terms of backwards
&gt; compatibility. We may need to add SDK check or preserve the old behavior
&gt; just in `-webkit-user-select`.

I think we should just make the user-select behavior match other browsers, and have other applications use -webkit-user-modify to override editability. Other apps shouldn&apos;t hold back interopability on the web.

Preserving the old behavior for just -webkit-user-select wouldn&apos;t really help in this case, since both unprefixed and prefixed versions are used here, so the unprefixed version would win (even if not the case, the prefixed version is set to `auto` and not `all`).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878398</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-06-25 15:04:35 -0700</bug_when>
    <thetext>(In reply to Tim Nguyen (:ntim) from comment #5)
&gt; (In reply to Ryosuke Niwa from comment #4)
&gt; &gt; So the current user-select: all behavior was specifically designed to be
&gt; &gt; used in Mail and other applications which want to treat an attachment file
&gt; &gt; as one non-editable thing that can be selected on its own.
&gt; &gt; 
&gt; &gt; It seems like `user-select: all` needs a different behavior but I agree with
&gt; &gt; you that making this change is quite risky in terms of backwards
&gt; &gt; compatibility. We may need to add SDK check or preserve the old behavior
&gt; &gt; just in `-webkit-user-select`.
&gt; 
&gt; I think we should just make the user-select behavior match other browsers,
&gt; and have other applications use -webkit-user-modify to override editability.
&gt; Other apps shouldn&apos;t hold back interopability on the web.

It&apos;s irresponsible to break iOS specific content or iOS applications like that. Think of end users who have been using an app suddenly faced with an erroneous behavior in new version of iOS.

&gt; Preserving the old behavior for just -webkit-user-select wouldn&apos;t really
&gt; help in this case, since both unprefixed and prefixed versions are used
&gt; here, so the unprefixed version would win (even if not the case, the
&gt; prefixed version is set to `auto` and not `all`).

I don&apos;t follow. They specify user-select and -webkit-user-select. If -webkit-user-select preserved the old behavior, then it would work precisely because it also specify user-select, which overrides the behavior of the prefixed version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878401</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-06-25 16:11:48 -0700</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #6)

&gt; I don&apos;t follow. They specify user-select and -webkit-user-select. If
&gt; -webkit-user-select preserved the old behavior, then it would work precisely
&gt; because it also specify user-select, which overrides the behavior of the
&gt; prefixed version.


In the case of Outlook, `-webkit-user-select: auto; user-select: all;` were both set. The computed value for both `-webkit-user-select` and `user-select` would be `all` regardless since both were specified.

Unless you&apos;re asking to make the computed value differ, and always prefer the `-webkit-` prefixed value, which would be very unusual to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878435</commentid>
    <comment_count>8</comment_count>
      <attachid>460498</attachid>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-06-26 20:09:41 -0700</bug_when>
    <thetext>Created attachment 460498
test with different cases for cross testing browsers.

I tested on Desktop only for now. 

Case 1: outlook breakage
-webkit-user-select:auto;user-select: all;  

| Browser | Edit | Computed value                  | Version              |
--------------------------------------------------------------------------|
| Safari  | FAIL | user-select: all                | 18614.1.14.1.15.     | 
| Firefox | OK   | user-select: all                | 103.0a1 (2022-06-21) | 
| Chrome  | OK   | user-select: all                | 104.0.5106.0         | 

user-select: all;

| Browser | Edit | Computed value                  | Version              |
--------------------------------------------------------------------------|
| Safari  | FAIL | user-select: all                | 18614.1.14.1.15.     | 
| Firefox | OK   | user-select: all                | 103.0a1 (2022-06-21) | 
| Chrome  | OK   | user-select: all                | 104.0.5106.0         | 


-webkit-user-select:auto;

| Browser | Edit | Computed value                  | Version              |
--------------------------------------------------------------------------|
| Safari  | OK   | user-select: text               | 18614.1.14.1.15.     | 
| Firefox | OK   | user-select: auto               | 103.0a1 (2022-06-21) | 
| Chrome  | OK   | -webkit-user-select:auto        | 104.0.5106.0         | 


Fun…


There is an issue for the compat spec so we can add it on the spec.
https://github.com/whatwg/compat/issues/135

This should probably be clarified. 
The implementation should not regressed the Web indeed. Is there a way to have a quirks identifying internal apps. We want to find a good compromise to minimize breakage. 
 

In the case of Outlook are we sure (I haven&apos;t checked yet), that Microsoft is sending the same style to all browsers? Or do they send something specific to each browsers?

Previous discussions about this.
https://docs.google.com/document/d/1158E0YvlUJ5Lwd-8XZBFqE2Ow_FWLrNVik1MFqk3WRU/edit
https://bugs.chromium.org/p/chromium/issues/detail?id=605419
https://bugzilla.mozilla.org/show_bug.cgi?id=1506547


(thinking mode)


Unprefixing:
https://bugs.webkit.org/show_bug.cgi?id=208677
Chromium unprefixed user-select in https://bugs.chromium.org/p/chromium/issues/detail?id=461018

Note that Firefox had to implement -webkit-user-select for compat reasons, but with specific behavior aligned with the behavior of what other browsers were doing in -webkit- only world.

See the discussion specifically in https://bugzilla.mozilla.org/show_bug.cgi?id=1506547#c1


(still thinking)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878437</commentid>
    <comment_count>9</comment_count>
      <attachid>460499</attachid>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-06-26 21:32:36 -0700</bug_when>
    <thetext>Created attachment 460499
actual markup from outlook

So Outlook is sending the same markup to Firefox Android and Safari iOS, but with a very specific CSS rule: 



```
&lt;div
  id=&quot;editorDiv&quot;
  aria-multiline=&quot;true&quot;
  role=&quot;textbox&quot;
  contenteditable=&quot;true&quot;
  class=&quot;_2Ty8EjISo75bsCGOwzk795&quot;
  spellcheck=&quot;false&quot;
  aria-label=&quot;Message: &quot;
&gt;
  &lt;div&gt;
    &lt;span id=&quot;_rooster_watermarkSpan&quot;&gt;Type &apos;@&apos; to mention someone&lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;
  ._2Ty8EjISo75bsCGOwzk795 {
    -webkit-user-select: auto;
    -ms-user-select: all;
    user-select: all;
    -moz-user-select: text;
    -webkit-user-modify: read-write;
  }
&lt;/style&gt;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878438</commentid>
    <comment_count>10</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-06-26 21:40:43 -0700</bug_when>
    <thetext>(In reply to Tim Nguyen (:ntim) from comment #7)
&gt; (In reply to Ryosuke Niwa from comment #6)
&gt; 
&gt; &gt; I don&apos;t follow. They specify user-select and -webkit-user-select. If
&gt; &gt; -webkit-user-select preserved the old behavior, then it would work precisely
&gt; &gt; because it also specify user-select, which overrides the behavior of the
&gt; &gt; prefixed version.
&gt; 
&gt; In the case of Outlook, `-webkit-user-select: auto; user-select: all;` were
&gt; both set. The computed value for both `-webkit-user-select` and
&gt; `user-select` would be `all` regardless since both were specified.

Right, and if we implemented the new behavior just for user-select: all and not -webkit-user-select: all, then outlook will still get the new behavior since it specifies both properties while other clients that might be relying on old behaviors of -webkit-user-select: all will continue to get the same behavior.

It&apos;s still possible though that there are content out there targeting iOS or Safari specifically and specify both user-select and -webkit-user-select and expect the old WebKit behavior so if those contents exist, then we&apos;re really screwed here.

At this point, I suggest we revert https://commits.webkit.org/249800@main for now and try again later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1878446</commentid>
    <comment_count>11</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-06-26 22:47:44 -0700</bug_when>
    <thetext>There was (In reply to Ryosuke Niwa from comment #10)
&gt; It&apos;s still possible though that there are content out there targeting iOS or
&gt; Safari specifically and specify both user-select and -webkit-user-select and
&gt; expect the old WebKit behavior so if those contents exist, then we&apos;re really
&gt; screwed here.

There was a resolution from the CSS WG about this. 

https://github.com/w3c/csswg-drafts/issues/4839

&gt; RESOLVED: For aliased properties both sides of the alias get new values as defined as a general rule</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1880791</commentid>
    <comment_count>12</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-07-05 13:59:04 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/2094</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1880838</commentid>
    <comment_count>13</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-07-05 16:15:07 -0700</bug_when>
    <thetext>Keeping this bug since it has more information, but going to fix the original bug by reverting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1880840</commentid>
    <comment_count>14</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-07-05 16:19:03 -0700</bug_when>
    <thetext>Bug 242366 reverts unprefixing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1880886</commentid>
    <comment_count>15</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-05 20:39:05 -0700</bug_when>
    <thetext>So it&apos;s pretty clear that the unprefixed version should behave like all other browsers and shouldn&apos;t make the element non-editable.

On the other hand, maybe the behavior of webkit prefixed version need to stay the same (with edibility effect) for backwards compatibility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154053</commentid>
    <comment_count>16</comment_count>
    <who name="Michał Gołębiowski-Owczarek">m.goleb+bugzilla</who>
    <bug_when>2025-10-24 09:48:00 -0700</bug_when>
    <thetext>This bug is the primary reason for why jQuery still needs its auto-prefixing feature of the `.css()` method. And probably the most popular (the only?) widely supported CSS property that still needs a prefix in a major browser. It&apos;d be good to get it fixed.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>460492</attachid>
            <date>2022-06-25 13:39:20 -0700</date>
            <delta_ts>2022-06-25 13:39:20 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>user-select-all.html</filename>
            <type>text/html</type>
            <size>67</size>
            <attacher name="Wenson Hsieh">wenson_hsieh</attacher>
            
              <data encoding="base64">PGRpdiBjb250ZW50ZWRpdGFibGUgc3R5bGU9InVzZXItc2VsZWN0OiBhbGw7Ij5UcnkgdG8gZWRp
dCBtZTwvZGl2Pg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>460498</attachid>
            <date>2022-06-26 20:09:41 -0700</date>
            <delta_ts>2022-06-26 20:09:41 -0700</delta_ts>
            <desc>test with different cases for cross testing browsers.</desc>
            <filename>test-user-select.html</filename>
            <type>text/html</type>
            <size>810</size>
            <attacher name="Karl Dubost">karlcow</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgICA8bWV0YSBjaGFyc2V0
PSJVVEYtOCI+CiAgICA8bWV0YSBodHRwLWVxdWl2PSJYLVVBLUNvbXBhdGlibGUiIGNvbnRlbnQ9
IklFPWVkZ2UiPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmlj
ZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0xLjAiPgogICAgPHRpdGxlPlRlc3QgdXNlci1zZWxlY3Qg
Y29tYmluYXRpb248L3RpdGxlPgo8L2hlYWQ+Cjxib2R5Pgo8YSBocmVmPSJodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MjQyMDA2Ij5idWcgMjQyMDA2PC9hPiAtIENhbm5v
dCBlZGl0IGNvbXBvc2UgYm9keSBmaWVsZCBvbiBvdXRsb29rLmNvbQoKPGgxPjxjb2RlPi13ZWJr
aXQtdXNlci1zZWxlY3Q6YXV0bzt1c2VyLXNlbGVjdDogYWxsOzwvY29kZT4gLSBvdXRsb29rIGJy
ZWFrYWdlPC9oMT4KPGRpdiBjb250ZW50ZWRpdGFibGUgc3R5bGU9Ii13ZWJraXQtdXNlci1zZWxl
Y3Q6YXV0bzt1c2VyLXNlbGVjdDogYWxsOyI+VHJ5IHRvIGVkaXQgbWU8L2Rpdj4KCjxoMT48Y29k
ZT51c2VyLXNlbGVjdDogYWxsOzwvY29kZT48L2gxPgo8ZGl2IGNvbnRlbnRlZGl0YWJsZSBzdHls
ZT0idXNlci1zZWxlY3Q6IGFsbDsiPlRyeSB0byBlZGl0IG1lPC9kaXY+Cgo8aDE+PGNvZGU+LXdl
YmtpdC11c2VyLXNlbGVjdDphdXRvOzwvY29kZT48L2gxPgo8ZGl2IGNvbnRlbnRlZGl0YWJsZSBz
dHlsZT0iLXdlYmtpdC11c2VyLXNlbGVjdDphdXRvOyI+VHJ5IHRvIGVkaXQgbWU8L2Rpdj4KPC9i
b2R5Pgo8L2h0bWw+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>460499</attachid>
            <date>2022-06-26 21:32:36 -0700</date>
            <delta_ts>2022-06-26 21:32:36 -0700</delta_ts>
            <desc>actual markup from outlook</desc>
            <filename>outlook-code-safari.html</filename>
            <type>text/html</type>
            <size>480</size>
            <attacher name="Karl Dubost">karlcow</attacher>
            
              <data encoding="base64">PGRpdgogIGlkPSJlZGl0b3JEaXYiCiAgYXJpYS1tdWx0aWxpbmU9InRydWUiCiAgcm9sZT0idGV4
dGJveCIKICBjb250ZW50ZWRpdGFibGU9InRydWUiCiAgY2xhc3M9Il8yVHk4RWpJU283NWJzQ0dP
d3prNzk1IgogIHNwZWxsY2hlY2s9ImZhbHNlIgogIGFyaWEtbGFiZWw9Ik1lc3NhZ2U6ICIKPgog
IDxkaXY+CiAgICA8c3BhbgogICAgICBpZD0iX3Jvb3N0ZXJfd2F0ZXJtYXJrU3BhbiIKICAgICAg
PlR5cGUgJ0AnIHRvIG1lbnRpb24gc29tZW9uZTwvc3BhbgogICAgPgogIDwvZGl2Pgo8L2Rpdj4K
CjxzdHlsZT4KICAuXzJUeThFaklTbzc1YnNDR093ems3OTUgewogICAgLXdlYmtpdC11c2VyLXNl
bGVjdDogYXV0bzsKICAgIC1tcy11c2VyLXNlbGVjdDogYWxsOwogICAgdXNlci1zZWxlY3Q6IGFs
bDsKICAgIC1tb3otdXNlci1zZWxlY3Q6IHRleHQ7CiAgICAtd2Via2l0LXVzZXItbW9kaWZ5OiBy
ZWFkLXdyaXRlOwogIH0KPC9zdHlsZT4K
</data>

          </attachment>
      

    </bug>

</bugzilla>