Title: [136928] trunk/Source
- Revision
- 136928
- Author
- [email protected]
- Date
- 2012-12-06 23:46:58 -0800 (Thu, 06 Dec 2012)
Log Message
Refactoring: Clean up placeholder attribute usage
https://bugs.webkit.org/show_bug.cgi?id=104337
Reviewed by Kentaro Hara.
Source/WebCore:
No new tests. This doesn't change any behavior.
* html/HTMLInputElement.cpp: Remove placeholder and setPlacehodler.
* html/HTMLInputElement.h: Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::strippedPlaceholder):
We can use fastGetAttribute for placeholder.
(WebCore::HTMLTextFormControlElement::isPlaceholderEmpty):
Ditto.
Source/WebKit/chromium:
* src/WebInputElement.cpp:
(WebKit::WebInputElement::setPlaceholder):
Use setAttribute.
(WebKit::WebInputElement::placeholder):
Use fastGetAttribute.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (136927 => 136928)
--- trunk/Source/WebCore/ChangeLog 2012-12-07 07:44:01 UTC (rev 136927)
+++ trunk/Source/WebCore/ChangeLog 2012-12-07 07:46:58 UTC (rev 136928)
@@ -1,5 +1,22 @@
2012-12-06 Kent Tamura <[email protected]>
+ Refactoring: Clean up placeholder attribute usage
+ https://bugs.webkit.org/show_bug.cgi?id=104337
+
+ Reviewed by Kentaro Hara.
+
+ No new tests. This doesn't change any behavior.
+
+ * html/HTMLInputElement.cpp: Remove placeholder and setPlacehodler.
+ * html/HTMLInputElement.h: Ditto.
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::strippedPlaceholder):
+ We can use fastGetAttribute for placeholder.
+ (WebCore::HTMLTextFormControlElement::isPlaceholderEmpty):
+ Ditto.
+
+2012-12-06 Kent Tamura <[email protected]>
+
Refactoring: Rename HTMLFormControlElement::required to isRequired
https://bugs.webkit.org/show_bug.cgi?id=104336
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (136927 => 136928)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2012-12-07 07:44:01 UTC (rev 136927)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2012-12-07 07:46:58 UTC (rev 136928)
@@ -1051,16 +1051,6 @@
m_inputType->setValueAsDouble(newValue, eventBehavior, ec);
}
-String HTMLInputElement::placeholder() const
-{
- return fastGetAttribute(placeholderAttr).string();
-}
-
-void HTMLInputElement::setPlaceholder(const String& value)
-{
- setAttribute(placeholderAttr, value);
-}
-
void HTMLInputElement::setValueFromRenderer(const String& value)
{
// File upload controls will never use this.
Modified: trunk/Source/WebCore/html/HTMLInputElement.h (136927 => 136928)
--- trunk/Source/WebCore/html/HTMLInputElement.h 2012-12-07 07:44:01 UTC (rev 136927)
+++ trunk/Source/WebCore/html/HTMLInputElement.h 2012-12-07 07:46:58 UTC (rev 136928)
@@ -176,9 +176,6 @@
double valueAsNumber() const;
void setValueAsNumber(double, ExceptionCode&, TextFieldEventBehavior = DispatchNoEvent);
- virtual String placeholder() const;
- virtual void setPlaceholder(const String&);
-
String valueWithDefault() const;
void setValueFromRenderer(const String&);
Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (136927 => 136928)
--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2012-12-07 07:44:01 UTC (rev 136927)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2012-12-07 07:46:58 UTC (rev 136928)
@@ -116,7 +116,7 @@
{
// According to the HTML5 specification, we need to remove CR and LF from
// the attribute value.
- const AtomicString& attributeValue = getAttribute(placeholderAttr);
+ const AtomicString& attributeValue = fastGetAttribute(placeholderAttr);
if (!attributeValue.contains(newlineCharacter) && !attributeValue.contains(carriageReturn))
return attributeValue;
@@ -136,7 +136,7 @@
bool HTMLTextFormControlElement::isPlaceholderEmpty() const
{
- const AtomicString& attributeValue = getAttribute(placeholderAttr);
+ const AtomicString& attributeValue = fastGetAttribute(placeholderAttr);
return attributeValue.string().find(isNotLineBreak) == notFound;
}
Modified: trunk/Source/WebKit/chromium/ChangeLog (136927 => 136928)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-12-07 07:44:01 UTC (rev 136927)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-12-07 07:46:58 UTC (rev 136928)
@@ -1,3 +1,16 @@
+2012-12-06 Kent Tamura <[email protected]>
+
+ Refactoring: Clean up placeholder attribute usage
+ https://bugs.webkit.org/show_bug.cgi?id=104337
+
+ Reviewed by Kentaro Hara.
+
+ * src/WebInputElement.cpp:
+ (WebKit::WebInputElement::setPlaceholder):
+ Use setAttribute.
+ (WebKit::WebInputElement::placeholder):
+ Use fastGetAttribute.
+
2012-12-06 Sami Kyostila <[email protected]>
[chromium] Introduce setting for low latency rendering
Modified: trunk/Source/WebKit/chromium/src/WebInputElement.cpp (136927 => 136928)
--- trunk/Source/WebKit/chromium/src/WebInputElement.cpp 2012-12-07 07:44:01 UTC (rev 136927)
+++ trunk/Source/WebKit/chromium/src/WebInputElement.cpp 2012-12-07 07:46:58 UTC (rev 136928)
@@ -125,12 +125,12 @@
void WebInputElement::setPlaceholder(const WebString& value)
{
- unwrap<HTMLInputElement>()->setPlaceholder(value);
+ unwrap<HTMLInputElement>()->setAttribute(HTMLNames::placeholderAttr, value);
}
WebString WebInputElement::placeholder() const
{
- return constUnwrap<HTMLInputElement>()->placeholder();
+ return constUnwrap<HTMLInputElement>()->fastGetAttribute(HTMLNames::placeholderAttr);
}
bool WebInputElement::isAutofilled() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes