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

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

Issue 418133003: Call insertedInto or removedFrom before childrenChanged (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix option elements. Created 6 years, 5 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/ContainerNode.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) 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 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (m_isSelected) 341 if (m_isSelected)
342 select->optionSelectionStateChanged(this, true); 342 select->optionSelectionStateChanged(this, true);
343 select->scrollToSelection(); 343 select->scrollToSelection();
344 } 344 }
345 345
346 return HTMLElement::insertedInto(insertionPoint); 346 return HTMLElement::insertedInto(insertionPoint);
347 } 347 }
348 348
349 void HTMLOptionElement::removedFrom(ContainerNode* insertionPoint) 349 void HTMLOptionElement::removedFrom(ContainerNode* insertionPoint)
350 { 350 {
351 if (HTMLSelectElement* select = Traversal<HTMLSelectElement>::firstAncestorO rSelf(*insertionPoint)) 351 if (HTMLSelectElement* select = Traversal<HTMLSelectElement>::firstAncestorO rSelf(*insertionPoint)) {
352 select->setRecalcListItems();
352 select->optionRemoved(*this); 353 select->optionRemoved(*this);
354 }
353 HTMLElement::removedFrom(insertionPoint); 355 HTMLElement::removedFrom(insertionPoint);
354 } 356 }
355 357
356 String HTMLOptionElement::collectOptionInnerText() const 358 String HTMLOptionElement::collectOptionInnerText() const
357 { 359 {
358 StringBuilder text; 360 StringBuilder text;
359 for (Node* node = firstChild(); node; ) { 361 for (Node* node = firstChild(); node; ) {
360 if (node->isTextNode()) 362 if (node->isTextNode())
361 text.append(node->nodeValue()); 363 text.append(node->nodeValue());
362 // Text nodes inside script elements are not part of the option text. 364 // Text nodes inside script elements are not part of the option text.
(...skipping 26 matching lines...) Expand all
389 391
390 bool HTMLOptionElement::spatialNavigationFocused() const 392 bool HTMLOptionElement::spatialNavigationFocused() const
391 { 393 {
392 HTMLSelectElement* select = ownerSelectElement(); 394 HTMLSelectElement* select = ownerSelectElement();
393 if (!select || !select->focused()) 395 if (!select || !select->focused())
394 return false; 396 return false;
395 return select->spatialNavigationFocusedOption() == this; 397 return select->spatialNavigationFocusedOption() == this;
396 } 398 }
397 399
398 } // namespace blink 400 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698