[Pkg-mozext-commits] [itsalltext] 212/459: * fixed bug for application/xhtml+xml documents. * added some test cases.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository itsalltext.

commit 4db82143713bc3ccb234529877dd5d886d7028fe
Author: docwhat at gerf.org <docwhat at gerf.org>
Date:   Tue May 8 10:04:42 2007 -0400

    * fixed bug for application/xhtml+xml documents.
    * added some test cases.
---
 src/chrome/content/itsalltext.js |  3 +-
 tests/basic.html                 | 44 +++++++++++++++++++
 tests/basic.xhtml                | 48 +++++++++++++++++++++
 tests/extended.html              | 47 ++++++++++++++++++++
 tests/index.html                 | 26 +++++++++++
 tests/setup.html                 | 50 +++++++++++++++++++++
 tests/style.css                  | 13 ++++++
 tests/test.html                  | 93 ++++++++++++++++++++++++++++++++++++++++
 8 files changed, 323 insertions(+), 1 deletion(-)

diff --git a/src/chrome/content/itsalltext.js b/src/chrome/content/itsalltext.js
index 5064cb7..d67c8ca 100644
--- a/src/chrome/content/itsalltext.js
+++ b/src/chrome/content/itsalltext.js
@@ -583,7 +583,8 @@ var ItsAllText = function() {
                 contentType = doc.contentType;
                 location = doc.location;
                 is_html = (contentType=='text/html' ||
-                               contentType=='text/xhtml');
+                           contentType=='text/xhtml' ||
+                           contentType=='application/xhtml+xml');
                 //var is_xul=(contentType=='application/vnd.mozilla.xul+xml');
                 is_usable = (is_html) && 
                     location.protocol != 'about:' &&
