| OLD | NEW |
| 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 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "core/html/HTMLOptionElement.h" | 27 #include "core/html/HTMLOptionElement.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
| 31 #include "core/dom/AXObjectCache.h" | 31 #include "core/dom/AXObjectCache.h" |
| 32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/dom/NodeComputedStyle.h" | 33 #include "core/dom/NodeComputedStyle.h" |
| 34 #include "core/dom/NodeTraversal.h" | 34 #include "core/dom/NodeTraversal.h" |
| 35 #include "core/dom/ScriptLoader.h" | |
| 36 #include "core/dom/Text.h" | 35 #include "core/dom/Text.h" |
| 37 #include "core/dom/shadow/ShadowRoot.h" | 36 #include "core/dom/shadow/ShadowRoot.h" |
| 38 #include "core/html/HTMLDataListElement.h" | 37 #include "core/html/HTMLDataListElement.h" |
| 39 #include "core/html/HTMLOptGroupElement.h" | 38 #include "core/html/HTMLOptGroupElement.h" |
| 40 #include "core/html/HTMLSelectElement.h" | 39 #include "core/html/HTMLSelectElement.h" |
| 41 #include "core/html/parser/HTMLParserIdioms.h" | 40 #include "core/html/parser/HTMLParserIdioms.h" |
| 42 #include "core/layout/LayoutTheme.h" | 41 #include "core/layout/LayoutTheme.h" |
| 43 #include "core/style/ComputedStyle.h" | 42 #include "core/style/ComputedStyle.h" |
| 44 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
| 45 #include "wtf/text/StringBuilder.h" | 44 #include "wtf/text/StringBuilder.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 371 } |
| 373 HTMLElement::removedFrom(insertionPoint); | 372 HTMLElement::removedFrom(insertionPoint); |
| 374 } | 373 } |
| 375 | 374 |
| 376 String HTMLOptionElement::collectOptionInnerText() const { | 375 String HTMLOptionElement::collectOptionInnerText() const { |
| 377 StringBuilder text; | 376 StringBuilder text; |
| 378 for (Node* node = firstChild(); node;) { | 377 for (Node* node = firstChild(); node;) { |
| 379 if (node->isTextNode()) | 378 if (node->isTextNode()) |
| 380 text.append(node->nodeValue()); | 379 text.append(node->nodeValue()); |
| 381 // Text nodes inside script elements are not part of the option text. | 380 // Text nodes inside script elements are not part of the option text. |
| 382 if (node->isElementNode() && toScriptLoaderIfPossible(toElement(node))) | 381 if (node->isElementNode() && toElement(node)->isScriptElement()) |
| 383 node = NodeTraversal::nextSkippingChildren(*node, this); | 382 node = NodeTraversal::nextSkippingChildren(*node, this); |
| 384 else | 383 else |
| 385 node = NodeTraversal::next(*node, this); | 384 node = NodeTraversal::next(*node, this); |
| 386 } | 385 } |
| 387 return text.toString(); | 386 return text.toString(); |
| 388 } | 387 } |
| 389 | 388 |
| 390 HTMLFormElement* HTMLOptionElement::form() const { | 389 HTMLFormElement* HTMLOptionElement::form() const { |
| 391 if (HTMLSelectElement* selectElement = ownerSelectElement()) | 390 if (HTMLSelectElement* selectElement = ownerSelectElement()) |
| 392 return selectElement->formOwner(); | 391 return selectElement->formOwner(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 433 } |
| 435 | 434 |
| 436 String HTMLOptionElement::innerText() { | 435 String HTMLOptionElement::innerText() { |
| 437 // A workaround for crbug.com/424578. We add ShadowRoot to an OPTION, but | 436 // A workaround for crbug.com/424578. We add ShadowRoot to an OPTION, but |
| 438 // innerText behavior for Shadow DOM is unclear. We just return the same | 437 // innerText behavior for Shadow DOM is unclear. We just return the same |
| 439 // string before adding ShadowRoot. | 438 // string before adding ShadowRoot. |
| 440 return textContent(); | 439 return textContent(); |
| 441 } | 440 } |
| 442 | 441 |
| 443 } // namespace blink | 442 } // namespace blink |
| OLD | NEW |