HTMLLegendElement* HTMLFieldSetElement::legend() const { for (Element* node = firstElementChild(); node; node = node->nextElementSibling()) { if (node->hasTagName(legendTag)) return static_cast<HTMLLegendElement*>(node); } return 0; }
void HTMLFieldSetElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) { HTMLFormControlElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); for (Element* element = firstElementChild(); element; element = element->nextElementSibling()) { if (element->hasTagName(legendTag)) invalidateDisabledStateUnder(element); } }
void MathMLMencloseElement::finishParsingChildren() { MathMLInlineContainerElement::finishParsingChildren(); // When notation value is a radical and menclose does not have any child // then we add anonymous squareroot child to menclose so that square root // symbol can be rendered. if (m_isRadicalValue && !firstElementChild()) renderer()->addChild(nullptr, nullptr); }
void BaseMultipleFieldsDateAndTimeInputType::updateInnerTextValue() { if (!m_dateTimeEditElement) return; AtomicString direction = element()->locale().isRTL() ? AtomicString("rtl", AtomicString::ConstructFromLiteral) : AtomicString("ltr", AtomicString::ConstructFromLiteral); if (Element* container = firstElementChild(element()->userAgentShadowRoot())) container->setAttribute(HTMLNames::dirAttr, direction); DateTimeEditElement::LayoutParameters layoutParameters(element()->locale(), createStepRange(AnyIsDefaultStep)); DateComponents date; const bool hasValue = parseToDateComponents(element()->value(), &date); if (!hasValue) setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDouble(), &date); setupLayoutParameters(layoutParameters, date); if (hasValue) m_dateTimeEditElement->setValueAsDate(layoutParameters, date); else m_dateTimeEditElement->setEmptyValue(layoutParameters, date); }