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); }