Граф коммитов

10162 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 19c23d725f Bug 1659276 - Make `AutoPlaceholderBatch` choose whether do or do not `ScrollSelectionIntoView` r=m_kato
The root cause of this bug is a bug of async `ScrollSelectionIntoView` that
is what it won't be canceled even if web app changes scroll position with
any API.  Fixing it is really risky and this bug affects an existing website.
Therefore, this patch makes the constructors of `AutoPlaceholderBatch` take
whether do or do not `ScrollSelectionIntoView` when it's destructed.  And
makes `HTMLEditor::SetInlinePropertyAsAction()` not request
`ScrollSelectionIntoView` for taking back the traditional behavior.

Note that this patch does not make it an optional argument because it's hard to
guess that it'll run `ScrollSelectionIntoView` automatically.

Differential Revision: https://phabricator.services.mozilla.com/D87819
2020-08-24 06:39:50 +00:00
Chris Fronk 3b7a1daba2 Bug 1647536 - Support ref counted pointers in nsDeque r=froydnj
Adds a new specialization of nsDeque, nsRefPtrDeque for use with
reference counted pointers.

Differential Revision: https://phabricator.services.mozilla.com/D84766
2020-08-22 15:47:59 +00:00
Simon Giesecke cfd7d0ea9c Bug 1659923 - Avoid unnecessary copies around Base64Encode. r=xpcom-reviewers,necko-reviewers,froydnj,valentin
This also adds some more variants of Base64Encode and Base64EncodeAppend.

Differential Revision: https://phabricator.services.mozilla.com/D87559
2020-08-19 17:45:16 +00:00
Masayuki Nakano 37a2794486 Bug 1655388 - part 7: Split off the check whether `<hr>` element should be removed or not from `HTMLEditor::HandleDeleteCollapsedSelectionAtHRElement()` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D87035
2020-08-19 06:48:31 +00:00
Masayuki Nakano d84d4847b0 Bug 1655388 - part 6: Get rid of unnecessary arguments of `HTMLEditor::HandleDeleteCollapsedSelectionAtAtomicContent()` and `HTMLEditor::HandleDeleteCollapsedSelectionAtHRElement()` r=m_kato
Depends on D87033

Differential Revision: https://phabricator.services.mozilla.com/D87034
2020-08-19 05:39:36 +00:00
Masayuki Nakano c9bee9126b Bug 1655388 - part 5: Split the special handling for `<hr>` element off from `HTMLEditor::HandleDeleteCollapsedSelectionAtAtomicContent()` r=m_kato
Depends on D87032

Differential Revision: https://phabricator.services.mozilla.com/D87033
2020-08-19 02:15:01 +00:00
Masayuki Nakano 416bf2f5ad Bug 1655388 - part 4: Get rid of `WhiteSpaceVisiblityKeeper::PrepareToDeleteNode()` r=m_kato
Now, the new method is only user of it.  So, we can get rid of it.

Depends on D87031

Differential Revision: https://phabricator.services.mozilla.com/D87032
2020-08-18 23:03:08 +00:00
Masayuki Nakano e844854c69 Bug 1655388 - part 3: Make `HTMLEditor::HandleDeleteSelectionInternal()` use the new method when it removes an invisible `<br>` element r=m_kato
Even though it hasn't normalize white-spaces before invisible `<br>` element,
it needs to do it for making them visible.  Therefore, we should make it
use the new method in this case too.

Depends on D87030

Differential Revision: https://phabricator.services.mozilla.com/D87031
2020-08-18 09:23:16 +00:00
Masayuki Nakano 9494d7d9c7 Bug 1655388 - part 2: Make deleting `<br>` element after `<hr>` element in `HTMLEditor::HandleDeleteCollapsedSelectionAtAtomicContent()` use the new method r=m_kato
Although it does not need to join text nodes around the `<br>` element since
its previous node is `<hr>`, it can use
`WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt()` too.

Depends on D87029

Differential Revision: https://phabricator.services.mozilla.com/D87030
2020-08-18 08:17:17 +00:00
Masayuki Nakano 07e4f0f69d Bug 1655388 - part 1: Move the last part of `HTMLEditor::HandleDeleteCollapsedSelectionAtAtomicContent()` into `WhiteSpaceVisibilityKeeper` r=m_kato
It works with the traditional white-space normalizer.  Therefore, it should
be moved into `WhiteSpaceVisibilityKeeper`.

Depends on D86910

