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

Unified Diff: Source/core/html/HTMLLabelElement.cpp

Issue 288933002: Fix crash after detaching document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing Issue 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/forms/label/detached-document-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLabelElement.cpp
diff --git a/Source/core/html/HTMLLabelElement.cpp b/Source/core/html/HTMLLabelElement.cpp
index f6dc7fc6d24226728ca4fbad415e0a585b3523df..1d4c0393c169efa8b9cc9ce507f9c712ded79a70 100644
--- a/Source/core/html/HTMLLabelElement.cpp
+++ b/Source/core/html/HTMLLabelElement.cpp
@@ -142,8 +142,13 @@ void HTMLLabelElement::defaultEventHandler(Event* evt)
// selected, do not pass the event to control element.
// Note: a click event may be not a mouse event if created by
// document.createEvent().
- if (evt->isMouseEvent() && !toMouseEvent(evt)->isSimulated() && document().frame()->selection().selection().isRange())
- return;
+ if (evt->isMouseEvent() && !toMouseEvent(evt)->isSimulated()) {
+ if (LocalFrame* frame = document().frame()) {
+ if (frame->selection().selection().isRange())
+ return;
+ }
+ }
+
RefPtrWillBeRawPtr<HTMLElement> element = control();
« no previous file with comments | « LayoutTests/fast/forms/label/detached-document-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698