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

11308 Коммитов

Автор SHA1 Сообщение Дата
Tom Schuster 9cf9360385 Bug 1808177 - mPointToInsert.GetContainer() in BlobReader::OnError could be nullptr. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D165858
2023-01-04 12:46:27 +00:00
Sylvestre Ledru 1f8d23143a Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D165559
2022-12-28 09:52:44 +00:00
Sandor Molnar 356a0e8699 Backed out changeset 78bd7cfde7b6 (bug 1793876) for causing wpt failures in /editing/other/editing-div-outside-body.html?designMode 2022-12-20 12:14:01 +02:00
Masayuki Nakano 5591cace33 Bug 1793876 - Make `HTMLEditor::ComputeEditingHostInternal` never return non-editable `<body>` r=m_kato
It returns the non-editable `<body>` causes the deletion handlers fail to
adjust range in the editing host and that caused hitting the assertion.

This patch also includes the wrong testcase with which the bug was reported.

Differential Revision: https://phabricator.services.mozilla.com/D164533
2022-12-20 07:28:24 +00:00
Masayuki Nakano e5e7abdba6 Bug 1805554 - Make `HTMLEditor::MaybeSplitAncestorsForInsertWithTransaction` return `NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE` if it got lost the editing host r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D164771
2022-12-20 03:13:57 +00:00
Masayuki Nakano 3c28aeafd1 Bug 1792386 - part 6: Make `HTMLEditor::RemoveInlinePropertiesAsSubAction` shrink the selection range r=m_kato
If the start boundary is immediately before the next node or if the end boundary
is immediately after the previous node, it should be shrunken for consistency
with setting style behavior and the other browsers.

Depends on D164526

Differential Revision: https://phabricator.services.mozilla.com/D164527
2022-12-20 01:52:32 +00:00
Masayuki Nakano ef9d4c15b7 Bug 1792386 - part 5: Move some jobs in `HTMLEditor::RemoveInlinePropertiesAsSubAction` into `AutoInlineStyleSetter` r=m_kato
Depends on D164525

Differential Revision: https://phabricator.services.mozilla.com/D164526
2022-12-20 01:12:28 +00:00
Masayuki Nakano cf849ddc10 Bug 1792386 - part 4: Make `HTMLEditor::RemoveInlinePropertiesAsSubAction` handle deleting bold style coming from parent in its own loop r=m_kato
The remaining issue is, `RemoveInlinePropertiesAsSubAction` uses
`AutoInlineStyleSetter` for removing bold style coming from parent block or
its ancestors with new `<span style="font-weight: normal">`.  However,
in the normal removing code users `Selection` range restorer.  Therefore,
we cannot adjust the range simply without splitting the part of the normal
part and the special part for bold style.

This patch moves the part from an existing `for` loop which calls
`RemoveStyleInside` to a new `for` loop.

Depends on D164524

Differential Revision: https://phabricator.services.mozilla.com/D164525
2022-12-20 00:44:02 +00:00
Masayuki Nakano 0ddac48689 Bug 1792386 - part 3: Clean up `HTMLEditor::PromoteInlineRange` and `HTMLEditor::PromoteRangeIfStartsOrEndsInNamedAnchor` r=m_kato
They ignore non-editable nodes at scanning the DOM tree.  According to the
other browsers' behavior, at least `PromoteInlineRange` should not do it.
(Removing `<a name>` is not a feature of `execCommand` and the `unlink` behavior
is anyway incompatible.)

Additionally, we don't need to stop scanning the DOM tree when we meet `<body>`.
Scanning its parents also fine because typically it's wont be extended since
there should be `<head>` element before `<body>`.

Therefore, we can make them simpler.

Depends on D164523

Differential Revision: https://phabricator.services.mozilla.com/D164524
2022-12-20 00:35:06 +00:00
Masayuki Nakano 5081bd63e8 Bug 1792386 - part 2: Make `AutoInlineStyleSetter` store updated range to compute new `Selection` after applying the style r=m_kato
Chrome and Safari selects content nodes which are applied the new style.
E.g., when `abc[def]ghi` gets embolden, it should become `abc<b>[def]</b>ghi`,
but Gecko does `abc[<b>def]</b>ghi` because `RangeUpdater::SelAdjSplitNode`
does not update the split point (i.e., end of the new text node, "abc" in the
example) [1].