Differential Revision: https://phabricator.services.mozilla.com/D87029
2020-08-18 08:16:33 +00:00
Sonia Singla 5f5c9fd7f2 Bug 1659267 - Remove usages of -moz-user-select across the Firefox codebase. r=emilio,marionette-reviewers,geckoview-reviewers,preferences-reviewers,whimboo,agi
Differential Revision: https://phabricator.services.mozilla.com/D87499
2020-08-18 23:37:51 +00:00
Masayuki Nakano 3da9fc2299 Bug 1658534 - part 2: Avoid infinite recursive calls at removing an invisible `<br>` element r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D86910
2020-08-18 07:26:02 +00:00
Masayuki Nakano e21079f1fd Bug 1658534 - part 1: Split the removing invisible `<br>` element part off from `HTMLEditor::HandleDeleteCollapsedSelectionAtAtomicContent()` r=m_kato
Depends on D86886

Differential Revision: https://phabricator.services.mozilla.com/D86909
2020-08-18 05:35:39 +00:00
Masayuki Nakano d550a723f8 Bug 1658472 - part 6: Make some utility methods for `AutoInclusiveAncestorBlockElementsJoiner` r=m_kato
This patch changes the behavior in the following 2 points:
* When both content is in same block element, won't return error
* When `<hr>` element has block children accidentally, this solves its container

The former case must not change actual behavior because
`AutoBlockElementsJoiner` is used with content nodes which are in different
blocks.

Differential Revision: https://phabricator.services.mozilla.com/D86886
2020-08-17 10:57:47 +00:00
Masayuki Nakano 909288b9a6 Bug 1658472 - part 5: Split `AutoInclusiveAncestorBlockElementsJoiner::Run()` to computation part and touching the DOM tree part r=m_kato
Depends on D86884

Differential Revision: https://phabricator.services.mozilla.com/D86885
2020-08-17 10:51:44 +00:00
Masayuki Nakano 5d03594318 Bug 1658472 - part 4: Make `AutoInclusiveAncestorBlockElementsJoiner` store new list element tag name with its member r=m_kato
Depends on D86883

Differential Revision: https://phabricator.services.mozilla.com/D86884
2020-08-17 10:24:13 +00:00
Masayuki Nakano 3e0a1d8d61 Bug 1658472 - part 3: Make `AutoInclusiveAncestorBlockElementsJoiner` store left block element and right block element as its members r=m_kato
Depends on D86882

Differential Revision: https://phabricator.services.mozilla.com/D86883
2020-08-17 09:54:49 +00:00
Masayuki Nakano 3496851ec0 Bug 1658472 - part 2: Make `AutoInclusiveAncestorBlockElementsJoiner` store left content and right content at construction r=m_kato
Depends on D86881

Differential Revision: https://phabricator.services.mozilla.com/D86882
2020-08-17 09:34:11 +00:00
Masayuki Nakano 1a08039730 Bug 1658472 - part 1: Move `HTMLEditor::TryToJoinBlocksWithTransaction()` into new nested class of `AutoBlockElementsJoiner` r=m_kato
Now all users of the method is methods of `AutoBlockElementsJoiner`.
Therefore, we can move it into the nested class.  And for splitting the
method in the following patch, it should be a nested class of
`AutoBlockElementJoiner`.

Depends on D86791

Differential Revision: https://phabricator.services.mozilla.com/D86881
2020-08-17 09:22:19 +00:00
Masayuki Nakano 33a78c310f Bug 1655392 - part 6: Split the text deletion part of start and/or end of range off from `HandleDeleteNonCollapsedRanges` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D86791
2020-08-17 00:26:24 +00:00
Masayuki Nakano 21d81f986c Bug 1655392 - part 5: Split the part removing contents in each range off from `HandleDeleteNonCollapsedRanges()` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D86790
2020-08-16 04:33:39 +00:00
Masayuki Nakano 9d1482c813 Bug 1655392 - part 4: Give independent mode and handler for the next block of `AutoBlockElementsJoiner::HandleDeleteNonCollapsedRanges()` r=m_kato
And now, `HTMLEditor::JoinNodesDeepWithTransaction()` is used only by
`AutoBlockElementsJoiner`.  Therefore, this patch moves it to the
stack only class.

Differential Revision: https://phabricator.services.mozilla.com/D86789
2020-08-16 04:20:38 +00:00
Masayuki Nakano aa3497a28e Bug 1655392 - part 3: Give independent mode and handler for first case of `AutoBlockElementsJoiner::HandleDeleteNonCollapsedRanges()` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D86788
2020-08-13 11:54:21 +00:00
Masayuki Nakano fa6c54cc66 Bug 1655392 - part 2: Make `AutoBlockElementsJoiner::PrepareToDeleteNonCollapsedRange()` initialize `mLeftContent` and `mRightContent` with inclusive ancestor block elements of start and end of first range r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D86787
2020-08-13 11:17:24 +00:00
Masayuki Nakano 7d56bc1b36 Bug 1655392 - part 1: Move some part of `HTMLEditor::HandleDeleteNonCollapsedRanges()` to `AutoBlockElementsJoiner` r=m_kato
For making the following review easier, this patch just moves some part of
`HandleDeleteNonCollapsedRanges()` into `AutoBlockElementJoiner`.

