| 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 11 matching lines...) Expand all Loading... |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #include "core/layout/LayoutTextControlSingleLine.h" | 24 #include "core/layout/LayoutTextControlSingleLine.h" |
| 25 | 25 |
| 26 #include "core/CSSValueKeywords.h" | 26 #include "core/CSSValueKeywords.h" |
| 27 #include "core/InputTypeNames.h" | 27 #include "core/InputTypeNames.h" |
| 28 #include "core/dom/shadow/ShadowRoot.h" | 28 #include "core/dom/shadow/ShadowRoot.h" |
| 29 #include "core/editing/FrameSelection.h" | 29 #include "core/editing/FrameSelection.h" |
| 30 #include "core/frame/LocalFrame.h" | 30 #include "core/frame/LocalFrame.h" |
| 31 #include "core/html/shadow/ShadowElementNames.h" | 31 #include "core/html/shadow/ShadowElementNames.h" |
| 32 #include "core/input/KeyboardEventManager.h" |
| 32 #include "core/layout/HitTestResult.h" | 33 #include "core/layout/HitTestResult.h" |
| 33 #include "core/layout/LayoutAnalyzer.h" | 34 #include "core/layout/LayoutAnalyzer.h" |
| 34 #include "core/layout/LayoutTheme.h" | 35 #include "core/layout/LayoutTheme.h" |
| 35 #include "core/paint/LayoutObjectDrawingRecorder.h" | 36 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 36 #include "core/paint/PaintInfo.h" | 37 #include "core/paint/PaintInfo.h" |
| 37 #include "core/paint/PaintLayer.h" | 38 #include "core/paint/PaintLayer.h" |
| 38 #include "core/paint/ThemePainter.h" | 39 #include "core/paint/ThemePainter.h" |
| 39 #include "platform/PlatformKeyboardEvent.h" | |
| 40 #include "platform/fonts/SimpleFontData.h" | 40 #include "platform/fonts/SimpleFontData.h" |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 using namespace HTMLNames; | 44 using namespace HTMLNames; |
| 45 | 45 |
| 46 LayoutTextControlSingleLine::LayoutTextControlSingleLine(HTMLInputElement* eleme
nt) | 46 LayoutTextControlSingleLine::LayoutTextControlSingleLine(HTMLInputElement* eleme
nt) |
| 47 : LayoutTextControl(element) | 47 : LayoutTextControl(element) |
| 48 , m_shouldDrawCapsLockIndicator(false) | 48 , m_shouldDrawCapsLockIndicator(false) |
| 49 { | 49 { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return; | 182 return; |
| 183 | 183 |
| 184 // Only draw the caps lock indicator if these things are true: | 184 // Only draw the caps lock indicator if these things are true: |
| 185 // 1) The field is a password field | 185 // 1) The field is a password field |
| 186 // 2) The frame is active | 186 // 2) The frame is active |
| 187 // 3) The element is focused | 187 // 3) The element is focused |
| 188 // 4) The caps lock is on | 188 // 4) The caps lock is on |
| 189 bool shouldDrawCapsLockIndicator = false; | 189 bool shouldDrawCapsLockIndicator = false; |
| 190 | 190 |
| 191 if (LocalFrame* frame = document().frame()) | 191 if (LocalFrame* frame = document().frame()) |
| 192 shouldDrawCapsLockIndicator = inputElement()->type() == InputTypeNames::
password && frame->selection().isFocusedAndActive() && document().focusedElement
() == node() && PlatformKeyboardEvent::currentCapsLockState(); | 192 shouldDrawCapsLockIndicator = inputElement()->type() == InputTypeNames::
password && frame->selection().isFocusedAndActive() && document().focusedElement
() == node() && KeyboardEventManager::currentCapsLockState(); |
| 193 | 193 |
| 194 if (shouldDrawCapsLockIndicator != m_shouldDrawCapsLockIndicator) { | 194 if (shouldDrawCapsLockIndicator != m_shouldDrawCapsLockIndicator) { |
| 195 m_shouldDrawCapsLockIndicator = shouldDrawCapsLockIndicator; | 195 m_shouldDrawCapsLockIndicator = shouldDrawCapsLockIndicator; |
| 196 setShouldDoFullPaintInvalidation(); | 196 setShouldDoFullPaintInvalidation(); |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool LayoutTextControlSingleLine::hasControlClip() const | 200 bool LayoutTextControlSingleLine::hasControlClip() const |
| 201 { | 201 { |
| 202 return true; | 202 return true; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // inner-editor element overflows the INPUT box intentionally, however it | 377 // inner-editor element overflows the INPUT box intentionally, however it |
| 378 // shouldn't affect outside of the INPUT box. So we ignore child overflow. | 378 // shouldn't affect outside of the INPUT box. So we ignore child overflow. |
| 379 } | 379 } |
| 380 | 380 |
| 381 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const | 381 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const |
| 382 { | 382 { |
| 383 return toHTMLInputElement(node()); | 383 return toHTMLInputElement(node()); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace blink | 386 } // namespace blink |
| OLD | NEW |