Created attachment 207303 [details] Summary of bug including test HTML/CSS and result images. Using [attribute=value] CSS selectors to customize specific elements which are referenced using custom attribute names (i.e. type=) results in inconsistent behavior for styling. I have attached example code as well as expected results for each example. The bug does not seem to appear in version of 6.0.5 of Safari shipped with Mac OS X 10.8.3. It does appear in the nightly build of WebKit r153022 (538+). These are the only two platforms I have tested the bug on.
<rdar://problem/14643850
Sigh. <rdar://problem/14643850>
is TYPE attribute supported in webkit code, because the attribute selectors are completely supported in webkit and since type is not the attribute of div tag it is not supported.
The type= attribute is only an example and no it is not part of the standard div. I have several websites and WebKit based applications on Mac OS that rely on the behavior described of using custom named attributes for identifying specific segments of the content as opposed to using id= values or other such methods. The behavior described in the bug only started happening recently which means earlier versions of WebKit supported the behavior fine. While not impossible to rewrite my own code to work around it, considering it works fine for all other popular web browsers, I figured it should be a known bug.
Hey Michael, as a workaround you may want to look into using data-* attributes. For example, using 'data-type' instead of 'type'. (This is the html5 way of doing custom attributes.) When I switched to 'data-type' in the attached tests the problem no longer manifested.
Looks like this style sharing bug: https://bugs.webkit.org/show_bug.cgi?id=139283 Note that those names are reserved, you really shouldn't use that with HTML. *** This bug has been marked as a duplicate of bug 139283 ***