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 2130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2141 | 2141 |
2142 bool Element::hasAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
g& localName) const | 2142 bool Element::hasAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
g& localName) const |
2143 { | 2143 { |
2144 if (!elementData()) | 2144 if (!elementData()) |
2145 return false; | 2145 return false; |
2146 QualifiedName qName(nullAtom, localName, namespaceURI); | 2146 QualifiedName qName(nullAtom, localName, namespaceURI); |
2147 synchronizeAttribute(qName); | 2147 synchronizeAttribute(qName); |
2148 return elementData()->attributes().find(qName); | 2148 return elementData()->attributes().find(qName); |
2149 } | 2149 } |
2150 | 2150 |
2151 void Element::focus(bool restorePreviousSelection, FocusType type) | 2151 void Element::focus(bool restorePreviousSelection, WebFocusType type) |
2152 { | 2152 { |
2153 if (!inDocument()) | 2153 if (!inDocument()) |
2154 return; | 2154 return; |
2155 | 2155 |
2156 if (document().focusedElement() == this) | 2156 if (document().focusedElement() == this) |
2157 return; | 2157 return; |
2158 | 2158 |
2159 if (!document().isActive()) | 2159 if (!document().isActive()) |
2160 return; | 2160 return; |
2161 | 2161 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2260 bool Element::isKeyboardFocusable() const | 2260 bool Element::isKeyboardFocusable() const |
2261 { | 2261 { |
2262 return isFocusable() && tabIndex() >= 0; | 2262 return isFocusable() && tabIndex() >= 0; |
2263 } | 2263 } |
2264 | 2264 |
2265 bool Element::isMouseFocusable() const | 2265 bool Element::isMouseFocusable() const |
2266 { | 2266 { |
2267 return isFocusable(); | 2267 return isFocusable(); |
2268 } | 2268 } |
2269 | 2269 |
2270 void Element::dispatchFocusEvent(Element* oldFocusedElement, FocusType type) | 2270 void Element::dispatchFocusEvent(Element* oldFocusedElement, WebFocusType type) |
2271 { | 2271 { |
2272 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::fo
cus, false, false, document().domWindow(), 0, oldFocusedElement); | 2272 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::fo
cus, false, false, document().domWindow(), 0, oldFocusedElement); |
2273 EventDispatcher::dispatchEvent(*this, FocusEventDispatchMediator::create(eve
nt.release())); | 2273 EventDispatcher::dispatchEvent(*this, FocusEventDispatchMediator::create(eve
nt.release())); |
2274 } | 2274 } |
2275 | 2275 |
2276 void Element::dispatchBlurEvent(Element* newFocusedElement) | 2276 void Element::dispatchBlurEvent(Element* newFocusedElement) |
2277 { | 2277 { |
2278 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::bl
ur, false, false, document().domWindow(), 0, newFocusedElement); | 2278 RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::bl
ur, false, false, document().domWindow(), 0, newFocusedElement); |
2279 EventDispatcher::dispatchEvent(*this, BlurEventDispatchMediator::create(even
t.release())); | 2279 EventDispatcher::dispatchEvent(*this, BlurEventDispatchMediator::create(even
t.release())); |
2280 } | 2280 } |
2281 | 2281 |
2282 void Element::dispatchFocusInEvent(const AtomicString& eventType, Element* oldFo
cusedElement, FocusType) | 2282 void Element::dispatchFocusInEvent(const AtomicString& eventType, Element* oldFo
cusedElement, WebFocusType) |
2283 { | 2283 { |
2284 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); | 2284 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); |
2285 ASSERT(eventType == EventTypeNames::focusin || eventType == EventTypeNames::
DOMFocusIn); | 2285 ASSERT(eventType == EventTypeNames::focusin || eventType == EventTypeNames::
DOMFocusIn); |
2286 dispatchScopedEventDispatchMediator(FocusInEventDispatchMediator::create(Foc
usEvent::create(eventType, true, false, document().domWindow(), 0, oldFocusedEle
ment))); | 2286 dispatchScopedEventDispatchMediator(FocusInEventDispatchMediator::create(Foc
usEvent::create(eventType, true, false, document().domWindow(), 0, oldFocusedEle
ment))); |
2287 } | 2287 } |
2288 | 2288 |
2289 void Element::dispatchFocusOutEvent(const AtomicString& eventType, Element* newF
ocusedElement) | 2289 void Element::dispatchFocusOutEvent(const AtomicString& eventType, Element* newF
ocusedElement) |
2290 { | 2290 { |
2291 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); | 2291 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); |
2292 ASSERT(eventType == EventTypeNames::focusout || eventType == EventTypeNames:
:DOMFocusOut); | 2292 ASSERT(eventType == EventTypeNames::focusout || eventType == EventTypeNames:
:DOMFocusOut); |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3422 return v8::Handle<v8::Object>(); | 3422 return v8::Handle<v8::Object>(); |
3423 | 3423 |
3424 V8PerContextData* perContextData = V8PerContextData::from(context); | 3424 V8PerContextData* perContextData = V8PerContextData::from(context); |
3425 if (perContextData) | 3425 if (perContextData) |
3426 wrapper->SetPrototype(perContextData->customElementBinding(customElement
Definition())->prototype()); | 3426 wrapper->SetPrototype(perContextData->customElementBinding(customElement
Definition())->prototype()); |
3427 | 3427 |
3428 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType,
wrapper); | 3428 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType,
wrapper); |
3429 } | 3429 } |
3430 | 3430 |
3431 } // namespace blink | 3431 } // namespace blink |
OLD | NEW |