Therefore, this patch makes `AutoInlineStyleSetter` record first and last points
trying to apply the style, then, `HTMLEditor::SetInlinePropertiesAsSubAction`
can set `Selection` to the applied range.

1. https://searchfox.org/mozilla-central/rev/dd216c1307a2bf1b0d2465b9749fa86dac44303a/editor/libeditor/SelectionState.cpp#329-334

Depends on D164522

Differential Revision: https://phabricator.services.mozilla.com/D164523
2022-12-20 00:25:45 +00:00
Masayuki Nakano 72b07d893e Bug 1792386 - part 1: Make `HTMLEditor::SetInlinePropertiesAsSubAction` extend and/or shrink range smarter r=m_kato
Blink's behavior is better than Gecko.  That is, when selected range crosses
an inline element boundary, Blink shrinks selected range to select only
children, but Gecko extends selected range to cover all inline parents around
the range.  E.g., when setting `abc[<i>def]</i>ghi` to `<b>`, Chrome changes it
to `abc<i><b>def</b></i>ghi`, but Gecko changes it to `abc<b><i>def</i></b>ghi`.
The Gecko's behavior is odd especially when `abc<i>[def]</i>ghi` since user
does not select the `<i>`, but Gecko wraps it in new `<b>`.

However, if the range contains an inline element entirely, e.g.,
`abc[<i>def</i>]ghi`, Chrome changes it to `abc<b><i>def</i></b>ghi` without
shrinking the range.  This is reasonable too.

On the other hand, there is a case that browsers need to extend the range.
That is an parent inline element has the style of what we're setting a range to.
E.g., `abc<span style="background-color: red"><b>[def]</b></span>ghi`, user
wants to update the style attribute of the `<span>` element rather than wrapping
the selected text node with new `<span>` element in the `<b>`.  Therefore,
if shrunken range starts from very beginning of a node or ends at very end of
a node and the inline parents have same style, we need extend the range to wrap
it.  (Note that Gecko deletes same styles in range with
`HTMLEditor::RemoveStyleInside`.  Therefore, wrapping most distant inline
element makes Gecko works as expected.)

Finally, if the containers of range boundaries are not same one, we should
extend the range to save the number of creating element.  E.g.,
`<span>[abc</span> <span>def]</span>` should become
`<b><span>abc</span> <span>def</span>` rather than
`<span><b>abc</b></span><b> </b><span><b>def</b></span>`.

Note that the new expected failures are caused by the difference of selection
range after applying the style.  That should be fixed by the following patch.

Depends on D164521

Differential Revision: https://phabricator.services.mozilla.com/D164522
2022-12-20 00:19:41 +00:00
Ben Freist ce6cd37bc7 Bug 1802799 - [refactor] Migrate NS_STYLE_TEXT_DECORATION_STYLE_* defines r=emilio,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D163177
2022-12-19 22:47:24 +00:00
Andrew McCreight ce28c41da0 Bug 1805931, part 2 - Automated removal of uses of ROOT and UNROOT CC macros. r=smaug
As of the prior patch, these are no longer needed. I removed
these with a script, then ran clang-format on the files, then
manually reverted a few unrelated changed from the formatter.

Differential Revision: https://phabricator.services.mozilla.com/D164829
2022-12-15 19:45:01 +00:00
Masayuki Nakano 2594ee7d9c Bug 1789574 - part 2: Make `HTMLEditor` preserve style of following text if deleting/replacing range starts around inline element boundary r=m_kato
Chrome preserves inline styles of first character in the deleting/replacing
if first visible thing is text.  Safari preserves inline style of the first
content of the range (i.e., styles of `<img>` etc is also respected).
For now, due to the market share and Safari's behavior is not obviously better
than Chrome, let's try to emulate the Chrome's behavior.  However, the rules are
complicated and probably depend on how it implements the deletion.  Therefore,
this patch makes Gecko only scan following text node if selection range starts
from end of a text node.

Depends on D164520

Differential Revision: https://phabricator.services.mozilla.com/D164521
2022-12-15 09:11:48 +00:00
Masayuki Nakano 4493e43e5d Bug 1789574 - part 1: Make `HTMLEditor` preserve order of inline style elements too r=m_kato
Currently, `HTMLEditor` preserves styled elements with the reversed order in
the loop.
https://searchfox.org/mozilla-central/rev/d7d5c89ee7bc70dec0fd846689ca030f94931393/editor/libeditor/HTMLEditSubActionHandler.cpp#8638-8658

