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

Unified Diff: Source/core/html/HTMLTextFormControlElement.h

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/html/HTMLTextFormControlElement.h
diff --git a/Source/core/html/HTMLTextFormControlElement.h b/Source/core/html/HTMLTextFormControlElement.h
index 906661dfbc87adbeddf081002595d84ecfed4abc..7bc3ec211383a955bd1a2d5978b492771595884b 100644
--- a/Source/core/html/HTMLTextFormControlElement.h
+++ b/Source/core/html/HTMLTextFormControlElement.h
@@ -60,11 +60,11 @@ public:
InsertionNotificationRequest insertedInto(ContainerNode*) override;
// The derived class should return true if placeholder processing is needed.
+ bool isPlaceholderVisible() const { return m_isPlaceholderVisible; }
esprehn 2015/08/21 10:18:10 virtual, HTMLInputElement and HTMLTextAreaElement
ramya.v 2015/08/25 10:24:45 Done.
virtual bool supportsPlaceholder() const = 0;
String strippedPlaceholder() const;
- bool placeholderShouldBeVisible() const;
HTMLElement* placeholderElement() const;
- void updatePlaceholderVisibility(bool);
+ void updatePlaceholderVisibility();
VisiblePosition visiblePositionForIndex(int) const;
int indexForVisiblePosition(const VisiblePosition&) const;
@@ -154,12 +154,15 @@ private:
// Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent().
virtual void handleBlurEvent() { }
+ bool placeholderShouldBeVisible() const;
+
String m_textAsOfLastFormControlChangeEvent;
bool m_lastChangeWasUserEdit;
int m_cachedSelectionStart;
int m_cachedSelectionEnd;
TextFieldSelectionDirection m_cachedSelectionDirection;
+ bool m_isPlaceholderVisible;
esprehn 2015/08/21 10:18:10 This should be on HTMLInputElement and merged with
ramya.v 2015/08/25 10:24:45 Done.
};
inline bool isHTMLTextFormControlElement(const Element& element)

Powered by Google App Engine
This is Rietveld 408576698