HTMLTextFormControlElement* enclosingTextFormControl(const Position& position) { ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOffsetInAnchor || position.containerNode() || !position.anchorNode()->shadowAncestorNode()); Node* container = position.containerNode(); if (!container) return 0; Node* ancestor = container->shadowAncestorNode(); return ancestor != container ? toTextFormControl(ancestor) : 0; }
RenderObject* RenderTextControl::layoutSpecialExcludedChild(bool relayoutChildren) { HTMLElement* placeholder = toTextFormControl(node())->placeholderElement(); RenderObject* placeholderRenderer = placeholder ? placeholder->renderer() : 0; if (!placeholderRenderer) return 0; if (relayoutChildren) { // The markParents arguments should be false because this function is // called from layout() of the parent and the placeholder layout doesn't // affect the parent layout. placeholderRenderer->setChildNeedsLayout(true, false); } return placeholderRenderer; }
RenderTextControl::RenderTextControl(Node* node) : RenderBlock(node) { ASSERT(toTextFormControl(node)); }