I.e., if `<b><i></i></b>` is restored in the HTML styling mode, it will be
restored as `<i><b>...</b></i>`.  This blocks writing tests for bug 1789574.
Therefore, this should be fixed first.

(As I commented in the method, ideally we should store all inline elements and
restore all of them, but currently we don't need to do it.  It requires redesign
of the style cache, but it seems that we don't know web apps which is broken by
current behavior.  Therefore, I think that we should do it when we meet a
trouble with the behavior.)

Depends on D164519

Differential Revision: https://phabricator.services.mozilla.com/D164520
2022-12-15 09:11:47 +00:00
Masayuki Nakano 077fe4f24c Bug 1789574 - part 0: Add WPT to check which inline style should be preserved r=m_kato
This patch removes some traditional behavior check in the mochitest and
port it into expected results which match with the behavior of Chrome.

Almost all the new tests pass in Chrome, but some fails due to odd result in
Chrome. E.g., Chrome sometimes append `style` attribute with empty value.
Therefore, the expectations in this patch must be what Chrome developers
expected at implementing it.

Depends on D164004

Differential Revision: https://phabricator.services.mozilla.com/D164519
2022-12-15 09:11:47 +00:00
Jan-Niklas Jaeschke 3db9161d69 Bug 1803336: Simplified check if a range to delete is start/end of a text node. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D164360
2022-12-14 08:21:29 +00:00
Masayuki Nakano db70f10b72 Bug 1803044 - part 9: Make the style editor use existing inline element in the CSS mode as far as possible r=m_kato
The other browsers use any inline elements to set CSS property for applying
an inline style.  However, Gecko limits it to a `<span>` which does not have
any attributes.  The other browsers' design is better for saving number of
elements and runtime cost of inserting new element (moving all children to the
new element and inserting it to the original position).  Therefore, it's nicer
to follow the other browses.  Then, we can avoid new WPT failures at aligning
other behaviors to the other browsers.

With doing that, removing style code requires complicated changes because
`RemoveStyleInside` assumes that one element has one style, but after taking
the compatible behavior, one element can have multiple styles including the
style represented by the element itself.

Note that the new expected failures are caused by bug 1183844. Gecko returns
closest ancestor element's background color for
`queryCommandValue("backColor")`.  Therefore, it returns "transparent" of the
inner `<span>` element.

Differential Revision: https://phabricator.services.mozilla.com/D164004
2022-12-13 03:37:38 +00:00
Masayuki Nakano 35e5ee1094 Bug 1803044 - part 8: Refactor the bottom half of `HTMLEditor::RemoveStyleInside` r=m_kato
Now, we can make there simpler because the part does one of them:
* Replaces element with new `<span>`
* Removes element
* Removes attribute
* Does nothing

However, there are duplicated code.  We should consider what there does with
lambdas.

Depends on D164002

Differential Revision: https://phabricator.services.mozilla.com/D164003
2022-12-13 03:31:51 +00:00
Masayuki Nakano 3ed70dcc38 Bug 1803044 - part 7: Make `HTMLEditor::RemoveStyleInside` use `HTMLEditor::ReplaceContainerWithTransaction` r=m_kato
Depends on D164001

Differential Revision: https://phabricator.services.mozilla.com/D164002
2022-12-13 03:25:12 +00:00
Masayuki Nakano 45ccd3c8fe Bug 1803044 - part 6: Make `HTMLEditor::RemoveStyleInside` remove CSS style before touching the DOM tree structure r=m_kato
This change makes the following changes smaller.  Once we remove CSS style
first, then, it becomes easier to consider whether we should delete the element
since `style` attribute may be deleted by `ChangeStyleTransaction` if the
removing style is the last rule in it.

Depends on D164000

Differential Revision: https://phabricator.services.mozilla.com/D164001
2022-12-13 03:14:17 +00:00
Masayuki Nakano 13c3a0c6ec Bug 1803044 - part 5: Make `HTMLEditor::RemoveStyleInside` check whether aElement is editable first r=m_kato
Depends on D163999

Differential Revision: https://phabricator.services.mozilla.com/D164000
2022-12-13 03:06:12 +00:00
Masayuki Nakano 29bc09a466 Bug 1803044 - part 4: Make `HTMLEditor::SetAttributeOrEquivalent` insert a white-space only when old value is empty r=m_kato
This causes some new failures after applying the following patches.

