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

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

Issue 316583002: Correctly handle accessing a replaced Attr object's attribute value. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
« 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 316 void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
317 { 317 {
318 if (name == sizeAttr) { 318 if (name == sizeAttr) {
319 int oldSize = m_size; 319 int oldSize = m_size;
320 // Set the attribute value to a number. 320 // Set the attribute value to a number.
321 // This is important since the style rules for this attribute can determ ine the appearance property. 321 // This is important since the style rules for this attribute can determ ine the appearance property.
322 int size = value.toInt(); 322 int size = value.toInt();
323 AtomicString attrSize = AtomicString::number(size); 323 AtomicString attrSize = AtomicString::number(size);
324 if (attrSize != value) { 324 if (attrSize != value) {
325 // FIXME: This is horribly factored. 325 // FIXME: This is horribly factored.
326 if (Attribute* sizeAttribute = ensureUniqueElementData().getAttribut eItem(sizeAttr)) 326 if (Attribute* sizeAttribute = ensureUniqueElementData().getAttribut eItem(sizeAttr, true))
Inactive 2014/06/03 15:11:39 Gosh, another boolean argument :) Could we make th
sof 2014/06/03 15:21:50 That would break with the convention followed else
327 sizeAttribute->setValue(attrSize); 327 sizeAttribute->setValue(attrSize);
328 } 328 }
329 size = max(size, 1); 329 size = max(size, 1);
330 330
331 // Ensure that we've determined selectedness of the items at least once prior to changing the size. 331 // Ensure that we've determined selectedness of the items at least once prior to changing the size.
332 if (oldSize != size) 332 if (oldSize != size)
333 updateListItemSelectedStates(); 333 updateListItemSelectedStates();
334 334
335 m_size = size; 335 m_size = size;
336 setNeedsValidityCheck(); 336 setNeedsValidityCheck();
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 1658
1659 void HTMLSelectElement::trace(Visitor* visitor) 1659 void HTMLSelectElement::trace(Visitor* visitor)
1660 { 1660 {
1661 #if ENABLE(OILPAN) 1661 #if ENABLE(OILPAN)
1662 visitor->trace(m_listItems); 1662 visitor->trace(m_listItems);
1663 #endif 1663 #endif
1664 HTMLFormControlElementWithState::trace(visitor); 1664 HTMLFormControlElementWithState::trace(visitor);
1665 } 1665 }
1666 1666
1667 } // namespace 1667 } // 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