Differential Revision: https://phabricator.services.mozilla.com/D86786
2020-08-13 10:12:13 +00:00
Mihai Alexandru Michis fb644eda26 Backed out changeset 5838f8b581ed (bug 1647536) for causing failures in browser_active_mediasession_among_tabs.js
CLOSED TREE
2020-08-14 19:42:51 +03:00
Chris Fronk 8770c8a332 Bug 1647536 - Support ref counted pointers in nsDeque r=froydnj
Adds a new specialization of nsDeque, nsRefPtrDeque for use with
reference counted pointers.

Differential Revision: https://phabricator.services.mozilla.com/D84766
2020-08-14 15:19:48 +00:00
Mirko Brodesser 21078a7903 Bug 1652557: don't skip test_bug767684.html when xorigin iframes and fission are enabled. r=masayuki
The test failed neither locally nor on try, hence enabling it again.

Differential Revision: https://phabricator.services.mozilla.com/D86706
2020-08-12 02:02:49 +00:00
Masayuki Nakano 220db95ff0 Bug 1657269 - part 2: Make `HTMLEditor::HandleDeleteSelectionInternal()` take `AutoRangeArray` instead of referring `Selection` ranges r=m_kato
Now, only when deleting table cell contents, `HandleDeleteSelectionInternal()`
depends on `Selection`.  However, this can be moved to `HandleDeleteSelection()`
because recursive callers expects `Selection` is collapsed by its previous job.

Differential Revision: https://phabricator.services.mozilla.com/D86183
2020-08-11 09:35:42 +00:00
Masayuki Nakano d5ed562a13 Bug 1657269 - part 1: Move `EditorBase::ExtendSelectionForDelete()` into `AutoRangeArray` r=m_kato
This patch moves `EditorBase::ExtendSelectionForDelete()` into `AutoRangeArray`
and make it stop modifying `Selection`.

The method extends anchor-focus range with `nsFrameSelection` and it refers
bidi information in it too.  Therefore, it needs to be called before modifying
anchor-focus range of `Selection`.  Unfortunately, this makes the code messy,
but for now, we should take this.  In the future, we should make the API of
`nsFrameSelection` free from `Selection`.

Differential Revision: https://phabricator.services.mozilla.com/D86182
2020-08-11 06:11:10 +00:00
Masayuki Nakano 0b7819addd Bug 1657270 - part 5: Guarantee that `AutoEmptyBlockAncestorDeleter` did nothing if it returns "not handled" or an error at the caller r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85999
2020-08-11 05:04:33 +00:00
Masayuki Nakano 76b257fb0f Bug 1657270 - part 4: Split caret computation part off from `AutoEmptyBlockAncestorDeleter::Run()` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85998
2020-08-11 05:04:08 +00:00
Masayuki Nakano 087c7979ab Bug 1657270 - part 3: Split `<br>` element insertion part for empty list element off from `AutoEmptyBlockAncestorDeleter::Run()` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85997
2020-08-11 04:35:05 +00:00
Masayuki Nakano d76fe99f0d Bug 1657270 - part 2: Split `AutoEmptyBlockAncestorDeleter::Run()` to scanning the target part and touching the DOM tree part r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85996
2020-08-11 02:02:31 +00:00
Masayuki Nakano 42c32fd19a Bug 1657270 - part 1: Move `HTMLEditor::MaybeDeleteTopMostEmptyAncestor()` into new stack only class r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85995
2020-08-11 02:02:19 +00:00
Edgar Chen ad6affb211 Bug 1658176 - Make mochitest tests with xorigin and fission enabled report assertion properly; r=kmag DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D86516
2020-08-10 20:48:13 +00:00
Dorel Luca c243829674 Backed out 5 changesets (bug 1623764) for WPT failures in /editing/run/forwarddelete.html. CLOSED TREE
Backed out changeset 838b1a256f25 (bug 1623764)
Backed out changeset 00911e3c92c3 (bug 1623764)
Backed out changeset 5f7d278953d7 (bug 1623764)
Backed out changeset 0059379a3c29 (bug 1623764)
Backed out changeset 6e3a9276ec41 (bug 1623764)
2020-08-10 09:07:48 +03:00
Kagami Sascha Rosylight a371405cd9 Bug 1623764 - Part 5: Prevent test failure by subpixel difference r=emilio
The failures already have been there: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3d6cc94f2db7a2e55f41405ef0575102637e0633&selectedTaskRun=ZUj4QROIQo6nGympvvqvjA.0

