Q:

Why Phantomjs/Selenium remove duplicated attributes on single HTML element

Its seems that Phantomjs/selenium autmatically removes duplicate attributes on HTML elements.  Does this forced from HTML standard itself (any pointer?)or some implementation defacto of webkit/gecko? 

A:

That's in the HTML5 recommendation under section 8.1.2.3 Attributes:

There must never be two or more attributes on the same start tag whose names are an ASCII case-insensitive match for each other. 

This will also happen in other "standards-conform" browsers.