wrap attribute of textarea element cannot be accessed by JavaScript.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 11:20:34 +0000 (11:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 11:20:34 +0000 (11:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68592

Patch by Vineet Chaudhary <vineet.chaudhary@motorola.com> on 2011-09-27
Reviewed by Kent Tamura.

Source/WebCore:

Added JS interface for wrap attribute to HTMLTextAreaElement.idl.

Test: fast/forms/textarea-wrap-attribute.html

* html/HTMLTextAreaElement.idl:

LayoutTests:

Added test cases to check accessibility to wrap attribute by JS.

* fast/forms/textarea-wrap-attribute-expected.txt: Added.
* fast/forms/textarea-wrap-attribute.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96096 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/textarea-wrap-attribute-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/textarea-wrap-attribute.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLTextAreaElement.idl

index ba49c2b..4a81657 100644 (file)
@@ -1,3 +1,15 @@
+2011-09-27  Vineet Chaudhary  <vineet.chaudhary@motorola.com>
+
+        wrap attribute of textarea element cannot be accessed by JavaScript.
+        https://bugs.webkit.org/show_bug.cgi?id=68592
+
+        Reviewed by Kent Tamura.
+
+        Added test cases to check accessibility to wrap attribute by JS.
+
+        * fast/forms/textarea-wrap-attribute-expected.txt: Added.
+        * fast/forms/textarea-wrap-attribute.html: Added.
+
 2011-09-27  Shinichiro Hamaji  <hamaji@chromium.org>
 
         [Chromium] Layout Test fast compositing/geometry/limit-layer-bounds-transformed-overflow.html is failing
diff --git a/LayoutTests/fast/forms/textarea-wrap-attribute-expected.txt b/LayoutTests/fast/forms/textarea-wrap-attribute-expected.txt
new file mode 100644 (file)
index 0000000..d690015
--- /dev/null
@@ -0,0 +1,25 @@
+HTMLTextAreaElement.wrap reflects the wrap="" attribute.
+It is not "limited to only known values", and it is a DOMString attribute which means it just returns the content attributes's value directly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+If wrap attribute is not specified it sould be empty String.
+PASS textArea.wrap is ''
+
+Check if it sets warpAttr value hard, should return hard.
+PASS textArea.wrap is 'hard'
+
+Check if it sets warpAttr value as soft, should return soft.
+PASS textArea.wrap is 'soft'
+
+Check if warpAttr present but no keyVal specified, should return empty String.
+PASS textArea.wrap is ''
+
+Check if it sets warpAttr invaild value, should return foo.
+PASS textArea.wrap is 'foo'
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/textarea-wrap-attribute.html b/LayoutTests/fast/forms/textarea-wrap-attribute.html
new file mode 100644 (file)
index 0000000..def8864
--- /dev/null
@@ -0,0 +1,49 @@
+<!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>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description('HTMLTextAreaElement.wrap reflects the wrap="" attribute.<br>It is not "limited to only known values", and it is a DOMString attribute which means it just returns the content attributes\'s value directly.');
+
+
+var textArea = document.createElement('textarea');
+document.body.appendChild(textArea);
+
+debug('If wrap attribute is not specified it sould be empty String.');
+shouldBe('textArea.wrap', "''");
+
+debug('');
+debug('Check if it sets warpAttr value hard, should return hard.');
+textArea.wrap = "hard";
+shouldBe('textArea.wrap', "'hard'");
+
+debug('');
+debug('Check if it sets warpAttr value as soft, should return soft.');
+textArea.wrap = "soft";
+shouldBe('textArea.wrap', "'soft'");
+
+debug('');
+debug('Check if warpAttr present but no keyVal specified, should return empty String.');
+textArea.wrap = "";
+shouldBe('textArea.wrap', "''");
+
+debug('');
+debug('Check if it sets warpAttr invaild value, should return foo.');
+textArea.wrap = "foo";
+shouldBe('textArea.wrap', "'foo'");
+
+debug('');
+var successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
+
+
+
+
index 80ce808..16e86ef 100644 (file)
@@ -1,3 +1,16 @@
+2011-09-27  Vineet Chaudhary  <vineet.chaudhary@motorola.com>
+
+        wrap attribute of textarea element cannot be accessed by JavaScript.
+        https://bugs.webkit.org/show_bug.cgi?id=68592
+
+        Reviewed by Kent Tamura.
+
+        Added JS interface for wrap attribute to HTMLTextAreaElement.idl.
+
+        Test: fast/forms/textarea-wrap-attribute.html
+
+        * html/HTMLTextAreaElement.idl:
+
 2011-09-27  Xan Lopez  <xlopez@igalia.com>
 
         [GTK] Add compatibility methods for DOM bindings
index ebc2a85..8031d24 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -34,6 +35,7 @@ module html {
         attribute [Reflect] boolean readOnly;
         attribute [Reflect] boolean required;
         attribute long rows;
+        attribute [Reflect] DOMString wrap;
         readonly attribute DOMString type;
         attribute [ConvertNullToNullString] DOMString value;
         readonly attribute unsigned long textLength;