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

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

Issue 2878333002: Make ETextModify an enum class. (Closed)
Patch Set: 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 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 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 inner_editor_layout_object->SetStyle(CreateInnerEditorStyle(StyleRef())); 60 inner_editor_layout_object->SetStyle(CreateInnerEditorStyle(StyleRef()));
61 inner_editor->SetNeedsStyleRecalc( 61 inner_editor->SetNeedsStyleRecalc(
62 kSubtreeStyleChange, 62 kSubtreeStyleChange,
63 StyleChangeReasonForTracing::Create(StyleChangeReason::kControl)); 63 StyleChangeReasonForTracing::Create(StyleChangeReason::kControl));
64 } 64 }
65 GetTextControlElement()->UpdatePlaceholderVisibility(); 65 GetTextControlElement()->UpdatePlaceholderVisibility();
66 } 66 }
67 67
68 static inline void UpdateUserModifyProperty(TextControlElement& node, 68 static inline void UpdateUserModifyProperty(TextControlElement& node,
69 ComputedStyle& style) { 69 ComputedStyle& style) {
70 style.SetUserModify(node.IsDisabledOrReadOnly() ? READ_ONLY 70 style.SetUserModify(node.IsDisabledOrReadOnly()
71 : READ_WRITE_PLAINTEXT_ONLY); 71 ? EUserModify::kReadOnly
72 : EUserModify::kReadWritePlaintextOnly);
72 } 73 }
73 74
74 void LayoutTextControl::AdjustInnerEditorStyle( 75 void LayoutTextControl::AdjustInnerEditorStyle(
75 ComputedStyle& text_block_style) const { 76 ComputedStyle& text_block_style) const {
76 // The inner block, if present, always has its direction set to LTR, 77 // The inner block, if present, always has its direction set to LTR,
77 // so we need to inherit the direction and unicode-bidi style from the 78 // so we need to inherit the direction and unicode-bidi style from the
78 // element. 79 // element.
79 text_block_style.SetDirection(Style()->Direction()); 80 text_block_style.SetDirection(Style()->Direction());
80 text_block_style.SetUnicodeBidi(Style()->GetUnicodeBidi()); 81 text_block_style.SetUnicodeBidi(Style()->GetUnicodeBidi());
81 82
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 LayoutUnit baseline(font_data->GetFontMetrics().Ascent(kAlphabeticBaseline)); 364 LayoutUnit baseline(font_data->GetFontMetrics().Ascent(kAlphabeticBaseline));
364 for (LayoutObject* box = inner_editor_layout_object; box && box != this; 365 for (LayoutObject* box = inner_editor_layout_object; box && box != this;
365 box = box->Parent()) { 366 box = box->Parent()) {
366 if (box->IsBox()) 367 if (box->IsBox())
367 baseline += ToLayoutBox(box)->LogicalTop(); 368 baseline += ToLayoutBox(box)->LogicalTop();
368 } 369 }
369 return baseline.ToInt(); 370 return baseline.ToInt();
370 } 371 }
371 372
372 } // namespace blink 373 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/layout/TextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698