void OptionElement::setSelectedState(OptionElementData& data, Element* element, bool selected) { if (data.selected() == selected) return; data.setSelected(selected); element->setNeedsStyleRecalc(); }
String OptionElement::collectOptionValue(const OptionElementData& data, const Element* element) { String value = data.value(); if (!value.isNull()) return value; // Use the text if the value wasn't set. return collectOptionInnerText(element).stripWhiteSpace(); }
String OptionElement::collectOptionLabelOrText(const OptionElementData& data, const Element* element) { Document& document = element->document(); String text; // WinIE does not use the label attribute, so as a quirk, we ignore it. if (document.inQuirksMode()) text = data.label(); if (text.isEmpty()) text = collectOptionInnerText(element); return text.stripWhiteSpace().simplifyWhiteSpace(); }
String OptionElement::collectOptionLabelOrText(const OptionElementData& data, const Element* element) { Document* document = element->document(); String text; // WinIE does not use the label attribute, so as a quirk, we ignore it. if (!document->inQuirksMode()) text = data.label(); if (text.isEmpty()) text = collectOptionInnerText(element); return normalizeText(document, text); }