Skip to content

Commit

Permalink
added the new ":placeholder-shown" pseudo-class, needs tests and poss…
Browse files Browse the repository at this point in the history
…ibly adjustments
  • Loading branch information
dperini committed Apr 18, 2018
1 parent 4e18c3c commit 3758218
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/nwsapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
struct_2 = '(?:nth(?:-last)?(?:-child|-of-type))',
pseudo_1 = 'any-link|link|visited|target|active|focus|hover',
pseudo_2 = 'checked|disabled|enabled|selected|local-link(?:\\(\\d*\\))?|lang\\(([-\\w]{2,})\\)',
pseudo_3 = 'default|indeterminate|optional|required|valid|invalid|in-range|out-of-range|read-only|read-write',
pseudo_3 = 'default|indeterminate|optional|required|valid|invalid|in-range|out-of-range|read-only|read-write|placeholder-shown',
pseudo_4 = 'after|before|first-letter|first-line',
pseudo_5 = 'selection|backdrop|placeholder',
params_1 = '(?:\\(\\s?(even|odd|(?:[-+]?\\d*n?)(?:[-+]?\\d+)?)\\s?\\))',
Expand Down Expand Up @@ -1184,6 +1184,13 @@
'(/^range$/i.test(e.type)||e.getAttribute("min")||e.getAttribute("max"))' +
'){' + source + '}';
break;
case 'placeholder-shown':
source =
'if(' + N + '(' +
'e.hasAttribute("placeholder")&&' +
'!s.match(":focus",e)' +
')){' + source + '}';
break;
default:
emit('\'' + selector_string + '\' is not a valid selector' + x_error);
break;
Expand Down

0 comments on commit 3758218

Please sign in to comment.