Changeset 260854 in webkit
- Timestamp:
- Apr 28, 2020 4:35:05 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r260852 r260854 1 2020-04-28 Daniel Bates <dabates@apple.com> 2 3 [WebKitLegacy] Implement -hidePlaceholder and -showPlaceholderIfNecessary in terms of setCanShowPlaceholder() 4 https://bugs.webkit.org/show_bug.cgi?id=211139 5 6 Reviewed by Simon Fraser. 7 8 Remove hidePlaceholder() and showPlaceholderIfNecessary() as they are no longer needed. 9 Callers should use setCanShowPlaceholder() instead. 10 11 * html/HTMLTextFormControlElement.cpp: 12 (WebCore::HTMLTextFormControlElement::hidePlaceholder): Deleted. 13 (WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary): Deleted. 14 * html/HTMLTextFormControlElement.h: 15 1 16 2020-04-28 ChangSeok Oh <changseok@webkit.org> 2 17 -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r259933 r260854 678 678 } 679 679 680 #if PLATFORM(IOS_FAMILY)681 void HTMLTextFormControlElement::hidePlaceholder()682 {683 if (RefPtr<HTMLElement> placeholder = placeholderElement())684 placeholder->setInlineStyleProperty(CSSPropertyVisibility, CSSValueHidden, true);685 }686 687 void HTMLTextFormControlElement::showPlaceholderIfNecessary()688 {689 if (RefPtr<HTMLElement> placeholder = placeholderElement())690 placeholder->setInlineStyleProperty(CSSPropertyVisibility, CSSValueVisible, true);691 }692 #endif693 694 680 static void getNextSoftBreak(RootInlineBox*& line, Node*& breakNode, unsigned& breakOffset) 695 681 { -
trunk/Source/WebCore/html/HTMLTextFormControlElement.h
r259933 r260854 100 100 101 101 void setTextAsOfLastFormControlChangeEvent(const String& text) { m_textAsOfLastFormControlChangeEvent = text; } 102 #if PLATFORM(IOS_FAMILY)103 WEBCORE_EXPORT void hidePlaceholder();104 WEBCORE_EXPORT void showPlaceholderIfNecessary();105 #endif106 102 107 103 WEBCORE_EXPORT virtual bool isInnerTextElementEditable() const; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r260777 r260854 1 2020-04-28 Daniel Bates <dabates@apple.com> 2 3 [WebKitLegacy] Implement -hidePlaceholder and -showPlaceholderIfNecessary in terms of setCanShowPlaceholder() 4 https://bugs.webkit.org/show_bug.cgi?id=211139 5 6 Reviewed by Simon Fraser. 7 8 Implement -hidePlaceholder and -showPlaceholderIfNecessary in terms of setCanShowPlaceholder() 9 because: 10 11 1. Unlike -hidePlaceholder and -showPlaceholderIfNecessary, setCanShowPlaceholder() does NOT of 12 reach into the guts of the control and mutate its CSS. 13 14 2. Because of (1), it works correctly should future code be written that modifies the structure 15 of the guts or the CSS of the placeholder element (which is inside the guts of the control). 16 17 3. Unlike -hidePlaceholder and -showPlaceholderIfNecessary, there is test coverage for setCanShowPlaceholder() 18 to ensure (2). 19 20 * DOM/WebDOMOperations.mm: 21 (-[DOMNode hidePlaceholder]): 22 (-[DOMNode showPlaceholderIfNecessary]): 23 1 24 2020-04-27 Antoine Quint <graouts@apple.com> 2 25 -
trunk/Source/WebKitLegacy/mac/DOM/WebDOMOperations.mm
r251425 r260854 49 49 #import <WebCore/HTMLInputElement.h> 50 50 #import <WebCore/HTMLParserIdioms.h> 51 #import <WebCore/HTMLTextFormControlElement.h> 51 52 #import <WebCore/JSElement.h> 52 53 #import <WebCore/LegacyWebArchive.h> … … 98 99 99 100 #if PLATFORM(IOS_FAMILY) 101 100 102 - (BOOL)isHorizontalWritingMode 101 103 { … … 113 115 - (void)hidePlaceholder 114 116 { 115 if (![self isKindOfClass:[DOMHTMLInputElement class]] 116 && ![self isKindOfClass:[DOMHTMLTextAreaElement class]]) 117 return; 118 119 Node *node = core(self); 120 HTMLTextFormControlElement *formControl = static_cast<HTMLTextFormControlElement *>(node); 121 formControl->hidePlaceholder(); 117 if (auto node = core(self); is<HTMLTextFormControlElement>(node)) 118 downcast<HTMLTextFormControlElement>(*node).setCanShowPlaceholder(false); 122 119 } 123 120 124 121 - (void)showPlaceholderIfNecessary 125 122 { 126 if (![self isKindOfClass:[DOMHTMLInputElement class]] 127 && ![self isKindOfClass:[DOMHTMLTextAreaElement class]]) 128 return; 129 130 HTMLTextFormControlElement *formControl = static_cast<HTMLTextFormControlElement *>(core(self)); 131 formControl->showPlaceholderIfNecessary(); 132 } 123 if (auto node = core(self); is<HTMLTextFormControlElement>(node)) 124 downcast<HTMLTextFormControlElement>(*node).setCanShowPlaceholder(true); 125 } 126 133 127 #endif 134 128
Note: See TracChangeset
for help on using the changeset viewer.