Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: Source/core/layout/LayoutTextControlSingleLine.cpp

Issue 1177043016: [SP] Add a drawing recorder before painting caps lock indicator in password fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Need to rebaseline new tests under virtual/antialiasedtext as well. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/text/caps-lock-indicator-enabled.html ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 16 matching lines...) Expand all
27 #include "core/CSSValueKeywords.h" 27 #include "core/CSSValueKeywords.h"
28 #include "core/InputTypeNames.h" 28 #include "core/InputTypeNames.h"
29 #include "core/dom/shadow/ShadowRoot.h" 29 #include "core/dom/shadow/ShadowRoot.h"
30 #include "core/editing/FrameSelection.h" 30 #include "core/editing/FrameSelection.h"
31 #include "core/frame/LocalFrame.h" 31 #include "core/frame/LocalFrame.h"
32 #include "core/html/shadow/ShadowElementNames.h" 32 #include "core/html/shadow/ShadowElementNames.h"
33 #include "core/layout/HitTestResult.h" 33 #include "core/layout/HitTestResult.h"
34 #include "core/layout/LayoutAnalyzer.h" 34 #include "core/layout/LayoutAnalyzer.h"
35 #include "core/layout/LayoutTheme.h" 35 #include "core/layout/LayoutTheme.h"
36 #include "core/paint/DeprecatedPaintLayer.h" 36 #include "core/paint/DeprecatedPaintLayer.h"
37 #include "core/paint/LayoutObjectDrawingRecorder.h"
37 #include "core/paint/PaintInfo.h" 38 #include "core/paint/PaintInfo.h"
38 #include "core/paint/ThemePainter.h" 39 #include "core/paint/ThemePainter.h"
39 #include "platform/PlatformKeyboardEvent.h" 40 #include "platform/PlatformKeyboardEvent.h"
40 #include "platform/fonts/SimpleFontData.h" 41 #include "platform/fonts/SimpleFontData.h"
41 42
42 namespace blink { 43 namespace blink {
43 44
44 using namespace HTMLNames; 45 using namespace HTMLNames;
45 46
46 LayoutTextControlSingleLine::LayoutTextControlSingleLine(HTMLInputElement* eleme nt) 47 LayoutTextControlSingleLine::LayoutTextControlSingleLine(HTMLInputElement* eleme nt)
(...skipping 30 matching lines...) Expand all
77 LayoutRect contentsRect = contentBoxRect(); 78 LayoutRect contentsRect = contentBoxRect();
78 79
79 // Center in the block progression direction. 80 // Center in the block progression direction.
80 if (isHorizontalWritingMode()) 81 if (isHorizontalWritingMode())
81 contentsRect.setY((size().height() - contentsRect.height()) / 2); 82 contentsRect.setY((size().height() - contentsRect.height()) / 2);
82 else 83 else
83 contentsRect.setX((size().width() - contentsRect.width()) / 2); 84 contentsRect.setX((size().width() - contentsRect.width()) / 2);
84 85
85 // Convert the rect into the coords used for painting the content 86 // Convert the rect into the coords used for painting the content
86 contentsRect.moveBy(paintOffset + location()); 87 contentsRect.moveBy(paintOffset + location());
87 LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInfo, p ixelSnappedIntRect(contentsRect)); 88 IntRect snappedRect = pixelSnappedIntRect(contentsRect);
89 LayoutObjectDrawingRecorder recorder(*paintInfo.context, *this, paintInf o.phase, snappedRect);
90 if (!recorder.canUseCachedDrawing())
91 LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInf o, snappedRect);
88 } 92 }
89 } 93 }
90 94
91 LayoutUnit LayoutTextControlSingleLine::computeLogicalHeightLimit() const 95 LayoutUnit LayoutTextControlSingleLine::computeLogicalHeightLimit() const
92 { 96 {
93 return containerElement() ? contentLogicalHeight() : logicalHeight(); 97 return containerElement() ? contentLogicalHeight() : logicalHeight();
94 } 98 }
95 99
96 void LayoutTextControlSingleLine::layout() 100 void LayoutTextControlSingleLine::layout()
97 { 101 {
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (innerEditorElement()) 443 if (innerEditorElement())
440 innerEditorElement()->setScrollTop(newTop); 444 innerEditorElement()->setScrollTop(newTop);
441 } 445 }
442 446
443 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const 447 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const
444 { 448 {
445 return toHTMLInputElement(node()); 449 return toHTMLInputElement(node());
446 } 450 }
447 451
448 } 452 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/caps-lock-indicator-enabled.html ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698