<?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>61697</bug_id>
          
          <creation_ts>2011-05-28 19:26:55 -0700</creation_ts>
          <short_desc>a:hover fails to work if it is the same color as a:link</short_desc>
          <delta_ts>2024-05-30 00:20:26 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=22539</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=156849</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=264641</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>
          <dependson>274889</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Matthieu Dubet">m_dubet</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>hyatt</cc>
    
    <cc>koivisto</cc>
    
    <cc>mihnea</cc>
    
    <cc>mustaf.here</cc>
    
    <cc>ntim</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkitbugzilla</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>411928</commentid>
    <comment_count>0</comment_count>
      <attachid>95279</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2011-05-28 19:26:55 -0700</bug_when>
    <thetext>Created attachment 95279
[REDUCTION] Test Case

Reduction attached.

This fails:

    &lt;style&gt;
    a:link { color: red; }
    a:hover { color: red; }
    &lt;style&gt;
    &lt;a&gt;Does not become red when hovered.&lt;/a&gt;

This works:

    &lt;style&gt;
    a:link { color: yellow; }
    a:hover { color: red; }
    &lt;style&gt;
    &lt;a&gt;Does become red when hovered.&lt;/a&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>414838</commentid>
    <comment_count>1</comment_count>
    <who name="Mihnea Ovidenie">mihnea</who>
    <bug_when>2011-06-03 06:25:52 -0700</bug_when>
    <thetext>In the first case, the color does not change when hover, so technically there is no style difference. In this case, RenderStyle::diff returns StyleDifferenceEqual and the link is displayed using the color associated with the :visited style.

Would it be an acceptable solution to modify RenderStyle::diff function to return StyleDifferenceRepaint when inherited_flags._insideLink != NotInsideLink?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>424380</commentid>
    <comment_count>2</comment_count>
    <who name="Mustafizur Rahaman (rahaman)">mustaf.here</who>
    <bug_when>2011-06-21 04:14:11 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; In the first case, the color does not change when hover, so technically there is no style difference. In this case, RenderStyle::diff returns StyleDifferenceEqual and the link is displayed using the color associated with the :visited style.
&gt; 
&gt; Would it be an acceptable solution to modify RenderStyle::diff function to return StyleDifferenceRepaint when inherited_flags._insideLink != NotInsideLink?

when I first ran the test case in Safari, I saw the issue. But then when I cleared the history &amp; reload the test case again, everything was working fine.

Don&apos;t know why the behavior was different in the first case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886331</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-24 04:51:30 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and upon hover on first line, it does not turn to red while all other browsers (Chrome Canary 106 and Firefox Nightly 104) does change the text to red upon hover.

Just wanted to share update testing results. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886416</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-24 14:49:04 -0700</bug_when>
    <thetext>wow, this is such a bizarre bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886456</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-24 20:06:58 -0700</bug_when>
    <thetext>&lt;rdar://problem/97529381&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888016</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-31 21:02:31 -0700</bug_when>
    <thetext>If I add a different background color, it would work as well so it&apos;s probably some style invalidation bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888022</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-07-31 21:50:15 -0700</bug_when>
    <thetext>I have an idea how to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888161</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-08-01 13:24:09 -0700</bug_when>
    <thetext>actually nevermind</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023656</commentid>
    <comment_count>9</comment_count>
    <who name="Alex Chan">webkitbugzilla</who>
    <bug_when>2024-03-25 08:16:07 -0700</bug_when>
    <thetext>In case it&apos;s helpful, I encountered a similar behaviour where a:hover fails to work if it&apos;s the same as a, and there&apos;s a rule for a:visited.  The rule for a:hover should override the a:visited, but it doesn&apos;t when it&apos;s the same as a plain a.

I suspect this has the same root cause as this bug.

This fails:

    &lt;style&gt;
    a         { color: green; }
    a:visited { color: red; }
    a:hover   { color: green; }
    &lt;/style&gt;

    &lt;a href=&quot;https://webkit.org&quot;&gt;WebKit website&lt;/a&gt; &lt;br&gt;
    &lt;a href=&quot;https://developer.mozilla.org/en-US/&quot;&gt;MDN Web Docs&lt;/a&gt;

This works:

    &lt;style&gt;
    a         { color: green; }
    a:visited { color: red; }
    a:hover   { color: blue; }
    &lt;/style&gt;

    &lt;a href=&quot;https://webkit.org&quot;&gt;WebKit website&lt;/a&gt; &lt;br&gt;
    &lt;a href=&quot;https://developer.mozilla.org/en-US/&quot;&gt;MDN Web Docs&lt;/a&gt;

This also works:

    &lt;style&gt;
    a         { color: green; }
    a:visited { color: red; }
    a:hover   { color: green; background: yellow; }
    &lt;/style&gt;

    &lt;a href=&quot;https://webkit.org&quot;&gt;WebKit website&lt;/a&gt; &lt;br&gt;
    &lt;a href=&quot;https://developer.mozilla.org/en-US/&quot;&gt;MDN Web Docs&lt;/a&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2024019</commentid>
    <comment_count>10</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2024-03-26 14:29:41 -0700</bug_when>
    <thetext>I can reproduce this on STP189.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025750</commentid>
    <comment_count>11</comment_count>
    <who name="Matthieu Dubet">m_dubet</who>
    <bug_when>2024-04-03 11:30:35 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/26797</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038321</commentid>
    <comment_count>12</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-05-28 16:34:36 -0700</bug_when>
    <thetext>Committed 279411@main (e451a390febd): &lt;https://commits.webkit.org/279411@main&gt;

Reviewed commits have been landed. Closing PR #26797 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038711</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2024-05-30 00:20:26 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 274889</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>95279</attachid>
            <date>2011-05-28 19:26:55 -0700</date>
            <delta_ts>2011-05-28 19:26:55 -0700</delta_ts>
            <desc>[REDUCTION] Test Case</desc>
            <filename>reduction.html</filename>
            <type>text/html</type>
            <size>239</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">PHN0eWxlPgphLm9uZTpsaW5rIHtjb2xvcjpyZWQ7fQphLm9uZTpob3ZlciB7Y29sb3I6cmVkO30K
YS50d286bGluayB7Y29sb3I6Z3JlZW47fQphLnR3bzpob3ZlciB7Y29sb3I6cmVkO30KPC9zdHls
ZT4KPGEgY2xhc3M9Im9uZSIgaHJlZj0iIj5XaHkgaXMgdGhpcyBub3QgcmVkIHdoZW4gaG92ZXJl
ZD88L2E+PGJyPgo8YSBjbGFzcz0idHdvIiBocmVmPSIiPlRoaXMgaXMgcmVkIHdoZW4gaG92ZXJl
ZC48L2E+PGJyPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>