зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1399564 - properly thread through selection-specific decorations to WR. r=jrmuizel
MozReview-Commit-ID: 7prde0BsOFL --HG-- extra : rebase_source : 188e7b75f7fc93ca2f87a8b3439696a28e3fb431
This commit is contained in:
Родитель
54c3a0b839
Коммит
952cdf7351
|
@ -6092,6 +6092,7 @@ nsTextFrame::PaintDecorationLine(const PaintDecorationLineParams& aParams)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
nsTextFrame::DrawSelectionDecorations(gfxContext* aContext,
|
nsTextFrame::DrawSelectionDecorations(gfxContext* aContext,
|
||||||
|
TextDrawTarget* aTextDrawer,
|
||||||
const LayoutDeviceRect& aDirtyRect,
|
const LayoutDeviceRect& aDirtyRect,
|
||||||
SelectionType aSelectionType,
|
SelectionType aSelectionType,
|
||||||
nsTextPaintStyle& aTextPaintStyle,
|
nsTextPaintStyle& aTextPaintStyle,
|
||||||
|
@ -6108,6 +6109,7 @@ nsTextFrame::DrawSelectionDecorations(gfxContext* aContext,
|
||||||
{
|
{
|
||||||
PaintDecorationLineParams params;
|
PaintDecorationLineParams params;
|
||||||
params.context = aContext;
|
params.context = aContext;
|
||||||
|
params.textDrawer = aTextDrawer;
|
||||||
params.dirtyRect = aDirtyRect;
|
params.dirtyRect = aDirtyRect;
|
||||||
params.pt = aPt;
|
params.pt = aPt;
|
||||||
params.lineSize.width = aWidth;
|
params.lineSize.width = aWidth;
|
||||||
|
@ -6124,6 +6126,12 @@ nsTextFrame::DrawSelectionDecorations(gfxContext* aContext,
|
||||||
|
|
||||||
float relativeSize;
|
float relativeSize;
|
||||||
|
|
||||||
|
// Since this happens after text, all we *should* be allowed to do is strikeThrough.
|
||||||
|
// If this isn't true, we're at least bug-compatible with gecko!
|
||||||
|
if (aTextDrawer) {
|
||||||
|
aTextDrawer->StartDrawing(TextDrawTarget::Phase::eLineThrough);
|
||||||
|
}
|
||||||
|
|
||||||
switch (aSelectionType) {
|
switch (aSelectionType) {
|
||||||
case SelectionType::eIMERawClause:
|
case SelectionType::eIMERawClause:
|
||||||
case SelectionType::eIMESelectedRawClause:
|
case SelectionType::eIMESelectedRawClause:
|
||||||
|
@ -6803,7 +6811,7 @@ nsTextFrame::PaintTextSelectionDecorations(
|
||||||
gfxFloat width = Abs(advance) / app;
|
gfxFloat width = Abs(advance) / app;
|
||||||
gfxFloat xInFrame = pt.x - (aParams.framePt.x / app);
|
gfxFloat xInFrame = pt.x - (aParams.framePt.x / app);
|
||||||
DrawSelectionDecorations(
|
DrawSelectionDecorations(
|
||||||
aParams.context, aParams.dirtyRect, aSelectionType,
|
aParams.context, aParams.textDrawer, aParams.dirtyRect, aSelectionType,
|
||||||
*aParams.textPaintStyle, selectedStyle, pt, xInFrame,
|
*aParams.textPaintStyle, selectedStyle, pt, xInFrame,
|
||||||
width, mAscent / app, decorationMetrics, aParams.callbacks,
|
width, mAscent / app, decorationMetrics, aParams.callbacks,
|
||||||
verticalRun, decorationOffsetDir, kDecoration);
|
verticalRun, decorationOffsetDir, kDecoration);
|
||||||
|
|
|
@ -829,6 +829,7 @@ protected:
|
||||||
* Utility methods to paint selection.
|
* Utility methods to paint selection.
|
||||||
*/
|
*/
|
||||||
void DrawSelectionDecorations(gfxContext* aContext,
|
void DrawSelectionDecorations(gfxContext* aContext,
|
||||||
|
TextDrawTarget* aTextDrawer,
|
||||||
const LayoutDeviceRect& aDirtyRect,
|
const LayoutDeviceRect& aDirtyRect,
|
||||||
mozilla::SelectionType aSelectionType,
|
mozilla::SelectionType aSelectionType,
|
||||||
nsTextPaintStyle& aTextPaintStyle,
|
nsTextPaintStyle& aTextPaintStyle,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче