Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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); | |
|
chrishtr
2015/06/18 20:09:02
visual overflow rect instead?
wkorman
2015/06/18 22:26:04
Discussed in person, sticking with contentsRect as
| |
| 90 LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInfo, s nappedRect); | |
| 88 } | 91 } |
| 89 } | 92 } |
| 90 | 93 |
| 91 LayoutUnit LayoutTextControlSingleLine::computeLogicalHeightLimit() const | 94 LayoutUnit LayoutTextControlSingleLine::computeLogicalHeightLimit() const |
| 92 { | 95 { |
| 93 return containerElement() ? contentLogicalHeight() : logicalHeight(); | 96 return containerElement() ? contentLogicalHeight() : logicalHeight(); |
| 94 } | 97 } |
| 95 | 98 |
| 96 void LayoutTextControlSingleLine::layout() | 99 void LayoutTextControlSingleLine::layout() |
| 97 { | 100 { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 if (innerEditorElement()) | 442 if (innerEditorElement()) |
| 440 innerEditorElement()->setScrollTop(newTop); | 443 innerEditorElement()->setScrollTop(newTop); |
| 441 } | 444 } |
| 442 | 445 |
| 443 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const | 446 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const |
| 444 { | 447 { |
| 445 return toHTMLInputElement(node()); | 448 return toHTMLInputElement(node()); |
| 446 } | 449 } |
| 447 | 450 |
| 448 } | 451 } |
| OLD | NEW |