nsIFrame::mClass is of type enum class nsQueryFrame::ClassID which is
a strict subset of the nsQueryFrame::FrameIID values. For a concrete
frame class, its FrameIID is the same numeric value as its ClassID.
MozReview-Commit-ID: 1N0AkCGo1ol
This patch implements chrome-only Selection#setColors and
Selection#resetColors methods, and use it to set the background color of
the preferences search highlight.
MozReview-Commit-ID: 2U92aBCAyeh
--HG--
extra : rebase_source : b07af1f37309d8184584b298a720cd5c1382929a
This avoids conflicts with mozilla::dom::FrameType.
MozReview-Commit-ID: 7aEMbHRaTFk
--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
The cleanup work includes:
part 1: make all methods 'const' for the abstract class of PropertyProvider.
part 2: make nsFontMetrics's StubPropertyProvider final.
part 3: make nsTextFrame's PropertyProvider final.
Make some methods 'const' and some variables 'mutable', so we could let all the
overridden methods stay const.
We also need to make the pass-in parameter of gfxFontGroup's GetHyphenWidth const.
Note that the comment of GetHyphenWidth seem outdated, so I fixed it as well.
part 4: make the member variables in nsTextFrame's PropertyProvider to be 'const'.
Make all the member variables 'const' except mStart, mLength,
mJustificationArrayStart, and mJustificationSpacings.
The static function AdvanceToNextTab is fixed since we only use 2 of the 4 parameters.
part 5: coding style fix for nsTextFrame's PropertyProvider.
MozReview-Commit-ID: 1kbWPwx27aQ
For the non-owning pointer usage like iterating SelectionDetails's linked
list, it's sufficient to use SelectionDetails*.
MozReview-Commit-ID: 7PCFhD6Iz8j
--HG--
extra : rebase_source : 2d26edd513a402384e26719b3c0b5362d7a4ebb8
Masayuki suggests GetCharcterRectsInRange instead of first idea's API by part 2 implementation.
IME wants to need the width per character. Now nsTextFrame/nsIFrmae has only API to get point of string. So I want to add this method to calculate simply by comment #3.
If no text frame, I would like to return error due to no character. (Caller shouldn't call this API on non-text frame.)
MozReview-Commit-ID: LQHUTzhnGn
--HG--
extra : rebase_source : bc495493c7be73afb05489ad2169e8dcdd6e6da4
extra : histedit_source : e54a7c3bfb100765317a0c8a83b432d5f706ffe1
This patch defines mozilla::SelectionType as an enum class. This is safer than nsISelectionController::SELECTION_* since setting illegal value to its variable is checked at build time. So, as far as possible, this should be used everywhere (but of course, this isn't available in scriptable interfaces).
And also this implements some useful methods for managing SelectionType and RawSelectionType which are implemented in layout/nsSelection.cpp because nsISelectionController is implemented by both PresShell and nsTextEditorState. Therefore, implementing one of them may make hard to find them. On the other hand, nsSelection.cpp is a better file name to look for them.
Note that this patch creates mozilla::Selection::RawType() for binding. Native code should keep using Selection::Type() but the binding code needs to use RawType() due to impossible to convert from SelectionType to RawSelectionType without explicit cast.
MozReview-Commit-ID: 81vX7A0hHQN
--HG--
extra : rebase_source : d9f88e217c713c60d1c2578ce6421c73ccba8650
mozilla::SelectionType will be an enum class. Therefore, we need to rename SelectionType with a word "raw" since it's a type for raw nsISelectionController::SELECTION_*.
MozReview-Commit-ID: K8SO0bbpv0Y
--HG--
extra : rebase_source : 56e3ac852657ef4795d718d2da09b16903c2e66c
Bug 655877 Part 20 made this deliberately to let nsTextFrame
QueryFrame-able. https://hg.mozilla.org/mozilla-central/rev/d8c6025c0881
But other types like nsPlaceholderFrame or nsBulletFrame are also
implemented QureyFrame, which do not have this inheritance indirection.
I guess it was for historical reason, and can be removed safely.
MozReview-Commit-ID: CPeQvpKzEKh
--HG--
extra : rebase_source : 86e784648cab3982ff16b3d45a312b98cd963841
Although this makes some places more complicated, code should generally
be simpler and clearer. It could slightly improve performance on x64 for
functions with more than four parameters, since it makes more data be
passed via registers rather than the stack.
MozReview-Commit-ID: D0GM2Jyrr6W
--HG--
extra : source : bd88a2e478e23edf1845f724a32fef908c8cc007