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

Side by Side Diff: Source/core/html/shadow/SliderThumbElement.cpp

Issue 211403003: Add a missing null check in SliderThumbElement::stopDragging() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/media/audio-delete-while-slider-thumb-clicked.html ('k') | 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) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 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 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 return new RenderSliderThumb(this); 219 return new RenderSliderThumb(this);
220 } 220 }
221 221
222 bool SliderThumbElement::isDisabledFormControl() const 222 bool SliderThumbElement::isDisabledFormControl() const
223 { 223 {
224 return hostInput() && hostInput()->isDisabledFormControl(); 224 return hostInput() && hostInput()->isDisabledFormControl();
225 } 225 }
226 226
227 bool SliderThumbElement::matchesReadOnlyPseudoClass() const 227 bool SliderThumbElement::matchesReadOnlyPseudoClass() const
228 { 228 {
229 return hostInput()->matchesReadOnlyPseudoClass(); 229 return hostInput() && hostInput()->matchesReadOnlyPseudoClass();
230 } 230 }
231 231
232 bool SliderThumbElement::matchesReadWritePseudoClass() const 232 bool SliderThumbElement::matchesReadWritePseudoClass() const
233 { 233 {
234 return hostInput()->matchesReadWritePseudoClass(); 234 return hostInput() && hostInput()->matchesReadWritePseudoClass();
235 } 235 }
236 236
237 Node* SliderThumbElement::focusDelegate() 237 Node* SliderThumbElement::focusDelegate()
238 { 238 {
239 return hostInput(); 239 return hostInput();
240 } 240 }
241 241
242 void SliderThumbElement::dragFrom(const LayoutPoint& point) 242 void SliderThumbElement::dragFrom(const LayoutPoint& point)
243 { 243 {
244 RefPtr<SliderThumbElement> protector(this); 244 RefPtr<SliderThumbElement> protector(this);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 void SliderThumbElement::stopDragging() 315 void SliderThumbElement::stopDragging()
316 { 316 {
317 if (!m_inDragMode) 317 if (!m_inDragMode)
318 return; 318 return;
319 319
320 if (LocalFrame* frame = document().frame()) 320 if (LocalFrame* frame = document().frame())
321 frame->eventHandler().setCapturingMouseEventsNode(nullptr); 321 frame->eventHandler().setCapturingMouseEventsNode(nullptr);
322 m_inDragMode = false; 322 m_inDragMode = false;
323 if (renderer()) 323 if (renderer())
324 renderer()->setNeedsLayout(); 324 renderer()->setNeedsLayout();
325 hostInput()->dispatchFormControlChangeEvent(); 325 if (hostInput())
326 hostInput()->dispatchFormControlChangeEvent();
326 } 327 }
327 328
328 void SliderThumbElement::defaultEventHandler(Event* event) 329 void SliderThumbElement::defaultEventHandler(Event* event)
329 { 330 {
330 if (!event->isMouseEvent()) { 331 if (!event->isMouseEvent()) {
331 HTMLDivElement::defaultEventHandler(event); 332 HTMLDivElement::defaultEventHandler(event);
332 return; 333 return;
333 } 334 }
334 335
335 // FIXME: Should handle this readonly/disabled check in more general way. 336 // FIXME: Should handle this readonly/disabled check in more general way.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 case MediaVolumeSliderThumbPart: 463 case MediaVolumeSliderThumbPart:
463 case MediaFullScreenVolumeSliderPart: 464 case MediaFullScreenVolumeSliderPart:
464 case MediaFullScreenVolumeSliderThumbPart: 465 case MediaFullScreenVolumeSliderThumbPart:
465 return mediaSliderContainer; 466 return mediaSliderContainer;
466 default: 467 default:
467 return sliderContainer; 468 return sliderContainer;
468 } 469 }
469 } 470 }
470 471
471 } 472 }
OLDNEW
« no previous file with comments | « LayoutTests/media/audio-delete-while-slider-thumb-clicked.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698