Index: Source/core/testing/Internals.cpp |
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp |
index 9dd1de88e29323a343b9ed150a9794c91e4c00f0..af87ede48e03a4e61c94745769168508d10712ef 100644 |
--- a/Source/core/testing/Internals.cpp |
+++ b/Source/core/testing/Internals.cpp |
@@ -688,8 +688,11 @@ const AtomicString& Internals::shadowPseudoId(Element* element) |
String Internals::visiblePlaceholder(Element* element) |
{ |
if (element && isHTMLTextFormControlElement(*element)) { |
- if (toHTMLTextFormControlElement(element)->placeholderShouldBeVisible()) |
- return toHTMLTextFormControlElement(element)->placeholderElement()->textContent(); |
+ const HTMLTextFormControlElement& textFormControlElement = toHTMLTextFormControlElement(*element); |
+ if (!textFormControlElement.isPlaceholderVisible()) |
+ return String(); |
+ if (HTMLElement* placeholderElement = textFormControlElement.placeholderElement()) |
+ return placeholderElement->textContent(); |
} |
return String(); |