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

20 Коммитов

Автор SHA1 Сообщение Дата
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 ff05850ef8 Bug 1793694 - part 7: Stop exposting `CSSEditUtils.h` and `ChangeStyleTransaction.h` r=m_kato
Depends on D158636

Differential Revision: https://phabricator.services.mozilla.com/D158637
2022-10-12 02:44:20 +00:00
Masayuki Nakano 1abcb1c46b Bug 1764866 - Add "mozilla/EditorForwards.h" r=m_kato
Headers in editor module has a lot of forward declarations for avoiding the
include hell and has a lot of helper template classes.

Forward declarations of template classes is really messy and I'd want to
avoid the duplication because it blocks changing template class.  Therefore,
centralizing forward declarations makes the headers cleaner and maintaining
template classes easier.  Therefore, this patch adds a new header file which
has only forward declarations and some aliases.

It'd be better to define `enum class`es in it like `EventForwards.h` for
reducing the dependencies between headers, but currently this does not do it
for making the new file simpler as far as possible.

Removing `EditActionListener.h` is because it's unused.

Removing `AutoTopLevelEditSubActionNotifier` is because it's renamed to
`AutoEditSubActionNotifier`.
https://hg.mozilla.org/mozilla-central/rev/6de55c5b5f8d5f92389d0d244d2bced1f979ade9

Differential Revision: https://phabricator.services.mozilla.com/D143817
2022-04-20 14:46:16 +00:00
Masayuki Nakano 119be8e287 Bug 1697876 - part 1: Add logging code to transaction classes for making easier to debug r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D110714
2021-04-05 11:35:48 +00:00
Emilio Cobos Álvarez 039592f4d8 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00
Masayuki Nakano 3aa3b37a40 Bug 1632021 - part 1: Add `GetAs*Transaction()` methods to every subclasses of `EditTransactionBase` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D71907
2020-04-23 05:46:43 +00:00
Masayuki Nakano 8390d2e8bc Bug 1619914 - part 2: Mark transaction class methods and their caller methods as `MOZ_CAN_RUN_SCRIPT r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69303

--HG--
extra : moz-landing-system : lando
2020-04-03 08:32:01 +00:00
Masayuki Nakano 3f95e60b07 Bug 1619914 - part 1: Make each transaction class grab their members with local variable before touching the DOM tree r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69302

--HG--
extra : moz-landing-system : lando
2020-04-03 08:30:37 +00:00
Mihai Alexandru Michis 2f9f34de0e Backed out 2 changesets (bug 1619914) for causing gtest failures regarding TransactionManager.
CLOSED TREE

Backed out changeset d3816f82c0b9 (bug 1619914)
Backed out changeset 876b1031a6ae (bug 1619914)
2020-04-03 07:57:06 +03:00
Masayuki Nakano eb881aff87 Bug 1619914 - part 2: Mark transaction class methods and their caller methods as `MOZ_CAN_RUN_SCRIPT r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69303

--HG--
extra : moz-landing-system : lando
2020-04-03 01:39:36 +00:00
Masayuki Nakano 5fb2cba97c Bug 1619914 - part 1: Make each transaction class grab their members with local variable before touching the DOM tree r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69302

--HG--
extra : moz-landing-system : lando
2020-04-03 01:38:22 +00:00
Masayuki Nakano 85a0bd9a61 Bug 1620135 - Clean up trivial constructor and destructor under libeditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D65448

--HG--
extra : moz-landing-system : lando
2020-03-06 04:38:25 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Masayuki Nakano 0dd5b5022a Bug 1425412 - part 11: Create factory methods for ChangeStyleTransaction and remove CSSEditUtils::CreateCSSPropertyTxn() r=m_kato
This patch creates factory methods for ChangeStyleTransaction and removes
CSSEditUtils::CreateCSSPropertyTxn().

MozReview-Commit-ID: 1h8ZAj2PP5O

--HG--
extra : rebase_source : 3da3070ad179bac1aadbfc6984b4c2922a052ec0
2017-12-18 17:46:57 +09:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Masayuki Nakano 7f30e926b8 Bug 1260651 part.60 editor/libeditor should export some headers which are required by other modules and other modules shouldn't use local include for them r=mccr8
MozReview-Commit-ID: FZSExwkHH2B
2016-07-08 14:03:31 +09:00
Masayuki Nakano 5fb3db78b5 Bug 1260651 part.32 Rename EditTxn to mozilla::EditTransactionBase r=mccr8
This patch also renames NS_DECL_EDITTXN to NS_DECL_EDIT_TRANSACTION_BASE.

MozReview-Commit-ID: 29TQbKBBEhD

--HG--
rename : editor/libeditor/EditTxn.cpp => editor/libeditor/EditTransactionBase.cpp
rename : editor/libeditor/EditTxn.h => editor/libeditor/EditTransactionBase.h
2016-07-08 09:48:34 +09:00
Masayuki Nakano f5aee941e2 Bug 1260651 part.18 Rename mozilla::dom::ChangeStyleTxn to mozilla::ChangeStyleTransaction (and their files too) r=mccr8
MozReview-Commit-ID: KQn4f35WjvT

--HG--
rename : editor/libeditor/ChangeStyleTxn.cpp => editor/libeditor/ChangeStyleTransaction.cpp
rename : editor/libeditor/ChangeStyleTxn.h => editor/libeditor/ChangeStyleTransaction.h
2016-07-07 14:23:25 +09:00