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 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 void HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) | 307 void HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) |
308 { | 308 { |
309 if (name == tabindexAttr) | 309 if (name == tabindexAttr) |
310 return Element::parseAttribute(name, value); | 310 return Element::parseAttribute(name, value); |
311 | 311 |
312 if (name == dirAttr) { | 312 if (name == dirAttr) { |
313 dirAttributeChanged(value); | 313 dirAttributeChanged(value); |
314 } else { | 314 } else { |
315 const AtomicString& eventName = eventNameForAttributeName(name); | 315 const AtomicString& eventName = eventNameForAttributeName(name); |
316 if (!eventName.isNull()) | 316 if (!eventName.isNull()) |
317 setAttributeEventListener(eventName, createAttributeEventListener(th
is, name, value)); | 317 setAttributeEventListener(eventName, createAttributeEventListener(th
is, name, value, eventParameterName())); |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 PassRefPtrWillBeRawPtr<DocumentFragment> HTMLElement::textToFragment(const Strin
g& text, ExceptionState& exceptionState) | 321 PassRefPtrWillBeRawPtr<DocumentFragment> HTMLElement::textToFragment(const Strin
g& text, ExceptionState& exceptionState) |
322 { | 322 { |
323 RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(doc
ument()); | 323 RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(doc
ument()); |
324 unsigned i, length = text.length(); | 324 unsigned i, length = text.length(); |
325 UChar c = 0; | 325 UChar c = 0; |
326 for (unsigned start = 0; start < length; ) { | 326 for (unsigned start = 0; start < length; ) { |
327 | 327 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 // even in spatial navigation mode instead of handling it as a "click" actio
n. | 943 // even in spatial navigation mode instead of handling it as a "click" actio
n. |
944 if (isTextFormControl() || isContentEditable()) | 944 if (isTextFormControl() || isContentEditable()) |
945 return; | 945 return; |
946 int charCode = event->charCode(); | 946 int charCode = event->charCode(); |
947 if (charCode == '\r' || charCode == ' ') { | 947 if (charCode == '\r' || charCode == ' ') { |
948 dispatchSimulatedClick(event); | 948 dispatchSimulatedClick(event); |
949 event->setDefaultHandled(); | 949 event->setDefaultHandled(); |
950 } | 950 } |
951 } | 951 } |
952 | 952 |
| 953 const AtomicString& HTMLElement::eventParameterName() |
| 954 { |
| 955 DEFINE_STATIC_LOCAL(const AtomicString, eventString, ("event", AtomicString:
:ConstructFromLiteral)); |
| 956 return eventString; |
| 957 } |
| 958 |
953 } // namespace WebCore | 959 } // namespace WebCore |
954 | 960 |
955 #ifndef NDEBUG | 961 #ifndef NDEBUG |
956 | 962 |
957 // For use in the debugger | 963 // For use in the debugger |
958 void dumpInnerHTML(WebCore::HTMLElement*); | 964 void dumpInnerHTML(WebCore::HTMLElement*); |
959 | 965 |
960 void dumpInnerHTML(WebCore::HTMLElement* element) | 966 void dumpInnerHTML(WebCore::HTMLElement* element) |
961 { | 967 { |
962 printf("%s\n", element->innerHTML().ascii().data()); | 968 printf("%s\n", element->innerHTML().ascii().data()); |
963 } | 969 } |
964 #endif | 970 #endif |
OLD | NEW |