Relative Content

Tag Archive for attributes

Should I mark what blocks mean in data-* attributes?

I was writing a webpage today with a comment after the start of every major section. Instead of using a comment, which comes with the bulgy <!-- --> syntax, could I instead put this in a data-* attribute? This would be more for me than anything else, so I don’t want to put it in an id or class, but it would also leave it open for userscripts to more easily parse the page.

Should I mark what blocks mean in data-* attributes?

I was writing a webpage today with a comment after the start of every major section. Instead of using a comment, which comes with the bulgy <!-- --> syntax, could I instead put this in a data-* attribute? This would be more for me than anything else, so I don’t want to put it in an id or class, but it would also leave it open for userscripts to more easily parse the page.

Accessing struct attribute: casting vs field name

I was just going over some kernel code, I noticed that rb->__rb_parent_color = (unsigned long)p | color; is kinda wired. The first field of a struct is accessed by casting the pointer and not by using the field name.