Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3290)

Unified Diff: Source/core/testing/Internals.cpp

Issue 1280423002: CSS4: Implement :placeholder-shown pseudo class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698