[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
tkent at chromium.org
tkent at chromium.org
Wed Dec 22 14:44:47 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 977c10c58ad80fe4818caf90f63191b90a10a86c
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 19 05:33:57 2010 +0000
2010-10-18 Kent Tamura <tkent at chromium.org>
Reviewed by Dimitri Glazkov.
Should not save state of a detached form control.
https://bugs.webkit.org/show_bug.cgi?id=47811
* fast/forms/state-save-of-detached-control-expected.txt: Added.
* fast/forms/state-save-of-detached-control.html: Added.
2010-10-18 Kent Tamura <tkent at chromium.org>
Reviewed by Dimitri Glazkov.
Should not save state of a detached form control.
https://bugs.webkit.org/show_bug.cgi?id=47811
Test: fast/forms/state-save-of-detached-control.html
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):
If the node is detached, don't save the state.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 116980e..6c6dab9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-18 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Should not save state of a detached form control.
+ https://bugs.webkit.org/show_bug.cgi?id=47811
+
+ * fast/forms/state-save-of-detached-control-expected.txt: Added.
+ * fast/forms/state-save-of-detached-control.html: Added.
+
2010-10-18 Oliver Hunt <oliver at apple.com>
Reviewed by Sam Weinig.
diff --git a/LayoutTests/fast/forms/state-save-of-detached-control-expected.txt b/LayoutTests/fast/forms/state-save-of-detached-control-expected.txt
new file mode 100644
index 0000000..b1080f7
--- /dev/null
+++ b/LayoutTests/fast/forms/state-save-of-detached-control-expected.txt
@@ -0,0 +1,5 @@
+Test to NOT save state of a detached form control.
+
+PASS document.getElementById("input2").value is ""
+
+
diff --git a/LayoutTests/fast/forms/state-save-of-detached-control.html b/LayoutTests/fast/forms/state-save-of-detached-control.html
new file mode 100644
index 0000000..d14c531
--- /dev/null
+++ b/LayoutTests/fast/forms/state-save-of-detached-control.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body onload="runTest()">
+<p>Test to NOT save state of a detached form control.</p>
+<div id="console"></div>
+
+<input id=emptyOnFirstVisit>
+<form action="data:text/html,<script>history.back()</script>" id=form1>
+<input name=user id=input2>
+</form>
+
+<script>
+var i1;
+
+function runTest()
+{
+ var form1 = document.getElementById('form1');
+ var state = document.getElementById('emptyOnFirstVisit');
+ if (!state.value) {
+ // First visit.
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+ state.value = 'visited';
+
+ form1.innerHTML = '<input name=user id=input1>';
+ i1 = document.getElementById('input1');
+ i1.value = 'value1';
+ form1.removeChild(i1);
+ // Submit form in a timeout to make sure that we create a new back/forward list item.
+ setTimeout(function() {document.getElementById('form1').submit();}, 0);
+ } else {
+ // Second visit.
+ shouldBe('document.getElementById("input2").value', '""'); // Not 'value1'.
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ }
+</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 284cc50..6b10dcb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-18 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Should not save state of a detached form control.
+ https://bugs.webkit.org/show_bug.cgi?id=47811
+
+ Test: fast/forms/state-save-of-detached-control.html
+
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):
+ If the node is detached, don't save the state.
+
2010-10-18 Xan Lopez <xlopez at igalia.com>
Reviewed by Martin Robinson.
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 1034bfc..51b9e20 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -440,7 +440,7 @@ bool HTMLFormControlElementWithState::autoComplete() const
bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
{
// We don't save/restore control state in a form with autocomplete=off.
- return autoComplete();
+ return attached() && autoComplete();
}
void HTMLFormControlElementWithState::finishParsingChildren()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list