Closed Bug 1727844 Opened 3 years ago Closed 3 years ago

Some code clean up for bug1724650

Categories

(Core :: DOM: Editor, task, P2)

task

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(8 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

This is for preparation work of bug 1724650.

Severity: -- → N/A
Keywords: leave-open
Priority: -- → P2

It was enabled for working on implementing blink-compat white-space normalizer,
but currently nobody works on it actively. Therefore, we should disable it
at running mochitests for detecting any regressions in the default settings.

The method returns false even if linefeed characters are preformatted.
So, it should be renamed to explain what it does clearer.

And this renames TextFragmentData::mIsPreformatted and its accessors too.

Depends on D123869

This patch adds EditorUtils::IsNewLinePreformatted() to check whether a
linefeed character is collapsible or not.

Then, a lot of users of EditorDOMPointBase::Is*CharASCIISpace() and
EditorDOMPointBase::Is*CharASCIISpaceOrNBSP() should check whether the
white-space at the point is collapsible or not. Therefore, this patch adds
Is*CharCollapsibleASCIISpace() and Is*CharCollapsibleASCIISpaceOrNBSP()
too.

Then, makes such callers use the new API instead.

Depends on D123870

Currently, it uses "normal text" and "normal white-spaces" for naming
enum class members and their accessors. However, this is unclear what
does the normal mean since the word depends on context.

Therefore, this patch replaces the former with "non-collapsible characters" and
the latter is "collapsible white-spaces".

Depends on D123871

For preparation, this patch just adds new "preformatted line break" information
to the scan result related places. This will be used for \n which is
preformatted by white-space: pre, white-space: nowrap,
white-space: pre-wrap, but not used for white-space: pre-line.

Depends on D123872

Although we should move it into EditorUtils, currently, this is enough.

Depends on D123873

It's should not cross preformatted line break, therefore, the better name
for it is, it means whether the preformatted white-space is found or not.

Depends on D123874

Attachment #9238354 - Attachment description: Bug 1727844 - part 6: Add "preformated line break" information to scan result of `WSRunObject.h` r=m_kato! → Bug 1727844 - part 6: Add "preformatted line break" information to scan result of `WSRunObject.h` r=m_kato!
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/8d167b18b790
part 1: Stop enabling blink-compat white-space normalizer at running mochitests r=m_kato
https://hg.mozilla.org/integration/autoland/rev/b55f2bffdb95
part 2: Add WPT to check back commands' behavior with `white-space` style r=m_kato
https://hg.mozilla.org/integration/autoland/rev/4be65378de38
part 3: Rename `EditorUtils::IsContentPreformatted()` to `IsWhiteSpacePreformatted()` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/11dce090ce94
part 4: Add API to check whether a char is collapsible or not r=m_kato
https://hg.mozilla.org/integration/autoland/rev/f0f37363bbf7
part 5: Rename some scan result related members in `WSRunObject.h` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/b42a71e94db5
part 6: Add "preformatted line break" information to scan result of `WSRunObject.h` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/0153e0f42cbc
part 7: Make `HTMLEditor` related classes use constants in `HTMLEditUtils` to use specific character code point r=m_kato
https://hg.mozilla.org/integration/autoland/rev/c8e63c2e2324
part 8: Rename `BoundaryData::Preformatted` to `BoundaryData::WhiteSpacePreformatted` r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/30263 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Keywords: leave-open
Target Milestone: --- → 93 Branch

oops, I just forgot to mark this as fixed.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: