News for hackers. Stuff that matters.
Re:Google HTML/CSS Style Guide – Omit Optional Tags by Animats on Saturday September 17, 2016 @03:10PM (#12521913)
This is one Google ad. Any questions?

    <h3><a style="display:none" href="http://www.googleadservices.com/pagead/aclk?sa=L&amp;ai=DChcSEwi36oSzi5fPAhWBh34KHQO2A0YYABAF&amp;ohost=www.google.com&amp;cid=CAASJORo9LOCMjoibKPv7gF6cak7OxiE3TtM_tpkLykYWNps5wdfUw&amp;sig=AOD64_3sHUU366i6dStUuQ_sGYCNCCiv9A&amp;q=&amp;ved=0ahUKEwiswYGzi5fPAhVSVWMKHYoQDjQQ0QwIJQ&amp;adurl=" id="s0p2c0"></a><a href="https://www.capitalone.com/credit-cards/compare/?external_id=WWW_VI194_ZZZ_ONL-SE_ZZZGO_T_SEM2_ZZZZ_c_Zg_" id="vs0p2c0" onmousedown="return google.arwt(this)" data-preconnect-urls="http://www.capitalone.com/,http://5138.xg4ken.com/" jsl="$t t-zxXzjt1d4B0;$x 0;" class="r-ifxiYWNp1hrU">Capital One® Card Offers - Apply for Credit Card Offers Now‎</a></h3>
    <div class="ads-visurl">
       <span class="_mB">Ad</span><cite class="_WGk">www.capitalone.com/ApplyFor<b>Card</b>Offers</cite>‎
       <g-bubble class="action-menu ab_ctl r-iS1b0Exw3vQ8" jsl="$t t-R7dwiTmE0C4;$x 0;">
          <a href="javascript:void(0)" data-theme="0" data-width="230" class="g-bbll" aria-haspopup="true" role="button" jsaction="r.saTe4DDW138" data-rtid="iS1b0Exw3vQ8" jsl="$x 1;" data-ved="0ahUKEwiswYGzi5fPAhVSVWMKHYoQDjQQJwgm"><span class="mn-dwn-arw"></span></a>
          <div class="g-bblc" data-ved="0ahUKEwiswYGzi5fPAhVSVWMKHYoQDjQQKAgn">
             <div class="_lBb">
                <div>This ad is based on your current search terms.</div>
                <div class="_zFc r-ivNjifPqiifI" jsl="$t t-h6cwAtrxkFI$t-wWNthJIwnKo;$x 0;">Visit Google’s <a href="javascript:void();" jsaction="r.8Na6VOGeTa8" data-rtid="ivNjifPqiifI" jsl="$x 7;" data-ved="0ahUKEwiswYGzi5fPAhVSVWMKHYoQDjQQKQgo">Why This Ad page</a> to learn more or opt out.</div>
             </div>
          </div>
       </g-bubble>
    </div>
    <div class="ellip ads-creative">Find Great Rates &amp; Rewards—Apply.</div>
    <div class="ellip">Autopay&nbsp;·&nbsp;Online Banking&nbsp;·&nbsp;Account Alerts&nbsp;·&nbsp;Travel Benefits&nbsp;·&nbsp;Security Alerts</div>
    <div class="ellip">Services: Apple Pay™, Chip Technology, Second Look®, Image Card℠, Wallet App</div>
    <ul class="_MEc">
       <li><a style="display:none" href="http://www.googleadservices.com/pagead/aclk?sa=L&amp;ai=DChcSEwi36oSzi5fPAhWBh34KHQO2A0YYABAG&amp;ohost=www.google.com&amp;cid=CAASJORo9LOCMjoibKPv7gF6cak7OxiE3TtM_tpkLykYWNps5wdfUw&amp;sig=AOD64_0_5WQ5HIxnRdQEOpUEmdSkkiWV4w&amp;ctype=4&amp;q=&amp;ved=0ahUKEwiswYGzi5fPAhVSVWMKHYoQDjQQpigILCgA&amp;adurl=" id="ads-0-0-2-1-0"></a><a href="https://findmycard.capitalone.com/?external_id=%7B_externalid%7D" id="vads-0-0-2-1-0" onmousedown="return google.arwt(this)">Find the Right Card</a></li>
       <li><a style="display:none" href="http://www.googleadservices.com/pagead/aclk?sa=L&amp;ai=DChcSEwi36oSzi5fPAhWBh34KHQO2A0YYABAH&amp;ohost=www.google.com&amp;cid=CAASJORo9LOCMjoibKPv7gF6cak7OxiE3TtM_tpkLykYWNps5wdfUw&amp;sig=AOD64_2iwTNF-VPyK96RTweJ4TAggXM4pw&amp;ctype=4&amp;q=&amp;ved=0ahUKEwiswYGzi5fPAhVSVWMKHYoQDjQQpigILSgB&amp;adurl=" id="ads-0-0-2-1-1"></a><a href="http://www.capitalone.com/credit-cards/compare/?filter=nofee&amp;external_id=%7B_externalid%7D" id="vads-0-0-2-1-1" onmousedown="return google.arwt(this)">Cards with $0 AMF</a></li>
       <li><a style="display:none" href="http://www.googleadservices.com/pagead/aclk?sa=L&amp;ai=DChcSEwi36oSzi5fPAhWBh34KHQO2A0YYABAI&amp;ohost=www.google.com&amp;cid=CAASJORo9LOCMjoibKPv7gF6cak7OxiE3TtM_tpkLykYWNps5wdfUw&amp;sig=AOD64_1AOh7CWEmBWXjNLs4Oondpyt-JAg&amp;ctype=4&amp;q=&amp;ved=0ahUKEwiswYGzi5fPAhVSVWMKHYoQDjQQpigILigC&amp;adurl=" id="ads-0-0-2-1-2"></a><a href="http://www.capitalone.com/credit-cards/compare/?filter=popular&amp;external_id=%7B_externalid%7D" id="vads-0-0-2-1-2" onmousedown="return google.arwt(this)">See Popular Cards</a></li>
    </ul>
Re:Google HTML/CSS Style Guide – Omit Optional Tags by scrollaway on Saturday September 17, 2016 @04:36PM (#12522334)
Well, yes, it's hypocritical. But that's from a different team. You don't need to look further than the styleguide to find contradictions: it's advising to omit optional tags in order to "save bytes", then it's advising to indent with spaces instead of tabs.

shrugs should just let minifiers do the job.

Re:Google HTML/CSS Style Guide – Omit Optional Tags by ahochhaus on Saturday September 17, 2016 @05:04PM (#12522440)
Google's standard template language (soy / closure-templates) does mininfy whitespace by default [1]. However, it does not omit optional tags. I think this is why the style guide is written as it is.

Still, I agree that both types of optimization / minification should be done by the tooling layer.

[1] https://developers.google.com/closure/templates/docs/concept...

Re:Google HTML/CSS Style Guide – Omit Optional Tags by jjgomo33 on Saturday September 17, 2016 @07:37PM (#12523111)
It doesn't advise only for saving bytes, but also for scannability, which is greatly enhanced following that advise.
Re:Google HTML/CSS Style Guide – Omit Optional Tags by ebbv on Saturday September 17, 2016 @03:43PM (#12522080)
Are we supposed to think this is too much HTML for one ad? Because I don't think it is.

A lot of it is URLs, and of course you have to have full URLs on an ad, you can't use relative.

As for the number of elements, there's quite a few divs but there's also more elements to an ad than people realize due to the built in reporting interface.

Sure a simple banner ad might be able to get away with only two HTML elements (an anchor tag and an image tag), but that image will end up being a lot more data than a text ad with as many elements as this one.

Re:Google HTML/CSS Style Guide – Omit Optional Tags by matt4077 on Saturday September 17, 2016 @05:26PM (#12522549)
To quote one URL http://www.googleadservices.com /pagead/aclk? sa=L&amp;ai=DChcSEwi36oSzi5fPAhWBh34KHQO2A0YYABAF &amp;ohost=www.google.com&amp; cid=CAASJORo9LOCMjoibKPv7gF6cak7OxiE3TtM_ tpkLykYWNps5wdfUw&amp;sig=AOD64_3sHUU366i 6dStUuQ_sGYCNCCiv9A&amp;q=&amp;ved=0ahUKE wiswYGzi5fPAhVSVWMKHYoQDjQQ0QwIJQ&amp;adurl="

Thats about 300 digits from an alphabet of 0-9a-zA-Z which my computer says allows for "NaN" unique combinations. They could shorten that by 95% percent and still give every atom a unique id.

... and thats just one URL. There are 4 or five more. For three lines of linked text.

Re:Google HTML/CSS Style Guide – Omit Optional Tags by onestone on Saturday September 17, 2016 @05:59PM (#12522703)
Such long Base64 URL parameters usually carry encrypted data. So they might be impossible to shorten.
Re:Google HTML/CSS Style Guide – Omit Optional Tags by Animats on Saturday September 17, 2016 @05:17PM (#12522499)
What does the first <a> tag do? It's empty and is not displayed. There's nothing inside it. What click triggers it?
Re:Google HTML/CSS Style Guide – Omit Optional Tags by leephillips on Saturday September 17, 2016 @05:43PM (#12522632)
It's possible that there is also a script that alters the markup after the page loads.
Re:Google HTML/CSS Style Guide – Omit Optional Tags by Animats on Saturday September 17, 2016 @06:58PM (#12522967)
No, that's extracted from the DOM using Firefox's DOM inspector.
Re:Google HTML/CSS Style Guide – Omit Optional Tags by raquo on Saturday September 17, 2016 @10:30PM (#12523649)
It could be manipulated onhover
Re:Google HTML/CSS Style Guide – Omit Optional Tags by Animats on Sunday September 25, 2016 @07:27PM (#12578025)
It doesn't take up space. You can't hover over it.
Re:Google HTML/CSS Style Guide – Omit Optional Tags by zeckalpha on Saturday September 17, 2016 @06:39PM (#12522892)
I've seen this sort of thing for fraud detection before. Given that they make money off of clicks, that seems important.
Re:Google HTML/CSS Style Guide – Omit Optional Tags by nip on Sunday September 18, 2016 @09:51AM (#12525287)
Most likely. It is sometimes also used with forms as an easy way to detect bots: an extra input with a display:none is used to filter out bots submissions.