Depends on D163998

Differential Revision: https://phabricator.services.mozilla.com/D163999
2022-12-13 01:48:51 +00:00
Masayuki Nakano 5255ec92fc Bug 1803044 - part 3: Make `EditorBase::RemoveAttributeWithTransaction` stop creating transaction if the element does not have the removing attribute r=m_kato
Depends on D163997

Differential Revision: https://phabricator.services.mozilla.com/D163998
2022-12-13 01:17:11 +00:00
Masayuki Nakano 512839adbf Bug 1803044 - part 2: Improve `HTMLEditUtils::ElementHasAttributeExcept` r=m_kato
In the following patches, the new variations are required.  Additionally,
`HTMLEditor` should ignore empty `class`, `id` and `style` attributes because
an older API does it.
https://searchfox.org/mozilla-central/rev/2ad13433da20a0749e1e9a10ec0ab49b987c2c8e/editor/libeditor/HTMLStyleEditor.cpp#3398-3402

Depends on D163996

Differential Revision: https://phabricator.services.mozilla.com/D163997
2022-12-13 01:09:43 +00:00
Masayuki Nakano 615cd98adf Bug 1803044 - part 1: Create a method of `EditorInlineStyle` to check whether an element represents the style r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D163996
2022-12-13 01:03:16 +00:00
Mark Banner ff47c36f9b Bug 1803914 - Automatically replace Cu.reportError with console.error (misc). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D163772
2022-12-06 14:34:57 +00:00
Masayuki Nakano d9e5a56230 Bug 1803623 - Don't use `Result::unwrap` after ignoring the error state r=m_kato
Depends on D163767

Differential Revision: https://phabricator.services.mozilla.com/D163768
2022-12-06 07:33:15 +00:00
Masayuki Nakano 7ff1025425 Bug 1803626 - Make `HTMLEditor::AlignNodesAndDescendants` check whether insertion point stays valid r=m_kato
In the test case, `deleteFromDocument` call makes the point unset.  We should
make it check whether a legacy mutation event listener creates unexpected result
after calling `RemoveAlignFromDescendants`.

Differential Revision: https://phabricator.services.mozilla.com/D163767
2022-12-06 07:33:14 +00:00
Masayuki Nakano be355a79de Bug 1802831 - Make `AutoInlineStyleSetter` align setting `text-decoration` style behavior in the CSS mode to the other browsers r=m_kato
Gecko wraps selection (and parent elements if entirely selected in them) in
new `<span>` element and set `text-decoration`.  However, the other browsers
tries to reuse selected or parent element which already has `text-decoration`
style. The other browsers' behavior is more reasonable from point of view of:
* smaller footprint
* minimizing to update the DOM tree

And aligning the behavior makes it easier to check the compatibility between
browsers and us avoid from new test failures aligning other behaviors to the
other browsers.

If there is an element specifying `text-decoration`, its `text-decoration`
declaration should be updated first.

If found element is `<i>`, `<s>` or `<strike>`, it should be replaced with new
`<span>` because these elements just represents the visual style and we should
not use such elements in the CSS mode (bug 1802736).  At this time, unless
the element has `text-decoration` rules in its `style` attribute value, we
the new `text-decoration` style should have the value represented by the
removing element (i.e., `underline` for `<i>`, `line-through` for the others).

However, if found element is `<ins>` or `<del>`, we should set its
`text-decoration` and unless it already has `text-decoration` rules, we need
to append corresponding style (`underline` for `<ins>` and `line-through` for
`<del>`) too.

When setting the values or removing a value from `text-decoration` declaration,
the value should be normalized to represent only `text-decoration-line` for
compatibility with the other browsers and keeping the implementation simpler.
And also the value should be built as the following order:
1. underline
2. overline
3. line-though

rather than updating current value with complicated code. Then, the tests can
compare with one expectation.

Depends on D163188

