Commit Graph
45 Commits
Author SHA1 Message Date
Sylvestre Ledru 9f5cc05eee Bug 2023419 - Remove Emacs/Vim modelines from editor/ r=masayuki
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287844
2026-03-16 12:52:41 +00:00
Masayuki Nakano 91fa81075a Bug 1998077 - part 7: Reimplement HTMLEditUtils::GetInclusiveDeepestFirstChildWhichHasOneChild with LeafNodeOptions r=m_kato
Similarly, we can implement it with `LeafNodeOptions` to ignore
unnecessary nodes.  Then, we can get rid of `WalkTreeOption` and
`WalkTreeOptions` completely.

Differential Revision: https://phabricator.services.mozilla.com/D277524
2026-01-13 05:27:53 +00:00
Masayuki Nakano b289a47a35 Bug 1998077 - part 5: Replace the remaining HTMLEditUtils::Get(Next|Previous)Content() with new ones based on Get(Next|Previous)LeafNodeOr(Next|Previous)BlockElement() r=m_kato
`HTMLEditUtils::GetNextContent()` and
`HTMLEditUtils::GetPreviousContent()` are wrappers of
`HTMLEditUtils::GetAdjacentContent()` and
`HTMLEditUtils::GetAdjacentLeafContent()`.  The behavior is similar to
`HTMLEditUtils::GetNextLeafContentOrNextBlockElement()` or
`HTMLEditUtils::GetPreviousLeafContentOrPreviousBlockElement()` but
they won't stop at block inclusive ancestor or a block sibling of an
inclusive ancestor.  Therefore, we can get rid of them and use the new
and better implementation.

Differential Revision: https://phabricator.services.mozilla.com/D277522
2026-01-13 05:27:47 +00:00
Sandor Molnar b77ea8700f Revert "Bug 1998077 - part 7: Reimplement HTMLEditUtils::GetInclusiveDeepestFirstChildWhichHasOneChild with LeafNodeOptions r=m_kato" for causing build bustages @ WSRunScanner.cpp
This reverts commit 5ccf392dce.

Revert "Bug 1998077 - part 6: Reimplement `HTMLEditUtils::Get(First|Last)Child()` and `HTMLEditUtils::Get(Next|Previous)Sibling()` with `LeafNodeOptions` r=m_kato"

This reverts commit 12eb928cb5.

Revert "Bug 1998077 - part 5: Replace the remaining `HTMLEditUtils::Get(Next|Previous)Content()` with new ones based on `Get(Next|Previous)LeafNodeOr(Next|Previous)BlockElement()` r=m_kato"

This reverts commit 58b4243d10.

Revert "Bug 1998077 - part 4: Replace some callers of `HTMLEditUtils::Get(Next|Previous)Content()` with `HTMLEditUtils::Get(Next|Previous)LeafContentOr(Next|Previous)BlockElement()` r=m_kato"

This reverts commit dd46967eb4.

Revert "Bug 1998077 - part 3: Add new options to ignore empty/invisible leaf nodes r=m_kato"

This reverts commit ca50a4a628.

Revert "Bug 1998077 - part 2: Add `WSType::EmptyInlineContainerElement` r=m_kato"

This reverts commit 4a5d93d631.

Revert "Bug 1998077 - part 1: Make `HTMLEditUtils::IsVisibleElementEvenIfLeafNode` work better if primary frame is available r=m_kato"

This reverts commit b42dc9d35f.
2026-01-07 06:15:59 +00:00
Masayuki Nakano 5ccf392dce Bug 1998077 - part 7: Reimplement HTMLEditUtils::GetInclusiveDeepestFirstChildWhichHasOneChild with LeafNodeOptions r=m_kato
Similarly, we can implement it with `LeafNodeOptions` to ignore
unnecessary nodes.  Then, we can get rid of `WalkTreeOption` and
`WalkTreeOptions` completely.

Differential Revision: https://phabricator.services.mozilla.com/D277524
2026-01-07 01:12:57 +00:00
Masayuki Nakano 58b4243d10 Bug 1998077 - part 5: Replace the remaining HTMLEditUtils::Get(Next|Previous)Content() with new ones based on Get(Next|Previous)LeafNodeOr(Next|Previous)BlockElement() r=m_kato
`HTMLEditUtils::GetNextContent()` and
`HTMLEditUtils::GetPreviousContent()` are wrappers of
`HTMLEditUtils::GetAdjacentContent()` and
`HTMLEditUtils::GetAdjacentLeafContent()`.  The behavior is similar to
`HTMLEditUtils::GetNextLeafContentOrNextBlockElement()` or
`HTMLEditUtils::GetPreviousLeafContentOrPreviousBlockElement()` but
they won't stop at block inclusive ancestor or a block sibling of an
inclusive ancestor.  Therefore, we can get rid of them and use the new
and better implementation.

