From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- dom/xml/test/old/books/bethlehem.gif | Bin 0 -> 5565 bytes dom/xml/test/old/books/bill.gif | Bin 0 -> 5022 bytes dom/xml/test/old/books/books.js | 90 +++++ dom/xml/test/old/books/books.xml | 103 ++++++ dom/xml/test/old/books/charing.gif | Bin 0 -> 5947 bytes dom/xml/test/old/books/classic.css | 78 +++++ dom/xml/test/old/books/common.css | 43 +++ dom/xml/test/old/books/kerouac.gif | Bin 0 -> 50387 bytes dom/xml/test/old/books/list.css | 61 ++++ dom/xml/test/old/books/road.gif | Bin 0 -> 8004 bytes dom/xml/test/old/books/welville.gif | Bin 0 -> 4535 bytes dom/xml/test/old/docbook.css | 621 +++++++++++++++++++++++++++++++++++ dom/xml/test/old/docbooktest.xml | 126 +++++++ dom/xml/test/old/flamer.gif | Bin 0 -> 11284 bytes dom/xml/test/old/script.xml | 67 ++++ dom/xml/test/old/simple.xml | 10 + dom/xml/test/old/toc/book.css | 137 ++++++++ dom/xml/test/old/toc/irslogo.gif | Bin 0 -> 2605 bytes dom/xml/test/old/toc/minus.gif | Bin 0 -> 85 bytes dom/xml/test/old/toc/plus.gif | Bin 0 -> 88 bytes dom/xml/test/old/toc/rights.xml | 292 ++++++++++++++++ dom/xml/test/old/toc/toc.css | 77 +++++ dom/xml/test/old/toc/toc.js | 131 ++++++++ dom/xml/test/old/xlink/auto.xml | 16 + dom/xml/test/old/xlink/link.css | 22 ++ dom/xml/test/old/xlink/manual.xml | 14 + dom/xml/test/old/xmlbase/xmlbase.css | 28 ++ dom/xml/test/old/xmlbase/xmlbase.xml | 82 +++++ 28 files changed, 1998 insertions(+) create mode 100644 dom/xml/test/old/books/bethlehem.gif create mode 100644 dom/xml/test/old/books/bill.gif create mode 100644 dom/xml/test/old/books/books.js create mode 100644 dom/xml/test/old/books/books.xml create mode 100644 dom/xml/test/old/books/charing.gif create mode 100644 dom/xml/test/old/books/classic.css create mode 100644 dom/xml/test/old/books/common.css create mode 100644 dom/xml/test/old/books/kerouac.gif create mode 100644 dom/xml/test/old/books/list.css create mode 100644 dom/xml/test/old/books/road.gif create mode 100644 dom/xml/test/old/books/welville.gif create mode 100644 dom/xml/test/old/docbook.css create mode 100644 dom/xml/test/old/docbooktest.xml create mode 100644 dom/xml/test/old/flamer.gif create mode 100644 dom/xml/test/old/script.xml create mode 100644 dom/xml/test/old/simple.xml create mode 100644 dom/xml/test/old/toc/book.css create mode 100644 dom/xml/test/old/toc/irslogo.gif create mode 100644 dom/xml/test/old/toc/minus.gif create mode 100644 dom/xml/test/old/toc/plus.gif create mode 100644 dom/xml/test/old/toc/rights.xml create mode 100644 dom/xml/test/old/toc/toc.css create mode 100644 dom/xml/test/old/toc/toc.js create mode 100644 dom/xml/test/old/xlink/auto.xml create mode 100644 dom/xml/test/old/xlink/link.css create mode 100644 dom/xml/test/old/xlink/manual.xml create mode 100644 dom/xml/test/old/xmlbase/xmlbase.css create mode 100644 dom/xml/test/old/xmlbase/xmlbase.xml (limited to 'dom/xml/test/old') diff --git a/dom/xml/test/old/books/bethlehem.gif b/dom/xml/test/old/books/bethlehem.gif new file mode 100644 index 0000000000..db41f52fb4 Binary files /dev/null and b/dom/xml/test/old/books/bethlehem.gif differ diff --git a/dom/xml/test/old/books/bill.gif b/dom/xml/test/old/books/bill.gif new file mode 100644 index 0000000000..4b00f890cb Binary files /dev/null and b/dom/xml/test/old/books/bill.gif differ diff --git a/dom/xml/test/old/books/books.js b/dom/xml/test/old/books/books.js new file mode 100644 index 0000000000..cf233a7b93 --- /dev/null +++ b/dom/xml/test/old/books/books.js @@ -0,0 +1,90 @@ +// An inefficient, but effective bubble sort +function sort(collection, key) { + var i, j; + var count = collection.length; + var parent, child; + + for (i = count - 1; i >= 0; i--) { + for (j = 1; j <= i; j++) { + if (collection[j - 1][key] > collection[j][key]) { + // Move the item both in the local array and + // in the tree + child = collection[j]; + parent = child.parentNode; + + collection[j] = collection[j - 1]; + collection[j - 1] = child; + + parent.removeChild(child); + parent.insertBefore(child, collection[j]); + } + } + } +} + +// Set user properties on the nodes in the collection +// based on information found in its children. For example, +// make a property "Author" based on the content of the +// "Author" element found in the childNode list of the node. +// This makes later sorting more efficient +function collectInfo(nodes, propNames) { + var i, j, k; + var ncount = nodes.length; + var pcount = propNames.length; + + for (i = 0; i < ncount; i++) { + var node = nodes[i]; + var childNodes = node.childNodes; + var ccount = childNodes.length; + + for (j = 0; j < ccount; j++) { + var child = childNodes[j]; + + if (child.nodeType == Node.ELEMENT_NODE) { + var tagName = child.tagName; + + for (k = 0; k < pcount; k++) { + var prop = propNames[k]; + if (prop == tagName) { + node[prop] = child.firstChild.data; + } + } + } + } + } +} + +var enabled = true; +function toggleStyleSheet() { + if (enabled) { + document.styleSheets[2].disabled = true; + } else { + document.styleSheets[2].disabled = false; + } + + enabled = !enabled; +} + +// XXX This is a workaround for a bug where +// changing the disabled state of a stylesheet can't +// be done in an event handler. For now, we do it +// in a zero-delay timeout. +function initiateToggle() { + setTimeout(toggleStyleSheet, 0); +} + +var sortableProps = new Array("Author", "Title", "ISBN"); +var books = new Array(); + +// We uppercase the tagName as a workaround for a bug +// that loses the original case of the tag. +var bookset = document.getElementsByTagName("Book"); + +// We need to create a "non-live" array to operate on. Since +// we'll be moving things around in this array, we can't use +// the read-only, live one returned by getElementsByTagName. +for (var i = 0; i < bookset.length; i++) { + books[i] = bookset[i]; +} + +collectInfo(books, sortableProps); diff --git a/dom/xml/test/old/books/books.xml b/dom/xml/test/old/books/books.xml new file mode 100644 index 0000000000..2067487d8d --- /dev/null +++ b/dom/xml/test/old/books/books.xml @@ -0,0 +1,103 @@ + + + + + + + + + +
+ + + + + + + + + + + Amazon.com Search Results for: the keywords include "Road" +
+ + + + + + On the Road + Kerouac, Jack + 0140042598 + +On The Road, the most famous of Jack Kerouac's works, is not only the soul of the Beat movement and literature, but one of the most important novels of the century. Like nearly all of Kerouac's writing, On The Road is thinly fictionalized autobiography, filled with a cast made of Kerouac's real life friends, lovers, and fellow travelers. Narrated by Sal Paradise, one of Kerouac's alter-egos, On the Road is a cross-country bohemian odyssey that not only influenced writing in the years since its 1957 publication but penetrated into the deepest levels of American thought and culture. + + $12.95 + $10.36 + + + + + The Road Ahead + Gates, Bill + 666666666 + +In a study, the founder of Microsoft presents his vision for the future in which he sees the digital technologies of the coming years changing the way we buy, work, learn, and communicate. But he doesn't mention XML! + + $15.95 + $12.76 + + + + + The Road to Wellville + Boyle, T. Coraghessan + 0140167188 + +A snobbish wife and her henpecked husband travel to Dr. Kellogg's spa in turn-of-the-century Battle Creek, where the youth-crazed affluent succumb to quackery. By the author of East is East. + + $12.95 + $10.36 + + + + + AAA Road Atlas 1999 + A. A. A. + 1562512625 + +The definitive road atlas to the United States, Canada and Mexico. + + $9.95 + $9.95 + + + + + Bethlehem Road + Perry, Anne + 0449219143 + +He might be elegant, but there's no mistaking it--the gentleman tied to the lamppost on Westminster Bridge is definitely dead. Before Inspector Thomas Pitt can even speculate on why anyone should want to kill the eminent M.P., Sir Lockwood, a colleague of his, meets the same fate at the same spot. The public is outraged, and clever Charlotte Pitt, Thomas's well-born wife, helps her hard-pressed husband by scouting society's drawing rooms for clues to these appalling crimes. Meanwhile, another victim is being stalked.... + + $6.99 + $5.59 + + + + + 84 Charing Cross Road + Hanff, Helene + 0140143505 + +84, Charing Cross Road is a charming record of bibliophilia, cultural difference, and imaginative sympathy. For 20 years, an outspoken New York writer and a rather more restrained London bookseller carried on an increasingly touching correspondence... + + $9.95 + $7.96 + + + + + + +
diff --git a/dom/xml/test/old/books/charing.gif b/dom/xml/test/old/books/charing.gif new file mode 100644 index 0000000000..9a63fb0b27 Binary files /dev/null and b/dom/xml/test/old/books/charing.gif differ diff --git a/dom/xml/test/old/books/classic.css b/dom/xml/test/old/books/classic.css new file mode 100644 index 0000000000..1ebc92f6e8 --- /dev/null +++ b/dom/xml/test/old/books/classic.css @@ -0,0 +1,78 @@ + + +BookSet { + display: block; +} + +Book { + float: left; + display: block; + width: 300px; + background-color: #f1f1f1; + border: 1px solid #cccccc; + margin-right: 8px; + margin-top: 8px; +} + +BookCover { + display: inline; + float: left; + margin-right: 10px; + padding: 5px; + width: 100px; + height: 140px; +} + +Title { + display: block; + font-weight: bold; + color: blue; + text-decoration: underline; + cursor: pointer; +} + +Author { + display: block; + font-style: italic; +} + +Synopsis { + display: block; + overflow: scroll; + height: 100px; + width: 155px; + padding: 3px; + background-color: #ddddff; +} + + +ListPrice { + display: block; + text-align: right; + padding-right: 15px; + text-decoration: line-through; +} + + +Price { + display: block; + color: rgb(20,100,0); + text-align:right; + padding-right: 15px; + font-weight: bold; +} + + +Price:before { + content: "Our Price: "; +} + +ISBN { + display: block; + font-family: monospace; + font-size: 8pt; +} + + + + diff --git a/dom/xml/test/old/books/common.css b/dom/xml/test/old/books/common.css new file mode 100644 index 0000000000..d63f09585d --- /dev/null +++ b/dom/xml/test/old/books/common.css @@ -0,0 +1,43 @@ +SearchResult { + display: block; + margin-top: 8px; + margin-left: 8px; +} + +Header { + width: 612px; + display: block; +} + +SearchTitle { + display: block; + width: 280px; + border-bottom: thin solid black; + padding-bottom: 6px; + margin-bottom: 12px; +} + +SearchTitle:first-line { + font-family: Verdana, Sans-Serif; + color: #cc6600; + font-size: 14pt; +} + +Toolbar { + font-family: Verdana, Sans-Serif; + float: right; + font-size: 7pt; + display: block; + border: ridge #ddddff 4px; + width: 220px; + margin-right: 0px; + text-align: center; +} + +Label { + font-weight: bold; +} + +input { + margin-top: 2px; +} \ No newline at end of file diff --git a/dom/xml/test/old/books/kerouac.gif b/dom/xml/test/old/books/kerouac.gif new file mode 100644 index 0000000000..df2b371d07 Binary files /dev/null and b/dom/xml/test/old/books/kerouac.gif differ diff --git a/dom/xml/test/old/books/list.css b/dom/xml/test/old/books/list.css new file mode 100644 index 0000000000..3b5d408915 --- /dev/null +++ b/dom/xml/test/old/books/list.css @@ -0,0 +1,61 @@ + +BookSet { + display: block; +} + +Book { + display: list-item; + float: none; + border: none; + background: inherit; +} + +BookCover { + display: none; +} + +Title { + display: block; + font-weight: bold; + color: blue; + text-decoration: underline; + cursor: pointer; +} + +Author { + display: block; + font-style: italic; +} + +Synopsis { + display: none; +} + + +ListPrice { + display: none; + text-align: right; + padding-right: 15px; + text-decoration: line-through; +} + + +Price { + display: block; + color: rgb(20,100,0); + font-weight: bold; + text-align:left; +} + + +Price:before { + content: "Our Price: "; +} + +ISBN { + display: block; + font-family: monospace; + font-size: 8pt; +} + + diff --git a/dom/xml/test/old/books/road.gif b/dom/xml/test/old/books/road.gif new file mode 100644 index 0000000000..5ba7920c7e Binary files /dev/null and b/dom/xml/test/old/books/road.gif differ diff --git a/dom/xml/test/old/books/welville.gif b/dom/xml/test/old/books/welville.gif new file mode 100644 index 0000000000..7ff24a99ec Binary files /dev/null and b/dom/xml/test/old/books/welville.gif differ diff --git a/dom/xml/test/old/docbook.css b/dom/xml/test/old/docbook.css new file mode 100644 index 0000000000..562c8d2133 --- /dev/null +++ b/dom/xml/test/old/docbook.css @@ -0,0 +1,621 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +Book { + display: block; + padding-left: 8px; + padding-top: 8px; + font-family: Courier; + font-size: 10pt; +} + +Abbrev { + display: block; +} + +Affiliation { + font-style: italic; +} + +Appendix Title { + font-weight: bold; + font-family: Arial; + font-size: 24pt; + margin-bottom: 10pt; + display: block; +} + +Para Author { + display: inline; +} + +Author { + display: block; +} + +AuthorGroup { + font-size: 12pt; + margin-top: 25pt; + display: block; + font-weight: bold; +} + +BiblioDiv Title { + font-style: italic; +} + +Blockquote { + display: block; + margin-top: 3pt; + margin-left: 30pt; +} + +Book Title { + font-weight: bold; + font-family: Arial; + font-size: 18pt; + margin-bottom: 10pt; + display: block; +} + +BookInfo { + display: block; + margin-bottom: 30pt; +} + +BridgeHead { + display: block; + font-size: 16pt; + font-weight: bold; + color: teal; +} + +Caution { + font-weight: bold; + color: red; +} + +Caution:before { + content: "Caution:"; +} + +Chapter { + display: block; + margin-bottom: 25pt; +} + +Chapter Title { + font-weight: bold; + font-family: Arial; + font-size: 20pt; + margin-bottom: 10pt; + display: block; +} + +CiteTitle { + font-style: italic; +} + +CmdSynopsis { + display: block; +} + +CO { + display: block; +} + +Command { + font-style: italic; +} + +Comment { + display: block; +} + +ComputerOutput { + font-family: monospace; +} + +Copyright { + display: block; +} + +Para CorpAuthor { + display: inline; +} + +CorpAuthor { + display: block; +} + +Email { + font-style: italic; +} + +Editor { + display: block; +} + +Emphasis { + font-style: italic; +} + +ErrorType { + font-family: monospace; +} + +Example { + display: block; + margin-top: 10pt; + margin-bottom: 10pt; +} + +Example Title { + display: block; + font-weight: bold; + font-size: 14pt; +} + +Figure Title { + font-family: Arial; + font-size: 10pt; + font-style: italic; + font-weight: bold; + display: block; +} + +Filename { + font-style: italic; +} + +Figure { + display: block; + margin-top: 10pt; +} + +FirstTerm { + font-style: italic; +} + +ForeignPhrase { + font-style: italic; +} + +FormalPara { + display: block; +} + +FormalPara Title { + display: block; + font-weight: bold; +} + +FuncSynopsis { + display: block; +} + +FuncSynopsisInfo { + display: block; + white-space: pre; +} + +Function { + font-family: monospace; + white-space: pre; +} + +Glossary { + display: block; +} + +GlossDef { + display: block; + margin-left: 15pt; +} + +GlossList { + display: block; +} + +GlossSee { + display: block; + margin-left: 15pt; +} + +GlossTerm { + display: block; + font-weight: bold; +} + +InformalTable { + display: block; + margin-top: 10pt; + margin-bottom: 10pt; +} + +Interface { + font-family: Arial; +} + +ISBN { + display: block; + font-size: 10pt; +} + +ItemizedList { + display: block; + margin-top: 5pt; + margin-left: 20pt; +} + +LineAnnotation { + font-style: italic; +} + +Link { + color: blue; + text-decoration: underline; +} + +ListItem { + margin-left: 25pt; + display: list-item; +} + +Literal { + font-family: monospace; +} + +LiteralLayout { + white-space: pre; + display: block; +} + +Member { + display: block; + margin-left: 15pt; +} + +OLink { + display: block; + font-size: 12pt; +} + +Option { + font-family: monospace; +} + +OrderedList { + margin-top: 5pt; + margin-left: 20pt; + margin-bottom: 10pt; + display: block; + list-style-type: decimal; +} + +OrderedList Para { + display: block; + margin-top: 15pt; +} + +Para OtherCredit { + display: inline; +} + +OtherCredit { + display: block; +} + +Para { + display: block; + margin-top: 8pt; +} + +Para LiteralLayout { + display: block; + margin-top: 4pt; + margin-left: 10pt; + white-space: pre; +} + +Para Screen { + margin-top: 7pt; + margin-left: 10pt; + margin-bottom: 7pt; + display: block; +} + +Parameter { + font-family: monospace; +} + +Part Title { + font-size: 24pt; + display: block; + font-weight: bold; +} + +Preface { + display: block; + margin-top: 10pt; +} + +Procedure { + display: block; +} + +ProgramListing { + display: block; + white-space: pre; + font-family: monospace; +} + +ProgramListingCO { + display: block; + white-space: pre; + font-family: monospace; +} + +PublisherName { + font-family: Times, New, Roman; + font-size: 20pt; + margin-top: 15pt; + margin-bottom: 15pt; + display: block; +} + +RefEntry { + display: block; +} + +RefEntryTitle { + display: block; + font-size: 20pt; + font-weight: bold; +} + +RefName { + font-weight: bold; +} + +RefNameDiv { + display: block; +} + +RefSect1 { + display: block; + margin-top: 10pt; +} + +RefSect1 Title { + font-size: 14pt; +} + +RefSect1Info { + display: block; + font-size: small; +} + +RefSect2 { + display: block; + margin-top: 10pt; +} + +RefSect2 Title { + font-size: 14pt; +} + +RefSect2Info { + display: block; + font-size: small; +} + +RefSect3 { + display: block; + margin-top: 10pt; +} + +RefSect3 Title { + font-size: 14pt; +} + +RefSect3Info { + display: block; + font-size: small; +} + +RefSynopsisDiv { + display: block; + margin-top: 15pt; +} + +RefSynopsisDiv Title { + display: block; + font-size: 18pt; +} + +Replaceable { + font-family: Arial; + font-style: italic; +} + +Screen { + display: block; + margin-left: 20pt; + margin-bottom: 10pt; + white-space: pre; +} + +ScreenCO { + white-space: pre; +} + +ScreenShot { + white-space: pre; +} + +Sect1 { + display: block; + margin-top: 16pt; +} + +Sect1 Title { + font-family: Arial; + font-size: 20pt; + font-weight: bold; + display: block; +} + +Sect2 { + display: block; + margin-top: 15pt; +} + +Sect2 Title { + font-family: Arial; + font-size: 14pt; + font-weight: bold; + display: block; +} + +Sect3 { + display: block; + margin-top: 15pt; +} + +Sect3 Title { + font-family: Arial; + font-size: 14pt; + font-weight: bold; + display: block; +} + +SegListItem { + display: block; +} + +SegmentedList { + display: block; +} + +SegmentedList Title { + display: block; + font-weight: bold; +} + +Sidebar { + display: block; + margin-top: 15pt; + margin-left: 30pt; + font-family: Arial; + font-size: 9pt; +} + +Step { + display: block; +} + +Step Title { + display: block; + font-style: italic; +} + +Subscript { + font-size: 5pt; + vertical-align: sub; +} + +Subtitle { + font-family: Arial; + font-size: 20pt; + font-weight: bold; + display: block; + text-align: center; +} + +Superscript { + font-size: 5pt; + vertical-align: super; +} + +Synopsis { + display: block; + white-space: pre; +} + +SystemItem { + font-family: monospace; +} + +Table { + display: block; + margin-top: 10pt; +} + +Table Title { + font-family: Arial; + font-size: 10pt; + font-style: italic; + font-weight: bold; +} + +Term { + font-weight: bold; +} + +Title { + font-family: Arial; + font-size: 20pt; + font-weight: bold; + display: block; + text-align: center; +} + +TitleAbbrev { + font-family: Arial; + font-size: 14pt; + font-weight: bold; + display: block; +} + +ULink { + color: blue; + text-decoration: underline; + cursor: pointer; +} + +UserInput { + font-family: monospace; + font-weight: bold; +} + +VariableList Title { + font-weight: bold; + display: block; +} + +VarListEntry { + display: block; + margin-top: 10pt; +} + +VarListEntry Term { + display: block; + font-style: italic; +} + +Warning { + font-weight: bold; + color: fuchsia; +} + +Warning:before { + content: "Warning:"; +} + + +Year { + font-family: serif; + font-weight: bold; +} diff --git a/dom/xml/test/old/docbooktest.xml b/dom/xml/test/old/docbooktest.xml new file mode 100644 index 0000000000..d47c3cb12e --- /dev/null +++ b/dom/xml/test/old/docbooktest.xml @@ -0,0 +1,126 @@ + + + + +SoftQuad +Inc. +

+ + + +

+ Demo Product Documentation +SoftQuad Inc. + <Anchor +Id="SDK3"/>Element Overview +Introduction to Elements +By far the vast majority of objects (apart from text) that authors +encounter when traversing a document are Element nodes. + <Anchor Id="SDK273"/>Element Interfaces + <Anchor Id="SDK274"/>Elements and +Attributes + <Anchor Id="SDK279"/>Introduction to Attributes + +Elements may have attributes associated with them; since the Element +interface inherits from Node, the generic Node interface method +getAttributes may be used to retrieve the set of all +attributes for an element. +There are methods on the Element interface to retrieve either an Attr +object by name or an attribute value by name. In XML, where an attribute value +may contain entity references, an Attr object should be retrieved to examine +the possibly fairly complex sub-tree representing the attribute value. On the +other hand, in HTML, where all attributes have simple string values, methods to +directly access an attribute value can safely be used as a convenience. + +Before you can access an Attribute, you must first gain access to the +associated Element. + <Anchor Id="SDK378"/>Setting the Attribute +Values +Attr objects inherit the Node interface, but since they are not actually +child nodes of the element they describe, the DOM does not consider them part +of the document tree. Thus, the Node attributes parentNode, previousSibling, +and nextSibling have a null value for Attr objects. The DOM takes the view that +attributes are properties of elements rather than having a separate identity +from the elements they are associated with; this should make it more efficient +to implement such features as default attributes associated with all elements +of a given type. Furthermore, Attr nodes may not be immediate children of a +DocumentFragment. However, they can be associated with Element nodes contained +within a DocumentFragment. In short, users and implementors of the DOM need to +be aware that Attr nodes have some things in common with other objects +inheriting the Node interface, but they also are quite distinct. +The attribute's effective value is determined as follows: + +If this attribute has been explicitly assigned any value, that value is +the attribute's effective value +Otherwise, if there is a declaration for this attribute, and that +declaration includes a default value, then that default value is the +attribute's effective value +Otherwise, the attribute does not exist on this element in the structure +model until it has been explicitly added. +In XML, where the value of an attribute can contain entity references, +the child nodes of the Attr node provide a representation in which entity +references are not expanded. These child nodes may be either Text or +EntityReference nodes. Because the attribute type may be unknown, there are no +tokenized attribute values. +The following topics describe DOM attributes: + + +Interface +Attr + + +Interface Element + + <Anchor +Id="SDK48"/>DOM Level 1 Core: Element Functions + setAttribute + setAttribute +Sets the Attributes on the associated Element object +Fundamental +<Anchor Id="SDK85"/>Syntax + OMG IDL +void setAttribute (in +DOMString name, in DOMString +value) raises (DOMException); + <Anchor Id="SDK86"/>Java +public void setAttribute ( +String name, String +value) throws (DOMException); + <Anchor Id="SDK87"/>ECMA Script + + setAttribute (name, value +) +<Anchor Id="SDK88"/>Parameters + name + +(IN) The name of the attribute to create or alter. + value + +(IN) Value to set in string form + <Anchor Id="SDK89"/>Exceptions + +These are the applicable exceptions. + + + +INVALID_CHARACTER_ERR +Raised if the specified name contains an invalid character. + + NO_MODIFICATION_ALLOWED_ERR +Raised if this node is readonly. + + <Anchor +Id="SDK90"/>Remarks + setAttribute adds a new attribute. If an attribute +with that name is already present in the element, its value is changed to be +that of the value parameter. This value is a simple string, it is not parsed as +it is being set. So any markup (such as syntax to be recognized as an entity +reference) is treated as literal text, and needs to be appropriately escaped by +the implementation when it is written out. + In order to assign an attribute value that contains entity references, +the user must create an Attr node plus any Text and EntityReference nodes, +build the appropriate subtree, and use setAttributeNode to +assign it as the value of an attribute. +
diff --git a/dom/xml/test/old/flamer.gif b/dom/xml/test/old/flamer.gif new file mode 100644 index 0000000000..5a05df583f Binary files /dev/null and b/dom/xml/test/old/flamer.gif differ diff --git a/dom/xml/test/old/script.xml b/dom/xml/test/old/script.xml new file mode 100644 index 0000000000..f21d30d973 --- /dev/null +++ b/dom/xml/test/old/script.xml @@ -0,0 +1,67 @@ + + + + + The Book + + Chapter 1. + Yada yada yada. + + +"); + + // get the children + var children = node.childNodes; + var length = children.length; + var count = 0; + while(count < length) { + child = children[count]; + list(child); + count++; + } + dump(""); + } + else { + // close tag + dump("/>"); + } + + + } + // if it's a piece of text just dump the text + else if (type == Node.TEXT_NODE) { + dump(node.data); + } +} + +list(document.documentElement); +dump("\n"); +]]> + + diff --git a/dom/xml/test/old/simple.xml b/dom/xml/test/old/simple.xml new file mode 100644 index 0000000000..c94708c665 --- /dev/null +++ b/dom/xml/test/old/simple.xml @@ -0,0 +1,10 @@ + + + + + The Book + + Chapter 1. + Yada yada yada. + + diff --git a/dom/xml/test/old/toc/book.css b/dom/xml/test/old/toc/book.css new file mode 100644 index 0000000000..778c4244c2 --- /dev/null +++ b/dom/xml/test/old/toc/book.css @@ -0,0 +1,137 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* The book style must be the first style for our JavaScript to work */ +book { + display: block; + padding-left: 2em; + padding-right: 2em; + padding-top: 8px; + font-size: 12pt; + background-color: lightyellow; + font-family: Arial; +} + +book title { + font-weight: bold; + font-size: 24pt; + display: block; + text-align: center; + margin-top: 12pt; + margin-bottom: 3pt; +} + +book subtitle { + display: block; + font-size:12pt; + text-align: center; +} + +book abstract { + display: block; + margin-top: 3pt; +} + +input { + display: block; + margin-left: auto; + margin-right: auto; +} + +chapter { + display: block; +} + +chapter title { + font-weight: bold; + font-size: 16pt; + display: block; + text-align: left; + margin-top: 12pt; + margin-bottom: 3pt; +} + +section { + display: block; +} + +section title { + display: block; + font-size: 10pt; + text-align: left; + margin-top: 12pt; + margin-bottom: 3pt; +} + +contents { + display: block; +} + +para { + display: block; + margin-bottom: auto; + margin-top: auto; + font-size:11pt; +} + +link { + display: inline; + color: blue; + text-decoration: underline; + cursor: pointer; +} + +list { + display: block; + margin-right: 0; + margin-bottom: auto; + margin-top: auto; + list-style-type: disc; + margin-left: 40px; +} + +listitem { + display: list-item; + list-style-position: inside; +} + +emph { + font-style: italic; + font-weight: bold; +} + +ref { + font-style: italic; +} + +heading { + font-weight: bold; +} + +navbar { + font-family: Arial; + font-size: 10pt; + display: block; + float: right; + background-color: #CCE6F3; + color: darkblue; + width: 10em; + margin-right: 0.5em; +} + +navbar title { + font-size: 10pt; + display: block; + background-color: black; + color: white; + margin-bottom:0px; +} + +navbar content { + display: block; + padding: 0.3em; + border: 1px solid black; + font-size: 9pt; +} + diff --git a/dom/xml/test/old/toc/irslogo.gif b/dom/xml/test/old/toc/irslogo.gif new file mode 100644 index 0000000000..daab0ca3ab Binary files /dev/null and b/dom/xml/test/old/toc/irslogo.gif differ diff --git a/dom/xml/test/old/toc/minus.gif b/dom/xml/test/old/toc/minus.gif new file mode 100644 index 0000000000..8adf8d6add Binary files /dev/null and b/dom/xml/test/old/toc/minus.gif differ diff --git a/dom/xml/test/old/toc/plus.gif b/dom/xml/test/old/toc/plus.gif new file mode 100644 index 0000000000..55446e34c9 Binary files /dev/null and b/dom/xml/test/old/toc/plus.gif differ diff --git a/dom/xml/test/old/toc/rights.xml b/dom/xml/test/old/toc/rights.xml new file mode 100644 index 0000000000..520eef3de1 --- /dev/null +++ b/dom/xml/test/old/toc/rights.xml @@ -0,0 +1,292 @@ + + + + + + + +]> + + + + + + Table of contents + + To toggle the Table of Contents, click on this button + + + + + Highlights of 1999 Tax Changes + (Rev. December 1999) + + + + Tax Changes for Individuals + +
+ + Child Tax Credit Increased + + +The maximum child tax credit for each qualifying child will increase from $400 to $500 in 1999. + + +
+
+ + Standard Mileage Rate + + +Beginning April 1, 1999, the optional standard mileage rate for operating your carfor business decreases to 31 cents a mile for each business mile. Until then, the business standard mileage rate of 32 1/2 cents per mile that was in effect for 1998 will continue to apply. + + +
+
+ + Estimated Tax Safe Harbor for Higher Income Individuals + + +For estimated tax payments for tax years beginning in 1999, the safe harbor for higher income individuals (other than farmers and fishermen) has been modified. If your 1998 adjusted gross income was more than $150,000 ($75,000 if you aremarried filing a separate return for 1999), you will have to pay the smaller of 90% of your expected tax for 1999 or 105% (up from 100%) of the tax shown on your 1998 return (provided your 1998 return covered all 12 months) to avoid an estimated tax penalty. + + +For more information on estimated tax, see + Publication 505. + + +
+
+ + Self-Employed Health Insurance Deduction + + +For 1999, the health insurance deduction for the self-employed is increased from 45% to 60% of the amount you pay for medical insurance for yourself and your family. For more information, see chapter 10 in + Publication 535. + + +
+
+ + Social Security and Medicare Taxes + + +For 1999, the employer and employee will continue to pay: + + +1.6.2% each for social security tax (old-age, survivors, and disability insurance), and + + +2.1.45% each for Medicare tax (hospital insurance). + + + + + Wage limits. +For social security tax, the maximum amount of 1999 wages subject to the tax has increased to $72,600. For Medicare tax, all covered 1999 wages are subject to the tax. There is no wage base limit. For information about these taxes, see + Publication 15, Circular E, Employer's Tax Guide. + + +
+
+ + Self-Employment Tax + + +The self-employment tax rate on net earnings remains the same for calendar year1999. This rate, 15.3%, is a total of 12.4% for social security (old-age, survivors, and disability insurance), and 2.9% for Medicare (hospital insurance). + + +The maximum amount subject to the social security part for tax years beginning in 1999 has increased to $72,600. All net earnings of at least $400 are subject to the Medicare part. + + +
+
+
+ + + + Tax Changes for Businesses + +
+ + Social Security and Medicare Taxes + + +For 1999, the employer and employee will continue to pay: + + +6.2% each for social security tax (old-age, survivors, and disability insurance), and + + +1.45% each for Medicare tax (hospital insurance). + + + + +Wage limits. For social security tax, the maximum amount of 1999 wages subject to the tax has increased to $72,600. For Medicare tax, all covered 1999 wages are subject to the tax. There is no wage base limit. For information about these taxes and amounts to withhold, see +Publication 15, Circular E, Employer's TaxGuide. + + +
+
+ + Employment Tax Deposits + + +Under certain circumstances, the IRS can waive the penalty for a first-time depositor's inadvertent failure to timely deposit employment taxes. For deposits required to be made after January 18, 1999, this waiver is expanded to include the first deposit required to be made after a required change in frequency of a taxpayer's deposits. + + +
+
+ + Electronic Deposit of Taxes + + +If you were first required to deposit taxes by electronic funds transfer after June 30, 1997, the IRS will not impose the penalty for not doing so before July 1, 1999. Previously, the IRS had waived the penalty through December 31, 1998. For information about depositing taxes electronically, see Publication 15. + + +
+
+ + 941 TeleFile + + +Beginning with the first quarter of 1998, many employers were able to file Form941 by phone, toll free. If you receive 941 TeleFile with your Form 941 package, check page TEL-1 of the 941 TeleFile Instructions to see if you qualify for this quick, convenient, and easy method of filing. + + +
+
+ + 941 On-Line + + +In 1998, a limited number of employers were allowed to file Form 941 using commercially available software to create the return and then transmitting the return electronically to IRS through a third party. 941 On-Line uses Electronic Data Interchange (EDI) format. In 1999, IRS expects to make the 941 On-Line filing option available nationwide. + + +
+
+ + Self-Employment Tax + + +The self-employment tax rate on net earnings remains the same for calendar year 1999. This rate, 15.3%, is a total of 12.4% for social security (old-age, survivors,and disability insurance), and 2.9% for Medicare (hospital insurance). + + +The maximum amount subject to the social security part for tax years beginning in 1999 has increased to $72,600. All net earnings of at least $400 are subject to the Medicare part. + + +
+
+
+ + + + IRA and other Retirement Plans + +
+ + Hardship Distributions + + +Beginning in 1999, hardship distributions from 401(k) plans and 403(b) plans are not eligible rollover distributions. They cannot be rolled over into a traditional IRA. For more information on traditional IRAs, see Publication 590. + + +
+
+
+ + + + Gift and Estate Taxes + +
+ + New Deduction From Gross Estate + + +For estates of decedents dying after 1997, the executor can elect to deduct the adjusted value of a qualified family-owned business interest, up to a limited amount, from the gross estate. For more information, see section 2057 of the Internal Revenue Code and the instructions for Schedule T, Form 706, United States Estate (and Generation-Skipping Transfer) Tax Return. + + +
+
+ + Suit for Refund + + +Effective July 23, 1998, an executor no longer needs to wait until all the installment payments have been made before filing a suit for refund with a federal district court or the U.S. Court of Federal Claims if the following conditions are met. + + +The estate consists largely of an interest in a closely-held business. + + +The estate elected to make tax payments through the installment method. + + + + +However, all of the following must be true before a suit can be filed. + + +All installment payments due on or before the date the suit is filed have been made. + + +No accelerated installment payments have been made. + + +No Tax Court case is pending with respect to any estate tax liability. + + +The time for petitioning the Tax Court has passed if a notice of deficiency was issued to the estate regarding its liability for estate tax. + + +No proceeding is pending for a declaratory judgment by the Tax Court on whether the estate is eligible to pay tax in installments. + + + + +In addition, the executor must not: + + +Include any previously litigated issues in the current suit for refund, and + + +Discontinue making timely installment payments while the court considers the suit for refund. + + + + +
+
+
+ + + + Excise Tax + +
+ + Air Transportation Taxes + + +For 1999, the tax on the use of international air travel facilities will be $12.20 for both arrivals and departures. In the case of air transportation between the continental United States and Alaska or between Alaska and Hawaii, the use-of-international-facilities tax on departures will be $6.10. + + +
+
+ + Luxury Tax + + +For 1999, the luxury tax on a passenger vehicle is reduced from 7% to 6% of the amount of the sales price that exceeds the base amount. The base amount for 1999 is $36,000. + + +The base amount is increased for electric vehicles and clean-fuel vehicles. See Publication 510 for information on these amounts. + + +
+
+
+ +
diff --git a/dom/xml/test/old/toc/toc.css b/dom/xml/test/old/toc/toc.css new file mode 100644 index 0000000000..99c0c9d327 --- /dev/null +++ b/dom/xml/test/old/toc/toc.css @@ -0,0 +1,77 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +toc { + position:fixed; + top:0; + left:0; + width:12em; + height:100%; + border-right: 1px solid black; + background-color: #CCE6F3; + font-family: Arial; + overflow:auto; + color: darkblue; +} + +toc > title { + display: block; + font-size:12pt; + font-weight: bold; + background-color: black; + color:white; +} + +toclink:visited { + color: purple; +} + +toclink:active { + color: red; +} + +level1 { + display: block; + font-weight:bold; + font-size:12pt; + margin-left: 4px; + margin-bottom: 2px; +} + +level1 > toclink { + list-style-position: inside; + text-decoration: none; + color: darkblue; +} + +level2 { + display: block; + font-size:11pt; + margin-left: 8px; + margin-bottom: 2px; +} + +level2 > toclink { + list-style-position: inside; + text-decoration: none; + color: darkblue; +} + +level3 { + display: list-item; + font-size: 8pt; + margin-left: 12px; + margin-bottom: 2px; +} + +level3 > toclink { + list-style-position: inside; + text-decoration: none; + color: darkblue; +} + +toc img { + margin-right: 1em; +} + diff --git a/dom/xml/test/old/toc/toc.js b/dom/xml/test/old/toc/toc.js new file mode 100644 index 0000000000..b1cfbc4959 --- /dev/null +++ b/dom/xml/test/old/toc/toc.js @@ -0,0 +1,131 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Event handler for display togglers in Table of Contents +function toggleDisplay(event) { + if (event.target.localName != "img") { + return; + } + var img = event.target; + var div = img.nextSibling.nextSibling; + + // Change the display: property of the container to + // hide and show the container. + if (div.style.display == "none") { + div.style.display = "block"; + img.src = "minus.gif"; + } else { + div.style.display = "none"; + img.src = "plus.gif"; + } +} + +// Function that recurses down the tree, looking for +// structural elements. For each structural element, +// a corresponding element is created in the table of +// contents. +var searchTags = new Array("book", "chapter", "section"); +var tocTags = new Array("level1", "level2", "level3"); +function addToToc(root, tocFrame) { + var i; + var newTocFrame = tocFrame; + var newTocElement = null; + var newTocLink = null; + + for (i = 0; i < searchTags.length; i++) { + if (root.tagName == searchTags[i]) { + // If we've found a structural element, create the + // equivalent TOC element. + newTocElement = document.createElement(tocTags[i]); + // Create the toclink element that is a link to the + // corresponding structural element. + newTocLink = document.createElement("toclink"); + newTocLink.setAttributeNS( + "http://www.w3.org/1999/xlink", + "xlink:type", + "simple" + ); + newTocLink.setAttributeNS( + "http://www.w3.org/1999/xlink", + "xlink:href", + "#" + root.getAttribute("id") + ); + newTocLink.setAttributeNS( + "http://www.w3.org/1999/xlink", + "xlink:show", + "replace" + ); + newTocElement.appendChild(newTocLink); + + // Create the image and toggling container in the table of contents + if (i < searchTags.length - 1) { + var img = document.createElementNS( + "http://www.w3.org/1999/xhtml", + "img" + ); + img.src = "minus.gif"; + newTocElement.insertBefore(img, newTocLink); + + newTocFrame = document.createElementNS( + "http://www.w3.org/1999/xhtml", + "div" + ); + newTocElement.appendChild(newTocFrame); + } else { + newTocFrame = null; + } + + tocFrame.appendChild(newTocElement); + + break; + } + } + + // Recurse down through the childNodes list + for (i = 0; i < root.childNodes.length; i++) { + var child = root.childNodes[i]; + if (child.nodeType == Node.ELEMENT_NODE) { + if (newTocLink != null && child.tagName == "title") { + var text = child.firstChild.cloneNode(true); + newTocLink.appendChild(text); + } else { + addToToc(child, newTocFrame); + } + } + } +} + +// Create the root table of contents element (a fixed element) +// and its contents. +function createToc() { + if (!document.getElementsByTagName("toc").length) { + var toc = document.createElement("toc"); + var title = document.createElement("title"); + title.appendChild(document.createTextNode("Table of Contents")); + toc.appendChild(title); + + // Recurse down and build up the document element + addToToc(document.documentElement, toc); + + // Since we've created the toc element as a fixed element, + // insert a rule that shifts over the document element by + // the width of the toc element. + document.styleSheets[0].cssRules[0].style.marginLeft = "12em"; + document.documentElement.appendChild(toc); + + // Attach the event handler for table of contents buttons. + // This will only work for content that is already a part + // of a document, which is why we had to wait until here + // to do this. + toc.addEventListener("mouseup", toggleDisplay, 1); + } else { + // Hide the table of contents. + // This is not very intelligent if we have a static document, we should + // just hide/show the toc via stylesheet mungling + document.documentElement.removeChild( + document.getElementsByTagName("toc")[0] + ); + document.styleSheets[0].cssRules[0].style.marginLeft = "0em"; + } +} diff --git a/dom/xml/test/old/xlink/auto.xml b/dom/xml/test/old/xlink/auto.xml new file mode 100644 index 0000000000..91eb15ff43 --- /dev/null +++ b/dom/xml/test/old/xlink/auto.xml @@ -0,0 +1,16 @@ + + + +

Testing simple XLinks that must fire immediately on load.

+ +Must not open automatically, illegal + +Must open automatically in new window (www.mozilla.org) + +Must open automatically in new window (www.mozillazine.org) + +Must load automatically in same window - "Refresh" (At a glance) + +Must not load automatically, one refresh link fired already (www.netscape.com) +
+ diff --git a/dom/xml/test/old/xlink/link.css b/dom/xml/test/old/xlink/link.css new file mode 100644 index 0000000000..19dc52198d --- /dev/null +++ b/dom/xml/test/old/xlink/link.css @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +@namespace xlink url(http://www.w3.org/1999/xlink); + +root { + display: block; + padding: +5px; +} + +p { + display: block; +} + +mylink { + display: block; + cursor: pointer; + color: blue; + text-decoration: underline; +} + diff --git a/dom/xml/test/old/xlink/manual.xml b/dom/xml/test/old/xlink/manual.xml new file mode 100644 index 0000000000..fd7d49fc17 --- /dev/null +++ b/dom/xml/test/old/xlink/manual.xml @@ -0,0 +1,14 @@ + + + +

Testing manual simple XLinks.

+ +Must not open, illegal + +Must open in new window (www.mozilla.org) + +Must open in same window (www.mozillazine.org) + +Foo +
+ diff --git a/dom/xml/test/old/xmlbase/xmlbase.css b/dom/xml/test/old/xmlbase/xmlbase.css new file mode 100644 index 0000000000..a100186bbc --- /dev/null +++ b/dom/xml/test/old/xmlbase/xmlbase.css @@ -0,0 +1,28 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +@namespace xlink url(http://www.w3.org/1999/xlink); + +title { + font-weight: bold; + display: block; +} + +xlink|link { + color: blue; + text-decoration: underline; + cursor: pointer; + display: inline; + padding-left: +5px; +} + +sect1,sect2,sect3 { + display: block; + padding-left: +20px; +} + +p { + display: block; + padding-left: +5px; +} \ No newline at end of file diff --git a/dom/xml/test/old/xmlbase/xmlbase.xml b/dom/xml/test/old/xmlbase/xmlbase.xml new file mode 100644 index 0000000000..b4cce1dc51 --- /dev/null +++ b/dom/xml/test/old/xmlbase/xmlbase.xml @@ -0,0 +1,82 @@ + + + +Root: no xml:base +a.xml +

Expected: <current path>/a.xml

+ + Sect1: xml:base="http://www.mozilla.org" + b.xml +

Expected: http://www.mozilla.org/b.xml

+ + Sect2: xml:base="/base" + c.xml +

Expected: http://www.mozilla.org/base/c.xml

+ + Sect3: xml:base="" + d.xml +

Expected: http://www.mozilla.org/base/d.xml

+
+ + Sect3: xml:base="/" + d-2.xml +

Expected: http://www.mozilla.org/d-2.xml

+
+ + Sect3: xml:base="/foobar" + e.xml +

Expected: http://www.mozilla.org/foobar/e.xml

+
+ + Sect3: xml:base="ding/dong" + f.xml +

Expected: http://www.mozilla.org/base/ding/dong/f.xml

+
+
+ + Sect2: xml:base="http://www.netscape.com" + g.xml +

Expected: http://www.netscape.com/g.xml

+
+ + Sect2: xml:base="http://www.netscape.com" + http://www.mozilla.org/foobar/h.xml +

Expected: http://www.mozilla.org/foobar/h.xml

+
+ + Sect2: xml:base="http://www.netscape.com" + i.xml, this element has xml:base="wow" +

Expected: http://www.netscape.com/wow/i.xml

+
+
+ + Sect1: xml:base="nothere" + j.xml +

Expected: <current path>/nothere/j.xml

+
+ + Sect1: xml:base="/not" + k.xml +

Expected: file:///not/k.xml

+
+ + Sect1: xml:base="http://foobar.com/ä ö/" + l.xml +

Expected: http://foobar.com/%E4%20%F6/l.xml

+
+ + Sect1: xml:base="http://foobar.com/ /%20/" + m.xml +

Expected: http://foobar.com/%20/%20/m.xml

+
+ + Sect1: xml:base="chrome://navigator" + n.xml +

Expected: |current path|/n.xml because chrome URL is not allowed

+ + Sect2: xml:base="http://www.mozilla.org" + o.xml, this element has xml:base="chrome://navigator" +

Expected: http://www.mozilla.org/o.xml because chrome base is not allowed

+
+
+
\ No newline at end of file -- cgit v1.2.3