<?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>231279</bug_id>
          
          <creation_ts>2021-10-05 22:43:22 -0700</creation_ts>
          <short_desc>ASSERTion failure in WebCore::deviceClass() on macCatalyst</short_desc>
          <delta_ts>2021-10-06 13:11:02 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Horton">thorton</reporter>
          <assigned_to name="Tim Horton">thorton</assigned_to>
          <cc>aestes</cc>
    
    <cc>andersca</cc>
    
    <cc>darin</cc>
    
    <cc>dino</cc>
    
    <cc>sam</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1800953</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2021-10-05 22:43:22 -0700</bug_when>
    <thetext>ASSERTion failure in WebCore::deviceClass() on macCatalyst</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1800954</commentid>
    <comment_count>1</comment_count>
      <attachid>440331</attachid>
    <who name="Tim Horton">thorton</who>
    <bug_when>2021-10-05 22:43:58 -0700</bug_when>
    <thetext>Created attachment 440331
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801207</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-10-06 11:17:49 -0700</bug_when>
    <thetext>Committed r283638 (242589@main): &lt;https://commits.webkit.org/242589@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440331.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801208</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-10-06 11:19:52 -0700</bug_when>
    <thetext>&lt;rdar://problem/83943064&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801233</commentid>
    <comment_count>4</comment_count>
      <attachid>440331</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-10-06 11:55:03 -0700</bug_when>
    <thetext>Comment on attachment 440331
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440331&amp;action=review

&gt; Source/WebCore/ChangeLog:9
&gt; +        * platform/ios/Device.cpp:
&gt; +        (WebCore::deviceClass):

Separately, should we stop exporting this unclear-how-to-use correctly function and instead expose more-semantic functions that match our uses?

3 uses are checking against iPad, so it can support a different media playback style than others in the iOS family
2 uses are checking for iPhone + iPod since we are omitting defaultMediaSource there (not sure why)
1 use is checking for iPhone + iPod + Apple Watch, to try to approximate -[UIDevice userInterfaceIdiom] when we can’t call it.

That’s it, just those 3 types of callers. Maybe we just expose three functions instead of using MGDeviceClass?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801236</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2021-10-06 11:59:57 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #4)
&gt; Comment on attachment 440331 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=440331&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:9
&gt; &gt; +        * platform/ios/Device.cpp:
&gt; &gt; +        (WebCore::deviceClass):
&gt; 
&gt; Separately, should we stop exporting this unclear-how-to-use correctly
&gt; function and instead expose more-semantic functions that match our uses?
&gt; 
&gt; 3 uses are checking against iPad, so it can support a different media
&gt; playback style than others in the iOS family

I expect these want to be iPhone+iPod checks instead, so we can probably expose just 2. And I agree!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801264</commentid>
    <comment_count>6</comment_count>
      <attachid>440331</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-10-06 12:34:19 -0700</bug_when>
    <thetext>Comment on attachment 440331
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440331&amp;action=review

&gt;&gt;&gt; Source/WebCore/ChangeLog:9
&gt;&gt;&gt; +        (WebCore::deviceClass):
&gt;&gt; 
&gt;&gt; Separately, should we stop exporting this unclear-how-to-use correctly function and instead expose more-semantic functions that match our uses?
&gt;&gt; 
&gt;&gt; 3 uses are checking against iPad, so it can support a different media playback style than others in the iOS family
&gt;&gt; 2 uses are checking for iPhone + iPod since we are omitting defaultMediaSource there (not sure why)
&gt;&gt; 1 use is checking for iPhone + iPod + Apple Watch, to try to approximate -[UIDevice userInterfaceIdiom] when we can’t call it.
&gt;&gt; 
&gt;&gt; That’s it, just those 3 types of callers. Maybe we just expose three functions instead of using MGDeviceClass?
&gt; 
&gt; I expect these want to be iPhone+iPod checks instead, so we can probably expose just 2. And I agree!

Then, I think we can expose just one function: something that returns true for iPhone+iPod+Watch, since in the hypothetical where we had media on watch, it would be iPhone-style, not iPad-style. We have a phone-style family (iPhone+iPod+Watch) and a larger-screen-style family (iPad+TV). And of course many features that should adapt to the current size/shape rather than the platform (so narrow apps on iPad act enough like iPhone). I would be so tempted to name this deviceClassIsSmallScreen.

