Bug 1571908 - part6 : add debug logs. r=heycam
authorAlastor Wu <alwu@mozilla.com>
Wed, 21 Aug 2019 07:10:27 +0000
changeset 489133 41ac8d98d5c7fc53832738c66e1661c56d50eb23
parent 489132 62ef7c15917a09e8194ecea263f2fcb2a334aa80
child 489134 2ae319789645bbc606930c683bd1be8ba5194d11
push id36465
push userdvarga@mozilla.com
push dateWed, 21 Aug 2019 16:47:43 +0000
treeherdermozilla-central@4ab60925635c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1571908
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1571908 - part6 : add debug logs. r=heycam Add debug logs to show which mode we're using to adjust cue's position. Differential Revision: https://phabricator.services.mozilla.com/D42434
dom/media/webvtt/vtt.jsm
--- a/dom/media/webvtt/vtt.jsm
+++ b/dom/media/webvtt/vtt.jsm
@@ -921,16 +921,17 @@ XPCOMUtils.defineLazyPreferenceGetter(th
 
     // Spec 7.2.10, adjust the positions of boxes according to the appropriate
     // steps from the following list. Also, we use offsetHeight/offsetWidth here
     // in order to prevent the incorrect positioning caused by CSS transform
     // scale.
     const fullDimension = isWritingDirectionHorizontal ?
       containerBox.height : containerBox.width;
     if (cue.snapToLines) {
+      LOG(`Adjust position when 'snap-to-lines' is true.`);
       // The step is the height or width of the line box. We should use font
       // size directly, instead of using text box's width or height, because the
       // width or height of the box would be changed when the text is wrapped to
       // different line. Ex. if text is wrapped to two line, the height or width
       // of the box would become 2 times of font size.
       let step = styleBox.getFirstLineBoxSize();
       if (step == 0) {
         return;
@@ -1009,16 +1010,17 @@ XPCOMUtils.defineLazyPreferenceGetter(th
           top: getPercentagePosition(box.top, fullDimension),
         });
       } else {
         styleBox.applyStyles({
           left: getPercentagePosition(box.left, fullDimension),
         });
       }
     } else {
+      LOG(`Adjust position when 'snap-to-lines' is false.`);
       // (snap-to-lines if false) spec 7.2.10.1 ~ 7.2.10.2
       if (cue.lineAlign != "start") {
         const isCenterAlign = cue.lineAlign == "center";
         const movingDirection = isWritingDirectionHorizontal ? "-y" : "-x";
         if (isWritingDirectionHorizontal) {
           box.move(movingDirection, isCenterAlign ? box.height : box.height / 2);
         } else {
           box.move(movingDirection, isCenterAlign ? box.width : box.width / 2);