Finally, this patch makes `HTMLEditor::DoInsertHTMLWithContext()` stop using
array of `nsINode`.
Differential Revision: https://phabricator.services.mozilla.com/D61984
--HG--
extra : moz-landing-system : lando
I suggested the compat_mode bit in D62923 but it was somehow only applied to one
of the branches.
Also rustfmt the code for consistency, and add a local alias.
Differential Revision: https://phabricator.services.mozilla.com/D63015
--HG--
extra : moz-landing-system : lando
For guaranteeing the meaning of `aArrayOfListAndTableRelatedElements`,
`ReplaceOrphanedStructure()` should call
`CollectListAndTableRelatedElementsAt()` by itself rather than taking as
a parameter.
Then, what it does becomes a little bit clearer. Therefore, this patch renames
`ReplaceOrphanedStructure()` to `EnsureBeginsOrEndsWithValidContent()` and
`DiscoverPartialListsAndTables()` to `GetMostAncestorListOrTableElement()`,
and adds a lot of comments.
As far as I've tested by my hand, the behavior is not changed even though
it's really buggy in some cases. We should fix them after writing automated
tests in another bug.
Differential Revision: https://phabricator.services.mozilla.com/D61983
--HG--
extra : moz-landing-system : lando
For guaranteeing the meaning of list or `<table>` element in
`ReplaceOrphanedStructure()`, it should call `DiscoverPartialListsAndTables()`.
Then, their meaning becomes clearer than coming from its parameter.
Differential Revision: https://phabricator.services.mozilla.com/D61982
--HG--
extra : moz-landing-system : lando
I think this is ready. We see no late write checks coming in from this
period in telemetry, and it's early in the cycle, so I think the best
time to enable this is now.
Differential Revision: https://phabricator.services.mozilla.com/D62456
--HG--
extra : moz-landing-system : lando
The text track list should not exceed the size of the video controls. Because it is positioned
absolutely, and because the height of the video is not known in the CSS, the only way to
ensure the list's height does not exceed the video's height is to set a 'top' value as well as
a 'bottom' one.
Unfortunately, that then means that if the list is quite small and the video quite tall, the
popup becomes way too large.
To avoid this, I've added another level of nesting, and used flexbox to align the actual list
to the bottom of the container for the list.
Differential Revision: https://phabricator.services.mozilla.com/D62452
--HG--
extra : moz-landing-system : lando
In these patches, we know that there are a lot of helper methods to fix node
list which is created by `SubtreeContentIterator` and will be inserted into
the editor's DOM tree, and they are not used by other places. So, we can
encapsulate them into a stack only class for making their usage clearer.
Differential Revision: https://phabricator.services.mozilla.com/D61981
--HG--
extra : moz-landing-system : lando
So that we can generate nsImageFrame for lazy load image elements in the first
place.
Differential Revision: https://phabricator.services.mozilla.com/D61942
--HG--
rename : layout/reftests/image/moz-broken-matching-1.html => layout/reftests/image/moz-broken-matching-lazy-load.html
extra : moz-landing-system : lando
For backward compatibility, `Document::EditingStateChanged()` calls
`HTMLEditor::BeginingOfDocument()` to initialize selection when the document
becomes editable first time. However, it checks whether
`Document::mEditingState` was ``EditingState::eOff` or not. This looks enough,
but not so because `Document::MaybeEditingStateChanged()` calls it
asynchronously if `contenteditable` element appears at not safe to run script.
Therefore, this patch makes it check `Document::mContentEditableCount` value
which is modified synchronously from `Element::AfterSetAttr()` (additionally,
this makes it check whether there is at least a range in normal selection too,
though).
Differential Revision: https://phabricator.services.mozilla.com/D62814
--HG--
extra : moz-landing-system : lando
We should port `editor/libeditor/tests/test_bug622371.html` to WPT. It was
written for compatibility issue with CKEditor 9 years ago and Gecko and
Blink behave as exactly same. Only Safari normalize the selection into the
end of the text node, but Safari also does not change selection at turning
on/off `designMode` too. Therefore, all browser engines have implicit
agreement at least that selection shouldn't be changed at changing
`designMode`.
Differential Revision: https://phabricator.services.mozilla.com/D62813
--HG--
extra : moz-landing-system : lando
It's not clear to me this ever worked before either, I don't think the logic
before my patch was sound before.
But oh well. This should work, gotta add a test for it.
Differential Revision: https://phabricator.services.mozilla.com/D62777
--HG--
extra : moz-landing-system : lando
After this change we can restrict contentSecurityPolicyAllows callbacks to just strings, because everything
else is excluded before calling that callback.
Differential Revision: https://phabricator.services.mozilla.com/D62794
--HG--
extra : moz-landing-system : lando