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

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

Issue 465593003: Merge 178976 "Call insertedInto or removedFrom before childrenCh..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2062/
Patch Set: 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/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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 // FIXME: Might be better to call this unconditionally, always passing m _isSelected, 336 // FIXME: Might be better to call this unconditionally, always passing m _isSelected,
337 // rather than only calling it if we are selected. 337 // rather than only calling it if we are selected.
338 if (m_isSelected) 338 if (m_isSelected)
339 select->optionSelectionStateChanged(this, true); 339 select->optionSelectionStateChanged(this, true);
340 select->scrollToSelection(); 340 select->scrollToSelection();
341 } 341 }
342 342
343 return HTMLElement::insertedInto(insertionPoint); 343 return HTMLElement::insertedInto(insertionPoint);
344 } 344 }
345 345
346 void HTMLOptionElement::removedFrom(ContainerNode* insertionPoint)
347 {
348 if (HTMLSelectElement* select = Traversal<HTMLSelectElement>::firstAncestorO rSelf(*insertionPoint)) {
349 select->setRecalcListItems();
350 }
351 HTMLElement::removedFrom(insertionPoint);
352 }
353
346 String HTMLOptionElement::collectOptionInnerText() const 354 String HTMLOptionElement::collectOptionInnerText() const
347 { 355 {
348 StringBuilder text; 356 StringBuilder text;
349 for (Node* node = firstChild(); node; ) { 357 for (Node* node = firstChild(); node; ) {
350 if (node->isTextNode()) 358 if (node->isTextNode())
351 text.append(node->nodeValue()); 359 text.append(node->nodeValue());
352 // Text nodes inside script elements are not part of the option text. 360 // Text nodes inside script elements are not part of the option text.
353 if (node->isElementNode() && toScriptLoaderIfPossible(toElement(node))) 361 if (node->isElementNode() && toScriptLoaderIfPossible(toElement(node)))
354 node = NodeTraversal::nextSkippingChildren(*node, this); 362 node = NodeTraversal::nextSkippingChildren(*node, this);
355 else 363 else
(...skipping 16 matching lines...) Expand all
372 // Check for parent optgroup having display NONE 380 // Check for parent optgroup having display NONE
373 if (parent && isHTMLOptGroupElement(*parent)) { 381 if (parent && isHTMLOptGroupElement(*parent)) {
374 if (toHTMLOptGroupElement(*parent).isDisplayNone()) 382 if (toHTMLOptGroupElement(*parent).isDisplayNone())
375 return true; 383 return true;
376 } 384 }
377 RenderStyle* style = nonRendererStyle(); 385 RenderStyle* style = nonRendererStyle();
378 return style && style->display() == NONE; 386 return style && style->display() == NONE;
379 } 387 }
380 388
381 } // namespace WebCore 389 } // namespace WebCore
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