Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
:enabled and :disabled don't consider an option's containing optgroup #382
Comments
added a commit
to gibson042/sizzle
that referenced
this issue
Jul 30, 2016
gibson042
referenced this issue
Jul 30, 2016
Closed
Selector: Properly implement :enabled/:disabled for select contents #384
gibson042
closed this
in
4f19ae6
Aug 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gibson042 commentedJul 11, 2016
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