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

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

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 2 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 352 }
353 353
354 PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(co nst ComputedStyle& startStyle) const 354 PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(co nst ComputedStyle& startStyle) const
355 { 355 {
356 RefPtr<ComputedStyle> textBlockStyle = ComputedStyle::create(); 356 RefPtr<ComputedStyle> textBlockStyle = ComputedStyle::create();
357 textBlockStyle->inheritFrom(startStyle); 357 textBlockStyle->inheritFrom(startStyle);
358 adjustInnerEditorStyle(*textBlockStyle); 358 adjustInnerEditorStyle(*textBlockStyle);
359 359
360 textBlockStyle->setWhiteSpace(PRE); 360 textBlockStyle->setWhiteSpace(PRE);
361 textBlockStyle->setOverflowWrap(NormalOverflowWrap); 361 textBlockStyle->setOverflowWrap(NormalOverflowWrap);
362 textBlockStyle->setOverflowX(OHIDDEN);
363 textBlockStyle->setOverflowY(OHIDDEN);
364 textBlockStyle->setTextOverflow(textShouldBeTruncated() ? TextOverflowEllips is : TextOverflowClip); 362 textBlockStyle->setTextOverflow(textShouldBeTruncated() ? TextOverflowEllips is : TextOverflowClip);
365 363
366 if (m_desiredInnerEditorLogicalHeight >= 0) 364 if (m_desiredInnerEditorLogicalHeight >= 0)
367 textBlockStyle->setLogicalHeight(Length(m_desiredInnerEditorLogicalHeigh t, Fixed)); 365 textBlockStyle->setLogicalHeight(Length(m_desiredInnerEditorLogicalHeigh t, Fixed));
368 // Do not allow line-height to be smaller than our default. 366 // Do not allow line-height to be smaller than our default.
369 if (textBlockStyle->fontMetrics().lineSpacing() > lineHeight(true, Horizonta lLine, PositionOfInteriorLineBoxes)) 367 if (textBlockStyle->fontMetrics().lineSpacing() > lineHeight(true, Horizonta lLine, PositionOfInteriorLineBoxes))
370 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); 368 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight());
371 369
372 textBlockStyle->setDisplay(BLOCK); 370 textBlockStyle->setDisplay(BLOCK);
373 textBlockStyle->setUnique(); 371 textBlockStyle->setUnique();
374 372
375 if (inputElement()->shouldRevealPassword()) 373 if (inputElement()->shouldRevealPassword())
376 textBlockStyle->setTextSecurity(TSNONE); 374 textBlockStyle->setTextSecurity(TSNONE);
377 375
376 textBlockStyle->setOverflowX(OSCROLL);
377 textBlockStyle->setOverflowY(OSCROLL);
378 RefPtr<ComputedStyle> noScrollbarStyle = ComputedStyle::create();
379 noScrollbarStyle->setStyleType(SCROLLBAR);
380 noScrollbarStyle->setDisplay(NONE);
381 textBlockStyle->addCachedPseudoStyle(noScrollbarStyle);
382 textBlockStyle->setHasPseudoStyle(SCROLLBAR);
383
378 return textBlockStyle.release(); 384 return textBlockStyle.release();
379 } 385 }
380 386
381 bool LayoutTextControlSingleLine::textShouldBeTruncated() const 387 bool LayoutTextControlSingleLine::textShouldBeTruncated() const
382 { 388 {
383 return document().focusedElement() != node() && styleRef().textOverflow() == TextOverflowEllipsis; 389 return document().focusedElement() != node() && styleRef().textOverflow() == TextOverflowEllipsis;
384 } 390 }
385 391
386 void LayoutTextControlSingleLine::autoscroll(const IntPoint& position) 392 void LayoutTextControlSingleLine::autoscroll(const IntPoint& position)
387 { 393 {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (innerEditorElement()) 445 if (innerEditorElement())
440 innerEditorElement()->setScrollTop(newTop); 446 innerEditorElement()->setScrollTop(newTop);
441 } 447 }
442 448
443 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const 449 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const
444 { 450 {
445 return toHTMLInputElement(node()); 451 return toHTMLInputElement(node());
446 } 452 }
447 453
448 } 454 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698