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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 textOffset = innerTextRenderer->location(); | 184 textOffset = innerTextRenderer->location(); |
185 if (editingViewPortElement() && editingViewPortElement()->renderBox()) | 185 if (editingViewPortElement() && editingViewPortElement()->renderBox()) |
186 textOffset += toLayoutSize(editingViewPortElement()->renderBox()->lo
cation()); | 186 textOffset += toLayoutSize(editingViewPortElement()->renderBox()->lo
cation()); |
187 if (containerRenderer) | 187 if (containerRenderer) |
188 textOffset += toLayoutSize(containerRenderer->location()); | 188 textOffset += toLayoutSize(containerRenderer->location()); |
189 placeholderBox->setLocation(textOffset); | 189 placeholderBox->setLocation(textOffset); |
190 | 190 |
191 if (!placeholderBoxHadLayout && placeholderBox->checkForRepaintDuringLay
out()) { | 191 if (!placeholderBoxHadLayout && placeholderBox->checkForRepaintDuringLay
out()) { |
192 // This assumes a shadow tree without floats. If floats are added, t
he | 192 // This assumes a shadow tree without floats. If floats are added, t
he |
193 // logic should be shared with RenderBlockFlow::layoutBlockChild. | 193 // logic should be shared with RenderBlockFlow::layoutBlockChild. |
194 placeholderBox->repaint(); | 194 placeholderBox->paintInvalidationForWholeRenderer(); |
195 } | 195 } |
196 // The placeholder gets layout last, after the parent text control and i
ts other children, | 196 // The placeholder gets layout last, after the parent text control and i
ts other children, |
197 // so in order to get the correct overflow from the placeholder we need
to recompute it now. | 197 // so in order to get the correct overflow from the placeholder we need
to recompute it now. |
198 if (neededLayout) | 198 if (neededLayout) |
199 computeOverflow(clientLogicalBottom()); | 199 computeOverflow(clientLogicalBottom()); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
TestResult& result, const HitTestLocation& locationInContainer, const LayoutPoin
t& accumulatedOffset, HitTestAction hitTestAction) | 203 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
TestResult& result, const HitTestLocation& locationInContainer, const LayoutPoin
t& accumulatedOffset, HitTestAction hitTestAction) |
204 { | 204 { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // 2) The frame is active | 258 // 2) The frame is active |
259 // 3) The element is focused | 259 // 3) The element is focused |
260 // 4) The caps lock is on | 260 // 4) The caps lock is on |
261 bool shouldDrawCapsLockIndicator = false; | 261 bool shouldDrawCapsLockIndicator = false; |
262 | 262 |
263 if (LocalFrame* frame = document().frame()) | 263 if (LocalFrame* frame = document().frame()) |
264 shouldDrawCapsLockIndicator = inputElement()->isPasswordField() && frame
->selection().isFocusedAndActive() && document().focusedElement() == node() && P
latformKeyboardEvent::currentCapsLockState(); | 264 shouldDrawCapsLockIndicator = inputElement()->isPasswordField() && frame
->selection().isFocusedAndActive() && document().focusedElement() == node() && P
latformKeyboardEvent::currentCapsLockState(); |
265 | 265 |
266 if (shouldDrawCapsLockIndicator != m_shouldDrawCapsLockIndicator) { | 266 if (shouldDrawCapsLockIndicator != m_shouldDrawCapsLockIndicator) { |
267 m_shouldDrawCapsLockIndicator = shouldDrawCapsLockIndicator; | 267 m_shouldDrawCapsLockIndicator = shouldDrawCapsLockIndicator; |
268 repaint(); | 268 paintInvalidationForWholeRenderer(); |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 bool RenderTextControlSingleLine::hasControlClip() const | 272 bool RenderTextControlSingleLine::hasControlClip() const |
273 { | 273 { |
274 // Apply control clip for text fields with decorations. | 274 // Apply control clip for text fields with decorations. |
275 return !!containerElement(); | 275 return !!containerElement(); |
276 } | 276 } |
277 | 277 |
278 LayoutRect RenderTextControlSingleLine::controlClipRect(const LayoutPoint& addit
ionalOffset) const | 278 LayoutRect RenderTextControlSingleLine::controlClipRect(const LayoutPoint& addit
ionalOffset) const |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 if (innerTextElement()) | 419 if (innerTextElement()) |
420 innerTextElement()->setScrollTop(newTop); | 420 innerTextElement()->setScrollTop(newTop); |
421 } | 421 } |
422 | 422 |
423 HTMLInputElement* RenderTextControlSingleLine::inputElement() const | 423 HTMLInputElement* RenderTextControlSingleLine::inputElement() const |
424 { | 424 { |
425 return toHTMLInputElement(node()); | 425 return toHTMLInputElement(node()); |
426 } | 426 } |
427 | 427 |
428 } | 428 } |
OLD | NEW |