But don’t ask me how this function differs from deviceHasIPadCapability.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801288</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2021-10-06 13:11:02 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #6)
&gt; Comment on attachment 440331 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=440331&amp;action=review
&gt; 
&gt; &gt;&gt;&gt; Source/WebCore/ChangeLog:9
&gt; &gt;&gt;&gt; +        (WebCore::deviceClass):
&gt; &gt;&gt; 
&gt; &gt;&gt; Separately, should we stop exporting this unclear-how-to-use correctly function and instead expose more-semantic functions that match our uses?
&gt; &gt;&gt; 
&gt; &gt;&gt; 3 uses are checking against iPad, so it can support a different media playback style than others in the iOS family
&gt; &gt;&gt; 2 uses are checking for iPhone + iPod since we are omitting defaultMediaSource there (not sure why)
&gt; &gt;&gt; 1 use is checking for iPhone + iPod + Apple Watch, to try to approximate -[UIDevice userInterfaceIdiom] when we can’t call it.
&gt; &gt;&gt; 
&gt; &gt;&gt; That’s it, just those 3 types of callers. Maybe we just expose three functions instead of using MGDeviceClass?
&gt; &gt; 
&gt; &gt; I expect these want to be iPhone+iPod checks instead, so we can probably expose just 2. And I agree!
&gt; 
&gt; Then, I think we can expose just one function: something that returns true
&gt; for iPhone+iPod+Watch, since in the hypothetical where we had media on
&gt; watch, it would be iPhone-style, not iPad-style. We have a phone-style
&gt; family (iPhone+iPod+Watch) and a larger-screen-style family (iPad+TV). And
&gt; of course many features that should adapt to the current size/shape rather
&gt; than the platform (so narrow apps on iPad act enough like iPhone). I would
&gt; be so tempted to name this deviceClassIsSmallScreen.

Good point! And then it 100% mimics the API we expose on top of UIUserInterfaceIdiom, but is non-adaptive. Seems like a great solution to reduce confusion. (except for the name; which we currently say &quot;isPhoneOrWatch&quot; but &quot;isSmallScreen&quot; is probably better since it does include iPod Touch as well)

&gt; But don’t ask me how this function differs from deviceHasIPadCapability.

I don&apos;t understand this one either :) Need to do some digging.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>440331</attachid>
            <date>2021-10-05 22:43:58 -0700</date>
            <delta_ts>2021-10-06 11:17:50 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-231279-20211005224357.patch</filename>
            <type>text/plain</type>
            <size>1832</size>
            <attacher name="Tim Horton">thorton</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI4MzYwMCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBACisyMDIxLTEwLTA1ICBUaW0gSG9y
dG9uICA8dGltb3RoeV9ob3J0b25AYXBwbGUuY29tPgorCisgICAgICAgIEFTU0VSVGlvbiBmYWls
dXJlIGluIFdlYkNvcmU6OmRldmljZUNsYXNzKCkgb24gbWFjQ2F0YWx5c3QKKyAgICAgICAgaHR0
cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIzMTI3OQorCisgICAgICAgIFJl
dmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogcGxhdGZvcm0vaW9zL0Rldmlj
ZS5jcHA6CisgICAgICAgIChXZWJDb3JlOjpkZXZpY2VDbGFzcyk6CisgICAgICAgIFNpbXBsaWZ5
IGRldmljZUNsYXNzKCk7IHRoZXJlJ3Mgbm8gcmVhc29uIHRvIGFzc2VydCBoZXJlLCBjYWxsZXJz
CisgICAgICAgIHNob3VsZCBiZSB3cml0dGVuIHRvIGFzc3VtZSB0aGV5IGRvbid0IGtub3cgdGhl
IGZ1dHVyZS4gQWxzbywgdGhpcworICAgICAgICBoYXMgYmVlbiBhc3NlcnRpbmcgb24gbWFjT1M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zZSBNR0RldmljZUNsYXNzV2F0Y2g6Ci0gICAgICAgICAgICBicmVhazsKLSAgICAg
ICAgZGVmYXVsdDoKLSAgICAgICAgICAgIEFTU0VSVF9OT1RfUkVBQ0hFRCgpOwotICAgICAgICB9
Ci0gICAgICAgIHJldHVybiBzdGF0aWNfY2FzdDxNR0RldmljZUNsYXNzPihkZXZpY2VDbGFzc051
bWJlcik7Ci0gICAgfSgpOworICAgIHN0YXRpYyBNR0RldmljZUNsYXNzIGRldmljZUNsYXNzID0g
c3RhdGljX2Nhc3Q8TUdEZXZpY2VDbGFzcz4oTUdHZXRTSW50MzJBbnN3ZXIoa01HUURldmljZUNs
YXNzTnVtYmVyLCBNR0RldmljZUNsYXNzSW52YWxpZCkpOwogICAgIHJldHVybiBkZXZpY2VDbGFz
czsKIH0KIAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>