mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 491960. Only reflow due to selection if we did or will have overflowing selection decorations. r=dbaron
This commit is contained in:
parent
6724ca0012
commit
2d82c27e96
@ -5032,11 +5032,12 @@ nsTextFrame::SetSelected(nsPresContext* aPresContext,
|
||||
// If the selection state is changed in this content, we need to reflow
|
||||
// to recompute the overflow area for underline of spellchecking or IME if
|
||||
// their underline is thicker than normal decoration line.
|
||||
PRBool didHaveSelectionUnderline =
|
||||
!!(mState & TEXT_SELECTION_UNDERLINE_OVERFLOWED);
|
||||
PRBool didHaveOverflowingSelection =
|
||||
(mState & TEXT_SELECTION_UNDERLINE_OVERFLOWED) != 0;
|
||||
nsRect r(nsPoint(0, 0), GetSize());
|
||||
if (didHaveSelectionUnderline != aSelected ||
|
||||
(aSelected && CombineSelectionUnderlineRect(PresContext(), r))) {
|
||||
PRBool willHaveOverflowingSelection =
|
||||
aSelected && CombineSelectionUnderlineRect(PresContext(), r);
|
||||
if (didHaveOverflowingSelection || willHaveOverflowingSelection) {
|
||||
PresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
|
Loading…
Reference in New Issue
Block a user