From 4dca577f2e35a67da23d5e7d54819a5e82231354 Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Tue, 2 Mar 2010 14:06:17 -0800 Subject: [PATCH] Bug 549311 - New lines management tests for placeholder are missing; r=ehsan --HG-- extra : rebase_source : ba4be5c6a90abfef87f573968d00b4cc179aafdd --- content/html/content/test/test_bug457800.html | 8 ++++++++ .../forms/placeholder/placeholder-11.html | 7 +++++++ .../forms/placeholder/placeholder-12.html | 7 +++++++ .../forms/placeholder/placeholder-13.html | 17 +++++++++++++++++ .../forms/placeholder/placeholder-14.html | 17 +++++++++++++++++ layout/reftests/forms/placeholder/reftest.list | 4 ++++ 6 files changed, 60 insertions(+) create mode 100644 layout/reftests/forms/placeholder/placeholder-11.html create mode 100644 layout/reftests/forms/placeholder/placeholder-12.html create mode 100644 layout/reftests/forms/placeholder/placeholder-13.html create mode 100644 layout/reftests/forms/placeholder/placeholder-14.html diff --git a/content/html/content/test/test_bug457800.html b/content/html/content/test/test_bug457800.html index 6079a47c6d9e..b0da1835643e 100644 --- a/content/html/content/test/test_bug457800.html +++ b/content/html/content/test/test_bug457800.html @@ -41,6 +41,14 @@ function testPlaceholderForElement(element) element.value = 'value'; is(element.placeholder, 'ph', "placeholder in DOM interface has changed when value has changed"); is(element.getAttribute('placeholder'), 'ph', "placeholder attribute has changed when value has changed"); + + // check new lines are managed correctly (shouldn't be shown but kept in the DOM) + element.placeholder = 'place\nholder'; + is(element.placeholder, 'place\nholder', "\\n shouldn't be stripped"); + is(element.getAttribute('placeholder'), 'place\nholder', "\\n shouldn't be stripped"); + element.placeholder = 'place\rholder'; + is(element.placeholder, 'place\rholder', "\\r shouldn't be stripped"); + is(element.getAttribute('placeholder'), 'place\rholder', "\\r shouldn't be stripped"); } testPlaceholderForElement(document.getElementById('inputtext')); diff --git a/layout/reftests/forms/placeholder/placeholder-11.html b/layout/reftests/forms/placeholder/placeholder-11.html new file mode 100644 index 000000000000..817b5bd75a0f --- /dev/null +++ b/layout/reftests/forms/placeholder/placeholder-11.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/layout/reftests/forms/placeholder/placeholder-12.html b/layout/reftests/forms/placeholder/placeholder-12.html new file mode 100644 index 000000000000..eff3a6d1fcf9 --- /dev/null +++ b/layout/reftests/forms/placeholder/placeholder-12.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/layout/reftests/forms/placeholder/placeholder-13.html b/layout/reftests/forms/placeholder/placeholder-13.html new file mode 100644 index 000000000000..0cc60b4b0c8d --- /dev/null +++ b/layout/reftests/forms/placeholder/placeholder-13.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/layout/reftests/forms/placeholder/placeholder-14.html b/layout/reftests/forms/placeholder/placeholder-14.html new file mode 100644 index 000000000000..aaea5d22fc24 --- /dev/null +++ b/layout/reftests/forms/placeholder/placeholder-14.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/layout/reftests/forms/placeholder/reftest.list b/layout/reftests/forms/placeholder/reftest.list index a0bdbd6a49a6..96c3a33693eb 100644 --- a/layout/reftests/forms/placeholder/reftest.list +++ b/layout/reftests/forms/placeholder/reftest.list @@ -11,3 +11,7 @@ == placeholder-8.html placeholder-focus-ref.html == placeholder-9.html placeholder-focus-ref.html == placeholder-10.html placeholder-visible-ref.html +== placeholder-11.html placeholder-visible-ref.html +== placeholder-12.html placeholder-visible-ref.html +== placeholder-13.html placeholder-visible-ref.html +== placeholder-14.html placeholder-visible-ref.html