<?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>163481</bug_id>
          
          <creation_ts>2016-10-14 20:38:49 -0700</creation_ts>
          <short_desc>[GTK] Restore user agent quirk for Yahoo</short_desc>
          <delta_ts>2016-10-16 13:37:15 -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>WebKitGTK</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1240551</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-14 20:38:49 -0700</bug_when>
    <thetext>What happened here was:

 * Yahoo used to do this on yahoo.com
 * We decided Yahoo lost the right to receive an accurate user agent, and added a user agent quirk to pretend to be OS X on yahoo.com (and apparently also on subdomains).
 * At some point in the past, Yahoo stopped doing this on yahoo.com
 * I removed the user agent quirk in 2.14.1, because it was no longer needed for yahoo.com, and I assumed Yahoo had regained the right to receive an accurate user agent.

I assumed wrongly. I didn&apos;t think to check finance.yahoo.com, which is still sending a mobile version in response to our user agent. Our policy is to add user agent quirks for any websites dumb enough to do this, to the detriment of anyone using WebKit on mobile devices.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240552</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-14 20:40:21 -0700</bug_when>
    <thetext>Ooops, copypaste error. &quot;Do this&quot; means &quot;display a mobile site without checking window dimensions.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240554</commentid>
    <comment_count>2</comment_count>
      <attachid>291703</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-14 20:43:39 -0700</bug_when>
    <thetext>Created attachment 291703
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240578</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-10-15 01:37:18 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; What happened here was:
&gt; 
&gt;  * Yahoo used to do this on yahoo.com
&gt;  * We decided Yahoo lost the right to receive an accurate user agent, and
&gt; added a user agent quirk to pretend to be OS X on yahoo.com (and apparently
&gt; also on subdomains).
&gt;  * At some point in the past, Yahoo stopped doing this on yahoo.com
&gt;  * I removed the user agent quirk in 2.14.1, because it was no longer needed
&gt; for yahoo.com, and I assumed Yahoo had regained the right to receive an
&gt; accurate user agent.
&gt; 
&gt; I assumed wrongly. I didn&apos;t think to check finance.yahoo.com, which is still
&gt; sending a mobile version in response to our user agent. Our policy is to add
&gt; user agent quirks for any websites dumb enough to do this, to the detriment
&gt; of anyone using WebKit on mobile devices.

That&apos;s right, maybe we should try to detect if we are running on a mobile device and not apply these particular quirks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240579</commentid>
    <comment_count>4</comment_count>
      <attachid>291703</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-10-15 01:38:44 -0700</bug_when>
    <thetext>Comment on attachment 291703
Patch

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

You also removed the code in the unit tests checking this quirk, please bring it back too.

&gt; Source/WebCore/platform/gtk/UserAgentGtk.cpp:202
&gt; +    // At least finance.yahoo.com displays a mobile version with our standard user agent.
&gt; +    if (baseDomain == &quot;yahoo.com&quot;)
&gt; +        return true;

Wouldn&apos;t it be possible to do this only for finance, since we now know that it doesn&apos;t happen with other yahoo pages?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240605</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-15 07:43:44 -0700</bug_when>
    <thetext>I agree, it would be good to apply these quirks only on mobile devices. Bug #163487.