Differential Revision: https://phabricator.services.mozilla.com/D163429
2022-12-02 22:50:56 +00:00
Masayuki Nakano 83c63f6aec Bug 1802736 - Make `AutoInlineStyleSetter` stop using different type of elements from the HTML/CSS mode point of view r=m_kato
The other browsers do not move styling nodes to existing element if the element
is never created in the mode. For example, `execCommand("bold")` in the CSS mode
for `[abc]<b>def</b>`, the other browsers make it
`<span style="font-weight: bold">abc</span><b>def</b>`, but Gecko does
`<b>abcdef</b>`.  Similarly, `execCommand("bold")` in the HTML mode for
`[abc]<span style="font-weight: bold">def</span>`, the other browsers make it
`<b>abc</b><span style="font-weight: bold">def</span>`, but Gecko does it
`<span style="font-weight: bold">abcdef</span>`.

This patch makes Gecko align the behavior to the other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D163188
2022-12-01 07:58:14 +00:00
Masayuki Nakano 643cdfeed4 Bug 1802668 - part 3: Make `AutoInlineStyleSetter` remove similar element at setting style r=m_kato
Depends on D163186

Differential Revision: https://phabricator.services.mozilla.com/D163187
2022-12-01 00:16:57 +00:00
Masayuki Nakano 3b1fb3cea4 Bug 1802668 - part 2: Make `AutoInlineStyleSetter` stop using `<strong>`, `<em>` and `<strike>` as alternative container of `<b>`, `<i>` and `<strike>` r=m_kato
The other browsers do not do this. From semantics point of view, stop reusing
them is better.

Depends on D163185

Differential Revision: https://phabricator.services.mozilla.com/D163186
2022-12-01 00:16:56 +00:00
Masayuki Nakano de84b4f105 Bug 1802418 - Make the style editor remove potentially conflicting `vertical-align` styles at applying `<sup>` or `<sub>` style r=m_kato
`execCommand("superscript")` and `execCommand("subscript")` are handled
specially.

`<sup>` and `<sub>` are exclusive. Therefore, existing element is removed first.

However, they are not mapped to CSS due to bug 394304 comment 2 even though the
behavior is different from the other browsers.  Therefore, Gecko does not remove
`vertical-align` styles from selected ranges. On the other hand, the other
browsers do it. This makes sense and matches with the handling in HTML mode.

Therefore, we should remove `vertical-align` style around the selection ranges.

Note that this updates existing WPTs.

The first block of each command checks how the command work with similar
`<span>` having `vertical-align` style. The new expectation matches with the
other browsers (i.e., currently they fail in the other browsers).

The second block of each command checks how the command work with similar
situation but there is a sibling which has the applying style (i.e., `<sup>`
or `<sub>`).  These tests keep failing in the other browsers since they want
to update `vertical-align` style at the selected range in the `<span>` having
`vertical-align` style.

Anyway, this fix is for avoiding new WPT failures of fixing bug 1792386, and
these commands must not be used so widely especially in the CSS mode.
Therefore, I believe that this change is not so risky.

Depends on D163183

Differential Revision: https://phabricator.services.mozilla.com/D163184
2022-11-29 05:48:53 +00:00
Masayuki Nakano b1973c6d74 Bug 1802402 - Group the inline style setter methods into stack only class r=m_kato
* `SetInlinePropertyOnTextNode`
* `SetInlinePropertyOnNode`
* `SetInlinePropertyOnNodeImpl`
* `ElementIsGoodContainerForTheStyle`

These `HTMLEditor` methods run only when `SetInlinePropertyOnTextNode` or
`SetInlinePropertyOnNode` is called, they take common style information as 3
arguments and they run in a short period.  Therefore, they can be in a stack
only class.

Differential Revision: https://phabricator.services.mozilla.com/D163183
2022-11-28 11:13:02 +00:00
Masayuki Nakano 9dc3f719e5 Bug 1800829 - part 4: Get rid of plugin handling documentaion due to removed in bug 1683226 r=m_kato DONTBUILD
Depends on D162686

Differential Revision: https://phabricator.services.mozilla.com/D162687
2022-11-28 03:03:54 +00:00
Masayuki Nakano 90f1122cd2 Bug 1800829 - part 3: Fix `InputContext::mHTMLInputInputMode` because of renamed DONTBUILD
Depends on D162685