Differential Revision: https://phabricator.services.mozilla.com/D277522
2026-01-07 01:12:52 +00:00
serge-sans-paille 8b7e3c3a81 Bug 1999733 - Remove unused STL header inclusions in editor/** r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D272296
2025-11-13 10:13:03 +00:00
Masayuki Nakano 5c667a6c58 Bug 1752093 - Make HTMLEditUtils::Is*() take const nsIContent& as far as possible r=m_kato
In the historical reason, some of them still take `nsINode*`.  In these
days, converting from `nsINode` to `nsIContent` or `Element` is faster
than before and most callers already use `nsIContent`.  Therefore, we
should make them take `const nsIContent&`.

Only some methods, allowing callers use pointer makes them simpler.
Therefore, only some methods have overloads which take
`const nsIContent*` instead.

Differential Revision: https://phabricator.services.mozilla.com/D265525
2025-09-30 01:31:25 +00:00
Cristina Horotan 8bdbf9625e Revert "Bug 1752093 - Make HTMLEditUtils::Is*() take const nsIContent& as far as possible r=m_kato" for causing assertion in nsINode.h
This reverts commit d7a3d6e49b.
2025-09-26 06:41:47 +00:00
Masayuki Nakano d7a3d6e49b Bug 1752093 - Make HTMLEditUtils::Is*() take const nsIContent& as far as possible r=m_kato
In the historical reason, some of them still take `nsINode*`.  In these
days, converting from `nsINode` to `nsIContent` or `Element` is faster
than before and most callers already use `nsIContent`.  Therefore, we
should make them take `const nsIContent&`.

Only some methods, allowing callers use pointer makes them simpler.
Therefore, only some methods have overloads which take
`const nsIContent*` instead.

Differential Revision: https://phabricator.services.mozilla.com/D265525
2025-09-26 01:07:57 +00:00
Masayuki Nakano 771489d350 Bug 1939220 - part 1: Split WSRunObject files for WSRunScanner and WhiteSpaceVisibilityKeeper r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D232932
2025-01-20 08:03:57 +00:00
Sandor Molnar 11ae540bbc Backed out 6 changesets (bug 1939220) for causing build bustages CLOSED TREE
Backed out changeset b15602e6fbf5 (bug 1939220)
Backed out changeset 129d2cd2e11e (bug 1939220)
Backed out changeset b663c3b349f0 (bug 1939220)
Backed out changeset cbd9e4f12bd2 (bug 1939220)
Backed out changeset 81260f9e6677 (bug 1939220)
Backed out changeset f33e7201796d (bug 1939220)
2025-01-20 05:02:53 +02:00
Masayuki Nakano 0537c53049 Bug 1939220 - part 1: Split WSRunObject files for WSRunScanner and WhiteSpaceVisibilityKeeper r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D232932
2025-01-19 23:35:34 +00:00
Masayuki Nakano 9fd27e7690 Bug 1937289 - Make AutoRangeArray::ExtendAnchorFocusRangeFor stop using nsFrameSelection r=m_kato,jjaschke,dom-core
`AutoRangeArray` is created for making some handlers of the editor classes free
from `Selection` and `nsFrameSelection` while handling the edit actions.
However, the method still depends on `nsFrameSelection` instance since its
callees are instance methods of `nsFrameSelection`.

However, `EditContext` requires completely free methods to compute target
ranges of `beforeinput`.  Therefore, we need to make it not depend on
`Selection` nor `nsFrameSelection`.

The common method, `nsFrameSelection::CreateRangeExtendedToSomewhere`, requires
`PresShell`, selection limiter which is set only when the selection is an
independent selection like in a selection for a text control, selection
ancestor limiter which is set only when an editing host has focus, caret
association hint to put caret to end of preceding line or start of following
line if selection range is collapsed at a line break and caret bidi level for
considering caret position around line break in bidi text.  They are now stored
by `nsFrameSelection` and modified when selection range is changed in some
cases.  Basically, the method is called without updating its ranges and if and
only if it's initialized with `Selection`.  So, simply caching the
`nsFrameSelection`'s values solves the issues in the most cases, but this
patch makes `AutoRangeArray` adjust the value only when its `Collapse` is
called because `Selection` automatically updates it and we can compute the
value without `Selection` nor `nsFrameSelection`.

After applying this patch, `AutoRangeArray` has two meanings, one is the
instance is a proxy for `Selection`.  The other is a container for a range to
call methods which take pointer or reference to it.  To make this differences
checked at build time, this patch creates a new subclass of it, and renamed to
`AutoClonedRangeArray` to make it clearer that what are stored in the array.

Oddly, `AutoRangeArray(nsRange&)` constructor has not been cloned.  Therefore,
I make it and its subclass version clone before storing into the array.  Then,
one caller needs to change which range should be tracked.

Differential Revision: https://phabricator.services.mozilla.com/D232174
2025-01-07 01:56:52 +00:00
longsonr 4a5a611b4e Bug 1929626 - Remove more uses/includes of nsAlgorithm.h r=emilio,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D228203
2024-11-07 11:09:40 +00:00
Goloman Adrian 74ec3166cc Backed out changeset fe24b8ac5257 (bug 1929626) for causing build bustages @StackArena.cpp. CLOSED TREE 2024-11-07 01:28:24 +02:00
longsonr 975fd89f6c Bug 1929626 - Remove more uses/includes of nsAlgorithm.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228203
2024-11-06 21:15:52 +00:00
Masayuki Nakano 387d5cb1ec Bug 1865729 - part 1: Make AutoMoveOneLineHandler make AutoRangeArray work with BlockInlineCheck::UseComputedDisplayOutsideStyle r=m_kato
`AutoMoveOneLineHandler` uses `AutoRangeArray` API for block level edit
sub-actions.  Therefore, the source line is computed with
`BlockInlineCheck::UseHTMLDefaultStyle`.  However, the deletion handler works
with `BlockInlineCheck::UseComputedDisplayOutsideStyle`.  Therefore,
`AutoMoveOneLineHandler` may try to move different range.  In the reported
test case, it tries to move all content under the `<body>` into the
`<a display="table-header-group">` which is contained in the range.  Therefore,
the `movedContentRange` check fails after the destination becomes into an
orphan node which was removed to move.

This patch renames the API and adds a `BlockInlineCheck` parameter to work
with both ways and makes `AutoMoveOneLineHandler` specify
`BlockInlineCheck::UseComputedDisplayOutsideStyle` as same as the other delete
handlers.

Finally, same thing may happen in
`HTMLEditor::OnEndHandlingTopLevelEditSubActionInternal`.  This patch makes it
check whether the top-level edit sub-action is a block level one or not and
consider `BlockInlineCheck` with the result.

Depends on D194180

Differential Revision: https://phabricator.services.mozilla.com/D194181
2023-11-27 01:46:42 +00:00
Masayuki Nakano 6eff325d75 Bug 1244437 - part 4: Make HTMLEditor::IsFormatElement return false for <dl>, <dt> and <dd> if it's called for XUL paragraph state command r=m_kato
Now, all callers of them do not require to check `<dl>`, `<dt>` and `<dd>` check
if it's in the HTML format block mode.  Therefore, we can move the check into
`HTMLEditor::IsFormatElement` to make the caller side simpler.

Additionally, this patch replaces some places with
`HTMLEditUtils::IsFormatElementForParagraphState` because the paths handle only
XUL paragraph state command with assertion check.

Depends on D190902

Differential Revision: https://phabricator.services.mozilla.com/D191604
2023-10-26 03:45:18 +00:00
Masayuki Nakano e8afcee76e Bug 1244437 - part 3: Make formatBlock command handlers use replace target as the nearest inclusive ancestor format node r=m_kato
Currently, we extend selection to outside block boundaries if selection starts
and/or ends very start/end of block boundaries.  Then, replace most-distant
ancestor format node, but this is odd because the innermost format is applied
to the text and the other browsers targets the innermost ancestor formant node.
Therefore, we should align to them.

Additionally, our replacing code for `<dd>` and `<dt>` has not been implemented
yet.  I guess that the old `HTMLEditUtils::IsFormatNode` returned `false` for
`<dd>`, `<dl>` and `<dt>` and it requires additional work for splitting parent
`<dl>` too.  Now, we can do it with simple code.

Finally, we created new format block element if `<br>` element appears, but
the other browsers moves it into the new format node simply.  Therefore, we
should follow them (about `<blockquote>`, we've already done this within
the different path).

Differential Revision: https://phabricator.services.mozilla.com/D190902
2023-10-26 03:45:18 +00:00
Masayuki Nakano 6e2fbc0c89 Bug 1244437 - part 2: Make ParagraphStateAtSelection handle <dl>, <dt> and <dd> elements r=m_kato
`Document.execCommand` accepts `dl`, `dt` and `dd` as a format block.  However,
`ParagraphStateAtSelection` ignores them as not a format block element.
Therefore, it causes odd result of `queryCommandValue` after applying the
format.  E.g., `execCommand("dd")` to `<p>[foobar]</p>` correctly updates the
HTML to `<dl><dd>foobar</dd></dl>`, however, `queryCommandValue("dd")` returns
empty string rather than `dd`.

Note that Chromium returns inclusive ancestor format element of common ancestor
of the range.  However, the behavior is odd because it makes the indeterm
state never `true` and the result is not used as the target of format block
command.  So, this patch does not follow them at least for now.

On the other hand, this patch adds special case for `dl`.  With user's
operation in valid HTML structure, selection range never selects `<dl>`
children directly.  However, may cross `<dt>` and `<dd>` elements.
Then, let's return `dl` for compatibility with Chromium because `<dl>`
ancestor may be the format block target.

Differential Revision: https://phabricator.services.mozilla.com/D190901
2023-10-26 03:45:17 +00:00
Masayuki Nakano 665f8cef01 Bug 1244437 - part 1: Make HTMLEditUtils::IsFormatNode check same tags as Chromium does r=m_kato
I realized that our `HTMLEditUtils::IsFormatNode` is not maintained different
from the other browsers.  Therefore, only we do not check new elements defined
after HTML 4.01.  This patch aligns the list of the format elements to the
others [1].

Then, this also changes some expectations of `editing/run/formatblock.html`
to align common behavior of the browsers.

Note that we mapped `formatBlock` of `execCommand` to `cmd_paragraphState`,
and the XUL command handles `<blockquote>` in a different path [2] and the
behavior is pretty different from the other formatBlock command implementations.
Therefore, this patch creates new command for `formatBlock` and makes
`HTMLEditor` switch behavior in any places.

1. https://source.chromium.org/chromium/chromium/src/+/ba50f40fc4a203df704dc697d6e72469da8c5019:third_party/WebKit/WebCore/editing/FormatBlockCommand.cpp;l=114-134
2. https://searchfox.org/mozilla-central/rev/6602bdf9fff5020fbc8e248c963ddddf09a77b1b/editor/libeditor/HTMLEditor.cpp#2461-2474

Differential Revision: https://phabricator.services.mozilla.com/D190900
2023-10-26 03:45:17 +00:00
Masayuki Nakano 6f1b3be29e Bug 1851951 - Make HTMLEditor refer computed display instead of the HTML default style at considering block or inline element r=m_kato
Blink [1] and WebKit [2] refers `display-outside` value when they consider whether an
element is a block or an inline.

However, our editor refers HTML default style instead.  Therefore, our editor
cannot handle the following cases:
* If a container block is a non-HTML element whose `display` style is `block`.
* If a container `<div>` etc is styled as `inline` and typing `Enter` in it.
* If a container `<span>` is styled as `block` and it ends with spaces.

For making users get better result, we should follow the other browsers.

However, this is too risky change.  Therefore, this patch enables new behavior
only in the Nightly channel and early beta builds to collect feedback from
testers.

The big rules of checking block vs. inline are:
* When we handle block level edit actions such as formatting block, indenting
or outdenting selection, making or removing list, we should keep referring
the HTML default style because the other browsers do so and the commands are
intended for modifying the HTML structure.
* Otherwise, we should refer the computed style of the block.  However, if
working with non-connected elements, we may need a special handling that is
falling back to refer the HTML default style because `HTMLEditorDataTransfer`
work with non-connected document fragments.
* Finally, if we check visibility of collapsible white-spaces and `<br>`s, we
should refer computed style.  However, in this case, we may need to treat
ancestor `inline-block`s as block too, but for siblings, we should refer only
`display-outside`.

1. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/editing_utilities.cc;l=779;drc=31fb07c05718d671d96c227855bfe97af9e3fb20
2. https://searchfox.org/wubkat/rev/b054636fffeffa0314914a11ce39725a3057131e/Source/WebCore/editing/Editing.cpp#317

Differential Revision: https://phabricator.services.mozilla.com/D188598
2023-09-27 03:01:26 +00:00
Emilio Cobos Álvarez 529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Masayuki Nakano 307c2dae78 Bug 1808886 - Make the style editor treat <font> related styles as exclusive styles r=m_kato
Currently, Gecko does not support updating `font-size` style even in the CSS
mode.  Therefore, `CSSEditUtils` claims that `<font size="...">` style is not
CSS editable.  Supporting it requires a lot of new code but currently we don't
have any reports about this poor support.  Therefore, we should only try to
make the style editor remove `font-size` properties around selection at setting
`<font size="...">` style for now.

Additionally, Blink and WebKit does not allow to nest multiple `<font>` elements
and `<span>` elements which specify `font-size`, `font-family` or `color`.  When
setting one of the styles, they split ancestors which are related to the style
at range boundaries.  Then, unwrap the unnecessary elements.  This makes the
DOM tree simpler, thus, the later handling will be simpler.  Therefore, it's
worthwhile to follow them.

Unfortunately, there are some logic differences when handling styles in elements
having `id` attribute.  Therefore, there are some new test failures, but I guess
that it does not cause any problems in web apps in the wild because it's hard to
manage editable identified elements in cross browsers and I have no idea of
motivations to do it.

Depends on D166617

Differential Revision: https://phabricator.services.mozilla.com/D167011
2023-01-20 03:45:58 +00:00
Masayuki Nakano a9570014cf Bug 1801028 - part 17: Make CSSEditUtils::IsCSSEditableProperty take EditorElementStyle r=m_kato
It can take `const Element&` instead of `nsINode*`, then most callers can be
simpler.

Depends on D162516

Differential Revision: https://phabricator.services.mozilla.com/D162517
2022-11-25 09:29:07 +00:00
Masayuki Nakano 0007b0e98a Bug 1801028 - part 16: Make CSSEditUtils::GetComputedCSSEquivalentToHTMLInlineStyleSet take EditorElementStyle r=m_kato
Depends on D162515

Differential Revision: https://phabricator.services.mozilla.com/D162516
2022-11-25 09:22:32 +00:00
Masayuki Nakano b2046e1fd7 Bug 1793694 - part 6: Stop exposting EditorUtils.h r=m_kato
Depends on D158635

Differential Revision: https://phabricator.services.mozilla.com/D158636
2022-10-12 02:44:20 +00:00
Masayuki Nakano 830bd376e2 Bug 1783402 - part 3: Make result of unsafe getter methods of EditorDOMPointBase templated r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D153842
2022-08-09 01:43:24 +00:00
Masayuki Nakano eb8aafe328 Bug 1783402 - part 2: Make result of safe getter methods of EditorDOMPointBase templated r=m_kato
Similar to the previous patch, and for consistency between editor helper
classes, we should make result of getter methods of `EditorDOMPointBase` too.

Differential Revision: https://phabricator.services.mozilla.com/D153841
2022-08-09 01:43:24 +00:00
Masayuki Nakano 276855fa75 Bug 1775381 - Move AutoRangeArray from EditorUtils.h to its own header and cpp file r=m_kato
Depends on D152982

Differential Revision: https://phabricator.services.mozilla.com/D153063
2022-08-04 05:39:16 +00:00
Masayuki Nakano fe2186dd7f Bug 1770877 - part 22: Move HTMLEditor::CollectEditTargetNodes into AutoRangeArray r=m_kato
And also this moves `HTMLEditor::CollectChildren` to `HTMLEditUtils`.

Differential Revision: https://phabricator.services.mozilla.com/D149086
2022-06-21 01:19:25 +00:00
Masayuki Nakano 4f89f0e183 Bug 1770877 - part 15: Implement equivalent of HTMLEditor::GetSelectionRangesExtendedToHardLineStartAndEnd r=m_kato
It's always work with `Selection` ranges.  Then, it should be treated within
`AutoRangeArray` which can be initialized with `Selection` ranges automatically.
Then, we can making `HTMLEditor` simpler.

Note tha this tries to make it get editing host when the corresponding
public method is called (after dispatched `beforeinput` event if handling a
users' operation).  However, as commented in
`HTMLEditor::SetParagraphFormatAsAction`, it breaks a tricky crash test.
Therefore, only the format block path computes it after the preparation.

Differential Revision: https://phabricator.services.mozilla.com/D149079
2022-06-17 21:28:36 +00:00
Masayuki Nakano 5058c3606f Bug 1770877 - part 12: Make HTMLEditor treat array of nsRange with OwningNonNull rather than RefPtr r=m_kato
`AutoRangeArran` uses `OwningNonNull`.  So making the following patch simpler
and smaller, all places should use array of `OwningNonNull<nsRange>` instead of
`RefPtr<nsRange>`.

Differential Revision: https://phabricator.services.mozilla.com/D149076
2022-06-17 07:40:37 +00:00
Masayuki Nakano 5280d86f3f Bug 1770877 - part 8: Get rid of HTMLEditor::CollectEditTargetNodesInExtendedSelectionRanges r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D149072
2022-06-17 04:13:04 +00:00
Masayuki Nakano 71411e3fb4 Bug 1771448 - part 4: Rename HTMLEditor::GetActiveEditingHost to ComputeEditingHost r=m_kato
It's currently computes the corresponding editing host from the focus node of
`Selection` with climbing up the DOM tree.  So, it does not just return a stored
element.  Therefore, some callers use it multiple times.  For avoiding it, we
should rename it to explain that it computes the editing host.

Note that I think that we should make it takes a node to compute editing host
without `Selection` for solving the case of no selection ranges.  Therefore,
I don't like to include more information into the name.

Differential Revision: https://phabricator.services.mozilla.com/D147504
2022-05-31 03:41:01 +00:00
Masayuki Nakano 083c6837d0 Bug 1765018 - part 2: Make EditorBase::Get(Start|End)Point return EditorDOMPoint or EditorRawDOMPoint r=m_kato
This avoids unnecessary conversion at the callers' side, although they should be
omitted by the complier.

Differential Revision: https://phabricator.services.mozilla.com/D143879
2022-04-20 23:35:18 +00:00
Masayuki Nakano 12c2411971 Bug 1726064 - part 10: Make the constructor of AlignStateAtSelection use HTMLEditUtils::GetInclusiveAncestorElement() r=m_kato
The "state" is not limited by editing host nor editable nodes.  Therefore, it
should keep scanning ancestor block element without checking editable state.

Differential Revision: https://phabricator.services.mozilla.com/D122948
2021-08-20 22:17:02 +00:00
Masayuki Nakano 7eba4e358a Bug 1627175 - part 38: Move EditorBase::GetNextContent() and EditorBase::GetPreviousContent() to HTMLEditUtils r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D113242
2021-04-27 11:17:44 +00:00
Masayuki Nakano c0e0a10439 Bug 1627175 - part 37: Get rid of editor type argument from EditorBase::GetNextContent() and EditorBase::GetPreviousContent() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D113241
2021-04-27 11:17:43 +00:00
Masayuki Nakano fbf8cf72c8 Bug 1627175 - part 34: Make EditorBase::GetNextContent() and EditorBase::GetPreviousContent() static r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D113238
2021-04-27 11:17:42 +00:00
Masayuki Nakano af490ea261 Bug 1627175 - part 31: Get rid of EditorBase::GetNextEditableNode() and EditorBase::GetPreviousEditableNode() r=m_kato
Depends on D113234

Differential Revision: https://phabricator.services.mozilla.com/D113235
2021-04-27 11:17:41 +00:00
Masayuki Nakano 04ff975886 Bug 1703144 - Get rid of MOZ_KnownLive for EditorBase::SelectionRefPtr() r=m_kato
The lifetime of it is guaranteed by `AutoEditActionDataSetter` which grabs
`Selection` until it's destroyed, and it's a stack only class and created
at first step of all public method calls.  Therefore, we can mark it as
`MOZ_KNOWN_LIVE` and we can change it returning reference of `Selection`
instead of reference of `RefPtr<Selection>`.

Differential Revision: https://phabricator.services.mozilla.com/D110896
2021-04-08 01:31:54 +00:00
Andi-Bogdan Postelnicu 5d5d183007 Bug 1683534 - Make editor buildable outside of unified-build environment. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D100206
2021-01-04 14:18:50 +00:00
Masayuki Nakano 50a0d51c3c Bug 1673790 - Split editor/libeditor/HTMLEditSubActionHandler.cpp r=m_kato
It's too big (+15k lines) and there are 2 groups which does not depend on the
others.  One is getting current state for `Document.queryCommandState` etc.
This is copied to `HTMLEditorState.cpp`.  And the other is delete handlers.
This is copied to `HTMLEditorDeleteHandler.cpp`.

Differential Revision: https://phabricator.services.mozilla.com/D94934
2020-10-28 13:08:34 +00:00