... but they only fail inside a job "geckoview-test-verify" and the job even does not always runs the test. It makes hard to track the initial failure, so this patch just allows subpixel difference.

Differential Revision: https://phabricator.services.mozilla.com/D86486
2020-08-10 01:46:26 +00:00
Kagami Sascha Rosylight ddbb369d71 Bug 1623764 - Part 4: Stop at hard linebreaks when eat_space_to_next_word r=emilio,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D85923
2020-08-09 12:58:27 +00:00
Masayuki Nakano 5b78d2b3c1 Bug 1657052 - Make `HTMLEditor::HandleDeleteAroundCollapsedSelection()` take ranges to delete instead of retrieving them via `Selection` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85965
2020-08-07 06:13:00 +00:00
Masayuki Nakano 4588958dcb Bug 1656799 - part 5: Make `HTMLEditor::GetRangeExtendedToIncludeInvisibleNodes()` directly extend given range r=m_kato
Creation cost of `nsRange` is expensive, and it's only user,
`HTMLEditor::HandleDeleteNonCollapsedRanges()` wants to extend the range.
Therefore, we can make it directly extend the given range.

Differential Revision: https://phabricator.services.mozilla.com/D85849
2020-08-07 06:12:17 +00:00
Masayuki Nakano 6346ed0316 Bug 1656799 - part 4: Make `HTMLEditor::HandleDeleteNonCollapsedSelection()` take ranges to delete instead of retrieving it via `Selection` r=m_kato
Depends on D85847

Differential Revision: https://phabricator.services.mozilla.com/D85848
2020-08-07 05:53:16 +00:00
Masayuki Nakano 3397c35fa4 Bug 1656799 - part 3: Make `WhiteSpaceVisibilityKeeper::PrepareToDeleteRange()` not track `EditorDOMPoint`s r=m_kato
It may be faster to use `AutoTrackDOMRange` directly.  Therefore, current
`WhiteSpaceVisibilityKeeper::PrepareToDeleteRange()` should be renamed to
`WhiteSpaceVisibilityKeeper::PrepareToDeleteRangeAndTrackPoints()` and
we should make `HTMLEditor::HandleDeleteNonCollapsedSelection()` track
the range by itself.

Depends on D85846

Differential Revision: https://phabricator.services.mozilla.com/D85847
2020-08-06 08:07:39 +00:00
Masayuki Nakano 0ada126b2a Bug 1656799 - part 2: Create range tracker r=m_kato
There is only `AutoTrackDOMPoint`, but
`HTMLEditor::HandleDeleteNonCollapsedSelection()` requires to tack pairs of
DOM points, i.e., requires to track ranges.  For making the code simpler,
we should have range tracker too.

Depends on D85845

Differential Revision: https://phabricator.services.mozilla.com/D85846
2020-08-08 02:57:16 +00:00
Masayuki Nakano 93ff6864bb Bug 1656799 - part 1: Make `HTMLEditor::HandleDeleteNonCollapsedSelection()` store selection ranges with `AutoRangeArray` first r=m_kato
Depends on D85686

Differential Revision: https://phabricator.services.mozilla.com/D85845
2020-08-06 07:03:55 +00:00
Cosmin Sabou 1fd1260b5e Backed out 4 changesets (bug 1623764) for mochitest failures on test_movement_by_characters.html. CLOSED TREE
Backed out changeset f927522d89bc (bug 1623764)
Backed out changeset c100eb8ae430 (bug 1623764)
Backed out changeset 1147ded16458 (bug 1623764)
Backed out changeset 7af572ec5edf (bug 1623764)
2020-08-06 08:09:42 +03:00
Kagami Sascha Rosylight 0f2d254487 Bug 1623764 - Part 4: Stop at hard linebreaks when eat_space_to_next_word r=emilio,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D85923
2020-08-06 01:18:52 +00:00
Masayuki Nakano e12a28bb16 Bug 1656430 - part 3: Create `EditorBase::DeleteRangesWithTransaction()` r=m_kato
This patch makes `EditorBase::DeleteSelectionWithTransaction()` a wrapper of
`EditorBase::DeleteRangesWithTransaction()`.

Differential Revision: https://phabricator.services.mozilla.com/D85686
2020-08-05 07:13:40 +00:00
Masayuki Nakano 65db771e7f Bug 1656430 - part 2: Add `AutoRangeArray` for alternative class of `Selection` r=m_kato
This new class will be used for treating selection ranges without modifying
it temporarily.

Differential Revision: https://phabricator.services.mozilla.com/D85685
2020-08-05 06:45:37 +00:00
Masayuki Nakano 9c3084ace7 Bug 1656430 - part 1: Rename `AutoRangeArray` to `AutoSelectionRangeArray` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85684
2020-08-05 01:37:26 +00:00