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

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

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix additional test Created 4 years, 10 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
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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 // decoration height 384 // decoration height
385 LayoutUnit adjustment = clientHeight() - inner->clientHeight(); 385 LayoutUnit adjustment = clientHeight() - inner->clientHeight();
386 return inner->scrollHeight() + adjustment; 386 return inner->scrollHeight() + adjustment;
387 } 387 }
388 return LayoutBlockFlow::scrollHeight(); 388 return LayoutBlockFlow::scrollHeight();
389 } 389 }
390 390
391 LayoutUnit LayoutTextControlSingleLine::scrollLeft() const 391 LayoutUnit LayoutTextControlSingleLine::scrollLeft() const
392 { 392 {
393 if (innerEditorElement()) 393 if (innerEditorElement())
394 return innerEditorElement()->scrollLeft(); 394 return LayoutUnit(innerEditorElement()->scrollLeft());
395 return LayoutBlockFlow::scrollLeft(); 395 return LayoutBlockFlow::scrollLeft();
396 } 396 }
397 397
398 LayoutUnit LayoutTextControlSingleLine::scrollTop() const 398 LayoutUnit LayoutTextControlSingleLine::scrollTop() const
399 { 399 {
400 if (innerEditorElement()) 400 if (innerEditorElement())
401 return innerEditorElement()->scrollTop(); 401 return LayoutUnit(innerEditorElement()->scrollTop());
402 return LayoutBlockFlow::scrollTop(); 402 return LayoutBlockFlow::scrollTop();
403 } 403 }
404 404
405 void LayoutTextControlSingleLine::setScrollLeft(LayoutUnit newLeft) 405 void LayoutTextControlSingleLine::setScrollLeft(LayoutUnit newLeft)
406 { 406 {
407 if (innerEditorElement()) 407 if (innerEditorElement())
408 innerEditorElement()->setScrollLeft(newLeft); 408 innerEditorElement()->setScrollLeft(newLeft);
409 } 409 }
410 410
411 void LayoutTextControlSingleLine::setScrollTop(LayoutUnit newTop) 411 void LayoutTextControlSingleLine::setScrollTop(LayoutUnit newTop)
412 { 412 {
413 if (innerEditorElement()) 413 if (innerEditorElement())
414 innerEditorElement()->setScrollTop(newTop); 414 innerEditorElement()->setScrollTop(newTop);
415 } 415 }
416 416
417 void LayoutTextControlSingleLine::addOverflowFromChildren() 417 void LayoutTextControlSingleLine::addOverflowFromChildren()
418 { 418 {
419 // If the INPUT content height is smaller than the font height, the 419 // If the INPUT content height is smaller than the font height, the
420 // inner-editor element overflows the INPUT box intentionally, however it 420 // inner-editor element overflows the INPUT box intentionally, however it
421 // shouldn't affect outside of the INPUT box. So we ignore child overflow. 421 // shouldn't affect outside of the INPUT box. So we ignore child overflow.
422 } 422 }
423 423
424 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const 424 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const
425 { 425 {
426 return toHTMLInputElement(node()); 426 return toHTMLInputElement(node());
427 } 427 }
428 428
429 } // namespace blink 429 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698