OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * | 10 * |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 327 void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
328 { | 328 { |
329 if (name == sizeAttr) { | 329 if (name == sizeAttr) { |
330 int oldSize = m_size; | 330 int oldSize = m_size; |
331 // Set the attribute value to a number. | 331 // Set the attribute value to a number. |
332 // This is important since the style rules for this attribute can determ
ine the appearance property. | 332 // This is important since the style rules for this attribute can determ
ine the appearance property. |
333 int size = value.toInt(); | 333 int size = value.toInt(); |
334 AtomicString attrSize = AtomicString::number(size); | 334 AtomicString attrSize = AtomicString::number(size); |
335 if (attrSize != value) { | 335 if (attrSize != value) { |
336 // FIXME: This is horribly factored. | 336 // FIXME: This is horribly factored. |
337 if (Attribute* sizeAttribute = ensureUniqueElementData().findAttribu
teByName(sizeAttr)) | 337 if (Attribute* sizeAttribute = ensureUniqueElementData().attributes(
).find(sizeAttr)) |
338 sizeAttribute->setValue(attrSize); | 338 sizeAttribute->setValue(attrSize); |
339 } | 339 } |
340 size = std::max(size, 1); | 340 size = std::max(size, 1); |
341 | 341 |
342 // Ensure that we've determined selectedness of the items at least once
prior to changing the size. | 342 // Ensure that we've determined selectedness of the items at least once
prior to changing the size. |
343 if (oldSize != size) | 343 if (oldSize != size) |
344 updateListItemSelectedStates(); | 344 updateListItemSelectedStates(); |
345 | 345 |
346 m_size = size; | 346 m_size = size; |
347 setNeedsValidityCheck(); | 347 setNeedsValidityCheck(); |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 int focusedIndex = activeSelectionEndListIndex(); | 1735 int focusedIndex = activeSelectionEndListIndex(); |
1736 if (focusedIndex < 0) | 1736 if (focusedIndex < 0) |
1737 focusedIndex = firstSelectableListIndex(); | 1737 focusedIndex = firstSelectableListIndex(); |
1738 if (focusedIndex < 0) | 1738 if (focusedIndex < 0) |
1739 return nullptr; | 1739 return nullptr; |
1740 HTMLElement* focused = listItems()[focusedIndex]; | 1740 HTMLElement* focused = listItems()[focusedIndex]; |
1741 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; | 1741 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; |
1742 } | 1742 } |
1743 | 1743 |
1744 } // namespace | 1744 } // namespace |
OLD | NEW |