Re: Inconsistent results between https://validator.w3.org/nu and bookmarklet

On 22 Jul 2019, at 16:06, Lisa Louise Davis (Aquent) wrote:

> (Original thread was False positives for "stray end tag" rule)
> Could someone in this group help me understand the difference in 
> results when typing a test URL into https://validator.w3.org/nu vs. 
> running the Check serialized DOM of current 
> page<javascript:(function()%7bfunction%20c(a,b)%7bvar%20c=document.createElement(%22textarea%22);c.name=a;c.value=b;d.appendChild(c)%7dvar%20e=function(a)%7bfor(var%20b=%22%22,a=a.firstChild;a;)%7bswitch(a.nodeType)%7bcase%20Node.ELEMENT_NODE:b+=a.outerHTML;break;case%20Node.TEXT_NODE:b+=a.nodeValue;break;case%20Node.CDATA_SECTION_NODE:b+=%22%3c![CDATA[%22+a.nodeValue+%22]]\%3e%22;break;case%20Node.COMMENT_NODE:b+=%22%3c\!--%22+a.nodeValue+%22--\%3e%22;break;case%20Node.DOCUMENT_TYPE_NODE:b+=%22%3c!DOCTYPE%20%22+a.name+%22%3e\n%22%7da=a.nextSibling%7dreturn%20b%7d(document),d=document.createElement(%22form%22);d.method=%22POST%22;d.action=%22https://validator.w3.org/nu/%22;d.enctype=%22multipart/form-data%22;d.target=%22_blank%22;d.acceptCharset=%22utf-8%22;c(%22showsource%22,%22yes%22);c(%22content%22,e);document.body.appendChild(d);d.submit()%7d)();> 
> bookmarklet? The latter consistently generates more issues.

Typing the URL into the validator causes it to test the HTML at that 
URL.

When you use the bookmarklet, you load the HTML into a browser which 
converts it into a DOM (which involves error recovery), then executes 
any JavaScript on the page (which could modify the DOM further), then 
you ask the browser to generate HTML from the DOM which you send to the 
validator.

Received on Monday, 22 July 2019 15:44:55 UTC