(In reply to comment #4)
&gt; You also removed the code in the unit tests checking this quirk, please
&gt; bring it back too.

I don&apos;t think it makes sense. It&apos;s not desirable to keep the same list of quirks in both the unit test and the quirks plugin. Right now we have one test for the OS X quirk, one test for the Chrome quirk, and two Google tests since that one is implemented a bit differently. We should add a WebCore API so that the unit test can add its own quirks, that way it can test that the quirks class works properly without requiring that we update it each time we add new quirks. Bug #163488.

&gt; &gt; Source/WebCore/platform/gtk/UserAgentGtk.cpp:202
&gt; &gt; +    // At least finance.yahoo.com displays a mobile version with our standard user agent.
&gt; &gt; +    if (baseDomain == &quot;yahoo.com&quot;)
&gt; &gt; +        return true;
&gt; 
&gt; Wouldn&apos;t it be possible to do this only for finance, since we now know that
&gt; it doesn&apos;t happen with other yahoo pages?

I think it&apos;s safer to apply the quirk to all of yahoo.com, since they probably have some internal toolkit with this bug and it would not be surprising to see this problem on other Yahoo subdomains. I have not checked each Yahoo domain to see which are broken. The OS X quirk should be much safer than the Chrome quirk; the worst breakage I would expect is to see Yahoo offer Mac downloads or something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240608</commentid>
    <comment_count>6</comment_count>
      <attachid>291703</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-10-15 08:06:41 -0700</bug_when>
    <thetext>Comment on attachment 291703
Patch

Clearing flags on attachment: 291703

Committed r207376: &lt;http://trac.webkit.org/changeset/207376&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240609</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-10-15 08:06:45 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240700</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-10-16 00:59:35 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; I agree, it would be good to apply these quirks only on mobile devices. Bug
&gt; #163487.
&gt; 
&gt; (In reply to comment #4)
&gt; &gt; You also removed the code in the unit tests checking this quirk, please
&gt; &gt; bring it back too.
&gt; 
&gt; I don&apos;t think it makes sense. It&apos;s not desirable to keep the same list of
&gt; quirks in both the unit test and the quirks plugin. Right now we have one
&gt; test for the OS X quirk, one test for the Chrome quirk, and two Google tests
&gt; since that one is implemented a bit differently. We should add a WebCore API
&gt; so that the unit test can add its own quirks, that way it can test that the
&gt; quirks class works properly without requiring that we update it each time we
&gt; add new quirks. Bug #163488.

I disagree, checking every single quirk you not only check the class works as expected but also that the UA is going to be changed for the websites you want. The goal of that unit test, was also to check that the quirks worked for different urls pointing to the same domain for example.

&gt; &gt; &gt; Source/WebCore/platform/gtk/UserAgentGtk.cpp:202
&gt; &gt; &gt; +    // At least finance.yahoo.com displays a mobile version with our standard user agent.
&gt; &gt; &gt; +    if (baseDomain == &quot;yahoo.com&quot;)
&gt; &gt; &gt; +        return true;
&gt; &gt; 
&gt; &gt; Wouldn&apos;t it be possible to do this only for finance, since we now know that
&gt; &gt; it doesn&apos;t happen with other yahoo pages?
&gt; 
&gt; I think it&apos;s safer to apply the quirk to all of yahoo.com, since they
&gt; probably have some internal toolkit with this bug and it would not be
&gt; surprising to see this problem on other Yahoo subdomains. I have not checked
&gt; each Yahoo domain to see which are broken. The OS X quirk should be much
&gt; safer than the Chrome quirk; the worst breakage I would expect is to see
&gt; Yahoo offer Mac downloads or something.

Ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240739</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-16 11:12:43 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; I disagree, checking every single quirk you not only check the class works
&gt; as expected but also that the UA is going to be changed for the websites you
&gt; want. The goal of that unit test, was also to check that the quirks worked
&gt; for different urls pointing to the same domain for example.

I really think this is going to become unwieldy as the quantity of quirks increases. We can test this well enough using test quirks. Actually, I think we should be doing more unit testing like this. Our layout tests and API tests are so good that we can&apos;t keep up when they start failing, but we have almost no unit tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240785</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-16 13:37:15 -0700</bug_when>
    <thetext>(In reply to comment #8) 
&gt; I disagree, checking every single quirk you not only check the class works
&gt; as expected but also that the UA is going to be changed for the websites you
&gt; want. The goal of that unit test, was also to check that the quirks worked
&gt; for different urls pointing to the same domain for example.

It&apos;s probably right... bug #163508.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>291703</attachid>
            <date>2016-10-14 20:43:39 -0700</date>
            <delta_ts>2016-10-15 08:06:41 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-163481-20161014224011.patch</filename>
            <type>text/plain</type>
            <size>1522</size>
            <attacher name="Michael Catanzaro">mcatanzaro</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjA3MzAyCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9D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