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

Unified Diff: third_party/WebKit/Source/core/html/forms/ColorInputType.cpp

Issue 2534873004: Avoid unchecked casts in UA shadow DOM. (Closed)
Patch Set: Created 4 years, 1 month 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/forms/ColorInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp
index 3bd2c9bf0f1964b7d2c0d13c59f08e6c2fd3f139..0f3b9e24264f34840957b4e36e824721e2004f13 100644
--- a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp
@@ -218,7 +218,8 @@ void ColorInputType::updateView() {
HTMLElement* ColorInputType::shadowColorSwatch() const {
ShadowRoot* shadow = element().userAgentShadowRoot();
- return shadow ? toHTMLElement(shadow->firstChild()->firstChild()) : 0;
+ return shadow ? toHTMLElementOrDie(shadow->firstChild()->firstChild())
+ : nullptr;
}
Element& ColorInputType::ownerElement() const {

Powered by Google App Engine
This is Rietveld 408576698