<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Parsing of &lt;body link vlink alink&gt; is not per spec"
   href="https://bugs.webkit.org/show_bug.cgi?id=156849">156849</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Parsing of &lt;body link vlink alink&gt; is not per spec
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>HTML DOM
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zcorpan&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>(Same issue for Chromium: <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=605534">https://bugs.chromium.org/p/chromium/issues/detail?id=605534</a> )

<a href="https://github.com/WebKit/webkit/blob/66e68cd8d7bf4ea1cf52f31ed9cb242f83ea5b57/Source/WebCore/html/HTMLBodyElement.cpp#L159">https://github.com/WebKit/webkit/blob/66e68cd8d7bf4ea1cf52f31ed9cb242f83ea5b57/Source/WebCore/html/HTMLBodyElement.cpp#L159</a>

This code does not match the requirements in the HTML spec:

[[
When a body element has a bgcolor attribute set, the new value is expected to be parsed using the rules for parsing a legacy colour value, and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the element's 'background-color' property to the resulting colour.

When a body element has a text attribute, its value is expected to be parsed using the rules for parsing a legacy colour value, and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the element's 'color' property to the resulting colour.

When a body element has a link attribute, its value is expected to be parsed using the rules for parsing a legacy colour value, and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the 'color' property of any element in the Document matching the :link pseudo-class to the resulting colour.

When a body element has a vlink attribute, its value is expected to be parsed using the rules for parsing a legacy colour value, and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the 'color' property of any element in the Document matching the :visited pseudo-class to the resulting colour.

When a body element has an alink attribute, its value is expected to be parsed using the rules for parsing a legacy colour value, and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the 'color' property of any element in the Document matching the :active pseudo-class and either the :link pseudo-class or the :visited pseudo-class to the resulting colour.
]]

<a href="https://html.spec.whatwg.org/multipage/rendering.html#the-page">https://html.spec.whatwg.org/multipage/rendering.html#the-page</a>

It seems we use the correct rules for bgcolor (on various elements, and &lt;font color&gt;, &lt;table bordercolor&gt;, &lt;hr color&gt;) and text but not the link/vlink/alink attributes on body. This should also not be conditional on quirks mode. Gecko matches the spec AFAICT.


Simple tests:

&lt;!doctype html&gt;
&lt;body bgcolor=&quot;00ff0x&quot;&gt;This should have a green background.

<a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4091">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4091</a> bgcolor

---

&lt;!doctype html&gt;
&lt;body link=&quot;00800x&quot;&gt;&lt;a href=javascript:&gt;This text should be green.

<a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4092">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4092</a> link (standards mode)

---

&lt;!doctype html&gt;
&lt;body link=&quot;00800x&quot;&gt;&lt;a href=javascript:&gt;This text should be green.

<a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4093">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4093</a> link (quirks mode)

---

&lt;body link=&quot;008000&quot;&gt;&lt;a href=javascript:&gt;This text should be green.

<a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4094">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4094</a> link (quirks mode, using a value we successfully parse today)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>