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

Side by Side Diff: Source/core/html/forms/TextFieldInputType.cpp

Issue 288143002: Added missing null check to avoid crash. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (event->defaultHandled()) 225 if (event->defaultHandled())
226 return; 226 return;
227 } 227 }
228 228
229 if (element().renderer() && (event->isMouseEvent() || event->isDragEvent() | | event->hasInterface(EventNames::WheelEvent) || event->type() == EventTypeNames ::blur || event->type() == EventTypeNames::focus)) { 229 if (element().renderer() && (event->isMouseEvent() || event->isDragEvent() | | event->hasInterface(EventNames::WheelEvent) || event->type() == EventTypeNames ::blur || event->type() == EventTypeNames::focus)) {
230 RenderTextControlSingleLine* renderTextControl = toRenderTextControlSing leLine(element().renderer()); 230 RenderTextControlSingleLine* renderTextControl = toRenderTextControlSing leLine(element().renderer());
231 if (event->type() == EventTypeNames::blur) { 231 if (event->type() == EventTypeNames::blur) {
232 if (RenderBox* innerTextRenderer = element().innerTextElement()->ren derBox()) { 232 if (RenderBox* innerTextRenderer = element().innerTextElement()->ren derBox()) {
233 // FIXME: This class has no need to know about RenderLayer! 233 // FIXME: This class has no need to know about RenderLayer!
234 if (RenderLayer* innerLayer = innerTextRenderer->layer()) { 234 if (RenderLayer* innerLayer = innerTextRenderer->layer()) {
235 RenderLayerScrollableArea* innerScrollableArea = innerLayer- >scrollableArea(); 235 if (RenderLayerScrollableArea* innerScrollableArea = innerLa yer->scrollableArea()) {
236 IntSize scrollOffset(!renderTextControl->style()->isLeftToRi ghtDirection() ? innerScrollableArea->scrollWidth() : 0, 0); 236 IntSize scrollOffset(!renderTextControl->style()->isLeft ToRightDirection() ? innerScrollableArea->scrollWidth() : 0, 0);
237 innerScrollableArea->scrollToOffset(scrollOffset, ScrollOffs etClamped); 237 innerScrollableArea->scrollToOffset(scrollOffset, Scroll OffsetClamped);
238 }
238 } 239 }
239 } 240 }
240 241
241 renderTextControl->capsLockStateMayHaveChanged(); 242 renderTextControl->capsLockStateMayHaveChanged();
242 } else if (event->type() == EventTypeNames::focus) { 243 } else if (event->type() == EventTypeNames::focus) {
243 renderTextControl->capsLockStateMayHaveChanged(); 244 renderTextControl->capsLockStateMayHaveChanged();
244 } 245 }
245 246
246 element().forwardEvent(event); 247 element().forwardEvent(event);
247 } 248 }
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 return shouldSpinButtonRespondToMouseEvents() && element().focused(); 554 return shouldSpinButtonRespondToMouseEvents() && element().focused();
554 } 555 }
555 556
556 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve ntDispatch eventDispatch) 557 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve ntDispatch eventDispatch)
557 { 558 {
558 if (eventDispatch == SpinButtonElement::EventDispatchAllowed) 559 if (eventDispatch == SpinButtonElement::EventDispatchAllowed)
559 element().dispatchFormControlChangeEvent(); 560 element().dispatchFormControlChangeEvent();
560 } 561 }
561 562
562 } // namespace WebCore 563 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698