Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up:enabled and :disabled don't consider an option's containing optgroup #382
Comments
gibson042
added a commit
to gibson042/sizzle
that referenced
this issue
Jul 30, 2016
SemVer patch Fixes jquerygh-382 Ref jquery/jquery#3224 Ref 7999a01
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref jquery/jquery#3224
Ref 7999a01
Include citations to:
<label>and<option>and<legend>also haveformIDL attributes).Also note that
:enabledand:disabledcan only match elements from exactly the same set, which includes three that aren't listed form-associated elements and don't haveformIDL attributes:<optgroup>,<option>, and<menuitem>. All three havelabelIDL attributes (as do the non-disableable<menu>and<track>), but none of them need to consider ancestor fieldsets (although<option>does need to consider parent<optgroup>).The bottom line is that boolean
disabledis a good indicator, excepting two special cases where an element can match:disabledinstead of:enableddespite having.disabled === false:<option>(the only element having bothlabelandformIDL attributes) with a disabled parent<optgroup>(which also haslabel)formIDL attribute and a disabled fieldset ancestor whose legend is not also an ancestorIt is interesting to observe that special processing is required if and only if
disabledisfalseandformexists. I think the resulting logic will look like