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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/TextControlInnerElements.cpp

Issue 2957513002: Removed calls to RefPtr::Release in return statements with auto move. (Closed)
Patch Set: rebased Created 3 years, 5 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, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 style->SetFlexGrow(1); 82 style->SetFlexGrow(1);
83 style->SetMinWidth(Length(0, kFixed)); 83 style->SetMinWidth(Length(0, kFixed));
84 style->SetDisplay(EDisplay::kBlock); 84 style->SetDisplay(EDisplay::kBlock);
85 style->SetDirection(TextDirection::kLtr); 85 style->SetDirection(TextDirection::kLtr);
86 86
87 // We don't want the shadow dom to be editable, so we set this block to 87 // We don't want the shadow dom to be editable, so we set this block to
88 // read-only in case the input itself is editable. 88 // read-only in case the input itself is editable.
89 style->SetUserModify(EUserModify::kReadOnly); 89 style->SetUserModify(EUserModify::kReadOnly);
90 style->SetUnique(); 90 style->SetUnique();
91 91
92 return style.Release(); 92 return style;
93 } 93 }
94 94
95 // --------------------------- 95 // ---------------------------
96 96
97 inline TextControlInnerEditorElement::TextControlInnerEditorElement( 97 inline TextControlInnerEditorElement::TextControlInnerEditorElement(
98 Document& document) 98 Document& document)
99 : HTMLDivElement(document) { 99 : HTMLDivElement(document) {
100 SetHasCustomStyleCallbacks(); 100 SetHasCustomStyleCallbacks();
101 } 101 }
102 102
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if (!parent_layout_object || !parent_layout_object->IsTextControl()) 139 if (!parent_layout_object || !parent_layout_object->IsTextControl())
140 return OriginalStyleForLayoutObject(); 140 return OriginalStyleForLayoutObject();
141 LayoutTextControlItem text_control_layout_item = 141 LayoutTextControlItem text_control_layout_item =
142 LayoutTextControlItem(ToLayoutTextControl(parent_layout_object)); 142 LayoutTextControlItem(ToLayoutTextControl(parent_layout_object));
143 RefPtr<ComputedStyle> inner_editor_style = 143 RefPtr<ComputedStyle> inner_editor_style =
144 text_control_layout_item.CreateInnerEditorStyle( 144 text_control_layout_item.CreateInnerEditorStyle(
145 text_control_layout_item.StyleRef()); 145 text_control_layout_item.StyleRef());
146 // Using StyleAdjuster::adjustComputedStyle updates unwanted style. We'd like 146 // Using StyleAdjuster::adjustComputedStyle updates unwanted style. We'd like
147 // to apply only editing-related and alignment-related. 147 // to apply only editing-related and alignment-related.
148 StyleAdjuster::AdjustStyleForEditing(*inner_editor_style); 148 StyleAdjuster::AdjustStyleForEditing(*inner_editor_style);
149 return inner_editor_style.Release(); 149 return inner_editor_style;
150 } 150 }
151 151
152 // ---------------------------- 152 // ----------------------------
153 153
154 inline SearchFieldCancelButtonElement::SearchFieldCancelButtonElement( 154 inline SearchFieldCancelButtonElement::SearchFieldCancelButtonElement(
155 Document& document) 155 Document& document)
156 : HTMLDivElement(document), capturing_(false) {} 156 : HTMLDivElement(document), capturing_(false) {}
157 157
158 SearchFieldCancelButtonElement* SearchFieldCancelButtonElement::Create( 158 SearchFieldCancelButtonElement* SearchFieldCancelButtonElement::Create(
159 Document& document) { 159 Document& document) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 bool SearchFieldCancelButtonElement::WillRespondToMouseClickEvents() { 198 bool SearchFieldCancelButtonElement::WillRespondToMouseClickEvents() {
199 const HTMLInputElement* input = toHTMLInputElement(OwnerShadowHost()); 199 const HTMLInputElement* input = toHTMLInputElement(OwnerShadowHost());
200 if (input && !input->IsDisabledOrReadOnly()) 200 if (input && !input->IsDisabledOrReadOnly())
201 return true; 201 return true;
202 202
203 return HTMLDivElement::WillRespondToMouseClickEvents(); 203 return HTMLDivElement::WillRespondToMouseClickEvents();
204 } 204 }
205 205
206 } // namespace blink 206 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698