There is no need to have an anonymous function after we replace all `var` to `let`, now those variables won't pollute outer scopes.
Differential Revision: https://phabricator.services.mozilla.com/D20028
--HG--
extra : moz-landing-system : lando
In order to keep the local variable only visible inside the function scope, we should only use 'let' for those variables.
Differential Revision: https://phabricator.services.mozilla.com/D20027
--HG--
extra : moz-landing-system : lando
Remove those funcitons which are used to implement the previous way to move the cue box.
Differential Revision: https://phabricator.services.mozilla.com/D19610
--HG--
extra : moz-landing-system : lando
According to the spec 7.2.10, step1 to step10 (snap-to-line is true) and step1 to step2 (snap-to-line is flase) [1], we would adjust cue box's position depending on the algorithm.
The algorithm would calculate the cue box's top (or left) position depending on the writing direction, and move the box to the specific position.
However, if the cue box is overlapping with other cue boxes in the rendering area, we would still need to adjust its postion, which will be implemented in next patch.
[1]
https://w3c.github.io/webvtt/#ref-for-webvtt-cue-snap-to-lines-flag-12https://w3c.github.io/webvtt/#ref-for-webvtt-cue-snap-to-lines-flag-13
Differential Revision: https://phabricator.services.mozilla.com/D19609
--HG--
extra : moz-landing-system : lando
It's confused that we have both simpleBoxPosition object and BoxPosition object, we should only use one format to perform all box related operations.
Therefore, BoxPosition should be able to be initiaized by StyleBox, HTMLElement or BoxPosition.
In addition, as `right` and `bottom` can be calculated from other attributes, we remove these two attributes from BoxPosition, and use getter to get the correct value, which can reduce some unnessary modification when we changes the `height` or `width`. In order to implement a more readable getter, so we change `BoxPosition` to class-based.
Differential Revision: https://phabricator.services.mozilla.com/D22809
--HG--
extra : moz-landing-system : lando
When calculating font size, we should use the original bounding box as a reference, or it would cause incorrect font size scale.
Differential Revision: https://phabricator.services.mozilla.com/D20026
--HG--
extra : moz-landing-system : lando
If cue div is not a pseudo element, which means we don't have a default style applying on it. Therefore, we should set the default css style for it.
Differential Revision: https://phabricator.services.mozilla.com/D19864
--HG--
extra : moz-landing-system : lando
CueStyleBox should handle all css attributes, so it make more sense to adjust font size and style inside CueStyleBox.
Differential Revision: https://phabricator.services.mozilla.com/D19719
--HG--
extra : moz-landing-system : lando
Using class syntax for CueStyleBox made us easier to simplify the code and make it more readable.
Differential Revision: https://phabricator.services.mozilla.com/D19252
--HG--
extra : moz-landing-system : lando
There is no need to check whether the code is running on other browser, because we won't upstream the change back to the github repo, as this code uses a lots mozilla-only APIs.
Differential Revision: https://phabricator.services.mozilla.com/D19251
--HG--
extra : moz-landing-system : lando
This patch removes the XBL videocontrols binding and make <video>
to always use the UA Widget to generate controls.
DevTools tests that look for NAC is switched to use <input type=file>.
Differential Revision: https://phabricator.services.mozilla.com/D17571
--HG--
extra : moz-landing-system : lando
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8
This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:
ChromeUtils.import("resource://gre/modules/Services.jsm");
is approximately the same as the following, in the new model:
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs
This was done using the followng script:
https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16750
--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
With UA Widget, the videocontrols container is created lazily.
It won't be a problem for WebVTT.processCues() in vtt.jsm, so
TextTrackManager::UpdateCueDisplay() should not early return there, but pass
nullptr to it.
Differential Revision: https://phabricator.services.mozilla.com/D3667
--HG--
extra : moz-landing-system : lando
These stopped having any effect when we switched to ChromeUtils.generateQI,
which does not support automatic nsIClassInfo forwarding.
Differential Revision: https://phabricator.services.mozilla.com/D3707
--HG--
extra : rebase_source : 62a3690304ad7baa760c41eba777aa17b9af33f0
This prevents XBL binding from being attached, and create the Shadow Root to
host controls to be created by the script.
Shadow Root and the JS controls are lazily constructed when the controls
attribute is set.
Set nsVideoFrame as dynamic-leaf so it will ignore content child frames when
the controls are XBL anonymous content, and handles child frames from controls
in the Shadow DOM. The content nodes are still ignored since there is no
<slot>s in our Shadow DOM.
MozReview-Commit-ID: 3hk41iMa07n
--HG--
extra : rebase_source : f6f8a3facc9d83f5626cf5f3b4e3fa27438a8a8f
This also removes any redundant Ci.nsISupports elements in the interface
lists.
This was done using the following script:
acecb401b7/processors/chromeutils-generateQI.jsm
MozReview-Commit-ID: AIx10P8GpZY
--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
1. The default value of position is "auto".
2. follow the spec to parse the position value.
MozReview-Commit-ID: HO7sQ0go5A6
--HG--
extra : rebase_source : ab6066f260abac25d71a1c35511c5389444e000a
Insert space character when we concatenate the string in HEADER. Then split them by ASCII whitespace.
MozReview-Commit-ID: 12jov2hKK2E
--HG--
extra : rebase_source : ed9dd2c9f0fd64083311166424b47b10e6c9cbdc
Because we need the parseContent function return "document fragment" or "div" or "pseudo cue div" or "pseudo region div" ...
It's better to use enumerate instead boolean flag.
MozReview-Commit-ID: 5zmwXiYreqS
--HG--
extra : rebase_source : 57706a7fbf36b2c65fa93362dbfbf9a30d2d7418
We should call shouldCompute() function first, then remove all children of MediaElement.
MozReview-Commit-ID: 6623Xn6T4mx
--HG--
extra : rebase_source : 51c328d0b87b977aa2f2fefbc7ded150501985b2
"video.controls = false" will remove the binding of videocontrols which is a xul element.
In vtt.jsm, we need to remember the last show/hide status of videocontrols, then render cues when status changed.
MozReview-Commit-ID: 30rebAuqmxy
--HG--
extra : rebase_source : e011ec0679ab03071e01b91c124c5b72e481a8da