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

45 Коммитов

Автор SHA1 Сообщение Дата
Kagami Sascha Rosylight 28d21e6fce Bug 1768189 - Part 27: Apply modernize-concat-nested-namespaces to dom/security/featurepolicy/FeaturePolicy.h ... r=andi
Depends on D145760

Differential Revision: https://phabricator.services.mozilla.com/D145761
2022-05-09 20:41:13 +00:00
Jonathan Kew 6da0fb652b Bug 1747114 - Test correctly for end-of-span before attempting to decode surrogate pair. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D134625
2021-12-24 09:29:20 +00:00
Nika Layzell 7b2e6d4996 Bug 1741665 - Align nsCString's public size_type better with other C++ APIs, r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D131422
2021-12-13 21:47:56 +00:00
Masayuki Nakano 25adcd81f5 Bug 1741148 - part 6: Make `nsContentUtils::GetInclusiveAncestorsAndOffsets()` return array of `Maybe<uint32_t>` as offsets in DOM nodes r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131339
2021-12-09 13:18:24 +00:00
Masayuki Nakano f2baf0d9ab Bug 1741148 - part 1: Rename `nsINode::ComputeIndexOf` to `ComputeIndexOf_Deprecated` r=smaug
It's hard to fix some callers.  Therefore, in this bug, we should fix only
simple cases.  Therefore, we should rename existing API first.

Differential Revision: https://phabricator.services.mozilla.com/D131334
2021-12-09 08:32:30 +00:00
Masayuki Nakano 82e2013683 Bug 1735446 - part 4: Make `Selection::GetRangeAt()` take `uint32_t` instead of `int32_t` r=smaug
It's an internal API corresponding to `Selection.getRangeAt` DOM API.
I think that it should use `uint32_t` rather than `size_t` because of the
consistency with the DOM API and `Selection::RangeCount()`.

This patch fixes all callers of `GetRangeAt()`, and rewrites it with ranged-
loops unless original ones do not refer `RangeCount()` every time and may run
script in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D128848
2021-12-09 07:35:09 +00:00
Dan Minor e12c3387e8 Bug 1719554 - Unify most of nsUnicodeProperties.h; r=platform-i18n-reviewers,jfkthame,gregtatum,necko-reviewers,valentin
This unifies most of the calls in nsUnicodeProperties.h. CharType and Script
will be handled in subsequent patches on this bug.

Differential Revision: https://phabricator.services.mozilla.com/D132273
2021-12-06 18:15:49 +00:00
Butkovits Atila 56c46d06a1 Backed out 3 changesets (bug 1719554) for causing bustages complaining about gfxTextRun.cpp.
Backed out changeset 6181e40d4da1 (bug 1719554)
Backed out changeset c261ede6ae81 (bug 1719554)
Backed out changeset 221ec418475c (bug 1719554)
2021-12-04 00:58:15 +02:00
Dan Minor c0ebed22d3 Bug 1719554 - Unify most of nsUnicodeProperties.h; r=platform-i18n-reviewers,jfkthame,gregtatum,necko-reviewers,valentin
This unifies most of the calls in nsUnicodeProperties.h. CharType and Script
will be handled in subsequent patches on this bug.

Differential Revision: https://phabricator.services.mozilla.com/D132273
2021-12-03 20:49:31 +00:00
Ting-Yu Lin f32eaad379 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-09 01:14:15 +00:00
Iulian Moraru 36283a9a3b Backed out 2 changesets (bug 1722484) for causing multiple build bustages. CLOSED TREE
Backed out changeset bef547b588ff (bug 1722484)
Backed out changeset e676fa1a0cb7 (bug 1722484)
2021-11-09 01:42:20 +02:00
Ting-Yu Lin 7310c93473 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-08 22:24:19 +00:00
ssummar 0992acc367 Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D129920
2021-11-08 08:14:00 +00:00
Cristian Tuns 71486b8924 Backed out changeset 7e8e3747c3f8 (bug 1603127) for causing toolchains build bustages (Bug 1739589). CLOSED TREE 2021-11-05 07:23:45 -04:00
ssummar 508562cc85 Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D129920
2021-11-05 05:33:58 +00:00
Ting-Yu Lin 427cc27771 Bug 1736938 Part 2 - Make all LineBreaker's methods static, and adapt the callers. r=jfkthame
LineBreaker has no member variables and acts like "namespaces" with
utility functions. Therefore, its methods can be static and called
directly without needing a LineBreaker instance.

