Improve test freshness page interaction experience.
[WebKit.git] / Websites / perf.webkit.org / public / v3 / components / base.js
index 42ed8fe..1fd79e0 100644 (file)
@@ -154,7 +154,7 @@ class ComponentBase extends CommonComponentBase {
 
         let content;
         let stylesheet;
 
         let content;
         let stylesheet;
-        if (!thisClass._parsed) {
+        if (!thisClass.hasOwnProperty('_parsed') || !thisClass._parsed) {
             thisClass._parsed = true;
 
             const contentTemplate = thisClass['contentTemplate'];
             thisClass._parsed = true;
 
             const contentTemplate = thisClass['contentTemplate'];
@@ -249,12 +249,14 @@ class ComponentBase extends CommonComponentBase {
         customElements.define(name, elementClass);
     }
 
         customElements.define(name, elementClass);
     }
 
-    createEventHandler(callback) { return ComponentBase.createEventHandler(callback); }
-    static createEventHandler(callback)
+    createEventHandler(callback, options={}) { return ComponentBase.createEventHandler(callback, options); }
+    static createEventHandler(callback, options={})
     {
         return function (event) {
     {
         return function (event) {
-            event.preventDefault();
-            event.stopPropagation();
+            if (!('preventDefault' in options) || options['preventDefault'])
+                event.preventDefault();
+            if (!('stopPropagation' in options) || options['stopPropagation'])
+                event.stopPropagation();
             callback.call(this, event);
         };
     }
             callback.call(this, event);
         };
     }