Page MenuHomePhabricator

WIP: Bug 1703961 - Part 3: Implement custom highlights as Selection. r=emilio
AbandonedPublicDraft

Authored by jjaschke on Nov 24 2022, 5:22 PM.

Details

Reviewers
None
Bugzilla Bug ID
1703961
Summary

This is done by adding a new entry SelectionType::eHighlight.
In contrast to the existing selection types, highlight selections can occur more than once
and are identified by their highlightName (i.e., ::highlight(foo) in css).
This made some changes necessary to nsFrameSelection,
which now uses an additional hash map of highlight selections,
as well as to several methods dealing with getting style properties for selected text
in nsTextFrame, which now in addition to the SelectionType enum need the highlight name
as well.

Depends on D163008

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Branch
default
Lint
No Lint Coverage
SeverityLocationCodeMessage
Errordom/base/Highlight.cpp:75mozilla-can-run-scriptBuild Error
Errordom/base/Highlight.cpp:76mozilla-can-run-scriptBuild Error
Errordom/base/HighlightRegistry.cpp:53mozilla-must-return-from-callerBuild Error
Errordom/base/HighlightRegistry.cpp:72mozilla-must-return-from-callerBuild Error
Errorlayout/generic/nsFrameSelection.cpp:1590mozilla-no-auto-typeBuild Error
Errorlayout/generic/nsFrameSelection.h:45source-test-mozlint-file-whitespacefile-whitespace (Mozlint)
Warningdom/base/AbstractRange.h:116invalid-stylingclang-format
Warningdom/base/Highlight.cpp:57invalid-stylingclang-format
Warningdom/base/HighlightRegistry.cpp:38invalid-stylingclang-format
Warningdom/base/HighlightRegistry.h:61invalid-stylingclang-format
Warninglayout/generic/nsFrameSelection.h:45invalid-stylingclang-format
Unit
No Test Coverage

Event Timeline

jjaschke created this revision.
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".Nov 24 2022, 5:22 PM
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Code analysis found 11 defects in the diff 651243:

  • 1 defect found by file-whitespace (Mozlint)
  • 5 build errors found by clang-tidy
  • 5 defects found by clang-format
WARNING: Found 5 issues (warning level) that can be dismissed.
IMPORTANT: Found 6 issues (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach clang-format -p dom/base/AbstractRange.h dom/base/HighlightRegistry.cpp layout/generic/nsFrameSelection.h dom/base/Highlight.cpp dom/base/HighlightRegistry.h
  • ./mach lint --warnings --outgoing
  • ./mach static-analysis check --outgoing (C/C++)

For your convenience, here is a patch that fixes all the clang-format defects (use it in your repository with hg import or git apply -p0).


If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 651243.