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 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 bool Element::isKeyboardFocusable() const | 2128 bool Element::isKeyboardFocusable() const |
2129 { | 2129 { |
2130 return isFocusable() && tabIndex() >= 0; | 2130 return isFocusable() && tabIndex() >= 0; |
2131 } | 2131 } |
2132 | 2132 |
2133 bool Element::isMouseFocusable() const | 2133 bool Element::isMouseFocusable() const |
2134 { | 2134 { |
2135 return isFocusable(); | 2135 return isFocusable(); |
2136 } | 2136 } |
2137 | 2137 |
2138 void Element::willCallDefaultEventHandler(const Event& event) | |
2139 { | |
2140 if (!wasFocusedByMouse()) | |
2141 return; | |
2142 if (!event.isKeyboardEvent() || event.type() != EventTypeNames::keydown) | |
2143 return; | |
2144 setWasFocusedByMouse(false); | |
2145 if (renderer()) | |
2146 renderer()->setShouldDoFullPaintInvalidation(true); | |
2147 } | |
2148 | |
2149 void Element::dispatchFocusEvent(Element* oldFocusedElement, FocusType type) | 2138 void Element::dispatchFocusEvent(Element* oldFocusedElement, FocusType type) |
2150 { | 2139 { |
2151 if (type != FocusTypePage) | |
2152 setWasFocusedByMouse(type == FocusTypeMouse); | |
2153 | |
2154 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::fo
cus, false, false, document().domWindow(), 0, oldFocusedElement); | 2140 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::fo
cus, false, false, document().domWindow(), 0, oldFocusedElement); |
2155 EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(even
t.release())); | 2141 EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(even
t.release())); |
2156 } | 2142 } |
2157 | 2143 |
2158 void Element::dispatchBlurEvent(Element* newFocusedElement) | 2144 void Element::dispatchBlurEvent(Element* newFocusedElement) |
2159 { | 2145 { |
2160 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::bl
ur, false, false, document().domWindow(), 0, newFocusedElement); | 2146 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::bl
ur, false, false, document().domWindow(), 0, newFocusedElement); |
2161 EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event
.release())); | 2147 EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event
.release())); |
2162 } | 2148 } |
2163 | 2149 |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3267 return v8::Handle<v8::Object>(); | 3253 return v8::Handle<v8::Object>(); |
3268 | 3254 |
3269 wrapper->SetPrototype(binding->prototype()); | 3255 wrapper->SetPrototype(binding->prototype()); |
3270 | 3256 |
3271 wrapperType->refObject(toScriptWrappableBase()); | 3257 wrapperType->refObject(toScriptWrappableBase()); |
3272 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp
er, isolate); | 3258 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp
er, isolate); |
3273 return wrapper; | 3259 return wrapper; |
3274 } | 3260 } |
3275 | 3261 |
3276 } // namespace blink | 3262 } // namespace blink |
OLD | NEW |