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

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

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 years 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. (http://www.torchmo bile.com/) 3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 void LayoutTextControl::updateFromElement() 104 void LayoutTextControl::updateFromElement()
105 { 105 {
106 Element* innerEditor = innerEditorElement(); 106 Element* innerEditor = innerEditorElement();
107 if (innerEditor && innerEditor->layoutObject()) 107 if (innerEditor && innerEditor->layoutObject())
108 updateUserModifyProperty(*textFormControlElement(), innerEditor->layoutO bject()->mutableStyleRef()); 108 updateUserModifyProperty(*textFormControlElement(), innerEditor->layoutO bject()->mutableStyleRef());
109 } 109 }
110 110
111 int LayoutTextControl::scrollbarThickness() const 111 int LayoutTextControl::scrollbarThickness() const
112 { 112 {
113 // FIXME: We should get the size of the scrollbar from the LayoutTheme inste ad. 113 // FIXME: We should get the size of the scrollbar from the LayoutTheme inste ad.
114 return ScrollbarTheme::theme()->scrollbarThickness(); 114 return ScrollbarTheme::theme().scrollbarThickness();
115 } 115 }
116 116
117 void LayoutTextControl::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUni t logicalTop, LogicalExtentComputedValues& computedValues) const 117 void LayoutTextControl::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUni t logicalTop, LogicalExtentComputedValues& computedValues) const
118 { 118 {
119 HTMLElement* innerEditor = innerEditorElement(); 119 HTMLElement* innerEditor = innerEditorElement();
120 ASSERT(innerEditor); 120 ASSERT(innerEditor);
121 if (LayoutBox* innerEditorBox = innerEditor->layoutBox()) { 121 if (LayoutBox* innerEditorBox = innerEditor->layoutBox()) {
122 LayoutUnit nonContentHeight = innerEditorBox->borderAndPaddingHeight() + innerEditorBox->marginHeight(); 122 LayoutUnit nonContentHeight = innerEditorBox->borderAndPaddingHeight() + innerEditorBox->marginHeight();
123 logicalHeight = computeControlLogicalHeight(innerEditorBox->lineHeight(t rue, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight); 123 logicalHeight = computeControlLogicalHeight(innerEditorBox->lineHeight(t rue, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight);
124 124
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element(); 280 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element();
281 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr; 281 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr;
282 if (!placeholderLayoutObject) 282 if (!placeholderLayoutObject)
283 return nullptr; 283 return nullptr;
284 if (relayoutChildren) 284 if (relayoutChildren)
285 layoutScope.setChildNeedsLayout(placeholderLayoutObject); 285 layoutScope.setChildNeedsLayout(placeholderLayoutObject);
286 return placeholderLayoutObject; 286 return placeholderLayoutObject;
287 } 287 }
288 288
289 } // namespace blink 289 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698