Rename GetJISx4051Breaks() to ComputeBreakPositions() per review
feedbacks.

Differential Revision: https://phabricator.services.mozilla.com/D129107
2021-10-25 19:00:22 +00:00
ssummar 51c0ff21e5 Bug 1626517 - Replaced mozilla::Unused with mozilla::Ignore in mozilla::Decoder/mozilla::Encoder calls. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D129022
2021-10-25 12:31:41 +00:00
Andrew McCreight 8c5d7e5ee8 Bug 1736707, part 1 - Get rid of nsContentUtils::NameSpaceManager(). r=peterv
Call nsNameSpaceManager::GetInstance() instead.

Differential Revision: https://phabricator.services.mozilla.com/D129033
2021-10-22 16:15:57 +00:00
Ting-Yu Lin bf848531df Bug 1733877 - Remove LineBreaker::Prev() in nsXMLContentSerializer. r=jfkthame,m_kato
`dom/base/test/unit/test_xmlserializer.js` exercises this part of the
code.

Differential Revision: https://phabricator.services.mozilla.com/D128557
2021-10-15 18:10:08 +00:00
Ting-Yu Lin 1b1a72c742 Bug 1735251 - Apply clang-format to nsXMLContentSerializer.cpp. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D128152
2021-10-12 17:51:12 +00:00
Masayuki Nakano fc532efa09 Bug 1734771 - part 3: Make `AppendString()` and `AppendSubString()` take `const Text&` instead of `Text*` r=m_kato
Depends on D128139

Differential Revision: https://phabricator.services.mozilla.com/D128140
2021-10-12 15:02:38 +00:00
Ting-Yu Lin 7a46b7baf7 Bug 1734792 Part 2 - Remove NS_LINEBREAKER_NEED_MORE_TEXT from the logic where break only at ascii spaces. r=m_kato
The logic has nothing to do with LineBreaker, and it shouldn't rely on
`NS_LINEBREAKER_NEED_MORE_TEXT == -1`.

Differential Revision: https://phabricator.services.mozilla.com/D128003
2021-10-11 21:23:15 +00:00
Ting-Yu Lin 7d5bad097c Bug 1734792 Part 1 - Fix the logic where we break only at ascii spaces in FindWrapIndexForContent(). r=m_kato
Bug 1733876 Part 3 wrongly changed the behavior because it failed to
consider that goodSpace may equals to -1 in the following forward search
while loop, which coincidentally is NS_LINEBREAKER_NEED_MORE_TEXT.

```
    while (goodSpace >= 0 && !nsCRT::IsAsciiSpace(mContent.CharAt(goodSpace))) {
      goodSpace--;
    }
```

Thus, when `goodSpace == -1`, we need to run the original forward search logic here.
https://searchfox.org/mozilla-central/rev/afe1ba25ee057a6118b5b990f994bdf9eb5ffb43/dom/serializers/nsPlainTextSerializer.cpp#180-185

The gtest is adapted from
https://searchfox.org/comm-central/rev/c77102402f9ddb2742f6782aa5b73362be39d5f5/mailnews/compose/test/unit/test_longLines.js#134-145

Differential Revision: https://phabricator.services.mozilla.com/D128002
2021-10-11 21:23:14 +00:00
Jonathan Kew 16d134b89d Bug 1734590 - Eliminate use of LineBreaker::DeprecatedNext in nsXMLContentSerializer.cpp. r=TYLin
The behavior change of Next() vs DeprecatedNext() here is OK, because if DeprecatedNext()
failed to find a break position then we'd end up reaching the "simple fallback logic"
below, which will just advance to the next space or end-of-text anyhow.

The only case, then, where this results in a change of behavior would be if there's a
space that the line-breaker does *not* consider a valid break, so that instead it
advances to end-of-text, where previously we'd have reached the fallback code and
used the (invalid) space as a break. So (a) this is a really obscure edge-case, and
(b) the new behavior would be more correct anyhow.

