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

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

Issue 2882903002: Make EOverflowWrap an enum class. (Closed)
Patch Set: Rebase Created 3 years, 7 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. 3 * (C) 2008 Torch Mobile Inc. All rights reserved.
4 * (http://www.torchmobile.com/) 4 * (http://www.torchmobile.com/)
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 6 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return line_height + non_content_height; 298 return line_height + non_content_height;
299 } 299 }
300 300
301 PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::CreateInnerEditorStyle( 301 PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::CreateInnerEditorStyle(
302 const ComputedStyle& start_style) const { 302 const ComputedStyle& start_style) const {
303 RefPtr<ComputedStyle> text_block_style = ComputedStyle::Create(); 303 RefPtr<ComputedStyle> text_block_style = ComputedStyle::Create();
304 text_block_style->InheritFrom(start_style); 304 text_block_style->InheritFrom(start_style);
305 AdjustInnerEditorStyle(*text_block_style); 305 AdjustInnerEditorStyle(*text_block_style);
306 306
307 text_block_style->SetWhiteSpace(EWhiteSpace::kPre); 307 text_block_style->SetWhiteSpace(EWhiteSpace::kPre);
308 text_block_style->SetOverflowWrap(kNormalOverflowWrap); 308 text_block_style->SetOverflowWrap(EOverflowWrap::kNormal);
309 text_block_style->SetTextOverflow( 309 text_block_style->SetTextOverflow(
310 TextShouldBeTruncated() ? kTextOverflowEllipsis : kTextOverflowClip); 310 TextShouldBeTruncated() ? kTextOverflowEllipsis : kTextOverflowClip);
311 311
312 int computed_line_height = 312 int computed_line_height =
313 LineHeight(true, kHorizontalLine, kPositionOfInteriorLineBoxes).ToInt(); 313 LineHeight(true, kHorizontalLine, kPositionOfInteriorLineBoxes).ToInt();
314 // Do not allow line-height to be smaller than our default. 314 // Do not allow line-height to be smaller than our default.
315 if (text_block_style->FontSize() >= computed_line_height) 315 if (text_block_style->FontSize() >= computed_line_height)
316 text_block_style->SetLineHeight(ComputedStyle::InitialLineHeight()); 316 text_block_style->SetLineHeight(ComputedStyle::InitialLineHeight());
317 317
318 // We'd like to remove line-height if it's unnecessary because 318 // We'd like to remove line-height if it's unnecessary because
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // If the INPUT content height is smaller than the font height, the 408 // If the INPUT content height is smaller than the font height, the
409 // inner-editor element overflows the INPUT box intentionally, however it 409 // inner-editor element overflows the INPUT box intentionally, however it
410 // shouldn't affect outside of the INPUT box. So we ignore child overflow. 410 // shouldn't affect outside of the INPUT box. So we ignore child overflow.
411 } 411 }
412 412
413 HTMLInputElement* LayoutTextControlSingleLine::InputElement() const { 413 HTMLInputElement* LayoutTextControlSingleLine::InputElement() const {
414 return toHTMLInputElement(GetNode()); 414 return toHTMLInputElement(GetNode());
415 } 415 }
416 416
417 } // namespace blink 417 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTextControl.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698