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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: rebase Created 4 years, 3 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 // We'd like to remove line-height if it's unnecessary because 282 // We'd like to remove line-height if it's unnecessary because
283 // overflow:scroll clips editing text by line-height. 283 // overflow:scroll clips editing text by line-height.
284 Length logicalHeight = startStyle.logicalHeight(); 284 Length logicalHeight = startStyle.logicalHeight();
285 // Here, we remove line-height if the INPUT fixed height is taller than the 285 // Here, we remove line-height if the INPUT fixed height is taller than the
286 // line-height. It's not the precise condition because logicalHeight 286 // line-height. It's not the precise condition because logicalHeight
287 // includes border and padding if box-sizing:border-box, and there are cases 287 // includes border and padding if box-sizing:border-box, and there are cases
288 // in which we don't want to remove line-height with percent or calculated 288 // in which we don't want to remove line-height with percent or calculated
289 // length. 289 // length.
290 // TODO(tkent): This should be done during layout. 290 // TODO(tkent): This should be done during layout.
291 if (logicalHeight.hasPercent() || (logicalHeight.isFixed() && logicalHeight. getFloatValue() > computedLineHeight)) 291 if (logicalHeight.isPercentOrCalc() || (logicalHeight.isFixed() && logicalHe ight.getFloatValue() > computedLineHeight))
292 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); 292 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight());
293 293
294 textBlockStyle->setDisplay(BLOCK); 294 textBlockStyle->setDisplay(BLOCK);
295 textBlockStyle->setUnique(); 295 textBlockStyle->setUnique();
296 296
297 if (inputElement()->shouldRevealPassword()) 297 if (inputElement()->shouldRevealPassword())
298 textBlockStyle->setTextSecurity(TSNONE); 298 textBlockStyle->setTextSecurity(TSNONE);
299 299
300 textBlockStyle->setOverflowX(OverflowScroll); 300 textBlockStyle->setOverflowX(OverflowScroll);
301 // overflow-y:visible doesn't work because overflow-x:scroll makes a layer. 301 // overflow-y:visible doesn't work because overflow-x:scroll makes a layer.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTextControl.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698