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

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 testcase 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 070d3bf3dca55b5c8119e4e9d8335a1991d2a604..22db66276e8bc4362b4d993095fa55c4b051696e 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -687,8 +687,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();
« Source/core/html/forms/TextFieldInputType.cpp ('K') | « Source/core/layout/LayoutTextControl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698