[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
arv at chromium.org
arv at chromium.org
Wed Dec 22 11:45:50 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 5e72eb25c2c69b48e93cbf4d9b6252410b272213
Author: arv at chromium.org <arv at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Aug 6 00:46:10 2010 +0000
2010-08-05 Erik Arvidsson <arv at chromium.org>
Reviewed by Kent Tamura.
Calling setCustomValidity should trigger a layout
https://bugs.webkit.org/show_bug.cgi?id=43582
* fast/forms/setCustomValidity-expected.txt: Added.
* fast/forms/setCustomValidity.html: Added.
2010-08-05 Erik Arvidsson <arv at chromium.org>
Reviewed by Kent Tamura.
Calling setCustomValidity should trigger a layout
https://bugs.webkit.org/show_bug.cgi?id=43582
Test: fast/forms/setCustomValidity.html
* html/ValidityState.cpp:
(WebCore::ValidityState::setCustomErrorMessage): Call setNeedsValidityCheck to tell the system that the validity might have changed.
* html/ValidityState.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 97d4928..39fea78 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-05 Erik Arvidsson <arv at chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Calling setCustomValidity should trigger a layout
+ https://bugs.webkit.org/show_bug.cgi?id=43582
+
+ * fast/forms/setCustomValidity-expected.txt: Added.
+ * fast/forms/setCustomValidity.html: Added.
+
2010-08-05 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/forms/setCustomValidity-expected.txt b/LayoutTests/fast/forms/setCustomValidity-expected.txt
new file mode 100644
index 0000000..c387238
--- /dev/null
+++ b/LayoutTests/fast/forms/setCustomValidity-expected.txt
@@ -0,0 +1,37 @@
+This test checks if setCustomValidity causes CSS to get applied correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+PASS test.validity.customError is false
+PASS test.validationMessage is ""
+PASS getComputedStyle(test).backgroundColor is "rgb(0, 255, 0)"
+PASS test.validity.customError is true
+PASS test.validationMessage is "Custom validation message"
+PASS getComputedStyle(test).backgroundColor is "rgb(255, 0, 0)"
+PASS test.validity.customError is false
+PASS test.validationMessage is ""
+PASS getComputedStyle(test).backgroundColor is "rgb(0, 255, 0)"
+PASS test.validity.customError is false
+PASS test.validationMessage is ""
+PASS getComputedStyle(test).backgroundColor is "rgb(0, 255, 0)"
+PASS test.validity.customError is true
+PASS test.validationMessage is "Custom validation message"
+PASS getComputedStyle(test).backgroundColor is "rgb(255, 0, 0)"
+PASS test.validity.customError is false
+PASS test.validationMessage is ""
+PASS getComputedStyle(test).backgroundColor is "rgb(0, 255, 0)"
+PASS test.validity.customError is false
+PASS test.validationMessage is ""
+PASS getComputedStyle(test).backgroundColor is "rgb(0, 255, 0)"
+PASS test.validity.customError is true
+PASS test.validationMessage is "Custom validation message"
+PASS getComputedStyle(test).backgroundColor is "rgb(255, 0, 0)"
+PASS test.validity.customError is false
+PASS test.validationMessage is ""
+PASS getComputedStyle(test).backgroundColor is "rgb(0, 255, 0)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/setCustomValidity.html b/LayoutTests/fast/forms/setCustomValidity.html
new file mode 100644
index 0000000..3942b6b
--- /dev/null
+++ b/LayoutTests/fast/forms/setCustomValidity.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<style>
+
+[name=victim] {
+ background-color: #0f0;
+}
+
+[name=victim]:invalid {
+ background-color: #f00;
+}
+
+</style>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+
+<select name="victim"></select>
+<textarea name="victim"></textarea>
+<input name="victim">
+
+<div id="console"></div>
+<script>
+
+description('This test checks if setCustomValidity causes CSS to get applied correctly.');
+
+var v = document.getElementsByName('victim');
+var test;
+
+for (var i = 0; i < v.length; i++) {
+ test = v[i];
+
+ shouldBeFalse('test.validity.customError');
+ shouldBeEqualToString('test.validationMessage', '');
+ shouldBeEqualToString('getComputedStyle(test).backgroundColor', 'rgb(0, 255, 0)');
+
+ var message = 'Custom validation message';
+ test.setCustomValidity(message);
+ shouldBeTrue('test.validity.customError');
+ shouldBeEqualToString('test.validationMessage', message);
+ shouldBeEqualToString('getComputedStyle(test).backgroundColor', 'rgb(255, 0, 0)');
+
+ test.setCustomValidity('');
+ shouldBeFalse('test.validity.customError');
+ shouldBeEqualToString('test.validationMessage', '');
+ shouldBeEqualToString('getComputedStyle(test).backgroundColor', 'rgb(0, 255, 0)');
+}
+
+var successfullyParsed = true;
+
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5fdc758..6307b12 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-05 Erik Arvidsson <arv at chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Calling setCustomValidity should trigger a layout
+ https://bugs.webkit.org/show_bug.cgi?id=43582
+
+ Test: fast/forms/setCustomValidity.html
+
+ * html/ValidityState.cpp:
+ (WebCore::ValidityState::setCustomErrorMessage): Call setNeedsValidityCheck to tell the system that the validity might have changed.
+ * html/ValidityState.h:
+
2010-08-05 Sam Weinig <sam at webkit.org>
Reviewed by Anders Carlsson.
diff --git a/WebCore/html/ValidityState.cpp b/WebCore/html/ValidityState.cpp
index 6a159e8..e286b64 100644
--- a/WebCore/html/ValidityState.cpp
+++ b/WebCore/html/ValidityState.cpp
@@ -66,6 +66,12 @@ String ValidityState::validationMessage() const
return String();
}
+void ValidityState::setCustomErrorMessage(const String& message)
+{
+ m_customErrorMessage = message;
+ m_control->setNeedsValidityCheck();
+}
+
bool ValidityState::typeMismatch() const
{
if (!m_control->hasTagName(inputTag))
diff --git a/WebCore/html/ValidityState.h b/WebCore/html/ValidityState.h
index 78238f1..04f11a1 100644
--- a/WebCore/html/ValidityState.h
+++ b/WebCore/html/ValidityState.h
@@ -41,7 +41,7 @@ public:
String validationMessage() const;
- void setCustomErrorMessage(const String& message) { m_customErrorMessage = message; }
+ void setCustomErrorMessage(const String&);
bool valueMissing() const { return m_control->valueMissing(); }
bool typeMismatch() const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list