Differential Revision: https://phabricator.services.mozilla.com/D127805
2021-10-11 12:20:41 +00:00
Jonathan Kew 5b12c5262b Bug 1310559 - Update GetUnicharStringWidth implementation to handle surrogate pairs. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D127815
2021-10-08 13:14:45 +00:00
Jonathan Kew a2361076d9 Bug 1310559 - Modernize (and simplify) GetUnicharWidth implementation. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D127814
2021-10-08 13:14:45 +00:00
Csoregi Natalia e92f158606 Backed out 4 changesets (bug 1734590) for failures on test_xmlserializer.js. CLOSED TREE
Backed out changeset e492f8fd3d53 (bug 1734590)
Backed out changeset 0af985bb7569 (bug 1734590)
Backed out changeset 3751b93ae994 (bug 1734590)
Backed out changeset 45059121c015 (bug 1734590)
2021-10-08 14:41:06 +03:00
Jonathan Kew a21b07a094 Bug 1734590 - Eliminate use of LineBreaker::DeprecatedNext in nsXMLContentSerializer.cpp. r=TYLin
The behavior change of Next() vs DeprecatedNext() here is OK, because if DeprecatedNext()
failed to find a break position then we'd end up reaching the "simple fallback logic"
below, which will just advance to the next space or end-of-text anyhow.

The only case, then, where this results in a change of behavior would be if there's a
space that the line-breaker does *not* consider a valid break, so that instead it
advances to end-of-text, where previously we'd have reached the fallback code and
used the (invalid) space as a break. So (a) this is a really obscure edge-case, and
(b) the new behavior would be more correct anyhow.

Differential Revision: https://phabricator.services.mozilla.com/D127805
2021-10-08 10:05:51 +00:00
Ting-Yu Lin 9c12e87bb7 Bug 1733876 Part 5 - Simply line wrapping logic involving line breaker in FindWrapIndexForContent(). r=m_kato
The purpose of this patch is to remove LineBreaker::Prev(), and audit
the deprecated LineBreaker::DeprecatedNext() (added in bug 1733872).

Add blockquotecite gtest to make sure short line wrapping with
blockquote citation still works. The testcase's behavior is not changed.

Differential Revision: https://phabricator.services.mozilla.com/D127385
2021-10-07 23:01:42 +00:00
Ting-Yu Lin 6e8b20ae7f Bug 1733876 Part 4 - Allow GetUnicharStringWidth() to support mozilla::Span substring argument. r=m_kato
This is required by Part 5.

Differential Revision: https://phabricator.services.mozilla.com/D127384
2021-10-07 23:01:41 +00:00
Ting-Yu Lin e296f6d00d Bug 1733876 Part 3 - Consolidate logic dealing with and without aLineBreaker in FindWrapIndexForContent(). r=m_kato
This patch only moves logic, and shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D127383
2021-10-07 23:01:41 +00:00
Ting-Yu Lin afe1ba25ee Bug 1733876 Part 2 - Run line wrapping algorithm only if content of current line is not empty. r=m_kato,mbrodesser
With this edge case explicitly considered, it will be easier for the
following patches to simplify logic in `FindWrapIndexForContent()`.

Differential Revision: https://phabricator.services.mozilla.com/D127382
2021-10-07 23:01:40 +00:00
Ting-Yu Lin 11076c9ddf Bug 1733876 Part 1 - Remove unused kNoFlags in nsPlainTextSerializer.cpp. r=mbrodesser
Differential Revision: https://phabricator.services.mozilla.com/D127381
2021-10-07 23:01:40 +00:00
Noemi Erli 6d82d33655 Backed out 5 changesets (bug 1733876) for causing build windows bustages CLOSED TREE
Backed out changeset f7f60a86bf47 (bug 1733876)
Backed out changeset 6f0a6fcd5f5e (bug 1733876)
Backed out changeset b06880832da2 (bug 1733876)
Backed out changeset 2a6422635d37 (bug 1733876)
Backed out changeset dd5f9ce8a831 (bug 1733876)
2021-10-07 21:12:58 +03:00
Ting-Yu Lin 896d7904fd Bug 1733876 Part 5 - Simply line wrapping logic involving line breaker in FindWrapIndexForContent(). r=m_kato
The purpose of this patch is to remove LineBreaker::Prev(), and audit
the deprecated LineBreaker::DeprecatedNext() (added in bug 1733872).

