Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: Source/core/html/HTMLSelectElement.cpp

Issue 354363002: Move attributes-related API from UniqueElementData to AttributeCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/ElementData.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/ElementData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698