| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 4398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4409 isInstrumented); | 4409 isInstrumented); |
| 4410 task->performTask(this); | 4410 task->performTask(this); |
| 4411 } | 4411 } |
| 4412 | 4412 |
| 4413 void Document::registerEventFactory( | 4413 void Document::registerEventFactory( |
| 4414 std::unique_ptr<EventFactoryBase> eventFactory) { | 4414 std::unique_ptr<EventFactoryBase> eventFactory) { |
| 4415 DCHECK(!eventFactories().contains(eventFactory.get())); | 4415 DCHECK(!eventFactories().contains(eventFactory.get())); |
| 4416 eventFactories().insert(std::move(eventFactory)); | 4416 eventFactories().insert(std::move(eventFactory)); |
| 4417 } | 4417 } |
| 4418 | 4418 |
| 4419 Event* Document::createEvent(ExecutionContext* executionContext, | 4419 Event* Document::createEvent(ScriptState* scriptState, |
| 4420 const String& eventType, | 4420 const String& eventType, |
| 4421 ExceptionState& exceptionState) { | 4421 ExceptionState& exceptionState) { |
| 4422 Event* event = nullptr; | 4422 Event* event = nullptr; |
| 4423 ExecutionContext* executionContext = scriptState->getExecutionContext(); |
| 4423 for (const auto& factory : eventFactories()) { | 4424 for (const auto& factory : eventFactories()) { |
| 4424 event = factory->create(executionContext, eventType); | 4425 event = factory->create(executionContext, eventType); |
| 4425 if (event) { | 4426 if (event) { |
| 4426 // createEvent for TouchEvent should throw DOM exception if touch event | 4427 // createEvent for TouchEvent should throw DOM exception if touch event |
| 4427 // feature detection is not enabled. See crbug.com/392584#c22 | 4428 // feature detection is not enabled. See crbug.com/392584#c22 |
| 4428 if (equalIgnoringCase(eventType, "TouchEvent") && | 4429 if (equalIgnoringCase(eventType, "TouchEvent") && |
| 4429 !RuntimeEnabledFeatures::touchEventFeatureDetectionEnabled()) | 4430 !RuntimeEnabledFeatures::touchEventFeatureDetectionEnabled()) |
| 4430 break; | 4431 break; |
| 4431 return event; | 4432 return event; |
| 4432 } | 4433 } |
| (...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6570 } | 6571 } |
| 6571 | 6572 |
| 6572 void showLiveDocumentInstances() { | 6573 void showLiveDocumentInstances() { |
| 6573 WeakDocumentSet& set = liveDocumentSet(); | 6574 WeakDocumentSet& set = liveDocumentSet(); |
| 6574 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6575 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6575 for (Document* document : set) | 6576 for (Document* document : set) |
| 6576 fprintf(stderr, "- Document %p URL: %s\n", document, | 6577 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6577 document->url().getString().utf8().data()); | 6578 document->url().getString().utf8().data()); |
| 6578 } | 6579 } |
| 6579 #endif | 6580 #endif |
| OLD | NEW |