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

Unified Diff: third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp

Issue 2270833002: Fix the crash of issue 2209773002 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another crash. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp b/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
index 3f147c3489f62434f5a7ec79f692fb61b8fdb747..16050685e7d46bd67d2ebadeb77d926d06266cde 100644
--- a/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
@@ -384,9 +384,11 @@ SliderContainerElement::Direction SliderContainerElement::getDirection(LayoutPoi
bool SliderContainerElement::canSlide()
{
- DCHECK(hostInput()->layoutObject());
- const ComputedStyle& sliderStyle = hostInput()->layoutObject()->styleRef();
- const TransformOperations& transforms = sliderStyle.transform();
+ if (!hostInput() || !hostInput()->layoutObject() || !hostInput()->layoutObject()->style()) {
+ return false;
+ }
+ const ComputedStyle* sliderStyle = hostInput()->layoutObject()->style();
+ const TransformOperations& transforms = sliderStyle->transform();
int transformSize = transforms.size();
if (transformSize > 0) {
for (int i = 0; i < transformSize; ++i) {
@@ -395,7 +397,7 @@ bool SliderContainerElement::canSlide()
}
}
}
- if ((m_slidingDirection == Vertical && sliderStyle.appearance() == SliderHorizontalPart) || (m_slidingDirection == Horizontal && sliderStyle.appearance() == SliderVerticalPart)) {
+ if ((m_slidingDirection == Vertical && sliderStyle->appearance() == SliderHorizontalPart) || (m_slidingDirection == Horizontal && sliderStyle->appearance() == SliderVerticalPart)) {
return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698