Raynos/DOM-shim

Fix bug in Opera 12 with <element>.dataset and Object.keys()

Opened this issue · 2 comments

CORE-44107: updating of <element>.dataset is frozen if apply Object.keys to it before any <element>.setAttribute.

Bug detection [Draft]:

var a = document.createElement('a');
Object.keys(a.dataset);
a.setAttribute("data-a", "");
if(Object.keys(a.dataset).length == 0)console.log("BUG")

Opera versions:

At least in Opera 11.61 and Opera 12.1256 Alpha

Note:

  1. for(var name in a.dataset){} instead of Object.keys(a.dataset) do the same behavior

How we can't fix this bug:

  1. Can't replace Object.keys due Note#1
  2. Can't fix document.createElement due it's not fixed existing elements

Does the same happen if we just touch a.dataset ? Like var a = document.createElement("a"), b = a.dataset; ?

Have you raised a ticket with the opera guys?