void HTMLTextAreaElement::updatePlaceholderText() { String placeholderText = strippedPlaceholder(); if (placeholderText.isEmpty()) { if (m_placeholder) { userAgentShadowRoot()->removeChild(m_placeholder, ASSERT_NO_EXCEPTION); m_placeholder = 0; } return; } if (!m_placeholder) { RefPtr<HTMLDivElement> placeholder = HTMLDivElement::create(document()); m_placeholder = placeholder.get(); m_placeholder->setPseudo(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral)); userAgentShadowRoot()->insertBefore(m_placeholder, innerTextElement()->nextSibling(), ASSERT_NO_EXCEPTION); } m_placeholder->setInnerText(placeholderText, ASSERT_NO_EXCEPTION); fixPlaceholderRenderer(m_placeholder, innerTextElement()); }
void HTMLTextAreaElement::updatePlaceholderText() { ExceptionCode ec = 0; String placeholderText = strippedPlaceholder(); if (placeholderText.isEmpty()) { if (m_placeholder) { shadow()->oldestShadowRoot()->removeChild(m_placeholder.get(), ec); ASSERT(!ec); m_placeholder.clear(); } return; } if (!m_placeholder) { m_placeholder = HTMLDivElement::create(document()); m_placeholder->setShadowPseudoId("-webkit-input-placeholder"); shadow()->oldestShadowRoot()->insertBefore(m_placeholder, innerTextElement()->nextSibling(), ec); ASSERT(!ec); } m_placeholder->setInnerText(placeholderText, ec); ASSERT(!ec); fixPlaceholderRenderer(m_placeholder.get(), innerTextElement()); }
void HTMLTextAreaElement::attach() { HTMLTextFormControlElement::attach(); fixPlaceholderRenderer(m_placeholder, innerTextElement()); }