To reduce non-neccesary input, we can always capture `this` and print the address in the log, and use same log level for all of them.
Differential Revision: https://phabricator.services.mozilla.com/D31559
--HG--
extra : moz-landing-system : lando
There are too many `self` used in the lambda, we can just capture `this` to remove redudant `self`.
Differential Revision: https://phabricator.services.mozilla.com/D31558
--HG--
extra : moz-landing-system : lando
There are two related problems this patch is trying to address. The first, and
simpler, one is bug 1553436: there are websites that use existing variables and
functions named "u2f" and adding a non-replaceable readonly property with that
name on Window breaks them. The fix for this is straightforward: mark the
property [Replaceable].
The second problem, covered by bug 1551282, involves sites that use the Google
U2F polyfill. The relevant parts of that polyfill look like this:
'use strict';
var u2f = u2f || {};
u2f.register = some_function_that_only_works_right_in_Chrome;
u2f.sign = some_function_that_only_works_right_in_Chrome;
The failure mode for that code before this fix is that the assignment to "u2f"
throws because it's a readonly property and we're in strict mode, so any code
the page concatenates in the same file after the polyfill does not get run.
That's what bug 1551282 is about. The [Replaceable] annotation fixes that
issue, because now the polyfill gets the value of window.u2f and then redefines
the property (via the [Replaceable] setter) to be a value property with that
value. So far, so good.
But then we need to prevent the sets of u2f.register
and u2f.sign from taking effect, because if they are allowed to happen, the
actual sign/register functionality on the page will not work in Firefox. We
can't just make the properties readonly, because then the sets will throw due
to being in strict mode, and we still have bug 1551282. The proposed fix is to
make these accessor properties with a no-op setter, which is exactly what
[LenientSetter] gives us.
The rest of the patch is just setting up infrastructure for generating the
normal bits we would generate if "sign" and "register" were methods and using
that to create the JSFunctions at the point when the getter is called. The
JSFunctions then get cached on the u2f instance object.
Differential Revision: https://phabricator.services.mozilla.com/D32357
--HG--
extra : moz-landing-system : lando
The idea is that we should only generate concreate-binding (wrap methods, etc)
machinery for an interface by default if we have reason to expect that the
interface is used as the primary interface for some objects. Two clear signals
that would indicate that are the interface being a leaf interface (with no
descendants) and the interface having a constructor. Other cases would require
a 'concrete' annotation in Bindings.conf.
Differential Revision: https://phabricator.services.mozilla.com/D32208
--HG--
extra : moz-landing-system : lando
This should keep people from marking things concrete unnecessarily just so
their example-generated WrapObject works.
Differential Revision: https://phabricator.services.mozilla.com/D32207
--HG--
extra : moz-landing-system : lando
As a plus this gives us an API we could use if we ever need to rotate the keys
at runtime.
Differential Revision: https://phabricator.services.mozilla.com/D32335
--HG--
extra : moz-landing-system : lando
I was clearly trying to do that in bug 882653 part 3 and failed to. Our
current behavior of passing two args to this error message (which only takes
one arg) is silly, and the only thing that makes it at all sane is that we only
use it in class hooks, which can never have the wrong sort of object, so it's
unreached code.
The comment cleanup is just to make the role of CGAbstractBindingMethod. and
the validity of the changes to it, clearer.
Differential Revision: https://phabricator.services.mozilla.com/D32478
--HG--
extra : moz-landing-system : lando
There are two related problems this patch is trying to address. The first, and
simpler, one is bug 1553436: there are websites that use existing variables and
functions named "u2f" and adding a non-replaceable readonly property with that
name on Window breaks them. The fix for this is straightforward: mark the
property [Replaceable].
The second problem, covered by bug 1551282, involves sites that use the Google
U2F polyfill. The relevant parts of that polyfill look like this:
'use strict';
var u2f = u2f || {};
u2f.register = some_function_that_only_works_right_in_Chrome;
u2f.sign = some_function_that_only_works_right_in_Chrome;
The failure mode for that code before this fix is that the assignment to "u2f"
throws because it's a readonly property and we're in strict mode, so any code
the page concatenates in the same file after the polyfill does not get run.
That's what bug 1551282 is about. The [Replaceable] annotation fixes that
issue, because now the polyfill gets the value of window.u2f and then redefines
the property (via the [Replaceable] setter) to be a value property with that
value. So far, so good.
But then we need to prevent the sets of u2f.register
and u2f.sign from taking effect, because if they are allowed to happen, the
actual sign/register functionality on the page will not work in Firefox. We
can't just make the properties readonly, because then the sets will throw due
to being in strict mode, and we still have bug 1551282. The proposed fix is to
make these accessor properties with a no-op setter, which is exactly what
[LenientSetter] gives us.
The rest of the patch is just setting up infrastructure for generating the
normal bits we would generate if "sign" and "register" were methods and using
that to create the JSFunctions at the point when the getter is called. The
JSFunctions then get cached on the u2f instance object.
Differential Revision: https://phabricator.services.mozilla.com/D32357
--HG--
extra : moz-landing-system : lando
We now also only access the document when the state is
nsIWebProgress::STATE_STOP. The comments in the previous code indicated that
touching the document inside the event handler when the state is not STATE_STOP
would result in the content creating a new about:blank document to retrieve the
values from. However, it then went on to do this in another location, causing a
document to be created whenever we received an onStateChange event. This should
no longer occur.
Differential Revision: https://phabricator.services.mozilla.com/D28125
--HG--
extra : moz-landing-system : lando
The BrowserParent's IPC receive methods for nsIWebProgress events in the
BrowserChild were all doing the same set up to ensure they had the correct
state to process them. This has now been refactored out into a single method.
Differential Revision: https://phabricator.services.mozilla.com/D30730
--HG--
extra : moz-landing-system : lando
Before the WebProgress event handlers started migrating to C++, the parent
process would only receive WebProgress events after the child process had
finished loading the WebProgressChild script. Now that listeners are registered
much earlier (before the BrowserChild has finished setting up its frame
scripts), the BrowserParent would receive WebProgress events that were
heretofore not received unless the BrowserChild was *very* careful about when
it sent the IPC messages.
However, even while being very careful, the OnStateChange event handler would
always fire events for initial about:blank loads that break a lot of unit
tests. Before porting that event, we are now ensuring that the WebProgressChild
has finished loading before the BrowserChild will send IPC messages for these
events to the BrowserParent.
Differential Revision: https://phabricator.services.mozilla.com/D30252
--HG--
extra : moz-landing-system : lando
It's dead code because we never create MIDIPort objects directly,
and all subclasses override WrapObject.
Differential Revision: https://phabricator.services.mozilla.com/D32206
--HG--
extra : moz-landing-system : lando
It's dead code because we never create AuthenticatorResponse objects directly,
and all subclasses override WrapObject.
Differential Revision: https://phabricator.services.mozilla.com/D32205
--HG--
extra : moz-landing-system : lando
It's dead code, because ReportBody is an abstract class and subclasses override
WrapObject.
Differential Revision: https://phabricator.services.mozilla.com/D32204
--HG--
extra : moz-landing-system : lando
It's dead code, because we never create PerformanceEntry objects directly and
subclasses override WrapObject.
Differential Revision: https://phabricator.services.mozilla.com/D32203
--HG--
extra : moz-landing-system : lando
It's dead code, because AudioScheduledSourceNode is an abstract class and all
subclasses override WrapObject.
Differential Revision: https://phabricator.services.mozilla.com/D32202
--HG--
extra : moz-landing-system : lando
The only different part is to resolve intrinsic image size. This patch
implements explicit requirements of the spec, but an edge case is tricky.
It's not clear per spec what the intrinsic image size is for an SVG
without explicit width/height, something like:
<svg>
<image href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><rect width='40' height='90' fill='red' /></svg>"/>
</svg>
Chrome treats the intrinsic size of the href svg as the default size of
a replaced element (300x150), our image/VectorImage.cpp doesn't resolve
size in this case.
We can handle this particular case in some seperate bug if necessary, I think.
Differential Revision: https://phabricator.services.mozilla.com/D32415
--HG--
extra : moz-landing-system : lando
The channel might not be created correctly if we pass invaild url (eg. "invalid://url"), we should handle this error.
Differential Revision: https://phabricator.services.mozilla.com/D32038
--HG--
extra : moz-landing-system : lando
Refactor those tests' structure in order to make them more readable, and add the comment to show what the test purpose is for each test.
Differential Revision: https://phabricator.services.mozilla.com/D31914
--HG--
extra : moz-landing-system : lando
This patch do two things in order to trigger loading for track element and wait for correct event to check track's and cues' status after loading finished.
(1) listen track element's load event
There are some tests listening video's loadedmetadata, but it's wrong. The loading process of media element and track element are completely non-related.
If you would like to check track element's status, you should wait for track element's load event.
(2) enable track explictly
If the text track which has default attribute is added to the media element before the media element starts running automatic track selection [1], then it would be enable by the media element.
Otherwise, you have to enable track explicitly by changing its track mode.
[1] https://html.spec.whatwg.org/multipage/media.html#sourcing-out-of-band-text-tracks:text-track-7
Differential Revision: https://phabricator.services.mozilla.com/D31913
--HG--
extra : moz-landing-system : lando
Create test elements in HTML beforehand, which can remove unnecessary JS code and make test cleaner.
Differential Revision: https://phabricator.services.mozilla.com/D31911
--HG--
extra : moz-landing-system : lando
To reduce non-neccesary input, we can always capture `this` and print the address in the log, and use same log level for all of them.
Differential Revision: https://phabricator.services.mozilla.com/D31559
--HG--
extra : moz-landing-system : lando
There are too many `self` used in the lambda, we can just capture `this` to remove redudant `self`.
Differential Revision: https://phabricator.services.mozilla.com/D31558
--HG--
extra : moz-landing-system : lando
The relevant definition in the spec;
https://drafts.csswg.org/css-device-adapt/#min-scale-max-scale
Before this change, if both of initial-scale and maximum-scale are negative,
both values are clamped to 0.25. Whereas with this change, negative scale
values are treated as if it's not specified so that initial-scale value is
automatically calculated based on the layout viewport size.
negative-initial-and-maximum-scale.html is a test case for the case.
Also with this change, initial-scale values are going to be clamped to the
range [0.25, 10] during parsing it so that initial-scale-0.html and
initial-scale-100.html need to be modified, now the former is scaled by 0.25x,
the latter is scaled by 10x.
(Before this change, initial-scale=0 and initial-scale=100 were treated as
invalid scale values in nsViewportInfo::ConstrainViewportValues[1])
[1] https://searchfox.org/mozilla-central/rev/6c9f60f8cc064a1005cd8141ecd526578ae9da7a/dom/base/nsViewportInfo.cpp#15,19
Differential Revision: https://phabricator.services.mozilla.com/D32098
--HG--
extra : moz-landing-system : lando
The channel might not be created correctly if we pass invaild url (eg. "invalid://url"), we should handle this error.
Differential Revision: https://phabricator.services.mozilla.com/D32038
--HG--
extra : moz-landing-system : lando
Adding tests to ensure that when cues with overlapping times, the one with earlier end timestamp should disappear when the media time reaches its end time. In this test, we have two cues with overlapping time, when the video starts, both cues should be displayed. When the time passes 1 seconds, the first cue should disappear and the second cues should be still displayed.
Differential Revision: https://phabricator.services.mozilla.com/D31172
--HG--
extra : moz-landing-system : lando
If the amount of cues which are going to be displayed is different from the one we displayed last time, we have to compute cues' display state again because cue's position might be affected by other cues.
Differential Revision: https://phabricator.services.mozilla.com/D31170
--HG--
extra : moz-landing-system : lando
We can actually let `processCue()` to handle rendering cues or cleaning displayed cues, no need to use another way to clear the cue.
The advantages is to make the code cleaner and easier to read, now we just need to know JS side would handle all rendering stuffs for us. We don't need to have different behavior when there is no showing cue.
The way we clear displayed cues are intuitive, we would remove all child nodes under the overlay, which are used to display cues.
Differential Revision: https://phabricator.services.mozilla.com/D31171
--HG--
extra : moz-landing-system : lando
Refactor those tests' structure in order to make them more readable, and add the comment to show what the test purpose is for each test.
Differential Revision: https://phabricator.services.mozilla.com/D31914
--HG--
extra : moz-landing-system : lando
This patch do two things in order to trigger loading for track element and wait for correct event to check track's and cues' status after loading finished.
(1) listen track element's load event
There are some tests listening video's loadedmetadata, but it's wrong. The loading process of media element and track element are completely non-related.
If you would like to check track element's status, you should wait for track element's load event.
(2) enable track explictly
If the text track which has default attribute is added to the media element before the media element starts running automatic track selection [1], then it would be enable by the media element.
Otherwise, you have to enable track explicitly by changing its track mode.
[1] https://html.spec.whatwg.org/multipage/media.html#sourcing-out-of-band-text-tracks:text-track-7
Differential Revision: https://phabricator.services.mozilla.com/D31913
--HG--
extra : moz-landing-system : lando
Create test elements in HTML beforehand, which can remove unnecessary JS code and make test cleaner.
Differential Revision: https://phabricator.services.mozilla.com/D31911
--HG--
extra : moz-landing-system : lando
To reduce non-neccesary input, we can always capture `this` and print the address in the log, and use same log level for all of them.
Differential Revision: https://phabricator.services.mozilla.com/D31559
--HG--
extra : moz-landing-system : lando
There are too many `self` used in the lambda, we can just capture `this` to remove redudant `self`.
Differential Revision: https://phabricator.services.mozilla.com/D31558
--HG--
extra : moz-landing-system : lando