LeaVerou/dabblet — Issue #7: Attribute selector bug in Safari
Author: kizu
Created: 2011-12-11 14:28:12+00:00
State: open

It seems that since the `~` and `+` selector bugs are fixed in webkit, the attribute selector one hadn't (or changed only later, so it works ok in Chrome).

The problem is that Safari don't update the styles for selectors with attributes in them, like `[data-view="split"]`. This causes at least two seriuos problems now:

1. Changing the View modes don't work.

2. Changing Tabs (CSS/HTML/Result) don't work.

One of the ways to fix it, is to add the bugfixing animation to the element, for whom you use attribute selector, so, adding

@-webkit-keyframes bugfix { from { padding: 0; } to { padding: 0; } }
body {
-webkit-animation: bugfix infinite 1s;
}

fixes the problem. However, this bugfix could cause some drop in performance, so it should be tested a bit.

(I've tested in Safari 5.1.1, there is a problem and the suggested fix fixes it.)