diff --git a/tests/basic.html b/tests/basic.html
new file mode 100644
index 0000000..bcb004f
--- /dev/null
+++ b/tests/basic.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>Basic HTML</title>
+    <link rel="stylesheet" href="style.css" type="text/css">
+  </head>
+
+  <body>
+    <h1>Basic HTML</h1>
+
+    <p>
+      Purpose: to verify IAT! works with HTML.
+    </p>
+
+    <form action="" method="get">
+      <p>
+        Use this textarea for the tests below:
+        <textarea>testing area</textarea>
+      </p>
+    </form>
+    
+    <ol>
+      <li>
+        Click on the edit button.  Your editor should open and should contain the text from the textarea.  Add the phrase “test 1” in your editor and save and exit.  The textarea should be updated within a few seconds.
+      </li>
+      <li>
+        Right click on the edit button.  Select the menu item <tt>.txt</tt>.  Your editor should open and should contain the text from the textarea.  Add the phrase “test 2” in your editor and save and exit.  The textarea should be updated within a few seconds.
+      </li>
+      <li>
+        Right click on the textarea.  Select the menu item <tt>It's All Text!</tt> → <tt>.txt</tt>.  Your editor should open and should contain the text from the textarea.  Add the phrase “test 3” in your editor and save and exit.  The textarea should be updated within a few seconds.
+      </li>
+
+      <li>
+        Right click on the edit button.  Select the menu item <tt>Preferences</tt>. The preferences should open.  Close them.
+      </li>
+      <li>
+        Right click on the textarea.  Select the menu item <tt>It's All Text!</tt> → <tt>Preferences</tt>. The preferences should open.  Close them.
+      </li>
+    </ol>
+
+  </body>
+</html>
+
diff --git a/tests/basic.xhtml b/tests/basic.xhtml
new file mode 100644
index 0000000..ba9df0b
--- /dev/null
+++ b/tests/basic.xhtml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <title>Basic XHTML</title>
+    <link rel="stylesheet" href="style.css" type="text/css"/>
+  </head>
+
+  <body>
+    <h1>Basic XHTML</h1>
+
+    <p>
+      Purpose: to verify IAT! works with XHTML.
+    </p>
+    <p style="color: #820;">
+      Note: This test is only valid if it is served with a Content-Type of <tt>application/xhtml+xml</tt>.  Verify this using <tt>View Page Info</tt>, the Type should be <tt>application/xhtml+xml</tt>.
+    </p>
+
+    <form action="" method="get">
+      <p>
+        Use this textarea for the tests below:
+        <textarea>testing area</textarea>
+      </p>
+    </form>
+    
+    <ol>
+      <li>
+        Click on the edit button.  Your editor should open and should contain the text from the textarea.  Add the phrase “test 1” in your editor and save and exit.  The textarea should be updated within a few seconds.
+      </li>
+      <li>
+        Right click on the edit button.  Select the menu item <tt>.txt</tt>.  Your editor should open and should contain the text from the textarea.  Add the phrase “test 2” in your editor and save and exit.  The textarea should be updated within a few seconds.
+      </li>
+      <li>
+        Right click on the textarea.  Select the menu item <tt>It's All Text!</tt> → <tt>.txt</tt>.  Your editor should open and should contain the text from the textarea.  Add the phrase “test 3” in your editor and save and exit.  The textarea should be updated within a few seconds.
+      </li>
+
+      <li>
+        Right click on the edit button.  Select the menu item <tt>Preferences</tt>. The preferences should open.  Close them.
+      </li>
+      <li>
+        Right click on the textarea.  Select the menu item <tt>It's All Text!</tt> → <tt>Preferences</tt>. The preferences should open.  Close them.
+      </li>
+    </ol>
+
+  </body>
+</html>
+
diff --git a/tests/extended.html b/tests/extended.html
new file mode 100644
index 0000000..b2485a9
--- /dev/null
+++ b/tests/extended.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>Extended Attributes</title>
+    <link rel="stylesheet" href="style.css" type="text/css">
+  </head>
+
+  <body>
+    <h1>Extended Attributes</h1>
+
+    <p>
+      Purpose: to verify that the extended attributes work.
+    </p>
+
+
+      <p>
+        Use this textarea for the tests below:
+        <textarea>testing area</textarea>
+      </p>
+    </form>
+    
+    <form action="" method="get">
+      <ol>
+        <li>
+          Click on the edit button on this textarea.  Your editor should open and the extension of the file should be <tt>.c</tt>.  Type in “test 1” and save and exit.  The textarea should be updated within a few seconds.
+          <br><textarea name="test1" itsalltext-extension=".c">/* Hello World */
+#include <stdio.h>
+
+main()
+{
+  for(;;)
+      { 
+          printf ("Hello World!\n");
+      }
+}</textarea>
+        </li>
+        <li>
+          Click on the edit button on this textarea.  Your editor should open and the extension of the file should be <tt>.txt</tt>.  Type in “test 2” and save and exit.  The textarea should be updated within a few seconds.
+          <br><textarea itsalltext-extension="/etc/hosts.txt" style="background: red; color: white;">HOSTILE</textarea>
+        </li>
+      </ol>
+    </form>
+
+  </body>
+</html>
+
diff --git a/tests/index.html b/tests/index.html
new file mode 100644
index 0000000..c0a210d
--- /dev/null
+++ b/tests/index.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>It's All Text! tests</title>
+    <link rel="stylesheet" href="style.css" type="text/css">
+  </head>
+
+  <body>
+    <h1>It's All Text! tests</h1>
+
+    <p>
+      These are a series of tests for verifying that <a href="http://addons.mozilla.org/firefox/4125">It's All Text!</a> is working correctly.  I'll be adding more tests to these pages as I discover bugs.
+    </p>
+
+    <ol>
+      <li><a href="setup.html">Setup Tests</a></li>
+      <li><a href="basic.html">Basic HTML</a></li>
+      <li><a href="basic.xhtml">Basic XHTML</a></li>
+      <li><a href="extended.html">Extended Attributes</a></li>
+    </ol>
+
+    <hr>
+    <address><a href="http://docwhat.gerf.org/email/">Christian Höltje</a></address>
+  </body>
+</html>
diff --git a/tests/setup.html b/tests/setup.html
new file mode 100644
index 0000000..b14f7ae
--- /dev/null
+++ b/tests/setup.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>Setup Tests</title>
+    <link rel="stylesheet" href="style.css" type="text/css">
+  </head>
+
+  <body>
+    <h1>Setup Tests</h1>
+
+    <p>
+      Purpose: to verify that a new version of IAT! has been setup correctly.
+    </p>
+
+    <form action="" method="get">
+      <p>
+        Use this textarea for the tests below:
+        <textarea>testing area</textarea>
+      </p>
+    </form>
+    
+    <ol>
+      <li>
+        When you first installed IAT! you should have gotten a new
+        tab or window describing IAT!
+      </li>
+      <li>
+        There should be an edit button next to the textarea.
+      </li>
+      <li>
+        If you right click on the textarea, there should be a context
+        menu item saying "It's All Text!"
+      </li>
+      <li>
+        If you have never installed IAT! for this browser
+        <ol>
+          <li>Click the edit button. You should get a dialog that says
+          that it was unable to open your editor.</li>
+          <li>Click on the preferences button.</li>
+          <li>Set the editor.</li>
+          <li>Close the preferences. The editor you chose should pop
+          up and should contain the text from the textarea.</li>
+        </ol>
+      </li>
+    </ol>
+
+  </body>
+</html>
+
diff --git a/tests/style.css b/tests/style.css
new file mode 100644
index 0000000..b51c1a8
--- /dev/null
+++ b/tests/style.css
@@ -0,0 +1,13 @@
+html, body { background: #ffa; color: #000; 
+             font: 1em sans-serif; }
+h1 { background: #00f; color: #fff; 
+     margin: -1ex -1em 1ex; 
+     padding: 0.8ex 1em 0.2ex; }
+form { margin: 0; padding: 0; }
+textarea { background: #ddd; color: #000; 
+           height: 5ex; width: 10em; display: inline; }
+
+tt { color: #080; font-weight: bold; font-size: 1.2em; }
+
+ol li, ul li, p { line-height: 1.2em; margin: 0.4em; }
+
diff --git a/tests/test.html b/tests/test.html
new file mode 100644
index 0000000..d679aae
--- /dev/null
+++ b/tests/test.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+  <head>
+    <title></title>
+    <style type="text/css">
+      textarea { background: #ddf; color: red; }
+    </style>
+  </head>
+  
+  <body>
+    <h1>Test Page</h1>
+
+    <p>Test link:
+    <a href="/" onclick="window.open(this.href,'_blank'); return false">link1</a>
+    <a href="/" onclick="try{window.open(this.href,'_blank'); return false;}catch(e){return true;}">link2</a>
+    <br/>
+    <a href="?back">Back Link</a>
+    </p>
+
+    <div style="margin: -1em">
+    <div style="margin: 1em; padding: 1em; border: 1px dotted red;">
+    <form name="fish" action="">
+      <textarea name="ralf" style="background: #def" cols="40"
+                rows="8">
+        743              scrollType = 2;
+        744      
+        745            var imageWidth = 28;
+        746            var imageHeight = 28;
+        747            
+        748            // marker
+        749            var el = this._clientFrameDoc.createElementNS("http://www.w3.org/1999/xhtml", "img");
+        750            
+        751            var scrollImages  = new Array("chrome://global/content/bindings/autoscroll_all.png",
+        752                                          "chrome://global/content/bindings/autoscroll_v.png",
+        753                                          "chrome://global/content/bindings/autoscroll_h.png");
+        754            
+        755            el.src = scrollImages[scrollType];         
+        756            el.style.position = "fixed";
+        757            el.style.left = left - imageWidth / 2 + "px";
+        758            el.style.top = top - imageHeight / 2 + "px";
+        759            el.style.width = imageWidth + "px";
+        760            el.style.height = imageHeight + "px";
+        761            el.style.cursor = scrollCursor[scrollType];
+        762            el.style.zIndex = 2147483647; //Max Int
+        763            el.style.borderStyle = "none";
+        764            el.style.padding = "0";
+        765            el.style.margin = "0";
+        766 
+        767            this._clientFrameDoc.documentElement.appendChild(el);
+        768            
+        769            this._autoScrollMarkerImage = el;
+      </textarea>
+      <br/>
+      <textarea name="e-v" id="one">e-v one</textarea>
+      <textarea name="e-v" id="two">e-v two</textarea>
+      <textarea name="e-v" disabled="disabled">disabled</textarea>
+      <textarea name="e-v" readonly="readonly">readonly</textarea>
+      <textarea name="e-v">readonly</textarea>
+      <div style="margin: 2em; border: 1px dashed green;">
+        <textarea name="javascript" itsalltext-extension=".JS">
+          function javascript() { 
+          alert('one');
+          }
+        </textarea>
+        <textarea name="hostile" itsalltext-extension="/../fish"
+                  style="background: red; color: white;">
+          HOSTILE
+        </textarea>
+      </div>
+      <input type="submit"/>
+    </form>
+    </div>
+    </div>
+    <p>
+      <b
+          onclick="document.getElementById('two').style.display='none';"
+          >hide</b>
+      <br/>
+      <b onclick="document.getElementById('two').style.display = '';">show</b>
+    </p>
+    
+    <p>Test text: Please note that FIPS codes are not the same thing as ZIP Codes, however the two-letter abbreviations for U.S. states are the same as the Postal Service state abbreviations. Currently, actual "states" of the United States are (with the exception of number 11, District of Columbia), those entries with a FIPS code of 01 to 56. NBSP:   	
+<--
+    </p>
+
+    <hr/>
+    <address><a href="mailto:holtje at holtje-desktop">Christian Holtje</a></address>
+<!-- Created: Wed Nov  8 12:25:35 EST 2006 -->
+<!-- hhmts start -->
+Last modified: Thu Mar  1 12:24:17 EST 2007
+<!-- hhmts end -->
+  </body>
+</html>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/itsalltext.git



More information about the Pkg-mozext-commits mailing list