According to the issue which added the test, the test intended that web driver
collapsing selection to end of the last editable text node at sending the text
do an editable element. However, it seems that GeckoDriver does not do it but
the test accidentally passed since `HTMLEditor` has collapsed selection to end
of last leaf node even if the node is not editable. Therefore, the test does
not check what the author expected enough (e.g., when there is another node
at end of the `<body>`, when there is a collapsed selection range outside
editor, when another editable element has focus).
Therefore, we can just mark the tests as known failures since we've not
explicitly support the behavior yet.
Differential Revision: https://phabricator.services.mozilla.com/D157777
It may be called even when there is no selection range and focused element.
However, it assumes that there is a selection range, and an editable element
has focus. Therefore, now, if there is an editing host and user tries to
do "Select All" without clicking somewhere before doing it, "Select All" does
nothing.
Differential Revision: https://phabricator.services.mozilla.com/D157409
They and their callees work with the result of `GetRoot()` which is the document
element or the body element. If the body is not editable, `Selection` should
not be updated in non-editable region nor `<br>` elements should not be
inserted in both non-focused editable elements and non-editable elements.
Therefore, they should run only when the document element or the `<body>`
element is editable.
To keep testing crashtests as reported, this patch makes tests which have
`contenteditable` except `<html>` and `<body>` initialize `Selection` as
what we've done. And clean up the tests for helping to port them to WPT
in the future (bug 1725850).
Differential Revision: https://phabricator.services.mozilla.com/D157408
It does different thing for `TextEditor` and `HTMLEditor`, and used almost
internally. Therefore, it should be implemented in the sub classes and
we should name them better.
Differential Revision: https://phabricator.services.mozilla.com/D157407
The method is enough simple, and uses bad cast from point of view of OOP.
Therefore, this patch make the sub classes implement the method only for each.
Differential Revision: https://phabricator.services.mozilla.com/D157406
nsTransferable was modified to prevent disk leakings when copying data
in private browsing mode with Bug 1123480.
However, the context is nullptr when it is initialized, so it still
leaks if PBM is enabled by default.
Our solution is to check the browser.privatebrowsing.autostart in this
condition.
Differential Revision: https://phabricator.services.mozilla.com/D157800
Basically, we need to detect a case if there is only scroll animations
which are not sampled because it goes back to before phase. If this
happens, we set ScrollToDelay to |mReason| in the returned value.
Without this patch, the visual result is intermittent because it
is possible that there are new animations arrived at the moment when
scrolling from active phase to before phase.
We don't have a test for after phase because we don't support end delay
for scroll animations now. However, although we set the adjusted fill, we may
still need this in the future so let's keep the check of after phase for now.
Differential Revision: https://phabricator.services.mozilla.com/D155108
Apply the usual HCM hover style to buttons in Firefox View, but also
override some of the custom properties for HCM so that Emily's patch for
bug 1790396 can use the same custom properties for feature callout hover
styles that we use in system content generally.
Differential Revision: https://phabricator.services.mozilla.com/D157364
Basically, we have to inavliadate the layout if AspectRatio gets changed.
In the test case, it's possible to retrieve the aspect-ratio from the
mapped attribute at the beginning. After the image gets loaded, we retrieve
the aspect-ratio from the image itself (i.e. natural aspect-ratio). Both
AspectRatio objects use different |mUseBoxSizing|s which have impact on
the calculation of the ratio-dependent size, so we have to trigger the
invalidation if the flag is changed, even if |mRatio| is the same.
It's a race condition, so the test case fails intermittently without this patch.
After applying this patch, we should always pass this reftest.
Differential Revision: https://phabricator.services.mozilla.com/D157763
This is in preparation of supporting multiple fragments, since we should
track each fragment size separately.
This patch should have no observable effect.
Differential Revision: https://phabricator.services.mozilla.com/D157640
This is in preparation of supporting multiple fragments, since we want
to track the logical sizes, and fragments might potentially have
different writing modes (but not sure if it can happen in practice).
This patch should have no observable effect.
Differential Revision: https://phabricator.services.mozilla.com/D157639