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 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 while (fieldset && !fieldset->hasTagName(fieldsetTag)) | 55 while (fieldset && !fieldset->hasTagName(fieldsetTag)) |
56 fieldset = fieldset->parentElement(); | 56 fieldset = fieldset->parentElement(); |
57 if (!fieldset) | 57 if (!fieldset) |
58 return 0; | 58 return 0; |
59 | 59 |
60 // Find first form element inside the fieldset that is not a legend element. | 60 // Find first form element inside the fieldset that is not a legend element. |
61 // FIXME: Should we consider tabindex? | 61 // FIXME: Should we consider tabindex? |
62 Element* element = fieldset; | 62 Element* element = fieldset; |
63 while ((element = ElementTraversal::next(element, fieldset))) { | 63 while ((element = ElementTraversal::next(element, fieldset))) { |
64 if (element->isFormControlElement()) | 64 if (element->isFormControlElement()) |
65 return static_cast<HTMLFormControlElement*>(element); | 65 return toHTMLFormControlElement(element); |
66 } | 66 } |
67 | 67 |
68 return 0; | 68 return 0; |
69 } | 69 } |
70 | 70 |
71 void HTMLLegendElement::focus(bool, FocusDirection direction) | 71 void HTMLLegendElement::focus(bool, FocusDirection direction) |
72 { | 72 { |
73 if (isFocusable()) | 73 if (isFocusable()) |
74 Element::focus(true, direction); | 74 Element::focus(true, direction); |
75 | 75 |
(...skipping 14 matching lines...) Expand all Loading... |
90 // its parent, then the form attribute must return the same value as the | 90 // its parent, then the form attribute must return the same value as the |
91 // form attribute on that fieldset element. Otherwise, it must return null. | 91 // form attribute on that fieldset element. Otherwise, it must return null. |
92 ContainerNode* fieldset = parentNode(); | 92 ContainerNode* fieldset = parentNode(); |
93 if (!fieldset || !fieldset->hasTagName(fieldsetTag)) | 93 if (!fieldset || !fieldset->hasTagName(fieldsetTag)) |
94 return 0; | 94 return 0; |
95 | 95 |
96 return static_cast<HTMLFieldSetElement*>(fieldset)->form(); | 96 return static_cast<HTMLFieldSetElement*>(fieldset)->form(); |
97 } | 97 } |
98 | 98 |
99 } // namespace | 99 } // namespace |
OLD | NEW |