Allow 'data-*' attributes in personal tools links
authorMoriel Schottlender <moriel@gmail.com>
Wed, 20 Jul 2016 21:15:01 +0000 (14:15 -0700)
committerMoriel Schottlender <moriel@gmail.com>
Fri, 22 Jul 2016 02:11:38 +0000 (19:11 -0700)
commit88f4eca6d8e6f86764ae9685b9e02ddc9843af12
tree4496363e5e48653ef3e337fd33f91aa25df3ec20
parent161e8669fe285b20d4534ca14a4ffdbe2271801a
Allow 'data-*' attributes in personal tools links

We are limiting the attributes that are read and rendered for the
personal toolbar, but there are cases -- especially as tools get
more and more complex -- for needing to supply and read more information.

The use case that led to this change is the need to style Notification
badges with values in ::before and ::after pseudo-elements; these
elements need to display some prefixed content, and the best (only)
way to do that in no-js mode, is to set it up in CSS to be read
out of an attribute (using attr( xxx ); ).

This means that we need to read a specific attribute from the element,
but the only attributes allowed were insufficient. Allowing for data-*
attributes seemed not only a good solution for this specific case,
but a good idea in general for future tools that are added and
manipulate the personal toolbar links - allowing for storing information
without polluting the DOM.

Bug: T115845
Change-Id: Ic666540d70de52f337f839da0518cb83a990f5fd
includes/skins/BaseTemplate.php