Commit 7f51babe authored by tkent@chromium.org's avatar tkent@chromium.org

Add toHTMLDialogElement(), and use it.

We'd like to avoid bare static_cast<>.

BUG=none
TEST=none; no behavior changes.

Review URL: https://chromiumcodereview.appspot.com/23828005

git-svn-id: svn://svn.chromium.org/blink/trunk@157429 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 625e1a5f
...@@ -4982,7 +4982,7 @@ HTMLDialogElement* Document::activeModalDialog() const ...@@ -4982,7 +4982,7 @@ HTMLDialogElement* Document::activeModalDialog() const
{ {
if (m_topLayerElements.isEmpty()) if (m_topLayerElements.isEmpty())
return 0; return 0;
return static_cast<HTMLDialogElement*>(m_topLayerElements.last().get()); return toHTMLDialogElement(m_topLayerElements.last().get());
} }
void Document::webkitExitPointerLock() void Document::webkitExitPointerLock()
......
...@@ -61,6 +61,12 @@ private: ...@@ -61,6 +61,12 @@ private:
String m_returnValue; String m_returnValue;
}; };
inline HTMLDialogElement* toHTMLDialogElement(Node* node)
{
ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::dialogTag));
return static_cast<HTMLDialogElement*>(node);
}
} // namespace WebCore } // namespace WebCore
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment