If you want to use Modernizr, you can add the following user test:
Modernizr.testStyles( '#modernizr, x::-webkit-search-cancel-button { width: 9px; }', function(elem, rule){ Modernizr.addTest('search-reset', elem.offsetWidth == 9); });
See here: http://dabblet.com/result/gist/1725982
By doing this, you can check if the browser supports the -webkit-search-cancel-button pseudo-element, so you can rely on it. However, you can still monitor the progress of other browsers, so you can add an appropriate selector to the Modernizr test.
It is satisfactory that you cannot execute this function because this element is not standardized and is only webkit.
source share