Differential Revision: https://phabricator.services.mozilla.com/D162686
2022-11-28 03:03:54 +00:00
Masayuki Nakano ae784df61d Bug 1800829 - part 2: Fix the renamed pref for TSF DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D162685
2022-11-28 03:03:53 +00:00
Masayuki Nakano 8a25be7fb9 Bug 1800829 - part 1: Re-format IMEHandlingCuide to avoid warnings and fix simple typos DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D162684
2022-11-28 03:03:53 +00:00
Masayuki Nakano 23f84e1ccb Bug 1777054 - part 2: Make `test_bug795785.html` synthesize key events in each event loop r=m_kato
When keyboard events are fired by auto repeat feature of OS, each event is fired
in each event loop.  However, `repeat` feature of the `synthesizeKey` and
typing multiple characters with `sendString` dispatch keyboard events in an
event loop.  Therefore, asynchronous scrolling is handled differently from
users' scenario.  So we should emulate the users' scenario better with
synthesizing each event with waiting a tick.

Depends on D162527

Differential Revision: https://phabricator.services.mozilla.com/D162528
2022-11-28 03:01:51 +00:00
Masayuki Nakano a8b90c9538 Bug 1777054 - part 1: Rewrite `test_bug795785.html` with `apz_test_utils.js` r=m_kato
It uses legacy `hitEventLoop` hack with `setTimeout`.  Now, we have better
utility methods and can avoid using callbacks with using async/await.

However, waiting only for `waitToClearOutAnyPotentialScrolls` does not fix
the intermittent failure.  Therefore, this patch checks whether the scroll
result in its wrapper to make sure that there is no pending scroll.

Differential Revision: https://phabricator.services.mozilla.com/D162527
2022-11-28 03:01:51 +00:00
Masayuki Nakano 410ddf5d67 Bug 1801028 - part 18: Make `CSSEditUtils::GenerateCSSDeclarationsFromHTMLStyle` take `EditorElementStyle` r=m_kato
And also making it and `BuildCSSDeclarations` return pairs of CSS property and
value with an array makes their callers simpler.

Depends on D162517

Differential Revision: https://phabricator.services.mozilla.com/D162518
2022-11-25 12:57:26 +00:00
Masayuki Nakano 753e7b2a04 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 c2398f968f 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 715aea76d9 Bug 1801028 - part 15: Make `HTMLEditor::RemoveCSSEquivalentToHTMLStyle(With|Without)Transaction` take `EditorElementStyle` r=m_kato
Depends on D162514

Differential Revision: https://phabricator.services.mozilla.com/D162515
2022-11-25 09:14:38 +00:00
Masayuki Nakano 92b9c76726 Bug 1801028 - part 14: Make `CSSEditUtils::SetCSSEquivalentToHTMLStyle(With|Without)Transaction` take `EditorElementStyle` r=m_kato
This patch creates a base class of `EditorInlineStyle`, the name is
`EditorElementStyle`.  It requires only attribute of HTML.  However, it's
obviously different from `EditorInlineStyle`'s rule which is `mHTMLProperty`
cannot be `nullptr`.  Therefore, the methods which can treat only
`EditorInlineStyle` do not want the data only whose attribute is not `nullptr`.
For solving this issue at build time, this approach is better than renaming
`EditorInlineStyle` and make it have the new mode.

Depends on D162513

Differential Revision: https://phabricator.services.mozilla.com/D162514
2022-11-25 09:04:35 +00:00
Masayuki Nakano f95a663df7 Bug 1801028 - part 13: Make `HTMLEditUtils::IsInlineStyleSetByElement` take `EditorInlineStyle` r=m_kato
Depends on D162512

Differential Revision: https://phabricator.services.mozilla.com/D162513
2022-11-25 07:14:16 +00:00
Masayuki Nakano 6e6720944a Bug 1801028 - part 12: Make `CSSEditUtils::Have(Specified|Computed)CSSEquivalentStyles` take `EditorInlineStyle` r=m_kato
Depends on D162511

Differential Revision: https://phabricator.services.mozilla.com/D162512
2022-11-25 06:55:31 +00:00
Masayuki Nakano 26d6947e93 Bug 1801028 - part 11: Make `CSSEditUtils::Is(Computed|Specified)CSSEquivalentToHTMLInlineStyleSet` take `EditorInlineStyle` r=m_kato
Depends on D162510

Differential Revision: https://phabricator.services.mozilla.com/D162511
2022-11-25 06:43:51 +00:00
Masayuki Nakano 86439634a2 Bug 1801028 - part 10: Make `HTMLEditor::RemoveStyleInside` take `EditorInlineStyle` r=m_kato
Depends on D162509

Differential Revision: https://phabricator.services.mozilla.com/D162510
2022-11-25 06:26:04 +00:00