Add blockquotecite gtest to make sure short line wrapping with
blockquote citation still works. The testcase's behavior is not changed.

Differential Revision: https://phabricator.services.mozilla.com/D127385
2021-10-07 17:10:15 +00:00
Ting-Yu Lin d08912596c Bug 1733876 Part 4 - Allow GetUnicharStringWidth() to support mozilla::Span substring argument. r=m_kato
This is required by Part 5.

Differential Revision: https://phabricator.services.mozilla.com/D127384
2021-10-07 17:10:15 +00:00
Ting-Yu Lin 060d72b1fb Bug 1733876 Part 3 - Consolidate logic dealing with and without aLineBreaker in FindWrapIndexForContent(). r=m_kato
This patch only moves logic, and shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D127383
2021-10-07 17:10:14 +00:00
Ting-Yu Lin 6993f02a9e Bug 1733876 Part 2 - Run line wrapping algorithm only if content of current line is not empty. r=m_kato,mbrodesser
With this edge case explicitly considered, it will be easier for the
following patches to simplify logic in `FindWrapIndexForContent()`.

Differential Revision: https://phabricator.services.mozilla.com/D127382
2021-10-07 17:10:14 +00:00
Ting-Yu Lin 431bd8d5d2 Bug 1733876 Part 1 - Remove unused kNoFlags in nsPlainTextSerializer.cpp. r=mbrodesser
Differential Revision: https://phabricator.services.mozilla.com/D127381
2021-10-07 17:10:14 +00:00
Ting-Yu Lin e558c2cbd9 Bug 1733872 Part 2 - Add a new LineBreaker::Next(), and deprecate the old Next(). r=m_kato
This patch is similar to Bug 1728708 Part 4, but for line breaker. This
should make the future integration of ICU4X line segmenter easier. A
UAX14 compatible line breaker always breaks at the end of text
(rule LB3 [1]), and ICU4X line segmenter has this behavior, too.

Current LineBreaker::Next() doesn't treat the end of text as a line
break opportunity, so this patch deprecates it by renaming it, and add a
new Next() method.

TestASCIILB() has adopted the new Next(). All the other callers of the
DeprecatedNext (nsPlainTextSerializer, nsXMLContentSerializer,
InternetCiter) should be audited later, possibly with the removal of
Prev() because the all the usages are very close to Prev().

[1] https://www.unicode.org/reports/tr14/#LB3

Differential Revision: https://phabricator.services.mozilla.com/D127379
2021-10-07 07:39:13 +00:00
Andi-Bogdan Postelnicu 2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
Emilio Cobos Álvarez 2d0a072174 Bug 1723921 - Cleanup nsComputedDOMStyle and related APIs. r=layout-reviewers,jfkthame
This will make implementing the new behavior behind a pref
really straight-forward, and is generally nicer.

Depends on D121858

Differential Revision: https://phabricator.services.mozilla.com/D121705
2021-08-07 09:47:15 +00:00
Chris Peterson 2d4ca059e8 Bug 1691889 - Replace MOZ_MUST_USE with [[nodiscard]] in dom/. r=peterv
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.

The [[nodiscard]] attribute must precede a function declaration's declaration specifiers (like static, extern, inline, or virtual). The __attribute__((warn_unused_result)) attribute does not have this order restriction.

Differential Revision: https://phabricator.services.mozilla.com/D107355
2021-03-10 08:19:25 +00:00
Daniel Holbert ac4480af11 Bug 1685231: Fix the typo "ot" in various code-comments (to "to", "of", or "not"). r=mccr8
DONTBUILD because this is a comment-only change and hence doesn't affect
behavior at all.

I ran across this typo in nsPageFrame.cpp, and figured I might as well grep for
it and fix it more comprehensively. And while I'm at it, I also fixed some
neighboring instances of a duplicated word around a linebreak, in
nsXMLContentSerializer.h.

Differential Revision: https://phabricator.services.mozilla.com/D100852
2021-01-06 04:54:51 +00:00
Mirko Brodesser 05656c4bf0 Bug 1679422: move serializers from dom/base/ to dom/serializers/. r=hsivonen
Required fixing some `EXPORTS` and the unified build.

Differential Revision: https://phabricator.services.mozilla.com/D98057
2020-11-29 15:58:13 +00:00