Title: [250399] trunk/Tools
Revision
250399
Author
[email protected]
Date
2019-09-26 14:51:35 -0700 (Thu, 26 Sep 2019)

Log Message

[results.webkit.org] Timeline support Image inner label
https://bugs.webkit.org/show_bug.cgi?id=202180

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/js/expectations.js:
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(.lengend>.item .dot img): support img symbol for lengend and dot
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent): Support user pass a Image object or a image url as inner label

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (250398 => 250399)


--- trunk/Tools/ChangeLog	2019-09-26 21:37:38 UTC (rev 250398)
+++ trunk/Tools/ChangeLog	2019-09-26 21:51:35 UTC (rev 250399)
@@ -1,3 +1,16 @@
+2019-09-26  Zhifei Fang  <[email protected]>
+
+        [results.webkit.org] Timeline support Image inner label
+        https://bugs.webkit.org/show_bug.cgi?id=202180
+
+        Reviewed by Jonathan Bedard.
+
+        * resultsdbpy/resultsdbpy/view/static/js/expectations.js:
+        * resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
+        (.lengend>.item .dot img): support img symbol for lengend and dot
+        * resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
+        (Timeline.CanvasSeriesComponent): Support user pass a Image object or a image url as inner label
+
 2019-09-26  Chris Dumez  <[email protected]>
 
         Stop using testRunner.overridePreference() to turn on Page Cache

Modified: trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/expectations.js (250398 => 250399)


--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/expectations.js	2019-09-26 21:37:38 UTC (rev 250398)
+++ trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/expectations.js	2019-09-26 21:51:35 UTC (rev 250399)
@@ -93,10 +93,15 @@
     timedout: 'TIMEOUT',
     crashed: 'CRASH',
 }
+const timeoutImage = new Image();
+timeoutImage.src = '';
+timeoutImage.toString = function () {
+    return this.outerHTML;
+}
 Expectations.symbolMap = {
     success: '✓',
     failed: '𝖷',
-    timedout: '⎋',
+    timedout: timeoutImage,
     crashed: '!',
 }
 

Modified: trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/css/webkit.css (250398 => 250399)


--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/css/webkit.css	2019-09-26 21:37:38 UTC (rev 250398)
+++ trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/css/webkit.css	2019-09-26 21:51:35 UTC (rev 250399)
@@ -592,6 +592,7 @@
   padding: 0;
   margin: 0 8px;
   background-color: var(--greyDark);
+  position: relative;
 }
 
 .dot.blink {
@@ -629,6 +630,16 @@
   margin-top: 1px;
 }
 
+.dot img, .dot.small img {
+    width: var(--tinySize);
+    height: var(--tinySize);
+    position: absolute;
+    top: calc((var(--smallSize) - var(--tinySize)) / 2);
+    left: calc((var(--smallSize) - var(--tinySize)) / 2);
+    padding: 0;
+    margin: 0;
+}
+
 .dot.medium {
   font-size: var(--smallSize)
   width: var(--mediumSize);
@@ -640,6 +651,16 @@
   padding-top: 3px;
 }
 
+.dot.medium img {
+    width: var(--smallSize);
+    height: var(--smallSize);
+    position: absolute;
+    top: calc((var(--mediumSize) - var(--smallSize)) / 2);
+    left: calc((var(--mediumSize) - var(--smallSize)) / 2);
+    padding: 0;
+    margin: 0;
+}
+
 .dot.large {
   font-size: var(--mediumSize);
   width: var(--largeSize);
@@ -651,6 +672,16 @@
   padding-top: 4px;
 }
 
+.dot.large img {
+    width: var(--mediumSize);
+    height: var(--mediumSize);
+    position: absolute;
+    top: calc((var(--largeSize) - var(--mediumSize)) / 2);
+    left: calc((var(--largeSize) - var(--mediumSize)) / 2);
+    padding: 0;
+    margin: 0;
+}
+
 .dot.success {
   background-color: var(--greenLight);
 }
@@ -2167,6 +2198,15 @@
   user-select: none;
   cursor: default;
 }
+.lengend>.item .dot img {
+    width: var(--tinySize);
+    height: var(--tinySize);
+    position: absolute;
+    top: calc((var(--smallSize) - var(--tinySize)) / 2);
+    left: calc((var(--smallSize) - var(--tinySize)) / 2);
+    padding: 0;
+    margin: 0;
+}
 .timeline.lengend>.item .dot::before{
   left: calc(0px - var(--tinySize));
   width: var(--tinySize);

Added: trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/icons/clock.svg (0 => 250399)


--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/icons/clock.svg	                        (rev 0)
+++ trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/icons/clock.svg	2019-09-26 21:51:35 UTC (rev 250399)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns:xl="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="-1147 -663 228 228" width="228" height="228">
+    <g fill="none" stroke="none" stroke-dasharray="none" stroke-opacity="1" fill-opacity="1">
+        <g id="clock_base">
+            <circle cx="-1033.25" cy="-549.25" r="98.7501577928122" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="30"/>
+        </g>
+        <g id="clock_hand">
+            <line x1="-1033.25" y1="-549.25" x2="-1033.5" y2="-612" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="21"/>
+            <line x1="-1033.25" y1="-549.25" x2="-1061.5" y2="-517" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="21"/>
+        </g>
+    </g>
+</svg>

Modified: trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js (250398 => 250399)


--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js	2019-09-26 21:37:38 UTC (rev 250398)
+++ trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js	2019-09-26 21:51:35 UTC (rev 250399)
@@ -279,8 +279,18 @@
             });
             colorBatchRender.addSeq(color, (context, color) => {
                 context.arc(x + dotMargin + useRadius, baselineY, useRadius, 0, 2 * Math.PI);
-                if (typeof innerLabel === "number" || typeof innerLabel === "string") {
+                if (innerLabel instanceof Image || typeof innerLabel === "string" && (innerLabel.endsWith('.svg') || innerLabel.endsWith('.png') || innerLabel.endsWith('.jpg') || innerLabel.endsWith('.jpeg'))) {
+                    let image = innerLabel;
+                    if (typeof innerLabel === "string") {
+                        image = new Image();
+                        image.src = ""
+                    }
+                    const image_padding = useRadius - fontSize / 2;
                     drawLabelsSeqs.push(() => {
+                        context.drawImage(image, x + dotMargin + image_padding, y + image_padding, fontSize, fontSize);
+                    });
+                } else if (typeof innerLabel === "number" || typeof innerLabel === "string") {
+                    drawLabelsSeqs.push(() => {
                         // Draw the inner label
                         const innerLabelSize = context.measureText(innerLabel);
                         const fontHeight = innerLabelSize.fontBoundingBoxAscent + innerLabelSize.fontBoundingBoxDescent;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to