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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3730 PassRefPtr<Event> Document::createEvent(const String& eventType, ExceptionState&
exceptionState) | 3730 PassRefPtr<Event> Document::createEvent(const String& eventType, ExceptionState&
exceptionState) |
3731 { | 3731 { |
3732 RefPtr<Event> event = EventFactory::create(eventType); | 3732 RefPtr<Event> event = EventFactory::create(eventType); |
3733 if (event) | 3733 if (event) |
3734 return event.release(); | 3734 return event.release(); |
3735 | 3735 |
3736 exceptionState.throwDOMException(NotSupportedError, "The provided event type
('" + eventType + "') is invalid."); | 3736 exceptionState.throwDOMException(NotSupportedError, "The provided event type
('" + eventType + "') is invalid."); |
3737 return 0; | 3737 return 0; |
3738 } | 3738 } |
3739 | 3739 |
| 3740 PassRefPtr<Event> Document::createEvent(ExceptionState& exceptionState) |
| 3741 { |
| 3742 if (!isSVGDocument()) { |
| 3743 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, 0
)); |
| 3744 return 0; |
| 3745 } |
| 3746 |
| 3747 UseCounter::count(this, UseCounter::DocumentCreateEventOptionalArgument); |
| 3748 // Legacy SVGDocument behavior. |
| 3749 return createEvent("undefined", exceptionState); |
| 3750 } |
| 3751 |
3740 void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType) | 3752 void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType) |
3741 { | 3753 { |
3742 if (ContextFeatures::mutationEventsEnabled(this)) | 3754 if (ContextFeatures::mutationEventsEnabled(this)) |
3743 addListenerType(listenerType); | 3755 addListenerType(listenerType); |
3744 } | 3756 } |
3745 | 3757 |
3746 void Document::addListenerTypeIfNeeded(const AtomicString& eventType) | 3758 void Document::addListenerTypeIfNeeded(const AtomicString& eventType) |
3747 { | 3759 { |
3748 if (eventType == EventTypeNames::DOMSubtreeModified) { | 3760 if (eventType == EventTypeNames::DOMSubtreeModified) { |
3749 UseCounter::count(*this, UseCounter::DOMSubtreeModifiedEvent); | 3761 UseCounter::count(*this, UseCounter::DOMSubtreeModifiedEvent); |
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5366 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) | 5378 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) |
5367 return false; | 5379 return false; |
5368 if (Frame* focusedFrame = page->focusController().focusedFrame()) { | 5380 if (Frame* focusedFrame = page->focusController().focusedFrame()) { |
5369 if (focusedFrame->tree().isDescendantOf(frame())) | 5381 if (focusedFrame->tree().isDescendantOf(frame())) |
5370 return true; | 5382 return true; |
5371 } | 5383 } |
5372 return false; | 5384 return false; |
5373 } | 5385 } |
5374 | 5386 |
5375 } // namespace WebCore | 5387 } // namespace WebCore |
OLD | NEW |